fail_derived_to_base.carbon 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // AUTOUPDATE
  6. // TIP: To test this file alone, run:
  7. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/fail_derived_to_base.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/fail_derived_to_base.carbon
  10. base class A1 {
  11. var a: i32;
  12. }
  13. base class A2 {
  14. var a: i32;
  15. }
  16. class B2 {
  17. extend base: A2;
  18. var b: i32;
  19. }
  20. // CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+7]]:38: error: cannot implicitly convert from `B2*` to `A1*` [ImplicitAsConversionFailure]
  21. // CHECK:STDERR: fn ConvertUnrelated(p: B2*) -> A1* { return p; }
  22. // CHECK:STDERR: ^~~~~~~~~
  23. // CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+4]]:38: note: type `B2*` does not implement interface `ImplicitAs` [MissingImplInMemberAccessNote]
  24. // CHECK:STDERR: fn ConvertUnrelated(p: B2*) -> A1* { return p; }
  25. // CHECK:STDERR: ^~~~~~~~~
  26. // CHECK:STDERR:
  27. fn ConvertUnrelated(p: B2*) -> A1* { return p; }
  28. class Incomplete;
  29. // CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+6]]:47: error: cannot implicitly convert from `Incomplete*` to `A2*` [ImplicitAsConversionFailure]
  30. // CHECK:STDERR: fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; }
  31. // CHECK:STDERR: ^~~~~~~~~
  32. // CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+3]]:47: note: type `Incomplete*` does not implement interface `ImplicitAs` [MissingImplInMemberAccessNote]
  33. // CHECK:STDERR: fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; }
  34. // CHECK:STDERR: ^~~~~~~~~
  35. fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; }
  36. // CHECK:STDOUT: --- fail_derived_to_base.carbon
  37. // CHECK:STDOUT:
  38. // CHECK:STDOUT: constants {
  39. // CHECK:STDOUT: %A1: type = class_type @A1 [template]
  40. // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
  41. // CHECK:STDOUT: %.1: type = tuple_type () [template]
  42. // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
  43. // CHECK:STDOUT: %.2: type = unbound_element_type %A1, i32 [template]
  44. // CHECK:STDOUT: %.3: type = struct_type {.a: i32} [template]
  45. // CHECK:STDOUT: %.4: <witness> = complete_type_witness %.3 [template]
  46. // CHECK:STDOUT: %A2: type = class_type @A2 [template]
  47. // CHECK:STDOUT: %.5: type = unbound_element_type %A2, i32 [template]
  48. // CHECK:STDOUT: %B2: type = class_type @B2 [template]
  49. // CHECK:STDOUT: %.6: type = ptr_type %.3 [template]
  50. // CHECK:STDOUT: %.7: type = unbound_element_type %B2, %A2 [template]
  51. // CHECK:STDOUT: %.8: type = unbound_element_type %B2, i32 [template]
  52. // CHECK:STDOUT: %.9: type = struct_type {.base: %A2, .b: i32} [template]
  53. // CHECK:STDOUT: %.10: <witness> = complete_type_witness %.9 [template]
  54. // CHECK:STDOUT: %.11: type = ptr_type %B2 [template]
  55. // CHECK:STDOUT: %.12: type = ptr_type %A1 [template]
  56. // CHECK:STDOUT: %ConvertUnrelated.type: type = fn_type @ConvertUnrelated [template]
  57. // CHECK:STDOUT: %ConvertUnrelated: %ConvertUnrelated.type = struct_value () [template]
  58. // CHECK:STDOUT: %.13: type = struct_type {.base: %.6, .b: i32} [template]
  59. // CHECK:STDOUT: %.14: type = ptr_type %.13 [template]
  60. // CHECK:STDOUT: %.15: type = ptr_type %.9 [template]
  61. // CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template]
  62. // CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template]
  63. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic]
  64. // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic]
  65. // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic]
  66. // CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic]
  67. // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic]
  68. // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic]
  69. // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic]
  70. // CHECK:STDOUT: %.16: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic]
  71. // CHECK:STDOUT: %.17: %.16 = assoc_entity element0, imports.%import_ref.6 [symbolic]
  72. // CHECK:STDOUT: %ImplicitAs.type.3: type = interface_type @ImplicitAs, @ImplicitAs(%.12) [template]
  73. // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert, @ImplicitAs(%.12) [template]
  74. // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template]
  75. // CHECK:STDOUT: %.18: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template]
  76. // CHECK:STDOUT: %.19: %.18 = assoc_entity element0, imports.%import_ref.6 [template]
  77. // CHECK:STDOUT: %.20: %.16 = assoc_entity element0, imports.%import_ref.7 [symbolic]
  78. // CHECK:STDOUT: %Incomplete: type = class_type @Incomplete [template]
  79. // CHECK:STDOUT: %.21: type = ptr_type %Incomplete [template]
  80. // CHECK:STDOUT: %.22: type = ptr_type %A2 [template]
  81. // CHECK:STDOUT: %ConvertIncomplete.type: type = fn_type @ConvertIncomplete [template]
  82. // CHECK:STDOUT: %ConvertIncomplete: %ConvertIncomplete.type = struct_value () [template]
  83. // CHECK:STDOUT: %ImplicitAs.type.4: type = interface_type @ImplicitAs, @ImplicitAs(%.22) [template]
  84. // CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert, @ImplicitAs(%.22) [template]
  85. // CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template]
  86. // CHECK:STDOUT: %.23: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.3 [template]
  87. // CHECK:STDOUT: %.24: %.23 = assoc_entity element0, imports.%import_ref.6 [template]
  88. // CHECK:STDOUT: }
  89. // CHECK:STDOUT:
  90. // CHECK:STDOUT: imports {
  91. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  92. // CHECK:STDOUT: .Int32 = %import_ref.1
  93. // CHECK:STDOUT: .ImplicitAs = %import_ref.2
  94. // CHECK:STDOUT: import Core//prelude
  95. // CHECK:STDOUT: import Core//prelude/operators
  96. // CHECK:STDOUT: import Core//prelude/types
  97. // CHECK:STDOUT: import Core//prelude/operators/arithmetic
  98. // CHECK:STDOUT: import Core//prelude/operators/as
  99. // CHECK:STDOUT: import Core//prelude/operators/bitwise
  100. // CHECK:STDOUT: import Core//prelude/operators/comparison
  101. // CHECK:STDOUT: import Core//prelude/types/bool
  102. // CHECK:STDOUT: }
  103. // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32]
  104. // CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+49, loaded [template = constants.%ImplicitAs]
  105. // CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+55, unloaded
  106. // CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.16) = import_ref Core//prelude/operators/as, inst+77, loaded [symbolic = @ImplicitAs.%.2 (constants.%.20)]
  107. // CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+70, unloaded
  108. // CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+70, unloaded
  109. // CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+70, unloaded
  110. // CHECK:STDOUT: }
  111. // CHECK:STDOUT:
  112. // CHECK:STDOUT: file {
  113. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  114. // CHECK:STDOUT: .Core = imports.%Core
  115. // CHECK:STDOUT: .A1 = %A1.decl
  116. // CHECK:STDOUT: .A2 = %A2.decl
  117. // CHECK:STDOUT: .B2 = %B2.decl
  118. // CHECK:STDOUT: .ConvertUnrelated = %ConvertUnrelated.decl
  119. // CHECK:STDOUT: .Incomplete = %Incomplete.decl
  120. // CHECK:STDOUT: .ConvertIncomplete = %ConvertIncomplete.decl
  121. // CHECK:STDOUT: }
  122. // CHECK:STDOUT: %Core.import = import Core
  123. // CHECK:STDOUT: %A1.decl: type = class_decl @A1 [template = constants.%A1] {} {}
  124. // CHECK:STDOUT: %A2.decl: type = class_decl @A2 [template = constants.%A2] {} {}
  125. // CHECK:STDOUT: %B2.decl: type = class_decl @B2 [template = constants.%B2] {} {}
  126. // CHECK:STDOUT: %ConvertUnrelated.decl: %ConvertUnrelated.type = fn_decl @ConvertUnrelated [template = constants.%ConvertUnrelated] {
  127. // CHECK:STDOUT: %p.patt: %.11 = binding_pattern p
  128. // CHECK:STDOUT: %p.param_patt: %.11 = param_pattern %p.patt, runtime_param0
  129. // CHECK:STDOUT: %return.patt: %.12 = return_slot_pattern
  130. // CHECK:STDOUT: %return.param_patt: %.12 = param_pattern %return.patt, runtime_param1
  131. // CHECK:STDOUT: } {
  132. // CHECK:STDOUT: %B2.ref: type = name_ref B2, file.%B2.decl [template = constants.%B2]
  133. // CHECK:STDOUT: %.loc31_26: type = ptr_type %B2 [template = constants.%.11]
  134. // CHECK:STDOUT: %A1.ref: type = name_ref A1, file.%A1.decl [template = constants.%A1]
  135. // CHECK:STDOUT: %.loc31_34: type = ptr_type %A1 [template = constants.%.12]
  136. // CHECK:STDOUT: %p.param: %.11 = param runtime_param0
  137. // CHECK:STDOUT: %p: %.11 = bind_name p, %p.param
  138. // CHECK:STDOUT: %return.param: %.12 = param runtime_param1
  139. // CHECK:STDOUT: %return: ref %.12 = return_slot %return.param
  140. // CHECK:STDOUT: }
  141. // CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} {}
  142. // CHECK:STDOUT: %ConvertIncomplete.decl: %ConvertIncomplete.type = fn_decl @ConvertIncomplete [template = constants.%ConvertIncomplete] {
  143. // CHECK:STDOUT: %p.patt: %.21 = binding_pattern p
  144. // CHECK:STDOUT: %p.param_patt: %.21 = param_pattern %p.patt, runtime_param0
  145. // CHECK:STDOUT: %return.patt: %.22 = return_slot_pattern
  146. // CHECK:STDOUT: %return.param_patt: %.22 = param_pattern %return.patt, runtime_param1
  147. // CHECK:STDOUT: } {
  148. // CHECK:STDOUT: %Incomplete.ref: type = name_ref Incomplete, file.%Incomplete.decl [template = constants.%Incomplete]
  149. // CHECK:STDOUT: %.loc41_35: type = ptr_type %Incomplete [template = constants.%.21]
  150. // CHECK:STDOUT: %A2.ref: type = name_ref A2, file.%A2.decl [template = constants.%A2]
  151. // CHECK:STDOUT: %.loc41_43: type = ptr_type %A2 [template = constants.%.22]
  152. // CHECK:STDOUT: %p.param: %.21 = param runtime_param0
  153. // CHECK:STDOUT: %p: %.21 = bind_name p, %p.param
  154. // CHECK:STDOUT: %return.param: %.22 = param runtime_param1
  155. // CHECK:STDOUT: %return: ref %.22 = return_slot %return.param
  156. // CHECK:STDOUT: }
  157. // CHECK:STDOUT: }
  158. // CHECK:STDOUT:
  159. // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) {
  160. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
  161. // CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)]
  162. // CHECK:STDOUT:
  163. // CHECK:STDOUT: !definition:
  164. // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)]
  165. // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)]
  166. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)]
  167. // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)]
  168. // CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.16)]
  169. // CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.16) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.17)]
  170. // CHECK:STDOUT:
  171. // CHECK:STDOUT: interface {
  172. // CHECK:STDOUT: !members:
  173. // CHECK:STDOUT: .Self = imports.%import_ref.3
  174. // CHECK:STDOUT: .Convert = imports.%import_ref.4
  175. // CHECK:STDOUT: witness = (imports.%import_ref.5)
  176. // CHECK:STDOUT: }
  177. // CHECK:STDOUT: }
  178. // CHECK:STDOUT:
  179. // CHECK:STDOUT: class @A1 {
  180. // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
  181. // CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32 [template = i32]
  182. // CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32, %.loc12_10.1 [template = i32]
  183. // CHECK:STDOUT: %.loc12_8: %.2 = field_decl a, element0 [template]
  184. // CHECK:STDOUT: %.loc13: <witness> = complete_type_witness %.3 [template = constants.%.4]
  185. // CHECK:STDOUT:
  186. // CHECK:STDOUT: !members:
  187. // CHECK:STDOUT: .Self = constants.%A1
  188. // CHECK:STDOUT: .a = %.loc12_8
  189. // CHECK:STDOUT: }
  190. // CHECK:STDOUT:
  191. // CHECK:STDOUT: class @A2 {
  192. // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
  193. // CHECK:STDOUT: %.loc16_10.1: type = value_of_initializer %int.make_type_32 [template = i32]
  194. // CHECK:STDOUT: %.loc16_10.2: type = converted %int.make_type_32, %.loc16_10.1 [template = i32]
  195. // CHECK:STDOUT: %.loc16_8: %.5 = field_decl a, element0 [template]
  196. // CHECK:STDOUT: %.loc17: <witness> = complete_type_witness %.3 [template = constants.%.4]
  197. // CHECK:STDOUT:
  198. // CHECK:STDOUT: !members:
  199. // CHECK:STDOUT: .Self = constants.%A2
  200. // CHECK:STDOUT: .a = %.loc16_8
  201. // CHECK:STDOUT: }
  202. // CHECK:STDOUT:
  203. // CHECK:STDOUT: class @B2 {
  204. // CHECK:STDOUT: %A2.ref: type = name_ref A2, file.%A2.decl [template = constants.%A2]
  205. // CHECK:STDOUT: %.loc20: %.7 = base_decl %A2, element0 [template]
  206. // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
  207. // CHECK:STDOUT: %.loc21_10.1: type = value_of_initializer %int.make_type_32 [template = i32]
  208. // CHECK:STDOUT: %.loc21_10.2: type = converted %int.make_type_32, %.loc21_10.1 [template = i32]
  209. // CHECK:STDOUT: %.loc21_8: %.8 = field_decl b, element1 [template]
  210. // CHECK:STDOUT: %.loc22: <witness> = complete_type_witness %.9 [template = constants.%.10]
  211. // CHECK:STDOUT:
  212. // CHECK:STDOUT: !members:
  213. // CHECK:STDOUT: .Self = constants.%B2
  214. // CHECK:STDOUT: .base = %.loc20
  215. // CHECK:STDOUT: .b = %.loc21_8
  216. // CHECK:STDOUT: extend name_scope3
  217. // CHECK:STDOUT: }
  218. // CHECK:STDOUT:
  219. // CHECK:STDOUT: class @Incomplete;
  220. // CHECK:STDOUT:
  221. // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
  222. // CHECK:STDOUT:
  223. // CHECK:STDOUT: fn @ConvertUnrelated(%p.param_patt: %.11) -> %.12 {
  224. // CHECK:STDOUT: !entry:
  225. // CHECK:STDOUT: %p.ref: %.11 = name_ref p, %p
  226. // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%.12) [template = constants.%ImplicitAs.type.3]
  227. // CHECK:STDOUT: %.loc31_46.1: %.18 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%.12) [template = constants.%.19]
  228. // CHECK:STDOUT: %Convert.ref: %.18 = name_ref Convert, %.loc31_46.1 [template = constants.%.19]
  229. // CHECK:STDOUT: %.loc31_46.2: %.12 = converted %p.ref, <error> [template = <error>]
  230. // CHECK:STDOUT: return <error>
  231. // CHECK:STDOUT: }
  232. // CHECK:STDOUT:
  233. // CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) {
  234. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
  235. // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)]
  236. // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)]
  237. // CHECK:STDOUT:
  238. // CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest);
  239. // CHECK:STDOUT: }
  240. // CHECK:STDOUT:
  241. // CHECK:STDOUT: fn @ConvertIncomplete(%p.param_patt: %.21) -> %.22 {
  242. // CHECK:STDOUT: !entry:
  243. // CHECK:STDOUT: %p.ref: %.21 = name_ref p, %p
  244. // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%.22) [template = constants.%ImplicitAs.type.4]
  245. // CHECK:STDOUT: %.loc41_55.1: %.23 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%.22) [template = constants.%.24]
  246. // CHECK:STDOUT: %Convert.ref: %.23 = name_ref Convert, %.loc41_55.1 [template = constants.%.24]
  247. // CHECK:STDOUT: %.loc41_55.2: %.22 = converted %p.ref, <error> [template = <error>]
  248. // CHECK:STDOUT: return <error>
  249. // CHECK:STDOUT: }
  250. // CHECK:STDOUT:
  251. // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) {
  252. // CHECK:STDOUT: %Dest => constants.%Dest
  253. // CHECK:STDOUT: %Dest.patt => constants.%Dest
  254. // CHECK:STDOUT: }
  255. // CHECK:STDOUT:
  256. // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) {
  257. // CHECK:STDOUT: %Dest => constants.%Dest
  258. // CHECK:STDOUT: %Dest.patt => constants.%Dest
  259. // CHECK:STDOUT: }
  260. // CHECK:STDOUT:
  261. // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) {
  262. // CHECK:STDOUT: %Dest => constants.%Dest
  263. // CHECK:STDOUT: %Dest.patt => constants.%Dest
  264. // CHECK:STDOUT: }
  265. // CHECK:STDOUT:
  266. // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) {
  267. // CHECK:STDOUT: %Dest => constants.%Dest
  268. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2
  269. // CHECK:STDOUT: %Self => constants.%Self.1
  270. // CHECK:STDOUT: }
  271. // CHECK:STDOUT:
  272. // CHECK:STDOUT: specific @ImplicitAs(constants.%.12) {
  273. // CHECK:STDOUT: %Dest => constants.%.12
  274. // CHECK:STDOUT: %Dest.patt => constants.%.12
  275. // CHECK:STDOUT:
  276. // CHECK:STDOUT: !definition:
  277. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3
  278. // CHECK:STDOUT: %Self => constants.%Self.2
  279. // CHECK:STDOUT: %Convert.type => constants.%Convert.type.2
  280. // CHECK:STDOUT: %Convert => constants.%Convert.2
  281. // CHECK:STDOUT: %.1 => constants.%.18
  282. // CHECK:STDOUT: %.2 => constants.%.19
  283. // CHECK:STDOUT: }
  284. // CHECK:STDOUT:
  285. // CHECK:STDOUT: specific @ImplicitAs(constants.%.22) {
  286. // CHECK:STDOUT: %Dest => constants.%.22
  287. // CHECK:STDOUT: %Dest.patt => constants.%.22
  288. // CHECK:STDOUT:
  289. // CHECK:STDOUT: !definition:
  290. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4
  291. // CHECK:STDOUT: %Self => constants.%Self.2
  292. // CHECK:STDOUT: %Convert.type => constants.%Convert.type.3
  293. // CHECK:STDOUT: %Convert => constants.%Convert.3
  294. // CHECK:STDOUT: %.1 => constants.%.23
  295. // CHECK:STDOUT: %.2 => constants.%.24
  296. // CHECK:STDOUT: }
  297. // CHECK:STDOUT: