member_inline.carbon 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  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/convert.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/class/generic/member_inline.carbon
  10. // TIP: To dump output, run:
  11. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/generic/member_inline.carbon
  12. // --- member_inline.carbon
  13. library "[[@TEST_NAME]]";
  14. //@dump-sem-ir-begin
  15. class Class(T:! Core.Copy) {
  16. fn F(n: T) -> T {
  17. return n;
  18. }
  19. fn G[self: Self]() -> T {
  20. return self.n;
  21. }
  22. var n: T;
  23. }
  24. //@dump-sem-ir-end
  25. // --- fail_member_inline_missing_self_dot.carbon
  26. library "[[@TEST_NAME]]";
  27. //@dump-sem-ir-begin
  28. class C(T:! Core.Copy) {
  29. fn F() {
  30. // CHECK:STDERR: fail_member_inline_missing_self_dot.carbon:[[@LINE+4]]:5: error: expression cannot be used as a value [UseOfNonExprAsValue]
  31. // CHECK:STDERR: data;
  32. // CHECK:STDERR: ^~~~
  33. // CHECK:STDERR:
  34. data;
  35. }
  36. var data: {};
  37. }
  38. //@dump-sem-ir-end
  39. // CHECK:STDOUT: --- member_inline.carbon
  40. // CHECK:STDOUT:
  41. // CHECK:STDOUT: constants {
  42. // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
  43. // CHECK:STDOUT: %T.f92: %Copy.type = symbolic_binding T, 0 [symbolic]
  44. // CHECK:STDOUT: %pattern_type.322: type = pattern_type %Copy.type [concrete]
  45. // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [concrete]
  46. // CHECK:STDOUT: %Class.generic: %Class.type = struct_value () [concrete]
  47. // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.f92) [symbolic]
  48. // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.f92 [symbolic]
  49. // CHECK:STDOUT: %pattern_type.c769df.1: type = pattern_type %T.binding.as_type [symbolic]
  50. // CHECK:STDOUT: %Class.F.type: type = fn_type @Class.F, @Class(%T.f92) [symbolic]
  51. // CHECK:STDOUT: %Class.F: %Class.F.type = struct_value () [symbolic]
  52. // CHECK:STDOUT: %pattern_type.0bc: type = pattern_type %Class [symbolic]
  53. // CHECK:STDOUT: %Class.G.type: type = fn_type @Class.G, @Class(%T.f92) [symbolic]
  54. // CHECK:STDOUT: %Class.G: %Class.G.type = struct_value () [symbolic]
  55. // CHECK:STDOUT: %require_complete.91e: <witness> = require_complete_type %T.binding.as_type [symbolic]
  56. // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T.binding.as_type [symbolic]
  57. // CHECK:STDOUT: %struct_type.n: type = struct_type {.n: %T.binding.as_type} [symbolic]
  58. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.n [symbolic]
  59. // CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete]
  60. // CHECK:STDOUT: %Copy.lookup_impl_witness.edd: <witness> = lookup_impl_witness %T.f92, @Copy [symbolic]
  61. // CHECK:STDOUT: %.232: type = fn_type_with_self_type %Copy.Op.type, %T.f92 [symbolic]
  62. // CHECK:STDOUT: %impl.elem0.8df: %.232 = impl_witness_access %Copy.lookup_impl_witness.edd, element0 [symbolic]
  63. // CHECK:STDOUT: %specific_impl_fn.5c4: <specific function> = specific_impl_function %impl.elem0.8df, @Copy.Op(%T.f92) [symbolic]
  64. // CHECK:STDOUT: %require_complete.3be: <witness> = require_complete_type %Class [symbolic]
  65. // CHECK:STDOUT: }
  66. // CHECK:STDOUT:
  67. // CHECK:STDOUT: imports {
  68. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  69. // CHECK:STDOUT: .Copy = %Core.Copy
  70. // CHECK:STDOUT: import Core//prelude
  71. // CHECK:STDOUT: import Core//prelude/...
  72. // CHECK:STDOUT: }
  73. // CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type]
  74. // CHECK:STDOUT: }
  75. // CHECK:STDOUT:
  76. // CHECK:STDOUT: file {
  77. // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [concrete = constants.%Class.generic] {
  78. // CHECK:STDOUT: %T.patt: %pattern_type.322 = symbolic_binding_pattern T, 0 [concrete]
  79. // CHECK:STDOUT: } {
  80. // CHECK:STDOUT: %.loc5: type = splice_block %Copy.ref [concrete = constants.%Copy.type] {
  81. // CHECK:STDOUT: <elided>
  82. // CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
  83. // CHECK:STDOUT: %Copy.ref: type = name_ref Copy, imports.%Core.Copy [concrete = constants.%Copy.type]
  84. // CHECK:STDOUT: }
  85. // CHECK:STDOUT: %T.loc5_13.2: %Copy.type = symbolic_binding T, 0 [symbolic = %T.loc5_13.1 (constants.%T.f92)]
  86. // CHECK:STDOUT: }
  87. // CHECK:STDOUT: }
  88. // CHECK:STDOUT:
  89. // CHECK:STDOUT: generic class @Class(%T.loc5_13.2: %Copy.type) {
  90. // CHECK:STDOUT: %T.loc5_13.1: %Copy.type = symbolic_binding T, 0 [symbolic = %T.loc5_13.1 (constants.%T.f92)]
  91. // CHECK:STDOUT:
  92. // CHECK:STDOUT: !definition:
  93. // CHECK:STDOUT: %Class.F.type: type = fn_type @Class.F, @Class(%T.loc5_13.1) [symbolic = %Class.F.type (constants.%Class.F.type)]
  94. // CHECK:STDOUT: %Class.F: @Class.%Class.F.type (%Class.F.type) = struct_value () [symbolic = %Class.F (constants.%Class.F)]
  95. // CHECK:STDOUT: %Class.G.type: type = fn_type @Class.G, @Class(%T.loc5_13.1) [symbolic = %Class.G.type (constants.%Class.G.type)]
  96. // CHECK:STDOUT: %Class.G: @Class.%Class.G.type (%Class.G.type) = struct_value () [symbolic = %Class.G (constants.%Class.G)]
  97. // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc5_13.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  98. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.binding.as_type [symbolic = %require_complete (constants.%require_complete.91e)]
  99. // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.loc5_13.1) [symbolic = %Class (constants.%Class)]
  100. // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T.binding.as_type [symbolic = %Class.elem (constants.%Class.elem)]
  101. // CHECK:STDOUT: %struct_type.n: type = struct_type {.n: @Class.%T.binding.as_type (%T.binding.as_type)} [symbolic = %struct_type.n (constants.%struct_type.n)]
  102. // CHECK:STDOUT: %complete_type.loc15_1.2: <witness> = complete_type_witness %struct_type.n [symbolic = %complete_type.loc15_1.2 (constants.%complete_type)]
  103. // CHECK:STDOUT:
  104. // CHECK:STDOUT: class {
  105. // CHECK:STDOUT: %Class.F.decl: @Class.%Class.F.type (%Class.F.type) = fn_decl @Class.F [symbolic = @Class.%Class.F (constants.%Class.F)] {
  106. // CHECK:STDOUT: %n.patt: @Class.F.%pattern_type (%pattern_type.c769df.1) = value_binding_pattern n [concrete]
  107. // CHECK:STDOUT: %n.param_patt: @Class.F.%pattern_type (%pattern_type.c769df.1) = value_param_pattern %n.patt, call_param0 [concrete]
  108. // CHECK:STDOUT: %return.patt: @Class.F.%pattern_type (%pattern_type.c769df.1) = return_slot_pattern [concrete]
  109. // CHECK:STDOUT: %return.param_patt: @Class.F.%pattern_type (%pattern_type.c769df.1) = out_param_pattern %return.patt, call_param1 [concrete]
  110. // CHECK:STDOUT: } {
  111. // CHECK:STDOUT: %T.ref.loc6_17: %Copy.type = name_ref T, @Class.%T.loc5_13.2 [symbolic = %T (constants.%T.f92)]
  112. // CHECK:STDOUT: %T.as_type.loc6_17: type = facet_access_type %T.ref.loc6_17 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  113. // CHECK:STDOUT: %.loc6_17: type = converted %T.ref.loc6_17, %T.as_type.loc6_17 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  114. // CHECK:STDOUT: %n.param: @Class.F.%T.binding.as_type (%T.binding.as_type) = value_param call_param0
  115. // CHECK:STDOUT: %.loc6_11.1: type = splice_block %.loc6_11.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] {
  116. // CHECK:STDOUT: %T.ref.loc6_11: %Copy.type = name_ref T, @Class.%T.loc5_13.2 [symbolic = %T (constants.%T.f92)]
  117. // CHECK:STDOUT: %T.as_type.loc6_11: type = facet_access_type %T.ref.loc6_11 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  118. // CHECK:STDOUT: %.loc6_11.2: type = converted %T.ref.loc6_11, %T.as_type.loc6_11 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  119. // CHECK:STDOUT: }
  120. // CHECK:STDOUT: %n: @Class.F.%T.binding.as_type (%T.binding.as_type) = value_binding n, %n.param
  121. // CHECK:STDOUT: %return.param: ref @Class.F.%T.binding.as_type (%T.binding.as_type) = out_param call_param1
  122. // CHECK:STDOUT: %return: ref @Class.F.%T.binding.as_type (%T.binding.as_type) = return_slot %return.param
  123. // CHECK:STDOUT: }
  124. // CHECK:STDOUT: %Class.G.decl: @Class.%Class.G.type (%Class.G.type) = fn_decl @Class.G [symbolic = @Class.%Class.G (constants.%Class.G)] {
  125. // CHECK:STDOUT: %self.patt: @Class.G.%pattern_type.loc10_8 (%pattern_type.0bc) = value_binding_pattern self [concrete]
  126. // CHECK:STDOUT: %self.param_patt: @Class.G.%pattern_type.loc10_8 (%pattern_type.0bc) = value_param_pattern %self.patt, call_param0 [concrete]
  127. // CHECK:STDOUT: %return.patt: @Class.G.%pattern_type.loc10_22 (%pattern_type.c769df.1) = return_slot_pattern [concrete]
  128. // CHECK:STDOUT: %return.param_patt: @Class.G.%pattern_type.loc10_22 (%pattern_type.c769df.1) = out_param_pattern %return.patt, call_param1 [concrete]
  129. // CHECK:STDOUT: } {
  130. // CHECK:STDOUT: %T.ref: %Copy.type = name_ref T, @Class.%T.loc5_13.2 [symbolic = %T (constants.%T.f92)]
  131. // CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  132. // CHECK:STDOUT: %.loc10_25: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  133. // CHECK:STDOUT: %self.param: @Class.G.%Class (%Class) = value_param call_param0
  134. // CHECK:STDOUT: %.loc10_14.1: type = splice_block %Self.ref [symbolic = %Class (constants.%Class)] {
  135. // CHECK:STDOUT: %.loc10_14.2: type = specific_constant constants.%Class, @Class(constants.%T.f92) [symbolic = %Class (constants.%Class)]
  136. // CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc10_14.2 [symbolic = %Class (constants.%Class)]
  137. // CHECK:STDOUT: }
  138. // CHECK:STDOUT: %self: @Class.G.%Class (%Class) = value_binding self, %self.param
  139. // CHECK:STDOUT: %return.param: ref @Class.G.%T.binding.as_type (%T.binding.as_type) = out_param call_param1
  140. // CHECK:STDOUT: %return: ref @Class.G.%T.binding.as_type (%T.binding.as_type) = return_slot %return.param
  141. // CHECK:STDOUT: }
  142. // CHECK:STDOUT: %T.ref: %Copy.type = name_ref T, %T.loc5_13.2 [symbolic = %T.loc5_13.1 (constants.%T.f92)]
  143. // CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  144. // CHECK:STDOUT: %.loc14_10: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  145. // CHECK:STDOUT: %.loc14_8: @Class.%Class.elem (%Class.elem) = field_decl n, element0 [concrete]
  146. // CHECK:STDOUT: %complete_type.loc15_1.1: <witness> = complete_type_witness constants.%struct_type.n [symbolic = %complete_type.loc15_1.2 (constants.%complete_type)]
  147. // CHECK:STDOUT: complete_type_witness = %complete_type.loc15_1.1
  148. // CHECK:STDOUT:
  149. // CHECK:STDOUT: !members:
  150. // CHECK:STDOUT: .Self = constants.%Class
  151. // CHECK:STDOUT: .T = <poisoned>
  152. // CHECK:STDOUT: .F = %Class.F.decl
  153. // CHECK:STDOUT: .G = %Class.G.decl
  154. // CHECK:STDOUT: .n = %.loc14_8
  155. // CHECK:STDOUT: }
  156. // CHECK:STDOUT: }
  157. // CHECK:STDOUT:
  158. // CHECK:STDOUT: generic fn @Class.F(@Class.%T.loc5_13.2: %Copy.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: %Copy.lookup_impl_witness: <witness> = lookup_impl_witness %T, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.edd)]
  166. // CHECK:STDOUT: %.loc7: type = fn_type_with_self_type constants.%Copy.Op.type, %T [symbolic = %.loc7 (constants.%.232)]
  167. // CHECK:STDOUT: %impl.elem0.loc7_12.2: @Class.F.%.loc7 (%.232) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc7_12.2 (constants.%impl.elem0.8df)]
  168. // CHECK:STDOUT: %specific_impl_fn.loc7_12.2: <specific function> = specific_impl_function %impl.elem0.loc7_12.2, @Copy.Op(%T) [symbolic = %specific_impl_fn.loc7_12.2 (constants.%specific_impl_fn.5c4)]
  169. // CHECK:STDOUT:
  170. // CHECK:STDOUT: fn(%n.param: @Class.F.%T.binding.as_type (%T.binding.as_type)) -> %return.param: @Class.F.%T.binding.as_type (%T.binding.as_type) {
  171. // CHECK:STDOUT: !entry:
  172. // CHECK:STDOUT: %n.ref: @Class.F.%T.binding.as_type (%T.binding.as_type) = name_ref n, %n
  173. // CHECK:STDOUT: %impl.elem0.loc7_12.1: @Class.F.%.loc7 (%.232) = impl_witness_access constants.%Copy.lookup_impl_witness.edd, element0 [symbolic = %impl.elem0.loc7_12.2 (constants.%impl.elem0.8df)]
  174. // CHECK:STDOUT: %bound_method.loc7_12.1: <bound method> = bound_method %n.ref, %impl.elem0.loc7_12.1
  175. // CHECK:STDOUT: %specific_impl_fn.loc7_12.1: <specific function> = specific_impl_function %impl.elem0.loc7_12.1, @Copy.Op(constants.%T.f92) [symbolic = %specific_impl_fn.loc7_12.2 (constants.%specific_impl_fn.5c4)]
  176. // CHECK:STDOUT: %bound_method.loc7_12.2: <bound method> = bound_method %n.ref, %specific_impl_fn.loc7_12.1
  177. // CHECK:STDOUT: %.loc6_14: ref @Class.F.%T.binding.as_type (%T.binding.as_type) = splice_block %return {}
  178. // CHECK:STDOUT: %Copy.Op.call: init @Class.F.%T.binding.as_type (%T.binding.as_type) = call %bound_method.loc7_12.2(%n.ref) to %.loc6_14
  179. // CHECK:STDOUT: return %Copy.Op.call to %return
  180. // CHECK:STDOUT: }
  181. // CHECK:STDOUT: }
  182. // CHECK:STDOUT:
  183. // CHECK:STDOUT: generic fn @Class.G(@Class.%T.loc5_13.2: %Copy.type) {
  184. // CHECK:STDOUT: %T: %Copy.type = symbolic_binding T, 0 [symbolic = %T (constants.%T.f92)]
  185. // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic = %Class (constants.%Class)]
  186. // CHECK:STDOUT: %pattern_type.loc10_8: type = pattern_type %Class [symbolic = %pattern_type.loc10_8 (constants.%pattern_type.0bc)]
  187. // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  188. // CHECK:STDOUT: %pattern_type.loc10_22: type = pattern_type %T.binding.as_type [symbolic = %pattern_type.loc10_22 (constants.%pattern_type.c769df.1)]
  189. // CHECK:STDOUT:
  190. // CHECK:STDOUT: !definition:
  191. // CHECK:STDOUT: %require_complete.loc10: <witness> = require_complete_type %Class [symbolic = %require_complete.loc10 (constants.%require_complete.3be)]
  192. // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T.binding.as_type [symbolic = %Class.elem (constants.%Class.elem)]
  193. // CHECK:STDOUT: %require_complete.loc11: <witness> = require_complete_type %T.binding.as_type [symbolic = %require_complete.loc11 (constants.%require_complete.91e)]
  194. // CHECK:STDOUT: %Copy.lookup_impl_witness: <witness> = lookup_impl_witness %T, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.edd)]
  195. // CHECK:STDOUT: %.loc11_16.3: type = fn_type_with_self_type constants.%Copy.Op.type, %T [symbolic = %.loc11_16.3 (constants.%.232)]
  196. // CHECK:STDOUT: %impl.elem0.loc11_16.2: @Class.G.%.loc11_16.3 (%.232) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc11_16.2 (constants.%impl.elem0.8df)]
  197. // CHECK:STDOUT: %specific_impl_fn.loc11_16.2: <specific function> = specific_impl_function %impl.elem0.loc11_16.2, @Copy.Op(%T) [symbolic = %specific_impl_fn.loc11_16.2 (constants.%specific_impl_fn.5c4)]
  198. // CHECK:STDOUT:
  199. // CHECK:STDOUT: fn(%self.param: @Class.G.%Class (%Class)) -> %return.param: @Class.G.%T.binding.as_type (%T.binding.as_type) {
  200. // CHECK:STDOUT: !entry:
  201. // CHECK:STDOUT: %self.ref: @Class.G.%Class (%Class) = name_ref self, %self
  202. // CHECK:STDOUT: %n.ref: @Class.G.%Class.elem (%Class.elem) = name_ref n, @Class.%.loc14_8 [concrete = @Class.%.loc14_8]
  203. // CHECK:STDOUT: %.loc11_16.1: ref @Class.G.%T.binding.as_type (%T.binding.as_type) = class_element_access %self.ref, element0
  204. // CHECK:STDOUT: %.loc11_16.2: @Class.G.%T.binding.as_type (%T.binding.as_type) = acquire_value %.loc11_16.1
  205. // CHECK:STDOUT: %impl.elem0.loc11_16.1: @Class.G.%.loc11_16.3 (%.232) = impl_witness_access constants.%Copy.lookup_impl_witness.edd, element0 [symbolic = %impl.elem0.loc11_16.2 (constants.%impl.elem0.8df)]
  206. // CHECK:STDOUT: %bound_method.loc11_16.1: <bound method> = bound_method %.loc11_16.2, %impl.elem0.loc11_16.1
  207. // CHECK:STDOUT: %specific_impl_fn.loc11_16.1: <specific function> = specific_impl_function %impl.elem0.loc11_16.1, @Copy.Op(constants.%T.f92) [symbolic = %specific_impl_fn.loc11_16.2 (constants.%specific_impl_fn.5c4)]
  208. // CHECK:STDOUT: %bound_method.loc11_16.2: <bound method> = bound_method %.loc11_16.2, %specific_impl_fn.loc11_16.1
  209. // CHECK:STDOUT: %.loc10_22: ref @Class.G.%T.binding.as_type (%T.binding.as_type) = splice_block %return {}
  210. // CHECK:STDOUT: %Copy.Op.call: init @Class.G.%T.binding.as_type (%T.binding.as_type) = call %bound_method.loc11_16.2(%.loc11_16.2) to %.loc10_22
  211. // CHECK:STDOUT: return %Copy.Op.call to %return
  212. // CHECK:STDOUT: }
  213. // CHECK:STDOUT: }
  214. // CHECK:STDOUT:
  215. // CHECK:STDOUT: specific @Class(constants.%T.f92) {
  216. // CHECK:STDOUT: %T.loc5_13.1 => constants.%T.f92
  217. // CHECK:STDOUT:
  218. // CHECK:STDOUT: !definition:
  219. // CHECK:STDOUT: %Class.F.type => constants.%Class.F.type
  220. // CHECK:STDOUT: %Class.F => constants.%Class.F
  221. // CHECK:STDOUT: %Class.G.type => constants.%Class.G.type
  222. // CHECK:STDOUT: %Class.G => constants.%Class.G
  223. // CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type
  224. // CHECK:STDOUT: %require_complete => constants.%require_complete.91e
  225. // CHECK:STDOUT: %Class => constants.%Class
  226. // CHECK:STDOUT: %Class.elem => constants.%Class.elem
  227. // CHECK:STDOUT: %struct_type.n => constants.%struct_type.n
  228. // CHECK:STDOUT: %complete_type.loc15_1.2 => constants.%complete_type
  229. // CHECK:STDOUT: }
  230. // CHECK:STDOUT:
  231. // CHECK:STDOUT: specific @Class.F(constants.%T.f92) {
  232. // CHECK:STDOUT: %T => constants.%T.f92
  233. // CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type
  234. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.c769df.1
  235. // CHECK:STDOUT: }
  236. // CHECK:STDOUT:
  237. // CHECK:STDOUT: specific @Class.G(constants.%T.f92) {
  238. // CHECK:STDOUT: %T => constants.%T.f92
  239. // CHECK:STDOUT: %Class => constants.%Class
  240. // CHECK:STDOUT: %pattern_type.loc10_8 => constants.%pattern_type.0bc
  241. // CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type
  242. // CHECK:STDOUT: %pattern_type.loc10_22 => constants.%pattern_type.c769df.1
  243. // CHECK:STDOUT: }
  244. // CHECK:STDOUT:
  245. // CHECK:STDOUT: --- fail_member_inline_missing_self_dot.carbon
  246. // CHECK:STDOUT:
  247. // CHECK:STDOUT: constants {
  248. // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
  249. // CHECK:STDOUT: %T: %Copy.type = symbolic_binding T, 0 [symbolic]
  250. // CHECK:STDOUT: %pattern_type: type = pattern_type %Copy.type [concrete]
  251. // CHECK:STDOUT: %C.type: type = generic_class_type @C [concrete]
  252. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [concrete]
  253. // CHECK:STDOUT: %C: type = class_type @C, @C(%T) [symbolic]
  254. // CHECK:STDOUT: %C.F.type: type = fn_type @C.F, @C(%T) [symbolic]
  255. // CHECK:STDOUT: %C.F: %C.F.type = struct_value () [symbolic]
  256. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  257. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  258. // CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %empty_struct_type [symbolic]
  259. // CHECK:STDOUT: %struct_type.data: type = struct_type {.data: %empty_struct_type} [concrete]
  260. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.data [concrete]
  261. // CHECK:STDOUT: }
  262. // CHECK:STDOUT:
  263. // CHECK:STDOUT: imports {
  264. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  265. // CHECK:STDOUT: .Copy = %Core.Copy
  266. // CHECK:STDOUT: import Core//prelude
  267. // CHECK:STDOUT: import Core//prelude/...
  268. // CHECK:STDOUT: }
  269. // CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type]
  270. // CHECK:STDOUT: }
  271. // CHECK:STDOUT:
  272. // CHECK:STDOUT: file {
  273. // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [concrete = constants.%C.generic] {
  274. // CHECK:STDOUT: %T.patt: %pattern_type = symbolic_binding_pattern T, 0 [concrete]
  275. // CHECK:STDOUT: } {
  276. // CHECK:STDOUT: %.loc5: type = splice_block %Copy.ref [concrete = constants.%Copy.type] {
  277. // CHECK:STDOUT: <elided>
  278. // CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
  279. // CHECK:STDOUT: %Copy.ref: type = name_ref Copy, imports.%Core.Copy [concrete = constants.%Copy.type]
  280. // CHECK:STDOUT: }
  281. // CHECK:STDOUT: %T.loc5_9.2: %Copy.type = symbolic_binding T, 0 [symbolic = %T.loc5_9.1 (constants.%T)]
  282. // CHECK:STDOUT: }
  283. // CHECK:STDOUT: }
  284. // CHECK:STDOUT:
  285. // CHECK:STDOUT: generic class @C(%T.loc5_9.2: %Copy.type) {
  286. // CHECK:STDOUT: %T.loc5_9.1: %Copy.type = symbolic_binding T, 0 [symbolic = %T.loc5_9.1 (constants.%T)]
  287. // CHECK:STDOUT:
  288. // CHECK:STDOUT: !definition:
  289. // CHECK:STDOUT: %C.F.type: type = fn_type @C.F, @C(%T.loc5_9.1) [symbolic = %C.F.type (constants.%C.F.type)]
  290. // CHECK:STDOUT: %C.F: @C.%C.F.type (%C.F.type) = struct_value () [symbolic = %C.F (constants.%C.F)]
  291. // CHECK:STDOUT: %C: type = class_type @C, @C(%T.loc5_9.1) [symbolic = %C (constants.%C)]
  292. // CHECK:STDOUT: %C.elem: type = unbound_element_type %C, constants.%empty_struct_type [symbolic = %C.elem (constants.%C.elem)]
  293. // CHECK:STDOUT:
  294. // CHECK:STDOUT: class {
  295. // CHECK:STDOUT: %C.F.decl: @C.%C.F.type (%C.F.type) = fn_decl @C.F [symbolic = @C.%C.F (constants.%C.F)] {} {}
  296. // CHECK:STDOUT: %.loc13_14.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  297. // CHECK:STDOUT: %.loc13_14.2: type = converted %.loc13_14.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  298. // CHECK:STDOUT: %.loc13_11: @C.%C.elem (%C.elem) = field_decl data, element0 [concrete]
  299. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.data [concrete = constants.%complete_type]
  300. // CHECK:STDOUT: complete_type_witness = %complete_type
  301. // CHECK:STDOUT:
  302. // CHECK:STDOUT: !members:
  303. // CHECK:STDOUT: .Self = constants.%C
  304. // CHECK:STDOUT: .F = %C.F.decl
  305. // CHECK:STDOUT: .data = %.loc13_11
  306. // CHECK:STDOUT: }
  307. // CHECK:STDOUT: }
  308. // CHECK:STDOUT:
  309. // CHECK:STDOUT: generic fn @C.F(@C.%T.loc5_9.2: %Copy.type) {
  310. // CHECK:STDOUT: !definition:
  311. // CHECK:STDOUT: %T: %Copy.type = symbolic_binding T, 0 [symbolic = %T (constants.%T)]
  312. // CHECK:STDOUT: %C: type = class_type @C, @C(%T) [symbolic = %C (constants.%C)]
  313. // CHECK:STDOUT: %C.elem: type = unbound_element_type %C, constants.%empty_struct_type [symbolic = %C.elem (constants.%C.elem)]
  314. // CHECK:STDOUT:
  315. // CHECK:STDOUT: fn() {
  316. // CHECK:STDOUT: !entry:
  317. // CHECK:STDOUT: %data.ref: @C.F.%C.elem (%C.elem) = name_ref data, @C.%.loc13_11 [concrete = @C.%.loc13_11]
  318. // CHECK:STDOUT: return
  319. // CHECK:STDOUT: }
  320. // CHECK:STDOUT: }
  321. // CHECK:STDOUT:
  322. // CHECK:STDOUT: specific @C(constants.%T) {
  323. // CHECK:STDOUT: %T.loc5_9.1 => constants.%T
  324. // CHECK:STDOUT:
  325. // CHECK:STDOUT: !definition:
  326. // CHECK:STDOUT: %C.F.type => constants.%C.F.type
  327. // CHECK:STDOUT: %C.F => constants.%C.F
  328. // CHECK:STDOUT: %C => constants.%C
  329. // CHECK:STDOUT: %C.elem => constants.%C.elem
  330. // CHECK:STDOUT: }
  331. // CHECK:STDOUT:
  332. // CHECK:STDOUT: specific @C.F(constants.%T) {}
  333. // CHECK:STDOUT: