syntactic_merge_literal.carbon 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  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. // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/int.carbon
  6. // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
  7. // EXTRA-ARGS: --dump-sem-ir-ranges=if-present
  8. //
  9. // AUTOUPDATE
  10. // TIP: To test this file alone, run:
  11. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/syntactic_merge_literal.carbon
  12. // TIP: To dump output, run:
  13. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/syntactic_merge_literal.carbon
  14. // --- int_match.carbon
  15. library "[[@TEST_NAME]]";
  16. class C(a:! i32) {}
  17. class D(b:! C(1_000));
  18. class D(b:! C(1_000)) {}
  19. // --- fail_int_mismatch.carbon
  20. library "[[@TEST_NAME]]";
  21. class C(a:! i32) {}
  22. class D(b:! C(1000));
  23. // CHECK:STDERR: fail_int_mismatch.carbon:[[@LINE+7]]:15: error: redeclaration syntax differs here [RedeclParamSyntaxDiffers]
  24. // CHECK:STDERR: class D(b:! C(1_000)) {}
  25. // CHECK:STDERR: ^~~~~
  26. // CHECK:STDERR: fail_int_mismatch.carbon:[[@LINE-4]]:15: note: comparing with previous declaration here [RedeclParamSyntaxPrevious]
  27. // CHECK:STDERR: class D(b:! C(1000));
  28. // CHECK:STDERR: ^~~~
  29. // CHECK:STDERR:
  30. class D(b:! C(1_000)) {}
  31. // CHECK:STDOUT: --- int_match.carbon
  32. // CHECK:STDOUT:
  33. // CHECK:STDOUT: constants {
  34. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  35. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  36. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  37. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  38. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  39. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  40. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  41. // CHECK:STDOUT: %a: %i32 = symbolic_binding a, 0 [symbolic]
  42. // CHECK:STDOUT: %C.type: type = generic_class_type @C [concrete]
  43. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [concrete]
  44. // CHECK:STDOUT: %C.ad6: type = class_type @C, @C(%a) [symbolic]
  45. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  46. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  47. // CHECK:STDOUT: %int_1000.ff9: Core.IntLiteral = int_value 1000 [concrete]
  48. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  49. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  50. // CHECK:STDOUT: %ImplicitAs.type.e8c: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  51. // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
  52. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  53. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6 = struct_value () [symbolic]
  54. // CHECK:STDOUT: %ImplicitAs.impl_witness.6bc: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.74f, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  55. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  56. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d = struct_value () [concrete]
  57. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.e8c = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.6bc) [concrete]
  58. // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.b37: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%i32, %ImplicitAs.facet) [concrete]
  59. // CHECK:STDOUT: %.545: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.b37, %ImplicitAs.facet [concrete]
  60. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %int_1000.ff9, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
  61. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  62. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_1000.ff9, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  63. // CHECK:STDOUT: %int_1000.1b6: %i32 = int_value 1000 [concrete]
  64. // CHECK:STDOUT: %C.a39: type = class_type @C, @C(%int_1000.1b6) [concrete]
  65. // CHECK:STDOUT: %pattern_type.f44: type = pattern_type %C.a39 [concrete]
  66. // CHECK:STDOUT: %b: %C.a39 = symbolic_binding b, 0 [symbolic]
  67. // CHECK:STDOUT: %D.type: type = generic_class_type @D [concrete]
  68. // CHECK:STDOUT: %D.generic: %D.type = struct_value () [concrete]
  69. // CHECK:STDOUT: %D: type = class_type @D, @D(%b) [symbolic]
  70. // CHECK:STDOUT: }
  71. // CHECK:STDOUT:
  72. // CHECK:STDOUT: imports {
  73. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  74. // CHECK:STDOUT: .Int = %Core.Int
  75. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  76. // CHECK:STDOUT: import Core//prelude
  77. // CHECK:STDOUT: import Core//prelude/...
  78. // CHECK:STDOUT: }
  79. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  80. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  81. // CHECK:STDOUT: %Core.import_ref.42d: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2)]
  82. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.74f = impl_witness_table (%Core.import_ref.42d), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  83. // CHECK:STDOUT: }
  84. // CHECK:STDOUT:
  85. // CHECK:STDOUT: file {
  86. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  87. // CHECK:STDOUT: .Core = imports.%Core
  88. // CHECK:STDOUT: .C = %C.decl
  89. // CHECK:STDOUT: .D = %D.decl.loc5
  90. // CHECK:STDOUT: }
  91. // CHECK:STDOUT: %Core.import = import Core
  92. // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [concrete = constants.%C.generic] {
  93. // CHECK:STDOUT: %a.patt: %pattern_type.7ce = symbolic_binding_pattern a, 0 [concrete]
  94. // CHECK:STDOUT: } {
  95. // CHECK:STDOUT: %.loc4: type = splice_block %i32 [concrete = constants.%i32] {
  96. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  97. // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
  98. // CHECK:STDOUT: }
  99. // CHECK:STDOUT: %a.loc4_10.2: %i32 = symbolic_binding a, 0 [symbolic = %a.loc4_10.1 (constants.%a)]
  100. // CHECK:STDOUT: }
  101. // CHECK:STDOUT: %D.decl.loc5: %D.type = class_decl @D [concrete = constants.%D.generic] {
  102. // CHECK:STDOUT: %b.patt: %pattern_type.f44 = symbolic_binding_pattern b, 0 [concrete]
  103. // CHECK:STDOUT: } {
  104. // CHECK:STDOUT: %.loc5_20.1: type = splice_block %C.loc5 [concrete = constants.%C.a39] {
  105. // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  106. // CHECK:STDOUT: %C.ref.loc5: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
  107. // CHECK:STDOUT: %int_1000.loc5: Core.IntLiteral = int_value 1000 [concrete = constants.%int_1000.ff9]
  108. // CHECK:STDOUT: %impl.elem0.loc5: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  109. // CHECK:STDOUT: %bound_method.loc5_20.1: <bound method> = bound_method %int_1000.loc5, %impl.elem0.loc5 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
  110. // CHECK:STDOUT: %specific_fn.loc5: <specific function> = specific_function %impl.elem0.loc5, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  111. // CHECK:STDOUT: %bound_method.loc5_20.2: <bound method> = bound_method %int_1000.loc5, %specific_fn.loc5 [concrete = constants.%bound_method]
  112. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc5: init %i32 = call %bound_method.loc5_20.2(%int_1000.loc5) [concrete = constants.%int_1000.1b6]
  113. // CHECK:STDOUT: %.loc5_20.2: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc5 [concrete = constants.%int_1000.1b6]
  114. // CHECK:STDOUT: %.loc5_20.3: %i32 = converted %int_1000.loc5, %.loc5_20.2 [concrete = constants.%int_1000.1b6]
  115. // CHECK:STDOUT: %C.loc5: type = class_type @C, @C(constants.%int_1000.1b6) [concrete = constants.%C.a39]
  116. // CHECK:STDOUT: }
  117. // CHECK:STDOUT: %b.loc5_10.2: %C.a39 = symbolic_binding b, 0 [symbolic = %b.loc5_10.1 (constants.%b)]
  118. // CHECK:STDOUT: }
  119. // CHECK:STDOUT: %D.decl.loc6: %D.type = class_decl @D [concrete = constants.%D.generic] {
  120. // CHECK:STDOUT: %b.patt: %pattern_type.f44 = symbolic_binding_pattern b, 0 [concrete]
  121. // CHECK:STDOUT: } {
  122. // CHECK:STDOUT: %.loc6_20.1: type = splice_block %C.loc6 [concrete = constants.%C.a39] {
  123. // CHECK:STDOUT: %.Self.1: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  124. // CHECK:STDOUT: %C.ref.loc6: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
  125. // CHECK:STDOUT: %int_1000.loc6: Core.IntLiteral = int_value 1000 [concrete = constants.%int_1000.ff9]
  126. // CHECK:STDOUT: %impl.elem0.loc6: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  127. // CHECK:STDOUT: %bound_method.loc6_20.1: <bound method> = bound_method %int_1000.loc6, %impl.elem0.loc6 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
  128. // CHECK:STDOUT: %specific_fn.loc6: <specific function> = specific_function %impl.elem0.loc6, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  129. // CHECK:STDOUT: %bound_method.loc6_20.2: <bound method> = bound_method %int_1000.loc6, %specific_fn.loc6 [concrete = constants.%bound_method]
  130. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6: init %i32 = call %bound_method.loc6_20.2(%int_1000.loc6) [concrete = constants.%int_1000.1b6]
  131. // CHECK:STDOUT: %.loc6_20.2: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6 [concrete = constants.%int_1000.1b6]
  132. // CHECK:STDOUT: %.loc6_20.3: %i32 = converted %int_1000.loc6, %.loc6_20.2 [concrete = constants.%int_1000.1b6]
  133. // CHECK:STDOUT: %C.loc6: type = class_type @C, @C(constants.%int_1000.1b6) [concrete = constants.%C.a39]
  134. // CHECK:STDOUT: }
  135. // CHECK:STDOUT: %b.loc6: %C.a39 = symbolic_binding b, 0 [symbolic = %b.loc5_10.1 (constants.%b)]
  136. // CHECK:STDOUT: }
  137. // CHECK:STDOUT: }
  138. // CHECK:STDOUT:
  139. // CHECK:STDOUT: generic class @C(%a.loc4_10.2: %i32) {
  140. // CHECK:STDOUT: %a.loc4_10.1: %i32 = symbolic_binding a, 0 [symbolic = %a.loc4_10.1 (constants.%a)]
  141. // CHECK:STDOUT:
  142. // CHECK:STDOUT: !definition:
  143. // CHECK:STDOUT:
  144. // CHECK:STDOUT: class {
  145. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  146. // CHECK:STDOUT: complete_type_witness = %complete_type
  147. // CHECK:STDOUT:
  148. // CHECK:STDOUT: !members:
  149. // CHECK:STDOUT: .Self = constants.%C.ad6
  150. // CHECK:STDOUT: }
  151. // CHECK:STDOUT: }
  152. // CHECK:STDOUT:
  153. // CHECK:STDOUT: generic class @D(%b.loc5_10.2: %C.a39) {
  154. // CHECK:STDOUT: %b.loc5_10.1: %C.a39 = symbolic_binding b, 0 [symbolic = %b.loc5_10.1 (constants.%b)]
  155. // CHECK:STDOUT:
  156. // CHECK:STDOUT: !definition:
  157. // CHECK:STDOUT:
  158. // CHECK:STDOUT: class {
  159. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  160. // CHECK:STDOUT: complete_type_witness = %complete_type
  161. // CHECK:STDOUT:
  162. // CHECK:STDOUT: !members:
  163. // CHECK:STDOUT: .Self = constants.%D
  164. // CHECK:STDOUT: }
  165. // CHECK:STDOUT: }
  166. // CHECK:STDOUT:
  167. // CHECK:STDOUT: specific @C(constants.%a) {
  168. // CHECK:STDOUT: %a.loc4_10.1 => constants.%a
  169. // CHECK:STDOUT: }
  170. // CHECK:STDOUT:
  171. // CHECK:STDOUT: specific @C(constants.%int_1000.1b6) {
  172. // CHECK:STDOUT: %a.loc4_10.1 => constants.%int_1000.1b6
  173. // CHECK:STDOUT: }
  174. // CHECK:STDOUT:
  175. // CHECK:STDOUT: specific @D(constants.%b) {
  176. // CHECK:STDOUT: %b.loc5_10.1 => constants.%b
  177. // CHECK:STDOUT: }
  178. // CHECK:STDOUT:
  179. // CHECK:STDOUT: --- fail_int_mismatch.carbon
  180. // CHECK:STDOUT:
  181. // CHECK:STDOUT: constants {
  182. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  183. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  184. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  185. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  186. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  187. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  188. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  189. // CHECK:STDOUT: %a: %i32 = symbolic_binding a, 0 [symbolic]
  190. // CHECK:STDOUT: %C.type: type = generic_class_type @C [concrete]
  191. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [concrete]
  192. // CHECK:STDOUT: %C.ad6: type = class_type @C, @C(%a) [symbolic]
  193. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  194. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  195. // CHECK:STDOUT: %int_1000.ff9: Core.IntLiteral = int_value 1000 [concrete]
  196. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  197. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  198. // CHECK:STDOUT: %ImplicitAs.type.e8c: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  199. // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
  200. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  201. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6 = struct_value () [symbolic]
  202. // CHECK:STDOUT: %ImplicitAs.impl_witness.6bc: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.74f, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  203. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  204. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d = struct_value () [concrete]
  205. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.e8c = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.6bc) [concrete]
  206. // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.b37: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%i32, %ImplicitAs.facet) [concrete]
  207. // CHECK:STDOUT: %.545: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.b37, %ImplicitAs.facet [concrete]
  208. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %int_1000.ff9, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
  209. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  210. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_1000.ff9, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  211. // CHECK:STDOUT: %int_1000.1b6: %i32 = int_value 1000 [concrete]
  212. // CHECK:STDOUT: %C.a39: type = class_type @C, @C(%int_1000.1b6) [concrete]
  213. // CHECK:STDOUT: %pattern_type.f44: type = pattern_type %C.a39 [concrete]
  214. // CHECK:STDOUT: %b: %C.a39 = symbolic_binding b, 0 [symbolic]
  215. // CHECK:STDOUT: %D.type.6dc267.1: type = generic_class_type @D.loc5 [concrete]
  216. // CHECK:STDOUT: %D.generic.3c4a9e.1: %D.type.6dc267.1 = struct_value () [concrete]
  217. // CHECK:STDOUT: %D.type.6dc267.2: type = generic_class_type @D.loc13 [concrete]
  218. // CHECK:STDOUT: %D.generic.3c4a9e.2: %D.type.6dc267.2 = struct_value () [concrete]
  219. // CHECK:STDOUT: %D.54c2d1.2: type = class_type @D.loc13, @D.loc13(%b) [symbolic]
  220. // CHECK:STDOUT: }
  221. // CHECK:STDOUT:
  222. // CHECK:STDOUT: imports {
  223. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  224. // CHECK:STDOUT: .Int = %Core.Int
  225. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  226. // CHECK:STDOUT: import Core//prelude
  227. // CHECK:STDOUT: import Core//prelude/...
  228. // CHECK:STDOUT: }
  229. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  230. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  231. // CHECK:STDOUT: %Core.import_ref.42d: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2)]
  232. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.74f = impl_witness_table (%Core.import_ref.42d), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  233. // CHECK:STDOUT: }
  234. // CHECK:STDOUT:
  235. // CHECK:STDOUT: file {
  236. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  237. // CHECK:STDOUT: .Core = imports.%Core
  238. // CHECK:STDOUT: .C = %C.decl
  239. // CHECK:STDOUT: .D = %D.decl.loc5
  240. // CHECK:STDOUT: }
  241. // CHECK:STDOUT: %Core.import = import Core
  242. // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [concrete = constants.%C.generic] {
  243. // CHECK:STDOUT: %a.patt: %pattern_type.7ce = symbolic_binding_pattern a, 0 [concrete]
  244. // CHECK:STDOUT: } {
  245. // CHECK:STDOUT: %.loc4: type = splice_block %i32 [concrete = constants.%i32] {
  246. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  247. // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
  248. // CHECK:STDOUT: }
  249. // CHECK:STDOUT: %a.loc4_10.2: %i32 = symbolic_binding a, 0 [symbolic = %a.loc4_10.1 (constants.%a)]
  250. // CHECK:STDOUT: }
  251. // CHECK:STDOUT: %D.decl.loc5: %D.type.6dc267.1 = class_decl @D.loc5 [concrete = constants.%D.generic.3c4a9e.1] {
  252. // CHECK:STDOUT: %b.patt: %pattern_type.f44 = symbolic_binding_pattern b, 0 [concrete]
  253. // CHECK:STDOUT: } {
  254. // CHECK:STDOUT: %.loc5_19.1: type = splice_block %C [concrete = constants.%C.a39] {
  255. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  256. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
  257. // CHECK:STDOUT: %int_1000: Core.IntLiteral = int_value 1000 [concrete = constants.%int_1000.ff9]
  258. // CHECK:STDOUT: %impl.elem0: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  259. // CHECK:STDOUT: %bound_method.loc5_19.1: <bound method> = bound_method %int_1000, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
  260. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  261. // CHECK:STDOUT: %bound_method.loc5_19.2: <bound method> = bound_method %int_1000, %specific_fn [concrete = constants.%bound_method]
  262. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc5_19.2(%int_1000) [concrete = constants.%int_1000.1b6]
  263. // CHECK:STDOUT: %.loc5_19.2: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1000.1b6]
  264. // CHECK:STDOUT: %.loc5_19.3: %i32 = converted %int_1000, %.loc5_19.2 [concrete = constants.%int_1000.1b6]
  265. // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%int_1000.1b6) [concrete = constants.%C.a39]
  266. // CHECK:STDOUT: }
  267. // CHECK:STDOUT: %b.loc5_10.2: %C.a39 = symbolic_binding b, 0 [symbolic = %b.loc5_10.1 (constants.%b)]
  268. // CHECK:STDOUT: }
  269. // CHECK:STDOUT: %D.decl.loc13: %D.type.6dc267.2 = class_decl @D.loc13 [concrete = constants.%D.generic.3c4a9e.2] {
  270. // CHECK:STDOUT: %b.patt: %pattern_type.f44 = symbolic_binding_pattern b, 0 [concrete]
  271. // CHECK:STDOUT: } {
  272. // CHECK:STDOUT: %.loc13_20.1: type = splice_block %C [concrete = constants.%C.a39] {
  273. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  274. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
  275. // CHECK:STDOUT: %int_1000: Core.IntLiteral = int_value 1000 [concrete = constants.%int_1000.ff9]
  276. // CHECK:STDOUT: %impl.elem0: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  277. // CHECK:STDOUT: %bound_method.loc13_20.1: <bound method> = bound_method %int_1000, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
  278. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  279. // CHECK:STDOUT: %bound_method.loc13_20.2: <bound method> = bound_method %int_1000, %specific_fn [concrete = constants.%bound_method]
  280. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc13_20.2(%int_1000) [concrete = constants.%int_1000.1b6]
  281. // CHECK:STDOUT: %.loc13_20.2: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1000.1b6]
  282. // CHECK:STDOUT: %.loc13_20.3: %i32 = converted %int_1000, %.loc13_20.2 [concrete = constants.%int_1000.1b6]
  283. // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%int_1000.1b6) [concrete = constants.%C.a39]
  284. // CHECK:STDOUT: }
  285. // CHECK:STDOUT: %b.loc13_10.2: %C.a39 = symbolic_binding b, 0 [symbolic = %b.loc13_10.1 (constants.%b)]
  286. // CHECK:STDOUT: }
  287. // CHECK:STDOUT: }
  288. // CHECK:STDOUT:
  289. // CHECK:STDOUT: generic class @C(%a.loc4_10.2: %i32) {
  290. // CHECK:STDOUT: %a.loc4_10.1: %i32 = symbolic_binding a, 0 [symbolic = %a.loc4_10.1 (constants.%a)]
  291. // CHECK:STDOUT:
  292. // CHECK:STDOUT: !definition:
  293. // CHECK:STDOUT:
  294. // CHECK:STDOUT: class {
  295. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  296. // CHECK:STDOUT: complete_type_witness = %complete_type
  297. // CHECK:STDOUT:
  298. // CHECK:STDOUT: !members:
  299. // CHECK:STDOUT: .Self = constants.%C.ad6
  300. // CHECK:STDOUT: }
  301. // CHECK:STDOUT: }
  302. // CHECK:STDOUT:
  303. // CHECK:STDOUT: generic class @D.loc5(%b.loc5_10.2: %C.a39) {
  304. // CHECK:STDOUT: %b.loc5_10.1: %C.a39 = symbolic_binding b, 0 [symbolic = %b.loc5_10.1 (constants.%b)]
  305. // CHECK:STDOUT:
  306. // CHECK:STDOUT: class;
  307. // CHECK:STDOUT: }
  308. // CHECK:STDOUT:
  309. // CHECK:STDOUT: generic class @D.loc13(%b.loc13_10.2: %C.a39) {
  310. // CHECK:STDOUT: %b.loc13_10.1: %C.a39 = symbolic_binding b, 0 [symbolic = %b.loc13_10.1 (constants.%b)]
  311. // CHECK:STDOUT:
  312. // CHECK:STDOUT: !definition:
  313. // CHECK:STDOUT:
  314. // CHECK:STDOUT: class {
  315. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  316. // CHECK:STDOUT: complete_type_witness = %complete_type
  317. // CHECK:STDOUT:
  318. // CHECK:STDOUT: !members:
  319. // CHECK:STDOUT: .Self = constants.%D.54c2d1.2
  320. // CHECK:STDOUT: }
  321. // CHECK:STDOUT: }
  322. // CHECK:STDOUT:
  323. // CHECK:STDOUT: specific @C(constants.%a) {
  324. // CHECK:STDOUT: %a.loc4_10.1 => constants.%a
  325. // CHECK:STDOUT: }
  326. // CHECK:STDOUT:
  327. // CHECK:STDOUT: specific @C(constants.%int_1000.1b6) {
  328. // CHECK:STDOUT: %a.loc4_10.1 => constants.%int_1000.1b6
  329. // CHECK:STDOUT: }
  330. // CHECK:STDOUT:
  331. // CHECK:STDOUT: specific @D.loc5(constants.%b) {
  332. // CHECK:STDOUT: %b.loc5_10.1 => constants.%b
  333. // CHECK:STDOUT: }
  334. // CHECK:STDOUT:
  335. // CHECK:STDOUT: specific @D.loc13(constants.%b) {
  336. // CHECK:STDOUT: %b.loc13_10.1 => constants.%b
  337. // CHECK:STDOUT: }
  338. // CHECK:STDOUT: