| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082 |
- // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
- // Exceptions. See /LICENSE for license information.
- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
- //
- // AUTOUPDATE
- // TIP: To test this file alone, run:
- // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/no_prelude/interface_args.carbon
- // TIP: To dump output, run:
- // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/no_prelude/interface_args.carbon
- // --- action.carbon
- library "[[@TEST_NAME]]";
- interface Action(T:! type) {
- fn Op();
- }
- class A {}
- class B {}
- class C {}
- impl A as Action(B) {
- fn Op() {}
- }
- fn F(a: A) { a.(Action(B).Op)(); }
- // --- action.impl.carbon
- impl library "[[@TEST_NAME]]";
- fn G(a: A) { a.(Action(B).Op)(); }
- // --- fail_action.impl.carbon
- impl library "[[@TEST_NAME]]";
- // CHECK:STDERR: fail_action.impl.carbon:[[@LINE+4]]:14: error: cannot access member of interface `Action(C)` in type `A` that does not implement that interface [MissingImplInMemberAccess]
- // CHECK:STDERR: fn G(a: A) { a.(Action(C).Op)(); }
- // CHECK:STDERR: ^~~~~~~~~~~~~~~~
- // CHECK:STDERR:
- fn G(a: A) { a.(Action(C).Op)(); }
- // --- factory.carbon
- library "[[@TEST_NAME]]";
- interface Factory(T:! type) {
- fn Make() -> T;
- }
- class A {}
- class B {}
- impl A as Factory(B) {
- fn Make() -> B;
- }
- // --- factory.impl.carbon
- impl library "[[@TEST_NAME]]";
- fn MakeB(a: A) -> B {
- return a.(Factory(B).Make)();
- }
- // --- fail_factory.impl.carbon
- impl library "[[@TEST_NAME]]";
- class C {}
- fn MakeC(a: A) -> C {
- // CHECK:STDERR: fail_factory.impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Factory(C)` in type `A` that does not implement that interface [MissingImplInMemberAccess]
- // CHECK:STDERR: return a.(Factory(C).Make)();
- // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~
- // CHECK:STDERR:
- return a.(Factory(C).Make)();
- }
- // CHECK:STDOUT: --- action.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
- // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
- // CHECK:STDOUT: %Action.type.29c: type = generic_interface_type @Action [concrete]
- // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
- // CHECK:STDOUT: %Action.generic: %Action.type.29c = struct_value () [concrete]
- // CHECK:STDOUT: %Action.type.cca: type = facet_type <@Action, @Action(%T)> [symbolic]
- // CHECK:STDOUT: %Self: %Action.type.cca = bind_symbolic_name Self, 1 [symbolic]
- // CHECK:STDOUT: %Op.type.036: type = fn_type @Op.1, @Action(%T) [symbolic]
- // CHECK:STDOUT: %Op.6ed: %Op.type.036 = struct_value () [symbolic]
- // CHECK:STDOUT: %Action.assoc_type.8f9: type = assoc_entity_type %Action.type.cca [symbolic]
- // CHECK:STDOUT: %assoc0.69b: %Action.assoc_type.8f9 = assoc_entity element0, @Action.%Op.decl [symbolic]
- // CHECK:STDOUT: %A: type = class_type @A [concrete]
- // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
- // CHECK:STDOUT: %B: type = class_type @B [concrete]
- // CHECK:STDOUT: %C: type = class_type @C [concrete]
- // CHECK:STDOUT: %Action.type.cb0: type = facet_type <@Action, @Action(%B)> [concrete]
- // CHECK:STDOUT: %Op.type.54d: type = fn_type @Op.1, @Action(%B) [concrete]
- // CHECK:STDOUT: %Op.dba: %Op.type.54d = struct_value () [concrete]
- // CHECK:STDOUT: %Action.assoc_type.827: type = assoc_entity_type %Action.type.cb0 [concrete]
- // CHECK:STDOUT: %assoc0.035: %Action.assoc_type.827 = assoc_entity element0, @Action.%Op.decl [concrete]
- // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%Op.decl) [concrete]
- // CHECK:STDOUT: %Op.type.4b4: type = fn_type @Op.2 [concrete]
- // CHECK:STDOUT: %Op.40d: %Op.type.4b4 = struct_value () [concrete]
- // CHECK:STDOUT: %Action.facet: %Action.type.cb0 = facet_value %A, %impl_witness [concrete]
- // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
- // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
- // CHECK:STDOUT: %.920: type = fn_type_with_self_type %Op.type.54d, %Action.facet [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .Action = %Action.decl
- // CHECK:STDOUT: .A = %A.decl
- // CHECK:STDOUT: .B = %B.decl
- // CHECK:STDOUT: .C = %C.decl
- // CHECK:STDOUT: .F = %F.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Action.decl: %Action.type.29c = interface_decl @Action [concrete = constants.%Action.generic] {
- // CHECK:STDOUT: %T.patt.loc4_18.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_18.2 (constants.%T.patt)]
- // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc4_18.1, runtime_param<none> [symbolic = %T.patt.loc4_18.2 (constants.%T.patt)]
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %T.param: type = value_param runtime_param<none>
- // CHECK:STDOUT: %T.loc4_18.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_18.2 (constants.%T)]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %A.decl: type = class_decl @A [concrete = constants.%A] {} {}
- // CHECK:STDOUT: %B.decl: type = class_decl @B [concrete = constants.%B] {} {}
- // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
- // CHECK:STDOUT: impl_decl @impl [concrete] {} {
- // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A]
- // CHECK:STDOUT: %Action.ref: %Action.type.29c = name_ref Action, file.%Action.decl [concrete = constants.%Action.generic]
- // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B]
- // CHECK:STDOUT: %Action.type: type = facet_type <@Action, @Action(constants.%B)> [concrete = constants.%Action.type.cb0]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%Op.decl) [concrete = constants.%impl_witness]
- // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
- // CHECK:STDOUT: %a.patt: %A = binding_pattern a
- // CHECK:STDOUT: %a.param_patt: %A = value_param_pattern %a.patt, runtime_param0
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %a.param: %A = value_param runtime_param0
- // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A]
- // CHECK:STDOUT: %a: %A = bind_name a, %a.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic interface @Action(%T.loc4_18.1: type) {
- // CHECK:STDOUT: %T.loc4_18.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_18.2 (constants.%T)]
- // CHECK:STDOUT: %T.patt.loc4_18.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_18.2 (constants.%T.patt)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: %Action.type: type = facet_type <@Action, @Action(%T.loc4_18.2)> [symbolic = %Action.type (constants.%Action.type.cca)]
- // CHECK:STDOUT: %Self.2: %Action.type.cca = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)]
- // CHECK:STDOUT: %Op.type: type = fn_type @Op.1, @Action(%T.loc4_18.2) [symbolic = %Op.type (constants.%Op.type.036)]
- // CHECK:STDOUT: %Op: @Action.%Op.type (%Op.type.036) = struct_value () [symbolic = %Op (constants.%Op.6ed)]
- // CHECK:STDOUT: %Action.assoc_type: type = assoc_entity_type @Action.%Action.type (%Action.type.cca) [symbolic = %Action.assoc_type (constants.%Action.assoc_type.8f9)]
- // CHECK:STDOUT: %assoc0.loc5_10.2: @Action.%Action.assoc_type (%Action.assoc_type.8f9) = assoc_entity element0, %Op.decl [symbolic = %assoc0.loc5_10.2 (constants.%assoc0.69b)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: interface {
- // CHECK:STDOUT: %Self.1: @Action.%Action.type (%Action.type.cca) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)]
- // CHECK:STDOUT: %Op.decl: @Action.%Op.type (%Op.type.036) = fn_decl @Op.1 [symbolic = @Action.%Op (constants.%Op.6ed)] {} {}
- // CHECK:STDOUT: %assoc0.loc5_10.1: @Action.%Action.assoc_type (%Action.assoc_type.8f9) = assoc_entity element0, %Op.decl [symbolic = %assoc0.loc5_10.2 (constants.%assoc0.69b)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = %Self.1
- // CHECK:STDOUT: .Op = %assoc0.loc5_10.1
- // CHECK:STDOUT: witness = (%Op.decl)
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: impl @impl: %A.ref as %Action.type {
- // CHECK:STDOUT: %Op.decl: %Op.type.4b4 = fn_decl @Op.2 [concrete = constants.%Op.40d] {} {}
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Op = %Op.decl
- // CHECK:STDOUT: witness = file.%impl_witness
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @A {
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
- // CHECK:STDOUT: complete_type_witness = %complete_type
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = constants.%A
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @B {
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
- // CHECK:STDOUT: complete_type_witness = %complete_type
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = constants.%B
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @C {
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
- // CHECK:STDOUT: complete_type_witness = %complete_type
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = constants.%C
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic fn @Op.1(@Action.%T.loc4_18.1: type, @Action.%Self.1: @Action.%Action.type (%Action.type.cca)) {
- // CHECK:STDOUT: fn();
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Op.2() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @F(%a.param_patt: %A) {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %a.ref: %A = name_ref a, %a
- // CHECK:STDOUT: %Action.ref: %Action.type.29c = name_ref Action, file.%Action.decl [concrete = constants.%Action.generic]
- // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B]
- // CHECK:STDOUT: %Action.type: type = facet_type <@Action, @Action(constants.%B)> [concrete = constants.%Action.type.cb0]
- // CHECK:STDOUT: %.loc16: %Action.assoc_type.827 = specific_constant @Action.%assoc0.loc5_10.1, @Action(constants.%B) [concrete = constants.%assoc0.035]
- // CHECK:STDOUT: %Op.ref: %Action.assoc_type.827 = name_ref Op, %.loc16 [concrete = constants.%assoc0.035]
- // CHECK:STDOUT: %impl.elem0: %.920 = impl_witness_access constants.%impl_witness, element0 [concrete = constants.%Op.40d]
- // CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %impl.elem0()
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Action(constants.%T) {
- // CHECK:STDOUT: %T.loc4_18.2 => constants.%T
- // CHECK:STDOUT: %T.patt.loc4_18.2 => constants.%T
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Op.1(constants.%T, constants.%Self) {}
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Action(%T.loc4_18.2) {}
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Action(constants.%B) {
- // CHECK:STDOUT: %T.loc4_18.2 => constants.%B
- // CHECK:STDOUT: %T.patt.loc4_18.2 => constants.%B
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: %Action.type => constants.%Action.type.cb0
- // CHECK:STDOUT: %Self.2 => constants.%Self
- // CHECK:STDOUT: %Op.type => constants.%Op.type.54d
- // CHECK:STDOUT: %Op => constants.%Op.dba
- // CHECK:STDOUT: %Action.assoc_type => constants.%Action.assoc_type.827
- // CHECK:STDOUT: %assoc0.loc5_10.2 => constants.%assoc0.035
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Op.1(constants.%B, constants.%Action.facet) {}
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- action.impl.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %B: type = class_type @B [concrete]
- // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
- // CHECK:STDOUT: %Action.type.29c: type = generic_interface_type @Action [concrete]
- // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
- // CHECK:STDOUT: %Action.generic: %Action.type.29c = struct_value () [concrete]
- // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
- // CHECK:STDOUT: %Action.type.cca: type = facet_type <@Action, @Action(%T)> [symbolic]
- // CHECK:STDOUT: %Self: %Action.type.cca = bind_symbolic_name Self, 1 [symbolic]
- // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
- // CHECK:STDOUT: %Action.type.cb0: type = facet_type <@Action, @Action(%B)> [concrete]
- // CHECK:STDOUT: %A: type = class_type @A [concrete]
- // CHECK:STDOUT: %Op.type.036: type = fn_type @Op.1, @Action(%T) [symbolic]
- // CHECK:STDOUT: %Op.6ed: %Op.type.036 = struct_value () [symbolic]
- // CHECK:STDOUT: %Action.assoc_type.8f9: type = assoc_entity_type %Action.type.cca [symbolic]
- // CHECK:STDOUT: %assoc0.905ab9.1: %Action.assoc_type.8f9 = assoc_entity element0, imports.%Main.import_ref.0e3753.1 [symbolic]
- // CHECK:STDOUT: %Op.type.54d: type = fn_type @Op.1, @Action(%B) [concrete]
- // CHECK:STDOUT: %Op.dba: %Op.type.54d = struct_value () [concrete]
- // CHECK:STDOUT: %Action.assoc_type.827: type = assoc_entity_type %Action.type.cb0 [concrete]
- // CHECK:STDOUT: %assoc0.4cc: %Action.assoc_type.827 = assoc_entity element0, imports.%Main.import_ref.1f6 [concrete]
- // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
- // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
- // CHECK:STDOUT: %assoc0.905ab9.2: %Action.assoc_type.8f9 = assoc_entity element0, imports.%Main.import_ref.0e3753.2 [symbolic]
- // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%Main.import_ref.d0b) [concrete]
- // CHECK:STDOUT: %Action.facet: %Action.type.cb0 = facet_value %A, %impl_witness [concrete]
- // CHECK:STDOUT: %.ae7: type = fn_type_with_self_type %Op.type.54d, %Action.facet [concrete]
- // CHECK:STDOUT: %Op.type.4b4: type = fn_type @Op.2 [concrete]
- // CHECK:STDOUT: %Op.40d: %Op.type.4b4 = struct_value () [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Main.Action: %Action.type.29c = import_ref Main//action, Action, loaded [concrete = constants.%Action.generic]
- // CHECK:STDOUT: %Main.A: type = import_ref Main//action, A, loaded [concrete = constants.%A]
- // CHECK:STDOUT: %Main.B: type = import_ref Main//action, B, loaded [concrete = constants.%B]
- // CHECK:STDOUT: %Main.C = import_ref Main//action, C, unloaded
- // CHECK:STDOUT: %Main.F = import_ref Main//action, F, unloaded
- // CHECK:STDOUT: %Main.import_ref.71c: <witness> = import_ref Main//action, loc12_21, loaded [concrete = constants.%impl_witness]
- // CHECK:STDOUT: %Main.import_ref.8f24d3.1: <witness> = import_ref Main//action, loc9_10, loaded [concrete = constants.%complete_type]
- // CHECK:STDOUT: %Main.import_ref.54a = import_ref Main//action, inst46 [no loc], unloaded
- // CHECK:STDOUT: %Main.import_ref.f6b058.1: type = import_ref Main//action, loc4_18, loaded [symbolic = @Action.%T (constants.%T)]
- // CHECK:STDOUT: %Main.import_ref.ddc = import_ref Main//action, inst26 [no loc], unloaded
- // CHECK:STDOUT: %Main.import_ref.318: @Action.%Action.assoc_type (%Action.assoc_type.8f9) = import_ref Main//action, loc5_10, loaded [symbolic = @Action.%assoc0 (constants.%assoc0.905ab9.2)]
- // CHECK:STDOUT: %Main.Op = import_ref Main//action, Op, unloaded
- // CHECK:STDOUT: %Main.import_ref.8f24d3.2: <witness> = import_ref Main//action, loc8_10, loaded [concrete = constants.%complete_type]
- // CHECK:STDOUT: %Main.import_ref.da3 = import_ref Main//action, inst41 [no loc], unloaded
- // CHECK:STDOUT: %Main.import_ref.984: type = import_ref Main//action, loc12_6, loaded [concrete = constants.%A]
- // CHECK:STDOUT: %Main.import_ref.bb2: type = import_ref Main//action, loc12_19, loaded [concrete = constants.%Action.type.cb0]
- // CHECK:STDOUT: %Main.import_ref.7b5 = import_ref Main//action, loc13_11, unloaded
- // CHECK:STDOUT: %Main.import_ref.f6b058.2: type = import_ref Main//action, loc4_18, loaded [symbolic = @Action.%T (constants.%T)]
- // CHECK:STDOUT: %Main.import_ref.835: @Action.%Action.type (%Action.type.cca) = import_ref Main//action, inst26 [no loc], loaded [symbolic = @Action.%Self (constants.%Self)]
- // CHECK:STDOUT: %Main.import_ref.0e3753.1 = import_ref Main//action, loc5_10, unloaded
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .Action = imports.%Main.Action
- // CHECK:STDOUT: .A = imports.%Main.A
- // CHECK:STDOUT: .B = imports.%Main.B
- // CHECK:STDOUT: .C = imports.%Main.C
- // CHECK:STDOUT: .F = imports.%Main.F
- // CHECK:STDOUT: .G = %G.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %default.import.loc2_6.1 = import <none>
- // CHECK:STDOUT: %default.import.loc2_6.2 = import <none>
- // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
- // CHECK:STDOUT: %a.patt: %A = binding_pattern a
- // CHECK:STDOUT: %a.param_patt: %A = value_param_pattern %a.patt, runtime_param0
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %a.param: %A = value_param runtime_param0
- // CHECK:STDOUT: %A.ref: type = name_ref A, imports.%Main.A [concrete = constants.%A]
- // CHECK:STDOUT: %a: %A = bind_name a, %a.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic interface @Action(imports.%Main.import_ref.f6b058.1: type) [from "action.carbon"] {
- // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
- // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: %Action.type: type = facet_type <@Action, @Action(%T)> [symbolic = %Action.type (constants.%Action.type.cca)]
- // CHECK:STDOUT: %Self: %Action.type.cca = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self)]
- // CHECK:STDOUT: %Op.type: type = fn_type @Op.1, @Action(%T) [symbolic = %Op.type (constants.%Op.type.036)]
- // CHECK:STDOUT: %Op: @Action.%Op.type (%Op.type.036) = struct_value () [symbolic = %Op (constants.%Op.6ed)]
- // CHECK:STDOUT: %Action.assoc_type: type = assoc_entity_type @Action.%Action.type (%Action.type.cca) [symbolic = %Action.assoc_type (constants.%Action.assoc_type.8f9)]
- // CHECK:STDOUT: %assoc0: @Action.%Action.assoc_type (%Action.assoc_type.8f9) = assoc_entity element0, imports.%Main.import_ref.0e3753.1 [symbolic = %assoc0 (constants.%assoc0.905ab9.1)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: interface {
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = imports.%Main.import_ref.ddc
- // CHECK:STDOUT: .Op = imports.%Main.import_ref.318
- // CHECK:STDOUT: witness = (imports.%Main.Op)
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: impl @impl: imports.%Main.import_ref.984 as imports.%Main.import_ref.bb2 [from "action.carbon"] {
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Op = imports.%Main.import_ref.7b5
- // CHECK:STDOUT: witness = imports.%Main.import_ref.71c
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @B [from "action.carbon"] {
- // CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8f24d3.1
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = imports.%Main.import_ref.54a
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @A [from "action.carbon"] {
- // CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8f24d3.2
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = imports.%Main.import_ref.da3
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic fn @Op.1(imports.%Main.import_ref.f6b058.2: type, imports.%Main.import_ref.835: @Action.%Action.type (%Action.type.cca)) [from "action.carbon"] {
- // CHECK:STDOUT: fn();
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @G(%a.param_patt: %A) {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %a.ref: %A = name_ref a, %a
- // CHECK:STDOUT: %Action.ref: %Action.type.29c = name_ref Action, imports.%Main.Action [concrete = constants.%Action.generic]
- // CHECK:STDOUT: %B.ref: type = name_ref B, imports.%Main.B [concrete = constants.%B]
- // CHECK:STDOUT: %Action.type: type = facet_type <@Action, @Action(constants.%B)> [concrete = constants.%Action.type.cb0]
- // CHECK:STDOUT: %.loc4: %Action.assoc_type.827 = specific_constant imports.%Main.import_ref.318, @Action(constants.%B) [concrete = constants.%assoc0.4cc]
- // CHECK:STDOUT: %Op.ref: %Action.assoc_type.827 = name_ref Op, %.loc4 [concrete = constants.%assoc0.4cc]
- // CHECK:STDOUT: %impl.elem0: %.ae7 = impl_witness_access constants.%impl_witness, element0 [concrete = constants.%Op.40d]
- // CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %impl.elem0()
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Op.2() [from "action.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Action(constants.%T) {
- // CHECK:STDOUT: %T => constants.%T
- // CHECK:STDOUT: %T.patt => constants.%T
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Action(constants.%B) {
- // CHECK:STDOUT: %T => constants.%B
- // CHECK:STDOUT: %T.patt => constants.%B
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: %Action.type => constants.%Action.type.cb0
- // CHECK:STDOUT: %Self => constants.%Self
- // CHECK:STDOUT: %Op.type => constants.%Op.type.54d
- // CHECK:STDOUT: %Op => constants.%Op.dba
- // CHECK:STDOUT: %Action.assoc_type => constants.%Action.assoc_type.827
- // CHECK:STDOUT: %assoc0 => constants.%assoc0.4cc
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Action(%T) {}
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Op.1(constants.%T, constants.%Self) {}
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- fail_action.impl.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %B: type = class_type @B [concrete]
- // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
- // CHECK:STDOUT: %Action.type.29c: type = generic_interface_type @Action [concrete]
- // CHECK:STDOUT: %Action.generic: %Action.type.29c = struct_value () [concrete]
- // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
- // CHECK:STDOUT: %Action.type.cca: type = facet_type <@Action, @Action(%T)> [symbolic]
- // CHECK:STDOUT: %Self: %Action.type.cca = bind_symbolic_name Self, 1 [symbolic]
- // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
- // CHECK:STDOUT: %Action.type.cb0: type = facet_type <@Action, @Action(%B)> [concrete]
- // CHECK:STDOUT: %A: type = class_type @A [concrete]
- // CHECK:STDOUT: %Op.type.036: type = fn_type @Op, @Action(%T) [symbolic]
- // CHECK:STDOUT: %Op.6ed: %Op.type.036 = struct_value () [symbolic]
- // CHECK:STDOUT: %Action.assoc_type.8f9: type = assoc_entity_type %Action.type.cca [symbolic]
- // CHECK:STDOUT: %assoc0.905ab9.1: %Action.assoc_type.8f9 = assoc_entity element0, imports.%Main.import_ref.0e3753.1 [symbolic]
- // CHECK:STDOUT: %Op.type.54d: type = fn_type @Op, @Action(%B) [concrete]
- // CHECK:STDOUT: %Op.dba: %Op.type.54d = struct_value () [concrete]
- // CHECK:STDOUT: %Action.assoc_type.827: type = assoc_entity_type %Action.type.cb0 [concrete]
- // CHECK:STDOUT: %assoc0.8f8: %Action.assoc_type.827 = assoc_entity element0, imports.%Main.import_ref.0e3753.2 [concrete]
- // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
- // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
- // CHECK:STDOUT: %C: type = class_type @C [concrete]
- // CHECK:STDOUT: %Action.type.e2b: type = facet_type <@Action, @Action(%C)> [concrete]
- // CHECK:STDOUT: %Op.type.5ad: type = fn_type @Op, @Action(%C) [concrete]
- // CHECK:STDOUT: %Op.b10: %Op.type.5ad = struct_value () [concrete]
- // CHECK:STDOUT: %Action.assoc_type.0a7: type = assoc_entity_type %Action.type.e2b [concrete]
- // CHECK:STDOUT: %assoc0.85d: %Action.assoc_type.0a7 = assoc_entity element0, imports.%Main.import_ref.0e3753.1 [concrete]
- // CHECK:STDOUT: %assoc0.905ab9.2: %Action.assoc_type.8f9 = assoc_entity element0, imports.%Main.import_ref.0e3753.3 [symbolic]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Main.Action: %Action.type.29c = import_ref Main//action, Action, loaded [concrete = constants.%Action.generic]
- // CHECK:STDOUT: %Main.A: type = import_ref Main//action, A, loaded [concrete = constants.%A]
- // CHECK:STDOUT: %Main.B = import_ref Main//action, B, unloaded
- // CHECK:STDOUT: %Main.C: type = import_ref Main//action, C, loaded [concrete = constants.%C]
- // CHECK:STDOUT: %Main.F = import_ref Main//action, F, unloaded
- // CHECK:STDOUT: %Main.import_ref.7a1 = import_ref Main//action, loc12_21, unloaded
- // CHECK:STDOUT: %Main.import_ref.8f24d3.1: <witness> = import_ref Main//action, loc9_10, loaded [concrete = constants.%complete_type]
- // CHECK:STDOUT: %Main.import_ref.54a = import_ref Main//action, inst46 [no loc], unloaded
- // CHECK:STDOUT: %Main.import_ref.f6b058.1: type = import_ref Main//action, loc4_18, loaded [symbolic = @Action.%T (constants.%T)]
- // CHECK:STDOUT: %Main.import_ref.ddc = import_ref Main//action, inst26 [no loc], unloaded
- // CHECK:STDOUT: %Main.import_ref.318: @Action.%Action.assoc_type (%Action.assoc_type.8f9) = import_ref Main//action, loc5_10, loaded [symbolic = @Action.%assoc0 (constants.%assoc0.905ab9.2)]
- // CHECK:STDOUT: %Main.Op = import_ref Main//action, Op, unloaded
- // CHECK:STDOUT: %Main.import_ref.8f24d3.2: <witness> = import_ref Main//action, loc8_10, loaded [concrete = constants.%complete_type]
- // CHECK:STDOUT: %Main.import_ref.da3 = import_ref Main//action, inst41 [no loc], unloaded
- // CHECK:STDOUT: %Main.import_ref.984: type = import_ref Main//action, loc12_6, loaded [concrete = constants.%A]
- // CHECK:STDOUT: %Main.import_ref.bb2: type = import_ref Main//action, loc12_19, loaded [concrete = constants.%Action.type.cb0]
- // CHECK:STDOUT: %Main.import_ref.7b5 = import_ref Main//action, loc13_11, unloaded
- // CHECK:STDOUT: %Main.import_ref.f6b058.2: type = import_ref Main//action, loc4_18, loaded [symbolic = @Action.%T (constants.%T)]
- // CHECK:STDOUT: %Main.import_ref.835: @Action.%Action.type (%Action.type.cca) = import_ref Main//action, inst26 [no loc], loaded [symbolic = @Action.%Self (constants.%Self)]
- // CHECK:STDOUT: %Main.import_ref.0e3753.1 = import_ref Main//action, loc5_10, unloaded
- // CHECK:STDOUT: %Main.import_ref.8f24d3.3: <witness> = import_ref Main//action, loc10_10, loaded [concrete = constants.%complete_type]
- // CHECK:STDOUT: %Main.import_ref.2c4 = import_ref Main//action, inst49 [no loc], unloaded
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .Action = imports.%Main.Action
- // CHECK:STDOUT: .A = imports.%Main.A
- // CHECK:STDOUT: .B = imports.%Main.B
- // CHECK:STDOUT: .C = imports.%Main.C
- // CHECK:STDOUT: .F = imports.%Main.F
- // CHECK:STDOUT: .G = %G.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %default.import.loc2_6.1 = import <none>
- // CHECK:STDOUT: %default.import.loc2_6.2 = import <none>
- // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
- // CHECK:STDOUT: %a.patt: %A = binding_pattern a
- // CHECK:STDOUT: %a.param_patt: %A = value_param_pattern %a.patt, runtime_param0
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %a.param: %A = value_param runtime_param0
- // CHECK:STDOUT: %A.ref: type = name_ref A, imports.%Main.A [concrete = constants.%A]
- // CHECK:STDOUT: %a: %A = bind_name a, %a.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic interface @Action(imports.%Main.import_ref.f6b058.1: type) [from "action.carbon"] {
- // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
- // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: %Action.type: type = facet_type <@Action, @Action(%T)> [symbolic = %Action.type (constants.%Action.type.cca)]
- // CHECK:STDOUT: %Self: %Action.type.cca = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self)]
- // CHECK:STDOUT: %Op.type: type = fn_type @Op, @Action(%T) [symbolic = %Op.type (constants.%Op.type.036)]
- // CHECK:STDOUT: %Op: @Action.%Op.type (%Op.type.036) = struct_value () [symbolic = %Op (constants.%Op.6ed)]
- // CHECK:STDOUT: %Action.assoc_type: type = assoc_entity_type @Action.%Action.type (%Action.type.cca) [symbolic = %Action.assoc_type (constants.%Action.assoc_type.8f9)]
- // CHECK:STDOUT: %assoc0: @Action.%Action.assoc_type (%Action.assoc_type.8f9) = assoc_entity element0, imports.%Main.import_ref.0e3753.1 [symbolic = %assoc0 (constants.%assoc0.905ab9.1)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: interface {
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = imports.%Main.import_ref.ddc
- // CHECK:STDOUT: .Op = imports.%Main.import_ref.318
- // CHECK:STDOUT: witness = (imports.%Main.Op)
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: impl @impl: imports.%Main.import_ref.984 as imports.%Main.import_ref.bb2 [from "action.carbon"] {
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Op = imports.%Main.import_ref.7b5
- // CHECK:STDOUT: witness = imports.%Main.import_ref.7a1
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @B [from "action.carbon"] {
- // CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8f24d3.1
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = imports.%Main.import_ref.54a
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @A [from "action.carbon"] {
- // CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8f24d3.2
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = imports.%Main.import_ref.da3
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @C [from "action.carbon"] {
- // CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8f24d3.3
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = imports.%Main.import_ref.2c4
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic fn @Op(imports.%Main.import_ref.f6b058.2: type, imports.%Main.import_ref.835: @Action.%Action.type (%Action.type.cca)) [from "action.carbon"] {
- // CHECK:STDOUT: fn();
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @G(%a.param_patt: %A) {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %a.ref: %A = name_ref a, %a
- // CHECK:STDOUT: %Action.ref: %Action.type.29c = name_ref Action, imports.%Main.Action [concrete = constants.%Action.generic]
- // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%Main.C [concrete = constants.%C]
- // CHECK:STDOUT: %Action.type: type = facet_type <@Action, @Action(constants.%C)> [concrete = constants.%Action.type.e2b]
- // CHECK:STDOUT: %.loc8: %Action.assoc_type.0a7 = specific_constant imports.%Main.import_ref.318, @Action(constants.%C) [concrete = constants.%assoc0.85d]
- // CHECK:STDOUT: %Op.ref: %Action.assoc_type.0a7 = name_ref Op, %.loc8 [concrete = constants.%assoc0.85d]
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Action(constants.%T) {
- // CHECK:STDOUT: %T => constants.%T
- // CHECK:STDOUT: %T.patt => constants.%T
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Action(constants.%B) {
- // CHECK:STDOUT: %T => constants.%B
- // CHECK:STDOUT: %T.patt => constants.%B
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: %Action.type => constants.%Action.type.cb0
- // CHECK:STDOUT: %Self => constants.%Self
- // CHECK:STDOUT: %Op.type => constants.%Op.type.54d
- // CHECK:STDOUT: %Op => constants.%Op.dba
- // CHECK:STDOUT: %Action.assoc_type => constants.%Action.assoc_type.827
- // CHECK:STDOUT: %assoc0 => constants.%assoc0.8f8
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Action(%T) {}
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Op(constants.%T, constants.%Self) {}
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Action(constants.%C) {
- // CHECK:STDOUT: %T => constants.%C
- // CHECK:STDOUT: %T.patt => constants.%C
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: %Action.type => constants.%Action.type.e2b
- // CHECK:STDOUT: %Self => constants.%Self
- // CHECK:STDOUT: %Op.type => constants.%Op.type.5ad
- // CHECK:STDOUT: %Op => constants.%Op.b10
- // CHECK:STDOUT: %Action.assoc_type => constants.%Action.assoc_type.0a7
- // CHECK:STDOUT: %assoc0 => constants.%assoc0.85d
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- factory.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
- // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
- // CHECK:STDOUT: %Factory.type.1a8: type = generic_interface_type @Factory [concrete]
- // CHECK:STDOUT: %Factory.generic: %Factory.type.1a8 = struct_value () [concrete]
- // CHECK:STDOUT: %Factory.type.c96: type = facet_type <@Factory, @Factory(%T)> [symbolic]
- // CHECK:STDOUT: %Self: %Factory.type.c96 = bind_symbolic_name Self, 1 [symbolic]
- // CHECK:STDOUT: %Make.type.598: type = fn_type @Make.1, @Factory(%T) [symbolic]
- // CHECK:STDOUT: %Make.737: %Make.type.598 = struct_value () [symbolic]
- // CHECK:STDOUT: %Factory.assoc_type.ca7: type = assoc_entity_type %Factory.type.c96 [symbolic]
- // CHECK:STDOUT: %assoc0.d7a: %Factory.assoc_type.ca7 = assoc_entity element0, @Factory.%Make.decl [symbolic]
- // CHECK:STDOUT: %A: type = class_type @A [concrete]
- // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
- // CHECK:STDOUT: %B: type = class_type @B [concrete]
- // CHECK:STDOUT: %Factory.type.a5d: type = facet_type <@Factory, @Factory(%B)> [concrete]
- // CHECK:STDOUT: %Make.type.c59: type = fn_type @Make.1, @Factory(%B) [concrete]
- // CHECK:STDOUT: %Make.efe: %Make.type.c59 = struct_value () [concrete]
- // CHECK:STDOUT: %Factory.assoc_type.668: type = assoc_entity_type %Factory.type.a5d [concrete]
- // CHECK:STDOUT: %assoc0.40c: %Factory.assoc_type.668 = assoc_entity element0, @Factory.%Make.decl [concrete]
- // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%Make.decl) [concrete]
- // CHECK:STDOUT: %Make.type.ec4: type = fn_type @Make.2 [concrete]
- // CHECK:STDOUT: %Make.377: %Make.type.ec4 = struct_value () [concrete]
- // CHECK:STDOUT: %Factory.facet: %Factory.type.a5d = facet_value %A, %impl_witness [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .Factory = %Factory.decl
- // CHECK:STDOUT: .A = %A.decl
- // CHECK:STDOUT: .B = %B.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Factory.decl: %Factory.type.1a8 = interface_decl @Factory [concrete = constants.%Factory.generic] {
- // CHECK:STDOUT: %T.patt.loc4_19.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_19.2 (constants.%T.patt)]
- // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc4_19.1, runtime_param<none> [symbolic = %T.patt.loc4_19.2 (constants.%T.patt)]
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %T.param: type = value_param runtime_param<none>
- // CHECK:STDOUT: %T.loc4_19.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_19.2 (constants.%T)]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %A.decl: type = class_decl @A [concrete = constants.%A] {} {}
- // CHECK:STDOUT: %B.decl: type = class_decl @B [concrete = constants.%B] {} {}
- // CHECK:STDOUT: impl_decl @impl [concrete] {} {
- // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A]
- // CHECK:STDOUT: %Factory.ref: %Factory.type.1a8 = name_ref Factory, file.%Factory.decl [concrete = constants.%Factory.generic]
- // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B]
- // CHECK:STDOUT: %Factory.type: type = facet_type <@Factory, @Factory(constants.%B)> [concrete = constants.%Factory.type.a5d]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%Make.decl) [concrete = constants.%impl_witness]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic interface @Factory(%T.loc4_19.1: type) {
- // CHECK:STDOUT: %T.loc4_19.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_19.2 (constants.%T)]
- // CHECK:STDOUT: %T.patt.loc4_19.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_19.2 (constants.%T.patt)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: %Factory.type: type = facet_type <@Factory, @Factory(%T.loc4_19.2)> [symbolic = %Factory.type (constants.%Factory.type.c96)]
- // CHECK:STDOUT: %Self.2: %Factory.type.c96 = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)]
- // CHECK:STDOUT: %Make.type: type = fn_type @Make.1, @Factory(%T.loc4_19.2) [symbolic = %Make.type (constants.%Make.type.598)]
- // CHECK:STDOUT: %Make: @Factory.%Make.type (%Make.type.598) = struct_value () [symbolic = %Make (constants.%Make.737)]
- // CHECK:STDOUT: %Factory.assoc_type: type = assoc_entity_type @Factory.%Factory.type (%Factory.type.c96) [symbolic = %Factory.assoc_type (constants.%Factory.assoc_type.ca7)]
- // CHECK:STDOUT: %assoc0.loc5_17.2: @Factory.%Factory.assoc_type (%Factory.assoc_type.ca7) = assoc_entity element0, %Make.decl [symbolic = %assoc0.loc5_17.2 (constants.%assoc0.d7a)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: interface {
- // CHECK:STDOUT: %Self.1: @Factory.%Factory.type (%Factory.type.c96) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)]
- // CHECK:STDOUT: %Make.decl: @Factory.%Make.type (%Make.type.598) = fn_decl @Make.1 [symbolic = @Factory.%Make (constants.%Make.737)] {
- // CHECK:STDOUT: %return.patt: @Make.1.%T (%T) = return_slot_pattern
- // CHECK:STDOUT: %return.param_patt: @Make.1.%T (%T) = out_param_pattern %return.patt, runtime_param0
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %T.ref: type = name_ref T, @Factory.%T.loc4_19.1 [symbolic = %T (constants.%T)]
- // CHECK:STDOUT: %return.param: ref @Make.1.%T (%T) = out_param runtime_param0
- // CHECK:STDOUT: %return: ref @Make.1.%T (%T) = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %assoc0.loc5_17.1: @Factory.%Factory.assoc_type (%Factory.assoc_type.ca7) = assoc_entity element0, %Make.decl [symbolic = %assoc0.loc5_17.2 (constants.%assoc0.d7a)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = %Self.1
- // CHECK:STDOUT: .T = <poisoned>
- // CHECK:STDOUT: .Make = %assoc0.loc5_17.1
- // CHECK:STDOUT: witness = (%Make.decl)
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: impl @impl: %A.ref as %Factory.type {
- // CHECK:STDOUT: %Make.decl: %Make.type.ec4 = fn_decl @Make.2 [concrete = constants.%Make.377] {
- // CHECK:STDOUT: %return.patt: %B = return_slot_pattern
- // CHECK:STDOUT: %return.param_patt: %B = out_param_pattern %return.patt, runtime_param0
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B]
- // CHECK:STDOUT: %return.param: ref %B = out_param runtime_param0
- // CHECK:STDOUT: %return: ref %B = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .B = <poisoned>
- // CHECK:STDOUT: .Make = %Make.decl
- // CHECK:STDOUT: witness = file.%impl_witness
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @A {
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
- // CHECK:STDOUT: complete_type_witness = %complete_type
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = constants.%A
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @B {
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
- // CHECK:STDOUT: complete_type_witness = %complete_type
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = constants.%B
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic fn @Make.1(@Factory.%T.loc4_19.1: type, @Factory.%Self.1: @Factory.%Factory.type (%Factory.type.c96)) {
- // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn() -> @Make.1.%T (%T);
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Make.2() -> %B;
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Factory(constants.%T) {
- // CHECK:STDOUT: %T.loc4_19.2 => constants.%T
- // CHECK:STDOUT: %T.patt.loc4_19.2 => constants.%T
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Make.1(constants.%T, constants.%Self) {
- // CHECK:STDOUT: %T => constants.%T
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Factory(%T.loc4_19.2) {}
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Factory(constants.%B) {
- // CHECK:STDOUT: %T.loc4_19.2 => constants.%B
- // CHECK:STDOUT: %T.patt.loc4_19.2 => constants.%B
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: %Factory.type => constants.%Factory.type.a5d
- // CHECK:STDOUT: %Self.2 => constants.%Self
- // CHECK:STDOUT: %Make.type => constants.%Make.type.c59
- // CHECK:STDOUT: %Make => constants.%Make.efe
- // CHECK:STDOUT: %Factory.assoc_type => constants.%Factory.assoc_type.668
- // CHECK:STDOUT: %assoc0.loc5_17.2 => constants.%assoc0.40c
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Make.1(constants.%B, constants.%Factory.facet) {
- // CHECK:STDOUT: %T => constants.%B
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- factory.impl.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %B: type = class_type @B [concrete]
- // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
- // CHECK:STDOUT: %Factory.type.1a8: type = generic_interface_type @Factory [concrete]
- // CHECK:STDOUT: %Factory.generic: %Factory.type.1a8 = struct_value () [concrete]
- // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
- // CHECK:STDOUT: %Factory.type.c96: type = facet_type <@Factory, @Factory(%T)> [symbolic]
- // CHECK:STDOUT: %Self: %Factory.type.c96 = bind_symbolic_name Self, 1 [symbolic]
- // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
- // CHECK:STDOUT: %Factory.type.a5d: type = facet_type <@Factory, @Factory(%B)> [concrete]
- // CHECK:STDOUT: %A: type = class_type @A [concrete]
- // CHECK:STDOUT: %Make.type.598: type = fn_type @Make.1, @Factory(%T) [symbolic]
- // CHECK:STDOUT: %Make.737: %Make.type.598 = struct_value () [symbolic]
- // CHECK:STDOUT: %Factory.assoc_type.ca7: type = assoc_entity_type %Factory.type.c96 [symbolic]
- // CHECK:STDOUT: %assoc0.35472f.1: %Factory.assoc_type.ca7 = assoc_entity element0, imports.%Main.import_ref.21018a.1 [symbolic]
- // CHECK:STDOUT: %Make.type.c59: type = fn_type @Make.1, @Factory(%B) [concrete]
- // CHECK:STDOUT: %Make.efe: %Make.type.c59 = struct_value () [concrete]
- // CHECK:STDOUT: %Factory.assoc_type.668: type = assoc_entity_type %Factory.type.a5d [concrete]
- // CHECK:STDOUT: %assoc0.503: %Factory.assoc_type.668 = assoc_entity element0, imports.%Main.import_ref.1aa [concrete]
- // CHECK:STDOUT: %MakeB.type: type = fn_type @MakeB [concrete]
- // CHECK:STDOUT: %MakeB: %MakeB.type = struct_value () [concrete]
- // CHECK:STDOUT: %assoc0.35472f.2: %Factory.assoc_type.ca7 = assoc_entity element0, imports.%Main.import_ref.21018a.2 [symbolic]
- // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%Main.import_ref.9ec) [concrete]
- // CHECK:STDOUT: %Factory.facet: %Factory.type.a5d = facet_value %A, %impl_witness [concrete]
- // CHECK:STDOUT: %.357: type = fn_type_with_self_type %Make.type.c59, %Factory.facet [concrete]
- // CHECK:STDOUT: %Make.type.ec4: type = fn_type @Make.2 [concrete]
- // CHECK:STDOUT: %Make.377: %Make.type.ec4 = struct_value () [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Main.Factory: %Factory.type.1a8 = import_ref Main//factory, Factory, loaded [concrete = constants.%Factory.generic]
- // CHECK:STDOUT: %Main.A: type = import_ref Main//factory, A, loaded [concrete = constants.%A]
- // CHECK:STDOUT: %Main.B: type = import_ref Main//factory, B, loaded [concrete = constants.%B]
- // CHECK:STDOUT: %Main.import_ref.72b: <witness> = import_ref Main//factory, loc11_22, loaded [concrete = constants.%impl_witness]
- // CHECK:STDOUT: %Main.import_ref.8f24d3.1: <witness> = import_ref Main//factory, loc9_10, loaded [concrete = constants.%complete_type]
- // CHECK:STDOUT: %Main.import_ref.54a = import_ref Main//factory, inst52 [no loc], unloaded
- // CHECK:STDOUT: %Main.import_ref.f6b058.1: type = import_ref Main//factory, loc4_19, loaded [symbolic = @Factory.%T (constants.%T)]
- // CHECK:STDOUT: %Main.import_ref.fbb = import_ref Main//factory, inst26 [no loc], unloaded
- // CHECK:STDOUT: %Main.import_ref.8d5: @Factory.%Factory.assoc_type (%Factory.assoc_type.ca7) = import_ref Main//factory, loc5_17, loaded [symbolic = @Factory.%assoc0 (constants.%assoc0.35472f.2)]
- // CHECK:STDOUT: %Main.Make = import_ref Main//factory, Make, unloaded
- // CHECK:STDOUT: %Main.import_ref.8f24d3.2: <witness> = import_ref Main//factory, loc8_10, loaded [concrete = constants.%complete_type]
- // CHECK:STDOUT: %Main.import_ref.da3 = import_ref Main//factory, inst47 [no loc], unloaded
- // CHECK:STDOUT: %Main.import_ref.984: type = import_ref Main//factory, loc11_6, loaded [concrete = constants.%A]
- // CHECK:STDOUT: %Main.import_ref.bd2: type = import_ref Main//factory, loc11_20, loaded [concrete = constants.%Factory.type.a5d]
- // CHECK:STDOUT: %Main.import_ref.a27 = import_ref Main//factory, loc12_17, unloaded
- // CHECK:STDOUT: %Main.import_ref.f6b058.2: type = import_ref Main//factory, loc4_19, loaded [symbolic = @Factory.%T (constants.%T)]
- // CHECK:STDOUT: %Main.import_ref.91b: @Factory.%Factory.type (%Factory.type.c96) = import_ref Main//factory, inst26 [no loc], loaded [symbolic = @Factory.%Self (constants.%Self)]
- // CHECK:STDOUT: %Main.import_ref.21018a.1 = import_ref Main//factory, loc5_17, unloaded
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .Factory = imports.%Main.Factory
- // CHECK:STDOUT: .A = imports.%Main.A
- // CHECK:STDOUT: .B = imports.%Main.B
- // CHECK:STDOUT: .MakeB = %MakeB.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %default.import.loc2_6.1 = import <none>
- // CHECK:STDOUT: %default.import.loc2_6.2 = import <none>
- // CHECK:STDOUT: %MakeB.decl: %MakeB.type = fn_decl @MakeB [concrete = constants.%MakeB] {
- // CHECK:STDOUT: %a.patt: %A = binding_pattern a
- // CHECK:STDOUT: %a.param_patt: %A = value_param_pattern %a.patt, runtime_param0
- // CHECK:STDOUT: %return.patt: %B = return_slot_pattern
- // CHECK:STDOUT: %return.param_patt: %B = out_param_pattern %return.patt, runtime_param1
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %B.ref.loc4: type = name_ref B, imports.%Main.B [concrete = constants.%B]
- // CHECK:STDOUT: %a.param: %A = value_param runtime_param0
- // CHECK:STDOUT: %A.ref: type = name_ref A, imports.%Main.A [concrete = constants.%A]
- // CHECK:STDOUT: %a: %A = bind_name a, %a.param
- // CHECK:STDOUT: %return.param: ref %B = out_param runtime_param1
- // CHECK:STDOUT: %return: ref %B = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic interface @Factory(imports.%Main.import_ref.f6b058.1: type) [from "factory.carbon"] {
- // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
- // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: %Factory.type: type = facet_type <@Factory, @Factory(%T)> [symbolic = %Factory.type (constants.%Factory.type.c96)]
- // CHECK:STDOUT: %Self: %Factory.type.c96 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self)]
- // CHECK:STDOUT: %Make.type: type = fn_type @Make.1, @Factory(%T) [symbolic = %Make.type (constants.%Make.type.598)]
- // CHECK:STDOUT: %Make: @Factory.%Make.type (%Make.type.598) = struct_value () [symbolic = %Make (constants.%Make.737)]
- // CHECK:STDOUT: %Factory.assoc_type: type = assoc_entity_type @Factory.%Factory.type (%Factory.type.c96) [symbolic = %Factory.assoc_type (constants.%Factory.assoc_type.ca7)]
- // CHECK:STDOUT: %assoc0: @Factory.%Factory.assoc_type (%Factory.assoc_type.ca7) = assoc_entity element0, imports.%Main.import_ref.21018a.1 [symbolic = %assoc0 (constants.%assoc0.35472f.1)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: interface {
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = imports.%Main.import_ref.fbb
- // CHECK:STDOUT: .Make = imports.%Main.import_ref.8d5
- // CHECK:STDOUT: witness = (imports.%Main.Make)
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: impl @impl: imports.%Main.import_ref.984 as imports.%Main.import_ref.bd2 [from "factory.carbon"] {
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Make = imports.%Main.import_ref.a27
- // CHECK:STDOUT: witness = imports.%Main.import_ref.72b
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @B [from "factory.carbon"] {
- // CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8f24d3.1
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = imports.%Main.import_ref.54a
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @A [from "factory.carbon"] {
- // CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8f24d3.2
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = imports.%Main.import_ref.da3
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic fn @Make.1(imports.%Main.import_ref.f6b058.2: type, imports.%Main.import_ref.91b: @Factory.%Factory.type (%Factory.type.c96)) [from "factory.carbon"] {
- // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn() -> @Make.1.%T (%T);
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @MakeB(%a.param_patt: %A) -> %return.param_patt: %B {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %a.ref: %A = name_ref a, %a
- // CHECK:STDOUT: %Factory.ref: %Factory.type.1a8 = name_ref Factory, imports.%Main.Factory [concrete = constants.%Factory.generic]
- // CHECK:STDOUT: %B.ref.loc5: type = name_ref B, imports.%Main.B [concrete = constants.%B]
- // CHECK:STDOUT: %Factory.type: type = facet_type <@Factory, @Factory(constants.%B)> [concrete = constants.%Factory.type.a5d]
- // CHECK:STDOUT: %.loc5: %Factory.assoc_type.668 = specific_constant imports.%Main.import_ref.8d5, @Factory(constants.%B) [concrete = constants.%assoc0.503]
- // CHECK:STDOUT: %Make.ref: %Factory.assoc_type.668 = name_ref Make, %.loc5 [concrete = constants.%assoc0.503]
- // CHECK:STDOUT: %impl.elem0: %.357 = impl_witness_access constants.%impl_witness, element0 [concrete = constants.%Make.377]
- // CHECK:STDOUT: %.loc4: ref %B = splice_block %return {}
- // CHECK:STDOUT: %Make.call: init %B = call %impl.elem0() to %.loc4
- // CHECK:STDOUT: return %Make.call to %return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Make.2() -> %B [from "factory.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Factory(constants.%T) {
- // CHECK:STDOUT: %T => constants.%T
- // CHECK:STDOUT: %T.patt => constants.%T
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Factory(constants.%B) {
- // CHECK:STDOUT: %T => constants.%B
- // CHECK:STDOUT: %T.patt => constants.%B
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: %Factory.type => constants.%Factory.type.a5d
- // CHECK:STDOUT: %Self => constants.%Self
- // CHECK:STDOUT: %Make.type => constants.%Make.type.c59
- // CHECK:STDOUT: %Make => constants.%Make.efe
- // CHECK:STDOUT: %Factory.assoc_type => constants.%Factory.assoc_type.668
- // CHECK:STDOUT: %assoc0 => constants.%assoc0.503
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Factory(%T) {}
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Make.1(constants.%T, constants.%Self) {
- // CHECK:STDOUT: %T => constants.%T
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- fail_factory.impl.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %B: type = class_type @B [concrete]
- // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
- // CHECK:STDOUT: %Factory.type.1a8: type = generic_interface_type @Factory [concrete]
- // CHECK:STDOUT: %Factory.generic: %Factory.type.1a8 = struct_value () [concrete]
- // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
- // CHECK:STDOUT: %Factory.type.c96: type = facet_type <@Factory, @Factory(%T)> [symbolic]
- // CHECK:STDOUT: %Self: %Factory.type.c96 = bind_symbolic_name Self, 1 [symbolic]
- // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
- // CHECK:STDOUT: %Factory.type.a5d: type = facet_type <@Factory, @Factory(%B)> [concrete]
- // CHECK:STDOUT: %A: type = class_type @A [concrete]
- // CHECK:STDOUT: %Make.type.598: type = fn_type @Make, @Factory(%T) [symbolic]
- // CHECK:STDOUT: %Make.737: %Make.type.598 = struct_value () [symbolic]
- // CHECK:STDOUT: %Factory.assoc_type.ca7: type = assoc_entity_type %Factory.type.c96 [symbolic]
- // CHECK:STDOUT: %assoc0.35472f.1: %Factory.assoc_type.ca7 = assoc_entity element0, imports.%Main.import_ref.21018a.1 [symbolic]
- // CHECK:STDOUT: %Make.type.c59: type = fn_type @Make, @Factory(%B) [concrete]
- // CHECK:STDOUT: %Make.efe: %Make.type.c59 = struct_value () [concrete]
- // CHECK:STDOUT: %Factory.assoc_type.668: type = assoc_entity_type %Factory.type.a5d [concrete]
- // CHECK:STDOUT: %assoc0.228: %Factory.assoc_type.668 = assoc_entity element0, imports.%Main.import_ref.21018a.2 [concrete]
- // CHECK:STDOUT: %C: type = class_type @C [concrete]
- // CHECK:STDOUT: %MakeC.type: type = fn_type @MakeC [concrete]
- // CHECK:STDOUT: %MakeC: %MakeC.type = struct_value () [concrete]
- // CHECK:STDOUT: %Factory.type.5c5: type = facet_type <@Factory, @Factory(%C)> [concrete]
- // CHECK:STDOUT: %Make.type.0de: type = fn_type @Make, @Factory(%C) [concrete]
- // CHECK:STDOUT: %Make.8ba: %Make.type.0de = struct_value () [concrete]
- // CHECK:STDOUT: %Factory.assoc_type.709: type = assoc_entity_type %Factory.type.5c5 [concrete]
- // CHECK:STDOUT: %assoc0.ef9: %Factory.assoc_type.709 = assoc_entity element0, imports.%Main.import_ref.21018a.1 [concrete]
- // CHECK:STDOUT: %assoc0.35472f.2: %Factory.assoc_type.ca7 = assoc_entity element0, imports.%Main.import_ref.21018a.3 [symbolic]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Main.Factory: %Factory.type.1a8 = import_ref Main//factory, Factory, loaded [concrete = constants.%Factory.generic]
- // CHECK:STDOUT: %Main.A: type = import_ref Main//factory, A, loaded [concrete = constants.%A]
- // CHECK:STDOUT: %Main.B = import_ref Main//factory, B, unloaded
- // CHECK:STDOUT: %Main.import_ref.3e9 = import_ref Main//factory, loc11_22, unloaded
- // CHECK:STDOUT: %Main.import_ref.8f24d3.1: <witness> = import_ref Main//factory, loc9_10, loaded [concrete = constants.%complete_type]
- // CHECK:STDOUT: %Main.import_ref.54a = import_ref Main//factory, inst52 [no loc], unloaded
- // CHECK:STDOUT: %Main.import_ref.f6b058.1: type = import_ref Main//factory, loc4_19, loaded [symbolic = @Factory.%T (constants.%T)]
- // CHECK:STDOUT: %Main.import_ref.fbb = import_ref Main//factory, inst26 [no loc], unloaded
- // CHECK:STDOUT: %Main.import_ref.8d5: @Factory.%Factory.assoc_type (%Factory.assoc_type.ca7) = import_ref Main//factory, loc5_17, loaded [symbolic = @Factory.%assoc0 (constants.%assoc0.35472f.2)]
- // CHECK:STDOUT: %Main.Make = import_ref Main//factory, Make, unloaded
- // CHECK:STDOUT: %Main.import_ref.8f24d3.2: <witness> = import_ref Main//factory, loc8_10, loaded [concrete = constants.%complete_type]
- // CHECK:STDOUT: %Main.import_ref.da3 = import_ref Main//factory, inst47 [no loc], unloaded
- // CHECK:STDOUT: %Main.import_ref.984: type = import_ref Main//factory, loc11_6, loaded [concrete = constants.%A]
- // CHECK:STDOUT: %Main.import_ref.bd2: type = import_ref Main//factory, loc11_20, loaded [concrete = constants.%Factory.type.a5d]
- // CHECK:STDOUT: %Main.import_ref.a27 = import_ref Main//factory, loc12_17, unloaded
- // CHECK:STDOUT: %Main.import_ref.f6b058.2: type = import_ref Main//factory, loc4_19, loaded [symbolic = @Factory.%T (constants.%T)]
- // CHECK:STDOUT: %Main.import_ref.91b: @Factory.%Factory.type (%Factory.type.c96) = import_ref Main//factory, inst26 [no loc], loaded [symbolic = @Factory.%Self (constants.%Self)]
- // CHECK:STDOUT: %Main.import_ref.21018a.1 = import_ref Main//factory, loc5_17, unloaded
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .Factory = imports.%Main.Factory
- // CHECK:STDOUT: .A = imports.%Main.A
- // CHECK:STDOUT: .B = imports.%Main.B
- // CHECK:STDOUT: .C = %C.decl
- // CHECK:STDOUT: .MakeC = %MakeC.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %default.import.loc2_6.1 = import <none>
- // CHECK:STDOUT: %default.import.loc2_6.2 = import <none>
- // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
- // CHECK:STDOUT: %MakeC.decl: %MakeC.type = fn_decl @MakeC [concrete = constants.%MakeC] {
- // CHECK:STDOUT: %a.patt: %A = binding_pattern a
- // CHECK:STDOUT: %a.param_patt: %A = value_param_pattern %a.patt, runtime_param0
- // CHECK:STDOUT: %return.patt: %C = return_slot_pattern
- // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param1
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %C.ref.loc6: type = name_ref C, file.%C.decl [concrete = constants.%C]
- // CHECK:STDOUT: %a.param: %A = value_param runtime_param0
- // CHECK:STDOUT: %A.ref: type = name_ref A, imports.%Main.A [concrete = constants.%A]
- // CHECK:STDOUT: %a: %A = bind_name a, %a.param
- // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param1
- // CHECK:STDOUT: %return: ref %C = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic interface @Factory(imports.%Main.import_ref.f6b058.1: type) [from "factory.carbon"] {
- // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
- // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: %Factory.type: type = facet_type <@Factory, @Factory(%T)> [symbolic = %Factory.type (constants.%Factory.type.c96)]
- // CHECK:STDOUT: %Self: %Factory.type.c96 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self)]
- // CHECK:STDOUT: %Make.type: type = fn_type @Make, @Factory(%T) [symbolic = %Make.type (constants.%Make.type.598)]
- // CHECK:STDOUT: %Make: @Factory.%Make.type (%Make.type.598) = struct_value () [symbolic = %Make (constants.%Make.737)]
- // CHECK:STDOUT: %Factory.assoc_type: type = assoc_entity_type @Factory.%Factory.type (%Factory.type.c96) [symbolic = %Factory.assoc_type (constants.%Factory.assoc_type.ca7)]
- // CHECK:STDOUT: %assoc0: @Factory.%Factory.assoc_type (%Factory.assoc_type.ca7) = assoc_entity element0, imports.%Main.import_ref.21018a.1 [symbolic = %assoc0 (constants.%assoc0.35472f.1)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: interface {
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = imports.%Main.import_ref.fbb
- // CHECK:STDOUT: .Make = imports.%Main.import_ref.8d5
- // CHECK:STDOUT: witness = (imports.%Main.Make)
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: impl @impl: imports.%Main.import_ref.984 as imports.%Main.import_ref.bd2 [from "factory.carbon"] {
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Make = imports.%Main.import_ref.a27
- // CHECK:STDOUT: witness = imports.%Main.import_ref.3e9
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @B [from "factory.carbon"] {
- // CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8f24d3.1
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = imports.%Main.import_ref.54a
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @A [from "factory.carbon"] {
- // CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8f24d3.2
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = imports.%Main.import_ref.da3
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @C {
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
- // CHECK:STDOUT: complete_type_witness = %complete_type
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = constants.%C
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic fn @Make(imports.%Main.import_ref.f6b058.2: type, imports.%Main.import_ref.91b: @Factory.%Factory.type (%Factory.type.c96)) [from "factory.carbon"] {
- // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn() -> @Make.%T (%T);
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @MakeC(%a.param_patt: %A) -> %return.param_patt: %C {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %a.ref: %A = name_ref a, %a
- // CHECK:STDOUT: %Factory.ref: %Factory.type.1a8 = name_ref Factory, imports.%Main.Factory [concrete = constants.%Factory.generic]
- // CHECK:STDOUT: %C.ref.loc11: type = name_ref C, file.%C.decl [concrete = constants.%C]
- // CHECK:STDOUT: %Factory.type: type = facet_type <@Factory, @Factory(constants.%C)> [concrete = constants.%Factory.type.5c5]
- // CHECK:STDOUT: %.loc11: %Factory.assoc_type.709 = specific_constant imports.%Main.import_ref.8d5, @Factory(constants.%C) [concrete = constants.%assoc0.ef9]
- // CHECK:STDOUT: %Make.ref: %Factory.assoc_type.709 = name_ref Make, %.loc11 [concrete = constants.%assoc0.ef9]
- // CHECK:STDOUT: return <error> to %return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Factory(constants.%T) {
- // CHECK:STDOUT: %T => constants.%T
- // CHECK:STDOUT: %T.patt => constants.%T
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Factory(constants.%B) {
- // CHECK:STDOUT: %T => constants.%B
- // CHECK:STDOUT: %T.patt => constants.%B
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: %Factory.type => constants.%Factory.type.a5d
- // CHECK:STDOUT: %Self => constants.%Self
- // CHECK:STDOUT: %Make.type => constants.%Make.type.c59
- // CHECK:STDOUT: %Make => constants.%Make.efe
- // CHECK:STDOUT: %Factory.assoc_type => constants.%Factory.assoc_type.668
- // CHECK:STDOUT: %assoc0 => constants.%assoc0.228
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Factory(%T) {}
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Make(constants.%T, constants.%Self) {
- // CHECK:STDOUT: %T => constants.%T
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Factory(constants.%C) {
- // CHECK:STDOUT: %T => constants.%C
- // CHECK:STDOUT: %T.patt => constants.%C
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: %Factory.type => constants.%Factory.type.5c5
- // CHECK:STDOUT: %Self => constants.%Self
- // CHECK:STDOUT: %Make.type => constants.%Make.type.0de
- // CHECK:STDOUT: %Make => constants.%Make.8ba
- // CHECK:STDOUT: %Factory.assoc_type => constants.%Factory.assoc_type.709
- // CHECK:STDOUT: %assoc0 => constants.%assoc0.ef9
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
|