dependent_param.carbon 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  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. //
  7. // AUTOUPDATE
  8. // TIP: To test this file alone, run:
  9. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/generic/dependent_param.carbon
  10. // TIP: To dump output, run:
  11. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/generic/dependent_param.carbon
  12. // --- nested_class.carbon
  13. library "[[@TEST_NAME]]";
  14. class Outer(T:! Core.Copy) {
  15. class Inner(U:! T) {
  16. //@dump-sem-ir-begin
  17. fn Get() -> T { return U; }
  18. //@dump-sem-ir-end
  19. }
  20. }
  21. //@dump-sem-ir-begin
  22. var n: i32 = Outer(i32).Inner(42).Get();
  23. //@dump-sem-ir-end
  24. // CHECK:STDOUT: --- nested_class.carbon
  25. // CHECK:STDOUT:
  26. // CHECK:STDOUT: constants {
  27. // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
  28. // CHECK:STDOUT: %T.f92: %Copy.type = symbolic_binding T, 0 [symbolic]
  29. // CHECK:STDOUT: %Outer.type: type = generic_class_type @Outer [concrete]
  30. // CHECK:STDOUT: %Outer.generic: %Outer.type = struct_value () [concrete]
  31. // CHECK:STDOUT: %Outer.44e: type = class_type @Outer, @Outer(%T.f92) [symbolic]
  32. // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.f92 [symbolic]
  33. // CHECK:STDOUT: %U.9fd: %T.binding.as_type = symbolic_binding U, 1 [symbolic]
  34. // CHECK:STDOUT: %pattern_type.c769df.1: type = pattern_type %T.binding.as_type [symbolic]
  35. // CHECK:STDOUT: %Inner.type.561: type = generic_class_type @Inner, @Outer(%T.f92) [symbolic]
  36. // CHECK:STDOUT: %Inner.generic.3b5: %Inner.type.561 = struct_value () [symbolic]
  37. // CHECK:STDOUT: %Inner.485: type = class_type @Inner, @Inner(%T.f92, %U.9fd) [symbolic]
  38. // CHECK:STDOUT: %Inner.Get.type.a07: type = fn_type @Inner.Get, @Inner(%T.f92, %U.9fd) [symbolic]
  39. // CHECK:STDOUT: %Inner.Get.15d: %Inner.Get.type.a07 = struct_value () [symbolic]
  40. // CHECK:STDOUT: %require_complete.91e: <witness> = require_complete_type %T.binding.as_type [symbolic]
  41. // CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete]
  42. // CHECK:STDOUT: %Copy.lookup_impl_witness.edd: <witness> = lookup_impl_witness %T.f92, @Copy [symbolic]
  43. // CHECK:STDOUT: %.232: type = fn_type_with_self_type %Copy.Op.type, %T.f92 [symbolic]
  44. // CHECK:STDOUT: %impl.elem0.8df: %.232 = impl_witness_access %Copy.lookup_impl_witness.edd, element0 [symbolic]
  45. // CHECK:STDOUT: %specific_impl_fn.5c4: <specific function> = specific_impl_function %impl.elem0.8df, @Copy.Op(%T.f92) [symbolic]
  46. // CHECK:STDOUT: %bound_method.293: <bound method> = bound_method %U.9fd, %impl.elem0.8df [symbolic]
  47. // CHECK:STDOUT: %bound_method.ed9: <bound method> = bound_method %U.9fd, %specific_impl_fn.5c4 [symbolic]
  48. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  49. // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic]
  50. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  51. // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete]
  52. // CHECK:STDOUT: %complete_type.f8a: <witness> = complete_type_witness %i32.builtin [concrete]
  53. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  54. // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.413: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic]
  55. // CHECK:STDOUT: %Int.as.Copy.impl.Op.2d6: %Int.as.Copy.impl.Op.type.413 = struct_value () [symbolic]
  56. // CHECK:STDOUT: %Copy.impl_witness.09c: <witness> = impl_witness imports.%Copy.impl_witness_table.e1c, @Int.as.Copy.impl(%int_32) [concrete]
  57. // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.60b: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete]
  58. // CHECK:STDOUT: %Int.as.Copy.impl.Op.c85: %Int.as.Copy.impl.Op.type.60b = struct_value () [concrete]
  59. // CHECK:STDOUT: %Copy.facet.6df: %Copy.type = facet_value %i32, (%Copy.impl_witness.09c) [concrete]
  60. // CHECK:STDOUT: %Outer.732: type = class_type @Outer, @Outer(%Copy.facet.6df) [concrete]
  61. // CHECK:STDOUT: %Inner.type.de0: type = generic_class_type @Inner, @Outer(%Copy.facet.6df) [concrete]
  62. // CHECK:STDOUT: %Inner.generic.6fc: %Inner.type.de0 = struct_value () [concrete]
  63. // CHECK:STDOUT: %int_42.20e: Core.IntLiteral = int_value 42 [concrete]
  64. // CHECK:STDOUT: %Copy.impl_witness.d08: <witness> = impl_witness imports.%Copy.impl_witness_table.5a1 [concrete]
  65. // CHECK:STDOUT: %Copy.facet.8aa: %Copy.type = facet_value Core.IntLiteral, (%Copy.impl_witness.d08) [concrete]
  66. // CHECK:STDOUT: %ImplicitAs.type.d14: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  67. // CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
  68. // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
  69. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.412: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  70. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.740: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.412 = struct_value () [symbolic]
  71. // CHECK:STDOUT: %ImplicitAs.impl_witness.ec0: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.99e, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  72. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.84b: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  73. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.84b = struct_value () [concrete]
  74. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.d14 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.ec0) [concrete]
  75. // CHECK:STDOUT: %.d28: type = fn_type_with_self_type %ImplicitAs.Convert.type.1b6, %ImplicitAs.facet [concrete]
  76. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %int_42.20e, %Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0 [concrete]
  77. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  78. // CHECK:STDOUT: %bound_method.5bc: <bound method> = bound_method %int_42.20e, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  79. // CHECK:STDOUT: %int_42.c68: %i32 = int_value 42 [concrete]
  80. // CHECK:STDOUT: %Inner.81e: type = class_type @Inner, @Inner(%Copy.facet.6df, %int_42.c68) [concrete]
  81. // CHECK:STDOUT: %Inner.Get.type.071: type = fn_type @Inner.Get, @Inner(%Copy.facet.6df, %int_42.c68) [concrete]
  82. // CHECK:STDOUT: %Inner.Get.0d9: %Inner.Get.type.071 = struct_value () [concrete]
  83. // CHECK:STDOUT: %Inner.Get.specific_fn: <specific function> = specific_function %Inner.Get.0d9, @Inner.Get(%Copy.facet.6df, %int_42.c68) [concrete]
  84. // CHECK:STDOUT: %.fe5: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.6df [concrete]
  85. // CHECK:STDOUT: %Int.as.Copy.impl.Op.bound: <bound method> = bound_method %int_42.c68, %Int.as.Copy.impl.Op.c85 [concrete]
  86. // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: <specific function> = specific_function %Int.as.Copy.impl.Op.c85, @Int.as.Copy.impl.Op(%int_32) [concrete]
  87. // CHECK:STDOUT: %bound_method.436: <bound method> = bound_method %int_42.c68, %Int.as.Copy.impl.Op.specific_fn [concrete]
  88. // CHECK:STDOUT: }
  89. // CHECK:STDOUT:
  90. // CHECK:STDOUT: imports {
  91. // CHECK:STDOUT: %Core.import_ref.edf: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.413) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.2d6)]
  92. // CHECK:STDOUT: %Copy.impl_witness_table.e1c = impl_witness_table (%Core.import_ref.edf), @Int.as.Copy.impl [concrete]
  93. // CHECK:STDOUT: %Core.import_ref.b02 = import_ref Core//prelude/parts/copy, loc{{\d+_\d+}}, unloaded
  94. // CHECK:STDOUT: %Copy.impl_witness_table.5a1 = impl_witness_table (%Core.import_ref.b02), @Core.IntLiteral.as.Copy.impl [concrete]
  95. // CHECK:STDOUT: %Core.import_ref.3e1: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.412) = 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.740)]
  96. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.99e = impl_witness_table (%Core.import_ref.3e1), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  97. // CHECK:STDOUT: }
  98. // CHECK:STDOUT:
  99. // CHECK:STDOUT: file {
  100. // CHECK:STDOUT: name_binding_decl {
  101. // CHECK:STDOUT: %n.patt: %pattern_type.7ce = ref_binding_pattern n [concrete]
  102. // CHECK:STDOUT: %n.var_patt: %pattern_type.7ce = var_pattern %n.patt [concrete]
  103. // CHECK:STDOUT: }
  104. // CHECK:STDOUT: %n.var: ref %i32 = var %n.var_patt [concrete]
  105. // CHECK:STDOUT: %.loc13: type = splice_block %i32 [concrete = constants.%i32] {
  106. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  107. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  108. // CHECK:STDOUT: }
  109. // CHECK:STDOUT: %n: ref %i32 = ref_binding n, %n.var [concrete = %n.var]
  110. // CHECK:STDOUT: }
  111. // CHECK:STDOUT:
  112. // CHECK:STDOUT: generic class @Outer(%T.loc4_13.2: %Copy.type) {
  113. // CHECK:STDOUT: <elided>
  114. // CHECK:STDOUT:
  115. // CHECK:STDOUT: !definition:
  116. // CHECK:STDOUT: <elided>
  117. // CHECK:STDOUT:
  118. // CHECK:STDOUT: class {
  119. // CHECK:STDOUT: <elided>
  120. // CHECK:STDOUT: complete_type_witness = %complete_type
  121. // CHECK:STDOUT:
  122. // CHECK:STDOUT: !members:
  123. // CHECK:STDOUT: .Self = constants.%Outer.44e
  124. // CHECK:STDOUT: .T = <poisoned>
  125. // CHECK:STDOUT: .Inner = %Inner.decl
  126. // CHECK:STDOUT: }
  127. // CHECK:STDOUT: }
  128. // CHECK:STDOUT:
  129. // CHECK:STDOUT: generic class @Inner(@Outer.%T.loc4_13.2: %Copy.type, %U.loc5_15.2: @Inner.%T.binding.as_type (%T.binding.as_type)) {
  130. // CHECK:STDOUT: <elided>
  131. // CHECK:STDOUT:
  132. // CHECK:STDOUT: !definition:
  133. // CHECK:STDOUT: %Inner.Get.type: type = fn_type @Inner.Get, @Inner(%T, %U.loc5_15.1) [symbolic = %Inner.Get.type (constants.%Inner.Get.type.a07)]
  134. // CHECK:STDOUT: %Inner.Get: @Inner.%Inner.Get.type (%Inner.Get.type.a07) = struct_value () [symbolic = %Inner.Get (constants.%Inner.Get.15d)]
  135. // CHECK:STDOUT:
  136. // CHECK:STDOUT: class {
  137. // CHECK:STDOUT: %Inner.Get.decl: @Inner.%Inner.Get.type (%Inner.Get.type.a07) = fn_decl @Inner.Get [symbolic = @Inner.%Inner.Get (constants.%Inner.Get.15d)] {
  138. // CHECK:STDOUT: %return.patt: @Inner.Get.%pattern_type (%pattern_type.c769df.1) = return_slot_pattern [concrete]
  139. // CHECK:STDOUT: %return.param_patt: @Inner.Get.%pattern_type (%pattern_type.c769df.1) = out_param_pattern %return.patt, call_param0 [concrete]
  140. // CHECK:STDOUT: } {
  141. // CHECK:STDOUT: %T.ref: %Copy.type = name_ref T, @Outer.%T.loc4_13.2 [symbolic = %T (constants.%T.f92)]
  142. // CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  143. // CHECK:STDOUT: %.loc7_17: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  144. // CHECK:STDOUT: %return.param: ref @Inner.Get.%T.binding.as_type (%T.binding.as_type) = out_param call_param0
  145. // CHECK:STDOUT: %return: ref @Inner.Get.%T.binding.as_type (%T.binding.as_type) = return_slot %return.param
  146. // CHECK:STDOUT: }
  147. // CHECK:STDOUT: <elided>
  148. // CHECK:STDOUT: complete_type_witness = %complete_type
  149. // CHECK:STDOUT:
  150. // CHECK:STDOUT: !members:
  151. // CHECK:STDOUT: .Self = constants.%Inner.485
  152. // CHECK:STDOUT: .T = <poisoned>
  153. // CHECK:STDOUT: .Get = %Inner.Get.decl
  154. // CHECK:STDOUT: .U = <poisoned>
  155. // CHECK:STDOUT: }
  156. // CHECK:STDOUT: }
  157. // CHECK:STDOUT:
  158. // CHECK:STDOUT: generic fn @Inner.Get(@Outer.%T.loc4_13.2: %Copy.type, @Inner.%U.loc5_15.2: @Inner.%T.binding.as_type (%T.binding.as_type)) {
  159. // CHECK:STDOUT: %T: %Copy.type = symbolic_binding T, 0 [symbolic = %T (constants.%T.f92)]
  160. // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  161. // CHECK:STDOUT: %pattern_type: type = pattern_type %T.binding.as_type [symbolic = %pattern_type (constants.%pattern_type.c769df.1)]
  162. // CHECK:STDOUT:
  163. // CHECK:STDOUT: !definition:
  164. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.binding.as_type [symbolic = %require_complete (constants.%require_complete.91e)]
  165. // CHECK:STDOUT: %U: @Inner.Get.%T.binding.as_type (%T.binding.as_type) = symbolic_binding U, 1 [symbolic = %U (constants.%U.9fd)]
  166. // CHECK:STDOUT: %Copy.lookup_impl_witness: <witness> = lookup_impl_witness %T, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.edd)]
  167. // CHECK:STDOUT: %.loc7_28: type = fn_type_with_self_type constants.%Copy.Op.type, %T [symbolic = %.loc7_28 (constants.%.232)]
  168. // CHECK:STDOUT: %impl.elem0.loc7_28.2: @Inner.Get.%.loc7_28 (%.232) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc7_28.2 (constants.%impl.elem0.8df)]
  169. // CHECK:STDOUT: %bound_method.loc7_28.3: <bound method> = bound_method %U, %impl.elem0.loc7_28.2 [symbolic = %bound_method.loc7_28.3 (constants.%bound_method.293)]
  170. // CHECK:STDOUT: %specific_impl_fn.loc7_28.2: <specific function> = specific_impl_function %impl.elem0.loc7_28.2, @Copy.Op(%T) [symbolic = %specific_impl_fn.loc7_28.2 (constants.%specific_impl_fn.5c4)]
  171. // CHECK:STDOUT: %bound_method.loc7_28.4: <bound method> = bound_method %U, %specific_impl_fn.loc7_28.2 [symbolic = %bound_method.loc7_28.4 (constants.%bound_method.ed9)]
  172. // CHECK:STDOUT:
  173. // CHECK:STDOUT: fn() -> %return.param: @Inner.Get.%T.binding.as_type (%T.binding.as_type) {
  174. // CHECK:STDOUT: !entry:
  175. // CHECK:STDOUT: %U.ref: @Inner.Get.%T.binding.as_type (%T.binding.as_type) = name_ref U, @Inner.%U.loc5_15.2 [symbolic = %U (constants.%U.9fd)]
  176. // CHECK:STDOUT: %impl.elem0.loc7_28.1: @Inner.Get.%.loc7_28 (%.232) = impl_witness_access constants.%Copy.lookup_impl_witness.edd, element0 [symbolic = %impl.elem0.loc7_28.2 (constants.%impl.elem0.8df)]
  177. // CHECK:STDOUT: %bound_method.loc7_28.1: <bound method> = bound_method %U.ref, %impl.elem0.loc7_28.1 [symbolic = %bound_method.loc7_28.3 (constants.%bound_method.293)]
  178. // CHECK:STDOUT: %specific_impl_fn.loc7_28.1: <specific function> = specific_impl_function %impl.elem0.loc7_28.1, @Copy.Op(constants.%T.f92) [symbolic = %specific_impl_fn.loc7_28.2 (constants.%specific_impl_fn.5c4)]
  179. // CHECK:STDOUT: %bound_method.loc7_28.2: <bound method> = bound_method %U.ref, %specific_impl_fn.loc7_28.1 [symbolic = %bound_method.loc7_28.4 (constants.%bound_method.ed9)]
  180. // CHECK:STDOUT: %.loc7_14: ref @Inner.Get.%T.binding.as_type (%T.binding.as_type) = splice_block %return {}
  181. // CHECK:STDOUT: %Copy.Op.call: init @Inner.Get.%T.binding.as_type (%T.binding.as_type) = call %bound_method.loc7_28.2(%U.ref) to %.loc7_14
  182. // CHECK:STDOUT: return %Copy.Op.call to %return
  183. // CHECK:STDOUT: }
  184. // CHECK:STDOUT: }
  185. // CHECK:STDOUT:
  186. // CHECK:STDOUT: fn @__global_init() {
  187. // CHECK:STDOUT: !entry:
  188. // CHECK:STDOUT: %Outer.ref: %Outer.type = name_ref Outer, file.%Outer.decl [concrete = constants.%Outer.generic]
  189. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  190. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  191. // CHECK:STDOUT: %Copy.facet.loc13_23: %Copy.type = facet_value %i32, (constants.%Copy.impl_witness.09c) [concrete = constants.%Copy.facet.6df]
  192. // CHECK:STDOUT: %.loc13_23: %Copy.type = converted %i32, %Copy.facet.loc13_23 [concrete = constants.%Copy.facet.6df]
  193. // CHECK:STDOUT: %Outer: type = class_type @Outer, @Outer(constants.%Copy.facet.6df) [concrete = constants.%Outer.732]
  194. // CHECK:STDOUT: %.loc13_24: %Inner.type.de0 = specific_constant @Outer.%Inner.decl, @Outer(constants.%Copy.facet.6df) [concrete = constants.%Inner.generic.6fc]
  195. // CHECK:STDOUT: %Inner.ref: %Inner.type.de0 = name_ref Inner, %.loc13_24 [concrete = constants.%Inner.generic.6fc]
  196. // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [concrete = constants.%int_42.20e]
  197. // CHECK:STDOUT: %Copy.facet.loc13_33: %Copy.type = facet_value Core.IntLiteral, (constants.%Copy.impl_witness.d08) [concrete = constants.%Copy.facet.8aa]
  198. // CHECK:STDOUT: %.loc13_33.1: %Copy.type = converted Core.IntLiteral, %Copy.facet.loc13_33 [concrete = constants.%Copy.facet.8aa]
  199. // CHECK:STDOUT: %impl.elem0: %.d28 = impl_witness_access constants.%ImplicitAs.impl_witness.ec0, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0]
  200. // CHECK:STDOUT: %bound_method.loc13_33.1: <bound method> = bound_method constants.%int_42.20e, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
  201. // 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]
  202. // CHECK:STDOUT: %bound_method.loc13_33.2: <bound method> = bound_method constants.%int_42.20e, %specific_fn [concrete = constants.%bound_method.5bc]
  203. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc13_33.2(constants.%int_42.20e) [concrete = constants.%int_42.c68]
  204. // CHECK:STDOUT: %.loc13_33.2: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_42.c68]
  205. // CHECK:STDOUT: %.loc13_33.3: %i32 = converted constants.%int_42.20e, %.loc13_33.2 [concrete = constants.%int_42.c68]
  206. // CHECK:STDOUT: %Inner: type = class_type @Inner, @Inner(constants.%Copy.facet.6df, constants.%int_42.c68) [concrete = constants.%Inner.81e]
  207. // CHECK:STDOUT: %.loc13_34: %Inner.Get.type.071 = specific_constant @Inner.%Inner.Get.decl, @Inner(constants.%Copy.facet.6df, constants.%int_42.c68) [concrete = constants.%Inner.Get.0d9]
  208. // CHECK:STDOUT: %Get.ref: %Inner.Get.type.071 = name_ref Get, %.loc13_34 [concrete = constants.%Inner.Get.0d9]
  209. // CHECK:STDOUT: %Inner.Get.specific_fn: <specific function> = specific_function %Get.ref, @Inner.Get(constants.%Copy.facet.6df, constants.%int_42.c68) [concrete = constants.%Inner.Get.specific_fn]
  210. // CHECK:STDOUT: %Inner.Get.call: init %i32 = call %Inner.Get.specific_fn()
  211. // CHECK:STDOUT: assign file.%n.var, %Inner.Get.call
  212. // CHECK:STDOUT: <elided>
  213. // CHECK:STDOUT: }
  214. // CHECK:STDOUT:
  215. // CHECK:STDOUT: specific @Outer(constants.%T.f92) {
  216. // CHECK:STDOUT: %T.loc4_13.1 => constants.%T.f92
  217. // CHECK:STDOUT:
  218. // CHECK:STDOUT: !definition:
  219. // CHECK:STDOUT: %Inner.type => constants.%Inner.type.561
  220. // CHECK:STDOUT: %Inner.generic => constants.%Inner.generic.3b5
  221. // CHECK:STDOUT: }
  222. // CHECK:STDOUT:
  223. // CHECK:STDOUT: specific @Inner(constants.%T.f92, constants.%U.9fd) {
  224. // CHECK:STDOUT: %T => constants.%T.f92
  225. // CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type
  226. // CHECK:STDOUT: %U.loc5_15.1 => constants.%U.9fd
  227. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.c769df.1
  228. // CHECK:STDOUT:
  229. // CHECK:STDOUT: !definition:
  230. // CHECK:STDOUT: %Inner.Get.type => constants.%Inner.Get.type.a07
  231. // CHECK:STDOUT: %Inner.Get => constants.%Inner.Get.15d
  232. // CHECK:STDOUT: }
  233. // CHECK:STDOUT:
  234. // CHECK:STDOUT: specific @Inner.Get(constants.%T.f92, constants.%U.9fd) {
  235. // CHECK:STDOUT: %T => constants.%T.f92
  236. // CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type
  237. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.c769df.1
  238. // CHECK:STDOUT: }
  239. // CHECK:STDOUT:
  240. // CHECK:STDOUT: specific @Outer(constants.%Copy.facet.6df) {
  241. // CHECK:STDOUT: %T.loc4_13.1 => constants.%Copy.facet.6df
  242. // CHECK:STDOUT:
  243. // CHECK:STDOUT: !definition:
  244. // CHECK:STDOUT: %Inner.type => constants.%Inner.type.de0
  245. // CHECK:STDOUT: %Inner.generic => constants.%Inner.generic.6fc
  246. // CHECK:STDOUT: }
  247. // CHECK:STDOUT:
  248. // CHECK:STDOUT: specific @Inner(constants.%Copy.facet.6df, constants.%int_42.c68) {
  249. // CHECK:STDOUT: %T => constants.%Copy.facet.6df
  250. // CHECK:STDOUT: %T.binding.as_type => constants.%i32
  251. // CHECK:STDOUT: %U.loc5_15.1 => constants.%int_42.c68
  252. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7ce
  253. // CHECK:STDOUT:
  254. // CHECK:STDOUT: !definition:
  255. // CHECK:STDOUT: %Inner.Get.type => constants.%Inner.Get.type.071
  256. // CHECK:STDOUT: %Inner.Get => constants.%Inner.Get.0d9
  257. // CHECK:STDOUT: }
  258. // CHECK:STDOUT:
  259. // CHECK:STDOUT: specific @Inner.Get(constants.%Copy.facet.6df, constants.%int_42.c68) {
  260. // CHECK:STDOUT: %T => constants.%Copy.facet.6df
  261. // CHECK:STDOUT: %T.binding.as_type => constants.%i32
  262. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7ce
  263. // CHECK:STDOUT:
  264. // CHECK:STDOUT: !definition:
  265. // CHECK:STDOUT: %require_complete => constants.%complete_type.f8a
  266. // CHECK:STDOUT: %U => constants.%int_42.c68
  267. // CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.impl_witness.09c
  268. // CHECK:STDOUT: %.loc7_28 => constants.%.fe5
  269. // CHECK:STDOUT: %impl.elem0.loc7_28.2 => constants.%Int.as.Copy.impl.Op.c85
  270. // CHECK:STDOUT: %bound_method.loc7_28.3 => constants.%Int.as.Copy.impl.Op.bound
  271. // CHECK:STDOUT: %specific_impl_fn.loc7_28.2 => constants.%Int.as.Copy.impl.Op.specific_fn
  272. // CHECK:STDOUT: %bound_method.loc7_28.4 => constants.%bound_method.436
  273. // CHECK:STDOUT: }
  274. // CHECK:STDOUT: