extend_adapt.carbon 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // AUTOUPDATE
  6. // TIP: To test this file alone, run:
  7. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/adapter/extend_adapt.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/adapter/extend_adapt.carbon
  10. // --- basic.carbon
  11. library "[[@TEST_NAME]]";
  12. class SomeClassAdapter;
  13. class SomeClass {
  14. var a: i32;
  15. var b: i32;
  16. fn StaticMemberFunction();
  17. fn AdapterMethod[self: SomeClassAdapter]();
  18. }
  19. class SomeClassAdapter {
  20. extend adapt SomeClass;
  21. }
  22. fn TestStaticMemberFunction(a: SomeClassAdapter) {
  23. a.StaticMemberFunction();
  24. }
  25. fn TestAdapterMethod(a: SomeClassAdapter) {
  26. a.AdapterMethod();
  27. }
  28. // --- fail_todo_method_access.carbon
  29. library "[[@TEST_NAME]]";
  30. class SomeClass {
  31. fn F[self: Self]();
  32. }
  33. class SomeClassAdapter {
  34. extend adapt SomeClass;
  35. }
  36. fn F(a: SomeClassAdapter) {
  37. // CHECK:STDERR: fail_todo_method_access.carbon:[[@LINE+10]]:3: error: cannot implicitly convert from `SomeClassAdapter` to `SomeClass` [ImplicitAsConversionFailure]
  38. // CHECK:STDERR: a.F();
  39. // CHECK:STDERR: ^
  40. // CHECK:STDERR: fail_todo_method_access.carbon:[[@LINE+7]]:3: note: type `SomeClassAdapter` does not implement interface `Core.ImplicitAs(SomeClass)` [MissingImplInMemberAccessNote]
  41. // CHECK:STDERR: a.F();
  42. // CHECK:STDERR: ^
  43. // CHECK:STDERR: fail_todo_method_access.carbon:[[@LINE-14]]:8: note: initializing function parameter [InCallToFunctionParam]
  44. // CHECK:STDERR: fn F[self: Self]();
  45. // CHECK:STDERR: ^~~~~~~~~~
  46. // CHECK:STDERR:
  47. a.F();
  48. }
  49. // --- fail_todo_field_access.carbon
  50. library "[[@TEST_NAME]]";
  51. class SomeClass {
  52. var a: i32;
  53. var b: i32;
  54. }
  55. class SomeClassAdapter {
  56. extend adapt SomeClass;
  57. }
  58. fn F(a: SomeClassAdapter) -> i32 {
  59. // CHECK:STDERR: fail_todo_field_access.carbon:[[@LINE+7]]:10: error: cannot implicitly convert from `SomeClassAdapter` to `SomeClass` [ImplicitAsConversionFailure]
  60. // CHECK:STDERR: return a.b;
  61. // CHECK:STDERR: ^~~
  62. // CHECK:STDERR: fail_todo_field_access.carbon:[[@LINE+4]]:10: note: type `SomeClassAdapter` does not implement interface `Core.ImplicitAs(SomeClass)` [MissingImplInMemberAccessNote]
  63. // CHECK:STDERR: return a.b;
  64. // CHECK:STDERR: ^~~
  65. // CHECK:STDERR:
  66. return a.b;
  67. }
  68. // --- fail_todo_adapt_struct.carbon
  69. library "[[@TEST_NAME]]";
  70. class StructAdapter {
  71. extend adapt {.a: i32, .b: i32};
  72. }
  73. fn F(a: StructAdapter) -> i32 {
  74. // TODO: This should be allowed.
  75. // CHECK:STDERR: fail_todo_adapt_struct.carbon:[[@LINE+4]]:10: error: member name `b` not found in `StructAdapter` [MemberNameNotFoundInScope]
  76. // CHECK:STDERR: return a.b;
  77. // CHECK:STDERR: ^~~
  78. // CHECK:STDERR:
  79. return a.b;
  80. }
  81. // --- fail_todo_adapt_tuple.carbon
  82. library "[[@TEST_NAME]]";
  83. class TupleAdapter {
  84. extend adapt (i32, i32);
  85. }
  86. fn F(a: TupleAdapter) -> i32 {
  87. // TODO: This should be allowed.
  88. // CHECK:STDERR: fail_todo_adapt_tuple.carbon:[[@LINE+4]]:10: error: type `TupleAdapter` does not support tuple indexing; only tuples can be indexed that way [TupleIndexOnANonTupleType]
  89. // CHECK:STDERR: return a.1;
  90. // CHECK:STDERR: ^~~
  91. // CHECK:STDERR:
  92. return a.1;
  93. }
  94. // --- fail_adapt_builtin.carbon
  95. library "[[@TEST_NAME]]";
  96. fn MakeInt(N: Core.IntLiteral()) -> type = "int.make_type_signed";
  97. class IntAdapter {
  98. extend adapt MakeInt(32);
  99. }
  100. fn F(a: IntAdapter) -> i32 {
  101. // Builtin types have no member names.
  102. // CHECK:STDERR: fail_adapt_builtin.carbon:[[@LINE+4]]:10: error: member name `foo` not found in `IntAdapter` [MemberNameNotFoundInScope]
  103. // CHECK:STDERR: return a.foo;
  104. // CHECK:STDERR: ^~~~~
  105. // CHECK:STDERR:
  106. return a.foo;
  107. }
  108. // CHECK:STDOUT: --- basic.carbon
  109. // CHECK:STDOUT:
  110. // CHECK:STDOUT: constants {
  111. // CHECK:STDOUT: %SomeClassAdapter: type = class_type @SomeClassAdapter [template]
  112. // CHECK:STDOUT: %SomeClass: type = class_type @SomeClass [template]
  113. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  114. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
  115. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  116. // CHECK:STDOUT: %SomeClass.elem: type = unbound_element_type %SomeClass, %i32 [template]
  117. // CHECK:STDOUT: %StaticMemberFunction.type: type = fn_type @StaticMemberFunction [template]
  118. // CHECK:STDOUT: %StaticMemberFunction: %StaticMemberFunction.type = struct_value () [template]
  119. // CHECK:STDOUT: %AdapterMethod.type: type = fn_type @AdapterMethod [template]
  120. // CHECK:STDOUT: %AdapterMethod: %AdapterMethod.type = struct_value () [template]
  121. // CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: %i32} [template]
  122. // CHECK:STDOUT: %complete_type.705: <witness> = complete_type_witness %struct_type.a.b [template]
  123. // CHECK:STDOUT: %TestStaticMemberFunction.type: type = fn_type @TestStaticMemberFunction [template]
  124. // CHECK:STDOUT: %TestStaticMemberFunction: %TestStaticMemberFunction.type = struct_value () [template]
  125. // CHECK:STDOUT: %TestAdapterMethod.type: type = fn_type @TestAdapterMethod [template]
  126. // CHECK:STDOUT: %TestAdapterMethod: %TestAdapterMethod.type = struct_value () [template]
  127. // CHECK:STDOUT: }
  128. // CHECK:STDOUT:
  129. // CHECK:STDOUT: imports {
  130. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  131. // CHECK:STDOUT: .Int = %Core.Int
  132. // CHECK:STDOUT: import Core//prelude
  133. // CHECK:STDOUT: import Core//prelude/...
  134. // CHECK:STDOUT: }
  135. // CHECK:STDOUT: }
  136. // CHECK:STDOUT:
  137. // CHECK:STDOUT: file {
  138. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  139. // CHECK:STDOUT: .Core = imports.%Core
  140. // CHECK:STDOUT: .SomeClassAdapter = %SomeClassAdapter.decl.loc4
  141. // CHECK:STDOUT: .SomeClass = %SomeClass.decl
  142. // CHECK:STDOUT: .TestStaticMemberFunction = %TestStaticMemberFunction.decl
  143. // CHECK:STDOUT: .TestAdapterMethod = %TestAdapterMethod.decl
  144. // CHECK:STDOUT: }
  145. // CHECK:STDOUT: %Core.import = import Core
  146. // CHECK:STDOUT: %SomeClassAdapter.decl.loc4: type = class_decl @SomeClassAdapter [template = constants.%SomeClassAdapter] {} {}
  147. // CHECK:STDOUT: %SomeClass.decl: type = class_decl @SomeClass [template = constants.%SomeClass] {} {}
  148. // CHECK:STDOUT: %SomeClassAdapter.decl.loc15: type = class_decl @SomeClassAdapter [template = constants.%SomeClassAdapter] {} {}
  149. // CHECK:STDOUT: %TestStaticMemberFunction.decl: %TestStaticMemberFunction.type = fn_decl @TestStaticMemberFunction [template = constants.%TestStaticMemberFunction] {
  150. // CHECK:STDOUT: %a.patt: %SomeClassAdapter = binding_pattern a
  151. // CHECK:STDOUT: %a.param_patt: %SomeClassAdapter = value_param_pattern %a.patt, runtime_param0
  152. // CHECK:STDOUT: } {
  153. // CHECK:STDOUT: %a.param: %SomeClassAdapter = value_param runtime_param0
  154. // CHECK:STDOUT: %SomeClassAdapter.ref: type = name_ref SomeClassAdapter, file.%SomeClassAdapter.decl.loc4 [template = constants.%SomeClassAdapter]
  155. // CHECK:STDOUT: %a: %SomeClassAdapter = bind_name a, %a.param
  156. // CHECK:STDOUT: }
  157. // CHECK:STDOUT: %TestAdapterMethod.decl: %TestAdapterMethod.type = fn_decl @TestAdapterMethod [template = constants.%TestAdapterMethod] {
  158. // CHECK:STDOUT: %a.patt: %SomeClassAdapter = binding_pattern a
  159. // CHECK:STDOUT: %a.param_patt: %SomeClassAdapter = value_param_pattern %a.patt, runtime_param0
  160. // CHECK:STDOUT: } {
  161. // CHECK:STDOUT: %a.param: %SomeClassAdapter = value_param runtime_param0
  162. // CHECK:STDOUT: %SomeClassAdapter.ref: type = name_ref SomeClassAdapter, file.%SomeClassAdapter.decl.loc4 [template = constants.%SomeClassAdapter]
  163. // CHECK:STDOUT: %a: %SomeClassAdapter = bind_name a, %a.param
  164. // CHECK:STDOUT: }
  165. // CHECK:STDOUT: }
  166. // CHECK:STDOUT:
  167. // CHECK:STDOUT: class @SomeClassAdapter {
  168. // CHECK:STDOUT: %SomeClass.ref: type = name_ref SomeClass, file.%SomeClass.decl [template = constants.%SomeClass]
  169. // CHECK:STDOUT: adapt_decl %SomeClass.ref [template]
  170. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.a.b [template = constants.%complete_type.705]
  171. // CHECK:STDOUT: complete_type_witness = %complete_type
  172. // CHECK:STDOUT:
  173. // CHECK:STDOUT: !members:
  174. // CHECK:STDOUT: .Self = constants.%SomeClassAdapter
  175. // CHECK:STDOUT: extend %SomeClass.ref
  176. // CHECK:STDOUT: }
  177. // CHECK:STDOUT:
  178. // CHECK:STDOUT: class @SomeClass {
  179. // CHECK:STDOUT: %.loc7_8: %SomeClass.elem = field_decl a, element0 [template]
  180. // CHECK:STDOUT: name_binding_decl {
  181. // CHECK:STDOUT: %.loc7_3: %SomeClass.elem = var_pattern %.loc7_8
  182. // CHECK:STDOUT: }
  183. // CHECK:STDOUT: %.var.loc7: ref %SomeClass.elem = var <none>
  184. // CHECK:STDOUT: %.loc8_8: %SomeClass.elem = field_decl b, element1 [template]
  185. // CHECK:STDOUT: name_binding_decl {
  186. // CHECK:STDOUT: %.loc8_3: %SomeClass.elem = var_pattern %.loc8_8
  187. // CHECK:STDOUT: }
  188. // CHECK:STDOUT: %.var.loc8: ref %SomeClass.elem = var <none>
  189. // CHECK:STDOUT: %StaticMemberFunction.decl: %StaticMemberFunction.type = fn_decl @StaticMemberFunction [template = constants.%StaticMemberFunction] {} {}
  190. // CHECK:STDOUT: %AdapterMethod.decl: %AdapterMethod.type = fn_decl @AdapterMethod [template = constants.%AdapterMethod] {
  191. // CHECK:STDOUT: %self.patt: %SomeClassAdapter = binding_pattern self
  192. // CHECK:STDOUT: %self.param_patt: %SomeClassAdapter = value_param_pattern %self.patt, runtime_param0
  193. // CHECK:STDOUT: } {
  194. // CHECK:STDOUT: %self.param: %SomeClassAdapter = value_param runtime_param0
  195. // CHECK:STDOUT: %SomeClassAdapter.ref: type = name_ref SomeClassAdapter, file.%SomeClassAdapter.decl.loc4 [template = constants.%SomeClassAdapter]
  196. // CHECK:STDOUT: %self: %SomeClassAdapter = bind_name self, %self.param
  197. // CHECK:STDOUT: }
  198. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.a.b [template = constants.%complete_type.705]
  199. // CHECK:STDOUT: complete_type_witness = %complete_type
  200. // CHECK:STDOUT:
  201. // CHECK:STDOUT: !members:
  202. // CHECK:STDOUT: .Self = constants.%SomeClass
  203. // CHECK:STDOUT: .a = %.loc7_8
  204. // CHECK:STDOUT: .b = %.loc8_8
  205. // CHECK:STDOUT: .StaticMemberFunction = %StaticMemberFunction.decl
  206. // CHECK:STDOUT: .AdapterMethod = %AdapterMethod.decl
  207. // CHECK:STDOUT: }
  208. // CHECK:STDOUT:
  209. // CHECK:STDOUT: fn @StaticMemberFunction();
  210. // CHECK:STDOUT:
  211. // CHECK:STDOUT: fn @AdapterMethod[%self.param_patt: %SomeClassAdapter]();
  212. // CHECK:STDOUT:
  213. // CHECK:STDOUT: fn @TestStaticMemberFunction(%a.param_patt: %SomeClassAdapter) {
  214. // CHECK:STDOUT: !entry:
  215. // CHECK:STDOUT: %a.ref: %SomeClassAdapter = name_ref a, %a
  216. // CHECK:STDOUT: %StaticMemberFunction.ref: %StaticMemberFunction.type = name_ref StaticMemberFunction, @SomeClass.%StaticMemberFunction.decl [template = constants.%StaticMemberFunction]
  217. // CHECK:STDOUT: %StaticMemberFunction.call: init %empty_tuple.type = call %StaticMemberFunction.ref()
  218. // CHECK:STDOUT: return
  219. // CHECK:STDOUT: }
  220. // CHECK:STDOUT:
  221. // CHECK:STDOUT: fn @TestAdapterMethod(%a.param_patt: %SomeClassAdapter) {
  222. // CHECK:STDOUT: !entry:
  223. // CHECK:STDOUT: %a.ref: %SomeClassAdapter = name_ref a, %a
  224. // CHECK:STDOUT: %AdapterMethod.ref: %AdapterMethod.type = name_ref AdapterMethod, @SomeClass.%AdapterMethod.decl [template = constants.%AdapterMethod]
  225. // CHECK:STDOUT: %AdapterMethod.bound: <bound method> = bound_method %a.ref, %AdapterMethod.ref
  226. // CHECK:STDOUT: %AdapterMethod.call: init %empty_tuple.type = call %AdapterMethod.bound(%a.ref)
  227. // CHECK:STDOUT: return
  228. // CHECK:STDOUT: }
  229. // CHECK:STDOUT:
  230. // CHECK:STDOUT: --- fail_todo_method_access.carbon
  231. // CHECK:STDOUT:
  232. // CHECK:STDOUT: constants {
  233. // CHECK:STDOUT: %SomeClass: type = class_type @SomeClass [template]
  234. // CHECK:STDOUT: %F.type.633: type = fn_type @F.1 [template]
  235. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
  236. // CHECK:STDOUT: %F.e19: %F.type.633 = struct_value () [template]
  237. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  238. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
  239. // CHECK:STDOUT: %SomeClassAdapter: type = class_type @SomeClassAdapter [template]
  240. // CHECK:STDOUT: %F.type.b25: type = fn_type @F.2 [template]
  241. // CHECK:STDOUT: %F.c41: %F.type.b25 = struct_value () [template]
  242. // CHECK:STDOUT: }
  243. // CHECK:STDOUT:
  244. // CHECK:STDOUT: imports {
  245. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  246. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  247. // CHECK:STDOUT: import Core//prelude
  248. // CHECK:STDOUT: import Core//prelude/...
  249. // CHECK:STDOUT: }
  250. // CHECK:STDOUT: }
  251. // CHECK:STDOUT:
  252. // CHECK:STDOUT: file {
  253. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  254. // CHECK:STDOUT: .Core = imports.%Core
  255. // CHECK:STDOUT: .SomeClass = %SomeClass.decl
  256. // CHECK:STDOUT: .SomeClassAdapter = %SomeClassAdapter.decl
  257. // CHECK:STDOUT: .F = %F.decl
  258. // CHECK:STDOUT: }
  259. // CHECK:STDOUT: %Core.import = import Core
  260. // CHECK:STDOUT: %SomeClass.decl: type = class_decl @SomeClass [template = constants.%SomeClass] {} {}
  261. // CHECK:STDOUT: %SomeClassAdapter.decl: type = class_decl @SomeClassAdapter [template = constants.%SomeClassAdapter] {} {}
  262. // CHECK:STDOUT: %F.decl: %F.type.b25 = fn_decl @F.2 [template = constants.%F.c41] {
  263. // CHECK:STDOUT: %a.patt: %SomeClassAdapter = binding_pattern a
  264. // CHECK:STDOUT: %a.param_patt: %SomeClassAdapter = value_param_pattern %a.patt, runtime_param0
  265. // CHECK:STDOUT: } {
  266. // CHECK:STDOUT: %a.param: %SomeClassAdapter = value_param runtime_param0
  267. // CHECK:STDOUT: %SomeClassAdapter.ref: type = name_ref SomeClassAdapter, file.%SomeClassAdapter.decl [template = constants.%SomeClassAdapter]
  268. // CHECK:STDOUT: %a: %SomeClassAdapter = bind_name a, %a.param
  269. // CHECK:STDOUT: }
  270. // CHECK:STDOUT: }
  271. // CHECK:STDOUT:
  272. // CHECK:STDOUT: class @SomeClass {
  273. // CHECK:STDOUT: %F.decl: %F.type.633 = fn_decl @F.1 [template = constants.%F.e19] {
  274. // CHECK:STDOUT: %self.patt: %SomeClass = binding_pattern self
  275. // CHECK:STDOUT: %self.param_patt: %SomeClass = value_param_pattern %self.patt, runtime_param0
  276. // CHECK:STDOUT: } {
  277. // CHECK:STDOUT: %self.param: %SomeClass = value_param runtime_param0
  278. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%SomeClass [template = constants.%SomeClass]
  279. // CHECK:STDOUT: %self: %SomeClass = bind_name self, %self.param
  280. // CHECK:STDOUT: }
  281. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  282. // CHECK:STDOUT: complete_type_witness = %complete_type
  283. // CHECK:STDOUT:
  284. // CHECK:STDOUT: !members:
  285. // CHECK:STDOUT: .Self = constants.%SomeClass
  286. // CHECK:STDOUT: .F = %F.decl
  287. // CHECK:STDOUT: }
  288. // CHECK:STDOUT:
  289. // CHECK:STDOUT: class @SomeClassAdapter {
  290. // CHECK:STDOUT: %SomeClass.ref: type = name_ref SomeClass, file.%SomeClass.decl [template = constants.%SomeClass]
  291. // CHECK:STDOUT: adapt_decl %SomeClass.ref [template]
  292. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  293. // CHECK:STDOUT: complete_type_witness = %complete_type
  294. // CHECK:STDOUT:
  295. // CHECK:STDOUT: !members:
  296. // CHECK:STDOUT: .Self = constants.%SomeClassAdapter
  297. // CHECK:STDOUT: extend %SomeClass.ref
  298. // CHECK:STDOUT: }
  299. // CHECK:STDOUT:
  300. // CHECK:STDOUT: fn @F.1[%self.param_patt: %SomeClass]();
  301. // CHECK:STDOUT:
  302. // CHECK:STDOUT: fn @F.2(%a.param_patt: %SomeClassAdapter) {
  303. // CHECK:STDOUT: !entry:
  304. // CHECK:STDOUT: %a.ref: %SomeClassAdapter = name_ref a, %a
  305. // CHECK:STDOUT: %F.ref: %F.type.633 = name_ref F, @SomeClass.%F.decl [template = constants.%F.e19]
  306. // CHECK:STDOUT: %F.bound: <bound method> = bound_method %a.ref, %F.ref
  307. // CHECK:STDOUT: %.loc23: %SomeClass = converted %a.ref, <error> [template = <error>]
  308. // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.bound(<error>)
  309. // CHECK:STDOUT: return
  310. // CHECK:STDOUT: }
  311. // CHECK:STDOUT:
  312. // CHECK:STDOUT: --- fail_todo_field_access.carbon
  313. // CHECK:STDOUT:
  314. // CHECK:STDOUT: constants {
  315. // CHECK:STDOUT: %SomeClass: type = class_type @SomeClass [template]
  316. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  317. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  318. // CHECK:STDOUT: %SomeClass.elem: type = unbound_element_type %SomeClass, %i32 [template]
  319. // CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: %i32} [template]
  320. // CHECK:STDOUT: %complete_type.705: <witness> = complete_type_witness %struct_type.a.b [template]
  321. // CHECK:STDOUT: %SomeClassAdapter: type = class_type @SomeClassAdapter [template]
  322. // CHECK:STDOUT: %F.type: type = fn_type @F [template]
  323. // CHECK:STDOUT: %F: %F.type = struct_value () [template]
  324. // CHECK:STDOUT: }
  325. // CHECK:STDOUT:
  326. // CHECK:STDOUT: imports {
  327. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  328. // CHECK:STDOUT: .Int = %Core.Int
  329. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  330. // CHECK:STDOUT: import Core//prelude
  331. // CHECK:STDOUT: import Core//prelude/...
  332. // CHECK:STDOUT: }
  333. // CHECK:STDOUT: }
  334. // CHECK:STDOUT:
  335. // CHECK:STDOUT: file {
  336. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  337. // CHECK:STDOUT: .Core = imports.%Core
  338. // CHECK:STDOUT: .SomeClass = %SomeClass.decl
  339. // CHECK:STDOUT: .SomeClassAdapter = %SomeClassAdapter.decl
  340. // CHECK:STDOUT: .F = %F.decl
  341. // CHECK:STDOUT: }
  342. // CHECK:STDOUT: %Core.import = import Core
  343. // CHECK:STDOUT: %SomeClass.decl: type = class_decl @SomeClass [template = constants.%SomeClass] {} {}
  344. // CHECK:STDOUT: %SomeClassAdapter.decl: type = class_decl @SomeClassAdapter [template = constants.%SomeClassAdapter] {} {}
  345. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
  346. // CHECK:STDOUT: %a.patt: %SomeClassAdapter = binding_pattern a
  347. // CHECK:STDOUT: %a.param_patt: %SomeClassAdapter = value_param_pattern %a.patt, runtime_param0
  348. // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern
  349. // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1
  350. // CHECK:STDOUT: } {
  351. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  352. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  353. // CHECK:STDOUT: %a.param: %SomeClassAdapter = value_param runtime_param0
  354. // CHECK:STDOUT: %SomeClassAdapter.ref: type = name_ref SomeClassAdapter, file.%SomeClassAdapter.decl [template = constants.%SomeClassAdapter]
  355. // CHECK:STDOUT: %a: %SomeClassAdapter = bind_name a, %a.param
  356. // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1
  357. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  358. // CHECK:STDOUT: }
  359. // CHECK:STDOUT: }
  360. // CHECK:STDOUT:
  361. // CHECK:STDOUT: class @SomeClass {
  362. // CHECK:STDOUT: %.loc5_8: %SomeClass.elem = field_decl a, element0 [template]
  363. // CHECK:STDOUT: name_binding_decl {
  364. // CHECK:STDOUT: %.loc5_3: %SomeClass.elem = var_pattern %.loc5_8
  365. // CHECK:STDOUT: }
  366. // CHECK:STDOUT: %.var.loc5: ref %SomeClass.elem = var <none>
  367. // CHECK:STDOUT: %.loc6_8: %SomeClass.elem = field_decl b, element1 [template]
  368. // CHECK:STDOUT: name_binding_decl {
  369. // CHECK:STDOUT: %.loc6_3: %SomeClass.elem = var_pattern %.loc6_8
  370. // CHECK:STDOUT: }
  371. // CHECK:STDOUT: %.var.loc6: ref %SomeClass.elem = var <none>
  372. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.a.b [template = constants.%complete_type.705]
  373. // CHECK:STDOUT: complete_type_witness = %complete_type
  374. // CHECK:STDOUT:
  375. // CHECK:STDOUT: !members:
  376. // CHECK:STDOUT: .Self = constants.%SomeClass
  377. // CHECK:STDOUT: .a = %.loc5_8
  378. // CHECK:STDOUT: .b = %.loc6_8
  379. // CHECK:STDOUT: }
  380. // CHECK:STDOUT:
  381. // CHECK:STDOUT: class @SomeClassAdapter {
  382. // CHECK:STDOUT: %SomeClass.ref: type = name_ref SomeClass, file.%SomeClass.decl [template = constants.%SomeClass]
  383. // CHECK:STDOUT: adapt_decl %SomeClass.ref [template]
  384. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.a.b [template = constants.%complete_type.705]
  385. // CHECK:STDOUT: complete_type_witness = %complete_type
  386. // CHECK:STDOUT:
  387. // CHECK:STDOUT: !members:
  388. // CHECK:STDOUT: .Self = constants.%SomeClassAdapter
  389. // CHECK:STDOUT: extend %SomeClass.ref
  390. // CHECK:STDOUT: }
  391. // CHECK:STDOUT:
  392. // CHECK:STDOUT: fn @F(%a.param_patt: %SomeClassAdapter) -> %i32 {
  393. // CHECK:STDOUT: !entry:
  394. // CHECK:STDOUT: %a.ref: %SomeClassAdapter = name_ref a, %a
  395. // CHECK:STDOUT: %b.ref: %SomeClass.elem = name_ref b, @SomeClass.%.loc6_8 [template = @SomeClass.%.loc6_8]
  396. // CHECK:STDOUT: %.loc21_11.1: %SomeClass = converted %a.ref, <error> [template = <error>]
  397. // CHECK:STDOUT: %.loc21_11.2: %i32 = class_element_access <error>, element1 [template = <error>]
  398. // CHECK:STDOUT: return <error>
  399. // CHECK:STDOUT: }
  400. // CHECK:STDOUT:
  401. // CHECK:STDOUT: --- fail_todo_adapt_struct.carbon
  402. // CHECK:STDOUT:
  403. // CHECK:STDOUT: constants {
  404. // CHECK:STDOUT: %StructAdapter: type = class_type @StructAdapter [template]
  405. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  406. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  407. // CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: %i32} [template]
  408. // CHECK:STDOUT: %complete_type.705: <witness> = complete_type_witness %struct_type.a.b [template]
  409. // CHECK:STDOUT: %F.type: type = fn_type @F [template]
  410. // CHECK:STDOUT: %F: %F.type = struct_value () [template]
  411. // CHECK:STDOUT: }
  412. // CHECK:STDOUT:
  413. // CHECK:STDOUT: imports {
  414. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  415. // CHECK:STDOUT: .Int = %Core.Int
  416. // CHECK:STDOUT: import Core//prelude
  417. // CHECK:STDOUT: import Core//prelude/...
  418. // CHECK:STDOUT: }
  419. // CHECK:STDOUT: }
  420. // CHECK:STDOUT:
  421. // CHECK:STDOUT: file {
  422. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  423. // CHECK:STDOUT: .Core = imports.%Core
  424. // CHECK:STDOUT: .StructAdapter = %StructAdapter.decl
  425. // CHECK:STDOUT: .F = %F.decl
  426. // CHECK:STDOUT: }
  427. // CHECK:STDOUT: %Core.import = import Core
  428. // CHECK:STDOUT: %StructAdapter.decl: type = class_decl @StructAdapter [template = constants.%StructAdapter] {} {}
  429. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
  430. // CHECK:STDOUT: %a.patt: %StructAdapter = binding_pattern a
  431. // CHECK:STDOUT: %a.param_patt: %StructAdapter = value_param_pattern %a.patt, runtime_param0
  432. // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern
  433. // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1
  434. // CHECK:STDOUT: } {
  435. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  436. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  437. // CHECK:STDOUT: %a.param: %StructAdapter = value_param runtime_param0
  438. // CHECK:STDOUT: %StructAdapter.ref: type = name_ref StructAdapter, file.%StructAdapter.decl [template = constants.%StructAdapter]
  439. // CHECK:STDOUT: %a: %StructAdapter = bind_name a, %a.param
  440. // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1
  441. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  442. // CHECK:STDOUT: }
  443. // CHECK:STDOUT: }
  444. // CHECK:STDOUT:
  445. // CHECK:STDOUT: class @StructAdapter {
  446. // CHECK:STDOUT: %int_32.loc5_21: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  447. // CHECK:STDOUT: %i32.loc5_21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  448. // CHECK:STDOUT: %int_32.loc5_30: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  449. // CHECK:STDOUT: %i32.loc5_30: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  450. // CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b]
  451. // CHECK:STDOUT: adapt_decl %struct_type.a.b [template]
  452. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.a.b [template = constants.%complete_type.705]
  453. // CHECK:STDOUT: complete_type_witness = %complete_type
  454. // CHECK:STDOUT:
  455. // CHECK:STDOUT: !members:
  456. // CHECK:STDOUT: .Self = constants.%StructAdapter
  457. // CHECK:STDOUT: extend %struct_type.a.b
  458. // CHECK:STDOUT: }
  459. // CHECK:STDOUT:
  460. // CHECK:STDOUT: fn @F(%a.param_patt: %StructAdapter) -> %i32 {
  461. // CHECK:STDOUT: !entry:
  462. // CHECK:STDOUT: %a.ref: %StructAdapter = name_ref a, %a
  463. // CHECK:STDOUT: %b.ref: <error> = name_ref b, <error> [template = <error>]
  464. // CHECK:STDOUT: return <error>
  465. // CHECK:STDOUT: }
  466. // CHECK:STDOUT:
  467. // CHECK:STDOUT: --- fail_todo_adapt_tuple.carbon
  468. // CHECK:STDOUT:
  469. // CHECK:STDOUT: constants {
  470. // CHECK:STDOUT: %TupleAdapter: type = class_type @TupleAdapter [template]
  471. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  472. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  473. // CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [template]
  474. // CHECK:STDOUT: %tuple.type.d07: type = tuple_type (%i32, %i32) [template]
  475. // CHECK:STDOUT: %complete_type.65d: <witness> = complete_type_witness %tuple.type.d07 [template]
  476. // CHECK:STDOUT: %F.type: type = fn_type @F [template]
  477. // CHECK:STDOUT: %F: %F.type = struct_value () [template]
  478. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template]
  479. // CHECK:STDOUT: }
  480. // CHECK:STDOUT:
  481. // CHECK:STDOUT: imports {
  482. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  483. // CHECK:STDOUT: .Int = %Core.Int
  484. // CHECK:STDOUT: import Core//prelude
  485. // CHECK:STDOUT: import Core//prelude/...
  486. // CHECK:STDOUT: }
  487. // CHECK:STDOUT: }
  488. // CHECK:STDOUT:
  489. // CHECK:STDOUT: file {
  490. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  491. // CHECK:STDOUT: .Core = imports.%Core
  492. // CHECK:STDOUT: .TupleAdapter = %TupleAdapter.decl
  493. // CHECK:STDOUT: .F = %F.decl
  494. // CHECK:STDOUT: }
  495. // CHECK:STDOUT: %Core.import = import Core
  496. // CHECK:STDOUT: %TupleAdapter.decl: type = class_decl @TupleAdapter [template = constants.%TupleAdapter] {} {}
  497. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
  498. // CHECK:STDOUT: %a.patt: %TupleAdapter = binding_pattern a
  499. // CHECK:STDOUT: %a.param_patt: %TupleAdapter = value_param_pattern %a.patt, runtime_param0
  500. // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern
  501. // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1
  502. // CHECK:STDOUT: } {
  503. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  504. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  505. // CHECK:STDOUT: %a.param: %TupleAdapter = value_param runtime_param0
  506. // CHECK:STDOUT: %TupleAdapter.ref: type = name_ref TupleAdapter, file.%TupleAdapter.decl [template = constants.%TupleAdapter]
  507. // CHECK:STDOUT: %a: %TupleAdapter = bind_name a, %a.param
  508. // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1
  509. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  510. // CHECK:STDOUT: }
  511. // CHECK:STDOUT: }
  512. // CHECK:STDOUT:
  513. // CHECK:STDOUT: class @TupleAdapter {
  514. // CHECK:STDOUT: %int_32.loc5_17: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  515. // CHECK:STDOUT: %i32.loc5_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  516. // CHECK:STDOUT: %int_32.loc5_22: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  517. // CHECK:STDOUT: %i32.loc5_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  518. // CHECK:STDOUT: %.loc5_25: %tuple.type.24b = tuple_literal (%i32.loc5_17, %i32.loc5_22)
  519. // CHECK:STDOUT: %.loc5_26: type = converted %.loc5_25, constants.%tuple.type.d07 [template = constants.%tuple.type.d07]
  520. // CHECK:STDOUT: adapt_decl %.loc5_26 [template]
  521. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %tuple.type.d07 [template = constants.%complete_type.65d]
  522. // CHECK:STDOUT: complete_type_witness = %complete_type
  523. // CHECK:STDOUT:
  524. // CHECK:STDOUT: !members:
  525. // CHECK:STDOUT: .Self = constants.%TupleAdapter
  526. // CHECK:STDOUT: extend %.loc5_26
  527. // CHECK:STDOUT: }
  528. // CHECK:STDOUT:
  529. // CHECK:STDOUT: fn @F(%a.param_patt: %TupleAdapter) -> %i32 {
  530. // CHECK:STDOUT: !entry:
  531. // CHECK:STDOUT: %a.ref: %TupleAdapter = name_ref a, %a
  532. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1]
  533. // CHECK:STDOUT: return <error>
  534. // CHECK:STDOUT: }
  535. // CHECK:STDOUT:
  536. // CHECK:STDOUT: --- fail_adapt_builtin.carbon
  537. // CHECK:STDOUT:
  538. // CHECK:STDOUT: constants {
  539. // CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [template]
  540. // CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [template]
  541. // CHECK:STDOUT: %MakeInt.type: type = fn_type @MakeInt [template]
  542. // CHECK:STDOUT: %MakeInt: %MakeInt.type = struct_value () [template]
  543. // CHECK:STDOUT: %IntAdapter: type = class_type @IntAdapter [template]
  544. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  545. // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template]
  546. // CHECK:STDOUT: %complete_type.f8a: <witness> = complete_type_witness %i32.builtin [template]
  547. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  548. // CHECK:STDOUT: %F.type: type = fn_type @F [template]
  549. // CHECK:STDOUT: %F: %F.type = struct_value () [template]
  550. // CHECK:STDOUT: }
  551. // CHECK:STDOUT:
  552. // CHECK:STDOUT: imports {
  553. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  554. // CHECK:STDOUT: .IntLiteral = %Core.IntLiteral
  555. // CHECK:STDOUT: .Int = %Core.Int
  556. // CHECK:STDOUT: import Core//prelude
  557. // CHECK:STDOUT: import Core//prelude/...
  558. // CHECK:STDOUT: }
  559. // CHECK:STDOUT: %Core.IntLiteral: %IntLiteral.type = import_ref Core//prelude/types/int_literal, IntLiteral, loaded [template = constants.%IntLiteral]
  560. // CHECK:STDOUT: }
  561. // CHECK:STDOUT:
  562. // CHECK:STDOUT: file {
  563. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  564. // CHECK:STDOUT: .Core = imports.%Core
  565. // CHECK:STDOUT: .MakeInt = %MakeInt.decl
  566. // CHECK:STDOUT: .IntAdapter = %IntAdapter.decl
  567. // CHECK:STDOUT: .F = %F.decl
  568. // CHECK:STDOUT: }
  569. // CHECK:STDOUT: %Core.import = import Core
  570. // CHECK:STDOUT: %MakeInt.decl: %MakeInt.type = fn_decl @MakeInt [template = constants.%MakeInt] {
  571. // CHECK:STDOUT: %N.patt: Core.IntLiteral = binding_pattern N
  572. // CHECK:STDOUT: %N.param_patt: Core.IntLiteral = value_param_pattern %N.patt, runtime_param0
  573. // CHECK:STDOUT: %return.patt: type = return_slot_pattern
  574. // CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param1
  575. // CHECK:STDOUT: } {
  576. // CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param0
  577. // CHECK:STDOUT: %.loc4_31.1: type = splice_block %.loc4_31.3 [template = Core.IntLiteral] {
  578. // CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [template = imports.%Core]
  579. // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [template = constants.%IntLiteral]
  580. // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral]
  581. // CHECK:STDOUT: %.loc4_31.2: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral]
  582. // CHECK:STDOUT: %.loc4_31.3: type = converted %int_literal.make_type, %.loc4_31.2 [template = Core.IntLiteral]
  583. // CHECK:STDOUT: }
  584. // CHECK:STDOUT: %N: Core.IntLiteral = bind_name N, %N.param
  585. // CHECK:STDOUT: %return.param: ref type = out_param runtime_param1
  586. // CHECK:STDOUT: %return: ref type = return_slot %return.param
  587. // CHECK:STDOUT: }
  588. // CHECK:STDOUT: %IntAdapter.decl: type = class_decl @IntAdapter [template = constants.%IntAdapter] {} {}
  589. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
  590. // CHECK:STDOUT: %a.patt: %IntAdapter = binding_pattern a
  591. // CHECK:STDOUT: %a.param_patt: %IntAdapter = value_param_pattern %a.patt, runtime_param0
  592. // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern
  593. // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1
  594. // CHECK:STDOUT: } {
  595. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  596. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  597. // CHECK:STDOUT: %a.param: %IntAdapter = value_param runtime_param0
  598. // CHECK:STDOUT: %IntAdapter.ref: type = name_ref IntAdapter, file.%IntAdapter.decl [template = constants.%IntAdapter]
  599. // CHECK:STDOUT: %a: %IntAdapter = bind_name a, %a.param
  600. // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1
  601. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  602. // CHECK:STDOUT: }
  603. // CHECK:STDOUT: }
  604. // CHECK:STDOUT:
  605. // CHECK:STDOUT: class @IntAdapter {
  606. // CHECK:STDOUT: %MakeInt.ref: %MakeInt.type = name_ref MakeInt, file.%MakeInt.decl [template = constants.%MakeInt]
  607. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  608. // CHECK:STDOUT: %int.make_type_signed: init type = call %MakeInt.ref(%int_32) [template = constants.%i32.builtin]
  609. // CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32.builtin]
  610. // CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_signed, %.loc7_27.1 [template = constants.%i32.builtin]
  611. // CHECK:STDOUT: adapt_decl %.loc7_27.2 [template]
  612. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %i32.builtin [template = constants.%complete_type.f8a]
  613. // CHECK:STDOUT: complete_type_witness = %complete_type
  614. // CHECK:STDOUT:
  615. // CHECK:STDOUT: !members:
  616. // CHECK:STDOUT: .Self = constants.%IntAdapter
  617. // CHECK:STDOUT: extend %.loc7_27.2
  618. // CHECK:STDOUT: }
  619. // CHECK:STDOUT:
  620. // CHECK:STDOUT: fn @MakeInt(%N.param_patt: Core.IntLiteral) -> type = "int.make_type_signed";
  621. // CHECK:STDOUT:
  622. // CHECK:STDOUT: fn @F(%a.param_patt: %IntAdapter) -> %i32 {
  623. // CHECK:STDOUT: !entry:
  624. // CHECK:STDOUT: %a.ref: %IntAdapter = name_ref a, %a
  625. // CHECK:STDOUT: %foo.ref: <error> = name_ref foo, <error> [template = <error>]
  626. // CHECK:STDOUT: return <error>
  627. // CHECK:STDOUT: }
  628. // CHECK:STDOUT: