dependent_param.carbon 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  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.035: %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.4b9: type = class_type @Outer, @Outer(%T.035) [symbolic]
  32. // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.035 [symbolic]
  33. // CHECK:STDOUT: %pattern_type.9b9f0c.2: type = pattern_type %T.binding.as_type [symbolic]
  34. // CHECK:STDOUT: %U.959: %T.binding.as_type = symbolic_binding U, 1 [symbolic]
  35. // CHECK:STDOUT: %Inner.type.af4: type = generic_class_type @Inner, @Outer(%T.035) [symbolic]
  36. // CHECK:STDOUT: %Inner.generic.994: %Inner.type.af4 = struct_value () [symbolic]
  37. // CHECK:STDOUT: %Inner.c23: type = class_type @Inner, @Inner(%T.035, %U.959) [symbolic]
  38. // CHECK:STDOUT: %.076a48.2: Core.Form = init_form %T.binding.as_type [symbolic]
  39. // CHECK:STDOUT: %Inner.Get.type.6ef: type = fn_type @Inner.Get, @Inner(%T.035, %U.959) [symbolic]
  40. // CHECK:STDOUT: %Inner.Get.ba5: %Inner.Get.type.6ef = struct_value () [symbolic]
  41. // CHECK:STDOUT: %require_complete.67c: <witness> = require_complete_type %T.binding.as_type [symbolic]
  42. // CHECK:STDOUT: %Copy.lookup_impl_witness.58d: <witness> = lookup_impl_witness %T.035, @Copy [symbolic]
  43. // CHECK:STDOUT: %Copy.WithSelf.Op.type.735e75.2: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%T.035) [symbolic]
  44. // CHECK:STDOUT: %.023: type = fn_type_with_self_type %Copy.WithSelf.Op.type.735e75.2, %T.035 [symbolic]
  45. // CHECK:STDOUT: %impl.elem0.594: %.023 = impl_witness_access %Copy.lookup_impl_witness.58d, element0 [symbolic]
  46. // CHECK:STDOUT: %specific_impl_fn.bdc: <specific function> = specific_impl_function %impl.elem0.594, @Copy.WithSelf.Op(%T.035) [symbolic]
  47. // CHECK:STDOUT: %bound_method.068: <bound method> = bound_method %U.959, %impl.elem0.594 [symbolic]
  48. // CHECK:STDOUT: %bound_method.d5d: <bound method> = bound_method %U.959, %specific_impl_fn.bdc [symbolic]
  49. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  50. // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic]
  51. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  52. // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete]
  53. // CHECK:STDOUT: %complete_type.f8a: <witness> = complete_type_witness %i32.builtin [concrete]
  54. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  55. // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.824: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic]
  56. // CHECK:STDOUT: %Int.as.Copy.impl.Op.9b9: %Int.as.Copy.impl.Op.type.824 = struct_value () [symbolic]
  57. // CHECK:STDOUT: %Copy.impl_witness.f17: <witness> = impl_witness imports.%Copy.impl_witness_table.e76, @Int.as.Copy.impl(%int_32) [concrete]
  58. // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.546: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete]
  59. // CHECK:STDOUT: %Int.as.Copy.impl.Op.664: %Int.as.Copy.impl.Op.type.546 = struct_value () [concrete]
  60. // CHECK:STDOUT: %Copy.facet.de4: %Copy.type = facet_value %i32, (%Copy.impl_witness.f17) [concrete]
  61. // CHECK:STDOUT: %Outer.a6c: type = class_type @Outer, @Outer(%Copy.facet.de4) [concrete]
  62. // CHECK:STDOUT: %Inner.type.518: type = generic_class_type @Inner, @Outer(%Copy.facet.de4) [concrete]
  63. // CHECK:STDOUT: %Inner.generic.887: %Inner.type.518 = struct_value () [concrete]
  64. // CHECK:STDOUT: %int_42.20e: Core.IntLiteral = int_value 42 [concrete]
  65. // CHECK:STDOUT: %Copy.impl_witness.006: <witness> = impl_witness imports.%Copy.impl_witness_table.b6d [concrete]
  66. // CHECK:STDOUT: %Copy.facet.cdd: %Copy.type = facet_value Core.IntLiteral, (%Copy.impl_witness.006) [concrete]
  67. // CHECK:STDOUT: %ImplicitAs.type.e8c: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  68. // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
  69. // 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]
  70. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6 = struct_value () [symbolic]
  71. // CHECK:STDOUT: %ImplicitAs.impl_witness.6bc: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.74f, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  72. // 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]
  73. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d = struct_value () [concrete]
  74. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.e8c = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.6bc) [concrete]
  75. // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.b37: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%i32, %ImplicitAs.facet) [concrete]
  76. // CHECK:STDOUT: %.545: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.b37, %ImplicitAs.facet [concrete]
  77. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %int_42.20e, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
  78. // CHECK:STDOUT: %.ff5: Core.Form = init_form %i32 [concrete]
  79. // 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]
  80. // CHECK:STDOUT: %bound_method.cb9: <bound method> = bound_method %int_42.20e, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  81. // CHECK:STDOUT: %int_42.c68: %i32 = int_value 42 [concrete]
  82. // CHECK:STDOUT: %Inner.e4a: type = class_type @Inner, @Inner(%Copy.facet.de4, %int_42.c68) [concrete]
  83. // CHECK:STDOUT: %Inner.Get.type.20d: type = fn_type @Inner.Get, @Inner(%Copy.facet.de4, %int_42.c68) [concrete]
  84. // CHECK:STDOUT: %Inner.Get.f96: %Inner.Get.type.20d = struct_value () [concrete]
  85. // CHECK:STDOUT: %Inner.Get.specific_fn: <specific function> = specific_function %Inner.Get.f96, @Inner.Get(%Copy.facet.de4, %int_42.c68) [concrete]
  86. // CHECK:STDOUT: %Copy.WithSelf.Op.type.081: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet.de4) [concrete]
  87. // CHECK:STDOUT: %.8e2: type = fn_type_with_self_type %Copy.WithSelf.Op.type.081, %Copy.facet.de4 [concrete]
  88. // CHECK:STDOUT: %Int.as.Copy.impl.Op.bound: <bound method> = bound_method %int_42.c68, %Int.as.Copy.impl.Op.664 [concrete]
  89. // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: <specific function> = specific_function %Int.as.Copy.impl.Op.664, @Int.as.Copy.impl.Op(%int_32) [concrete]
  90. // CHECK:STDOUT: %bound_method.d85: <bound method> = bound_method %int_42.c68, %Int.as.Copy.impl.Op.specific_fn [concrete]
  91. // CHECK:STDOUT: }
  92. // CHECK:STDOUT:
  93. // CHECK:STDOUT: imports {
  94. // CHECK:STDOUT: %Core.import_ref.18d: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.824) = 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.9b9)]
  95. // CHECK:STDOUT: %Copy.impl_witness_table.e76 = impl_witness_table (%Core.import_ref.18d), @Int.as.Copy.impl [concrete]
  96. // CHECK:STDOUT: %Core.import_ref.bb6 = import_ref Core//prelude/parts/copy, loc{{\d+_\d+}}, unloaded
  97. // CHECK:STDOUT: %Copy.impl_witness_table.b6d = impl_witness_table (%Core.import_ref.bb6), @Core.IntLiteral.as.Copy.impl [concrete]
  98. // 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)]
  99. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.74f = impl_witness_table (%Core.import_ref.42d), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  100. // CHECK:STDOUT: }
  101. // CHECK:STDOUT:
  102. // CHECK:STDOUT: file {
  103. // CHECK:STDOUT: name_binding_decl {
  104. // CHECK:STDOUT: %n.patt: %pattern_type.7ce = ref_binding_pattern n [concrete]
  105. // CHECK:STDOUT: %n.var_patt: %pattern_type.7ce = var_pattern %n.patt [concrete]
  106. // CHECK:STDOUT: }
  107. // CHECK:STDOUT: %n.var: ref %i32 = var %n.var_patt [concrete]
  108. // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
  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_14.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.4b9
  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_14.2: %Copy.type, %U.loc5_16.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_16.1) [symbolic = %Inner.Get.type (constants.%Inner.Get.type.6ef)]
  134. // CHECK:STDOUT: %Inner.Get: @Inner.%Inner.Get.type (%Inner.Get.type.6ef) = struct_value () [symbolic = %Inner.Get (constants.%Inner.Get.ba5)]
  135. // CHECK:STDOUT:
  136. // CHECK:STDOUT: class {
  137. // CHECK:STDOUT: %Inner.Get.decl: @Inner.%Inner.Get.type (%Inner.Get.type.6ef) = fn_decl @Inner.Get [symbolic = @Inner.%Inner.Get (constants.%Inner.Get.ba5)] {
  138. // CHECK:STDOUT: %return.param_patt: @Inner.Get.%pattern_type (%pattern_type.9b9f0c.2) = out_param_pattern [concrete]
  139. // CHECK:STDOUT: %return.patt: @Inner.Get.%pattern_type (%pattern_type.9b9f0c.2) = return_slot_pattern %return.param_patt, %.loc7_17.3 [concrete]
  140. // CHECK:STDOUT: } {
  141. // CHECK:STDOUT: %T.ref: %Copy.type = name_ref T, @Outer.%T.loc4_14.2 [symbolic = %T (constants.%T.035)]
  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.3: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  144. // CHECK:STDOUT: %.loc7_17.4: Core.Form = init_form %.loc7_17.3 [symbolic = %.loc7_17.2 (constants.%.076a48.2)]
  145. // CHECK:STDOUT: %return.param: ref @Inner.Get.%T.binding.as_type (%T.binding.as_type) = out_param call_param0
  146. // CHECK:STDOUT: %return: ref @Inner.Get.%T.binding.as_type (%T.binding.as_type) = return_slot %return.param
  147. // CHECK:STDOUT: }
  148. // CHECK:STDOUT: <elided>
  149. // CHECK:STDOUT: complete_type_witness = %complete_type
  150. // CHECK:STDOUT:
  151. // CHECK:STDOUT: !members:
  152. // CHECK:STDOUT: .Self = constants.%Inner.c23
  153. // CHECK:STDOUT: .T = <poisoned>
  154. // CHECK:STDOUT: .Get = %Inner.Get.decl
  155. // CHECK:STDOUT: .U = <poisoned>
  156. // CHECK:STDOUT: }
  157. // CHECK:STDOUT: }
  158. // CHECK:STDOUT:
  159. // CHECK:STDOUT: generic fn @Inner.Get(@Outer.%T.loc4_14.2: %Copy.type, @Inner.%U.loc5_16.2: @Inner.%T.binding.as_type (%T.binding.as_type)) {
  160. // CHECK:STDOUT: %T: %Copy.type = symbolic_binding T, 0 [symbolic = %T (constants.%T.035)]
  161. // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  162. // CHECK:STDOUT: %.loc7_17.2: Core.Form = init_form %T.binding.as_type [symbolic = %.loc7_17.2 (constants.%.076a48.2)]
  163. // CHECK:STDOUT: %pattern_type: type = pattern_type %T.binding.as_type [symbolic = %pattern_type (constants.%pattern_type.9b9f0c.2)]
  164. // CHECK:STDOUT:
  165. // CHECK:STDOUT: !definition:
  166. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.binding.as_type [symbolic = %require_complete (constants.%require_complete.67c)]
  167. // CHECK:STDOUT: %U: @Inner.Get.%T.binding.as_type (%T.binding.as_type) = symbolic_binding U, 1 [symbolic = %U (constants.%U.959)]
  168. // CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%T) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.735e75.2)]
  169. // CHECK:STDOUT: %.loc7_28: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %T [symbolic = %.loc7_28 (constants.%.023)]
  170. // CHECK:STDOUT: %Copy.lookup_impl_witness: <witness> = lookup_impl_witness %T, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.58d)]
  171. // CHECK:STDOUT: %impl.elem0.loc7_28.2: @Inner.Get.%.loc7_28 (%.023) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc7_28.2 (constants.%impl.elem0.594)]
  172. // 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.068)]
  173. // CHECK:STDOUT: %specific_impl_fn.loc7_28.2: <specific function> = specific_impl_function %impl.elem0.loc7_28.2, @Copy.WithSelf.Op(%T) [symbolic = %specific_impl_fn.loc7_28.2 (constants.%specific_impl_fn.bdc)]
  174. // 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.d5d)]
  175. // CHECK:STDOUT:
  176. // CHECK:STDOUT: fn() -> out %return.param: @Inner.Get.%T.binding.as_type (%T.binding.as_type) {
  177. // CHECK:STDOUT: !entry:
  178. // CHECK:STDOUT: %U.ref: @Inner.Get.%T.binding.as_type (%T.binding.as_type) = name_ref U, @Inner.%U.loc5_16.2 [symbolic = %U (constants.%U.959)]
  179. // CHECK:STDOUT: %impl.elem0.loc7_28.1: @Inner.Get.%.loc7_28 (%.023) = impl_witness_access constants.%Copy.lookup_impl_witness.58d, element0 [symbolic = %impl.elem0.loc7_28.2 (constants.%impl.elem0.594)]
  180. // 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.068)]
  181. // CHECK:STDOUT: %specific_impl_fn.loc7_28.1: <specific function> = specific_impl_function %impl.elem0.loc7_28.1, @Copy.WithSelf.Op(constants.%T.035) [symbolic = %specific_impl_fn.loc7_28.2 (constants.%specific_impl_fn.bdc)]
  182. // 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.d5d)]
  183. // CHECK:STDOUT: %.loc7_17.1: ref @Inner.Get.%T.binding.as_type (%T.binding.as_type) = splice_block %return.param {}
  184. // CHECK:STDOUT: %Copy.WithSelf.Op.call: init @Inner.Get.%T.binding.as_type (%T.binding.as_type) to %.loc7_17.1 = call %bound_method.loc7_28.2(%U.ref)
  185. // CHECK:STDOUT: return %Copy.WithSelf.Op.call to %return.param
  186. // CHECK:STDOUT: }
  187. // CHECK:STDOUT: }
  188. // CHECK:STDOUT:
  189. // CHECK:STDOUT: fn @__global_init() {
  190. // CHECK:STDOUT: !entry:
  191. // CHECK:STDOUT: %Outer.ref: %Outer.type = name_ref Outer, file.%Outer.decl [concrete = constants.%Outer.generic]
  192. // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
  193. // CHECK:STDOUT: %Copy.facet.loc13_23: %Copy.type = facet_value %i32, (constants.%Copy.impl_witness.f17) [concrete = constants.%Copy.facet.de4]
  194. // CHECK:STDOUT: %.loc13_23: %Copy.type = converted %i32, %Copy.facet.loc13_23 [concrete = constants.%Copy.facet.de4]
  195. // CHECK:STDOUT: %Outer: type = class_type @Outer, @Outer(constants.%Copy.facet.de4) [concrete = constants.%Outer.a6c]
  196. // CHECK:STDOUT: %.loc13_24: %Inner.type.518 = specific_constant @Outer.%Inner.decl, @Outer(constants.%Copy.facet.de4) [concrete = constants.%Inner.generic.887]
  197. // CHECK:STDOUT: %Inner.ref: %Inner.type.518 = name_ref Inner, %.loc13_24 [concrete = constants.%Inner.generic.887]
  198. // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [concrete = constants.%int_42.20e]
  199. // CHECK:STDOUT: %Copy.facet.loc13_33: %Copy.type = facet_value Core.IntLiteral, (constants.%Copy.impl_witness.006) [concrete = constants.%Copy.facet.cdd]
  200. // CHECK:STDOUT: %.loc13_33.1: %Copy.type = converted Core.IntLiteral, %Copy.facet.loc13_33 [concrete = constants.%Copy.facet.cdd]
  201. // CHECK:STDOUT: %impl.elem0: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  202. // 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]
  203. // 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]
  204. // CHECK:STDOUT: %bound_method.loc13_33.2: <bound method> = bound_method constants.%int_42.20e, %specific_fn [concrete = constants.%bound_method.cb9]
  205. // 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]
  206. // CHECK:STDOUT: %.loc13_33.2: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_42.c68]
  207. // CHECK:STDOUT: %.loc13_33.3: %i32 = converted constants.%int_42.20e, %.loc13_33.2 [concrete = constants.%int_42.c68]
  208. // CHECK:STDOUT: %Inner: type = class_type @Inner, @Inner(constants.%Copy.facet.de4, constants.%int_42.c68) [concrete = constants.%Inner.e4a]
  209. // CHECK:STDOUT: %.loc13_34: %Inner.Get.type.20d = specific_constant @Inner.%Inner.Get.decl, @Inner(constants.%Copy.facet.de4, constants.%int_42.c68) [concrete = constants.%Inner.Get.f96]
  210. // CHECK:STDOUT: %Get.ref: %Inner.Get.type.20d = name_ref Get, %.loc13_34 [concrete = constants.%Inner.Get.f96]
  211. // CHECK:STDOUT: %Inner.Get.specific_fn: <specific function> = specific_function %Get.ref, @Inner.Get(constants.%Copy.facet.de4, constants.%int_42.c68) [concrete = constants.%Inner.Get.specific_fn]
  212. // CHECK:STDOUT: %Inner.Get.call: init %i32 = call %Inner.Get.specific_fn()
  213. // CHECK:STDOUT: assign file.%n.var, %Inner.Get.call
  214. // CHECK:STDOUT: <elided>
  215. // CHECK:STDOUT: }
  216. // CHECK:STDOUT:
  217. // CHECK:STDOUT: specific @Outer(constants.%T.035) {
  218. // CHECK:STDOUT: %T.loc4_14.1 => constants.%T.035
  219. // CHECK:STDOUT:
  220. // CHECK:STDOUT: !definition:
  221. // CHECK:STDOUT: %Inner.type => constants.%Inner.type.af4
  222. // CHECK:STDOUT: %Inner.generic => constants.%Inner.generic.994
  223. // CHECK:STDOUT: }
  224. // CHECK:STDOUT:
  225. // CHECK:STDOUT: specific @Inner(constants.%T.035, constants.%U.959) {
  226. // CHECK:STDOUT: %T => constants.%T.035
  227. // CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type
  228. // CHECK:STDOUT: %U.loc5_16.1 => constants.%U.959
  229. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.9b9f0c.2
  230. // CHECK:STDOUT:
  231. // CHECK:STDOUT: !definition:
  232. // CHECK:STDOUT: %Inner.Get.type => constants.%Inner.Get.type.6ef
  233. // CHECK:STDOUT: %Inner.Get => constants.%Inner.Get.ba5
  234. // CHECK:STDOUT: }
  235. // CHECK:STDOUT:
  236. // CHECK:STDOUT: specific @Inner.Get(constants.%T.035, constants.%U.959) {
  237. // CHECK:STDOUT: %T => constants.%T.035
  238. // CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type
  239. // CHECK:STDOUT: %.loc7_17.2 => constants.%.076a48.2
  240. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.9b9f0c.2
  241. // CHECK:STDOUT: }
  242. // CHECK:STDOUT:
  243. // CHECK:STDOUT: specific @Outer(constants.%Copy.facet.de4) {
  244. // CHECK:STDOUT: %T.loc4_14.1 => constants.%Copy.facet.de4
  245. // CHECK:STDOUT:
  246. // CHECK:STDOUT: !definition:
  247. // CHECK:STDOUT: %Inner.type => constants.%Inner.type.518
  248. // CHECK:STDOUT: %Inner.generic => constants.%Inner.generic.887
  249. // CHECK:STDOUT: }
  250. // CHECK:STDOUT:
  251. // CHECK:STDOUT: specific @Inner(constants.%Copy.facet.de4, constants.%int_42.c68) {
  252. // CHECK:STDOUT: %T => constants.%Copy.facet.de4
  253. // CHECK:STDOUT: %T.binding.as_type => constants.%i32
  254. // CHECK:STDOUT: %U.loc5_16.1 => constants.%int_42.c68
  255. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7ce
  256. // CHECK:STDOUT:
  257. // CHECK:STDOUT: !definition:
  258. // CHECK:STDOUT: %Inner.Get.type => constants.%Inner.Get.type.20d
  259. // CHECK:STDOUT: %Inner.Get => constants.%Inner.Get.f96
  260. // CHECK:STDOUT: }
  261. // CHECK:STDOUT:
  262. // CHECK:STDOUT: specific @Inner.Get(constants.%Copy.facet.de4, constants.%int_42.c68) {
  263. // CHECK:STDOUT: %T => constants.%Copy.facet.de4
  264. // CHECK:STDOUT: %T.binding.as_type => constants.%i32
  265. // CHECK:STDOUT: %.loc7_17.2 => constants.%.ff5
  266. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7ce
  267. // CHECK:STDOUT:
  268. // CHECK:STDOUT: !definition:
  269. // CHECK:STDOUT: %require_complete => constants.%complete_type.f8a
  270. // CHECK:STDOUT: %U => constants.%int_42.c68
  271. // CHECK:STDOUT: %Copy.WithSelf.Op.type => constants.%Copy.WithSelf.Op.type.081
  272. // CHECK:STDOUT: %.loc7_28 => constants.%.8e2
  273. // CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.impl_witness.f17
  274. // CHECK:STDOUT: %impl.elem0.loc7_28.2 => constants.%Int.as.Copy.impl.Op.664
  275. // CHECK:STDOUT: %bound_method.loc7_28.3 => constants.%Int.as.Copy.impl.Op.bound
  276. // CHECK:STDOUT: %specific_impl_fn.loc7_28.2 => constants.%Int.as.Copy.impl.Op.specific_fn
  277. // CHECK:STDOUT: %bound_method.loc7_28.4 => constants.%bound_method.d85
  278. // CHECK:STDOUT: }
  279. // CHECK:STDOUT: