diff --git a/toolchain/check/call.cpp b/toolchain/check/call.cpp index a7299af67f1c..64b7efb899ea 100644 --- a/toolchain/check/call.cpp +++ b/toolchain/check/call.cpp @@ -167,36 +167,50 @@ auto PerformCall(Context& context, SemIR::LocId loc_id, SemIR::InstId callee_id, } if (callee_specific_id->has_value()) { - auto inner_callee_id = callee_id; - if (auto bound_method = - context.insts().TryGetAs(callee_id)) { - inner_callee_id = GetOrAddInst( - context, context.insts().GetLocId(bound_method->function_decl_id), + auto generic_callee_id = callee_id; + + // Strip off a bound_method so that we can form a constant specific callee. + auto bound_method = context.insts().TryGetAs(callee_id); + if (bound_method) { + generic_callee_id = bound_method->function_decl_id; + } + + // Form a specific callee. + if (callee_function.self_type_id.has_value()) { + // This is an associated function in an interface; the callee is the + // specific function in the impl that corresponds to the specific function + // we deduced. + callee_id = GetOrAddInst( + context, context.insts().GetLocId(generic_callee_id), + SemIR::SpecificImplFunction{ + .type_id = GetSingletonType( + context, SemIR::SpecificFunctionType::SingletonInstId), + .callee_id = generic_callee_id, + .specific_id = *callee_specific_id}); + // TODO: Add to `definitions_required` when evaluating the + // `SpecificImplFunction`. + } else { + // This is a regular generic function. The callee is the specific function + // we deduced. + callee_id = GetOrAddInst( + context, context.insts().GetLocId(generic_callee_id), SemIR::SpecificFunction{ .type_id = GetSingletonType( context, SemIR::SpecificFunctionType::SingletonInstId), - .callee_id = bound_method->function_decl_id, + .callee_id = generic_callee_id, .specific_id = *callee_specific_id}); + // TODO: The specific function could be a symbolic constant. Delay doing + // this until we form a concrete `SpecificFunction` constant. + context.definitions_required().push_back(callee_id); + } + + // Add the `self` argument back if there was one. + if (bound_method) { callee_id = GetOrAddInst( context, loc_id, {.type_id = bound_method->type_id, .object_id = bound_method->object_id, - .function_decl_id = inner_callee_id}); - } else { - callee_id = GetOrAddInst( - context, context.insts().GetLocId(callee_id), - SemIR::SpecificFunction{ - .type_id = GetSingletonType( - context, SemIR::SpecificFunctionType::SingletonInstId), - .callee_id = callee_id, - .specific_id = *callee_specific_id}); - inner_callee_id = callee_id; - } - if (callee_function.self_type_id.has_value()) { - // This is an associated function, and will be required to be defined as - // part of checking that the impl is complete. - } else { - context.definitions_required().push_back(inner_callee_id); + .function_decl_id = callee_id}); } } diff --git a/toolchain/check/eval_inst.cpp b/toolchain/check/eval_inst.cpp index f42c97327e36..f9a67525ed49 100644 --- a/toolchain/check/eval_inst.cpp +++ b/toolchain/check/eval_inst.cpp @@ -5,6 +5,7 @@ #include "toolchain/check/eval_inst.h" #include "toolchain/check/facet_type.h" +#include "toolchain/check/generic.h" #include "toolchain/check/import_ref.h" #include "toolchain/check/type.h" #include "toolchain/check/type_completion.h" @@ -299,6 +300,61 @@ auto EvalConstantInst(Context& context, SemIRLoc /*loc*/, context.sem_ir(), inst.specific_id, inst.inst_id)); } +auto EvalConstantInst(Context& context, SemIRLoc loc, + SemIR::SpecificImplFunction inst) -> ConstantEvalResult { + auto callee_inst = context.insts().Get(inst.callee_id); + // If the callee is not a function value, we're not ready to evaluate this + // yet. Build a symbolic `SpecificImplFunction` constant. + if (!callee_inst.Is()) { + return ConstantEvalResult::NewSamePhase(inst); + } + auto callee_type_id = callee_inst.type_id(); + auto callee_fn_type = + context.types().TryGetAs(callee_type_id); + if (!callee_fn_type) { + return ConstantEvalResult::NewSamePhase(inst); + } + + // If the callee function found in the impl witness is not generic, the result + // is simply that function. + // TODO: We could do this even before the callee is concrete. + auto generic_id = + context.functions().Get(callee_fn_type->function_id).generic_id; + if (!generic_id.has_value()) { + return ConstantEvalResult::Existing( + context.constant_values().Get(inst.callee_id)); + } + + // Find the arguments to use. + auto enclosing_specific_id = callee_fn_type->specific_id; + auto enclosing_args = context.inst_blocks().Get( + context.specifics().GetArgsOrEmpty(enclosing_specific_id)); + auto interface_fn_args = context.inst_blocks().Get( + context.specifics().GetArgsOrEmpty(inst.specific_id)); + + // Form new specific for the generic callee function. The arguments for this + // specific are the enclosing arguments of the callee followed by the + // remaining arguments from the interface function. Impl checking has ensured + // that these arguments can also be used for the function in the impl witness. + auto num_params = context.inst_blocks() + .Get(context.generics().Get(generic_id).bindings_id) + .size(); + llvm::SmallVector args; + args.reserve(num_params); + args.append(enclosing_args.begin(), enclosing_args.end()); + int remaining_params = num_params - args.size(); + CARBON_CHECK(static_cast(interface_fn_args.size()) >= remaining_params); + args.append(interface_fn_args.end() - remaining_params, + interface_fn_args.end()); + auto specific_id = MakeSpecific(context, loc, generic_id, args); + + // TODO: Add the new `SpecificFunction` to definitions_required. + return ConstantEvalResult::NewSamePhase( + SemIR::SpecificFunction{.type_id = inst.type_id, + .callee_id = inst.callee_id, + .specific_id = specific_id}); +} + auto EvalConstantInst(Context& context, SemIRLoc /*loc*/, SemIR::SpliceBlock inst) -> ConstantEvalResult { // SpliceBlock evaluates to the result value that is (typically) within the diff --git a/toolchain/check/testdata/facet/min_prelude/call_combined_impl_witness.carbon b/toolchain/check/testdata/facet/min_prelude/call_combined_impl_witness.carbon index 5104fec85b6b..55984fbad1c3 100644 --- a/toolchain/check/testdata/facet/min_prelude/call_combined_impl_witness.carbon +++ b/toolchain/check/testdata/facet/min_prelude/call_combined_impl_witness.carbon @@ -110,21 +110,19 @@ fn F() { // CHECK:STDOUT: %A.facet.5b4: %A.type = facet_value %T.as_type, (%T.as_wit.iface1) [symbolic] // CHECK:STDOUT: %.860: type = fn_type_with_self_type %AA.type.b97, %A.facet.5b4 [symbolic] // CHECK:STDOUT: %impl.elem0.656: %.860 = impl_witness_access %T.as_wit.iface1, element0 [symbolic] -// CHECK:STDOUT: %specific_fn.74e: = specific_function %impl.elem0.656, @AA.1(%A.facet.5b4) [symbolic] +// CHECK:STDOUT: %specific_impl_fn.d89: = specific_impl_function %impl.elem0.656, @AA.1(%A.facet.5b4) [symbolic] // CHECK:STDOUT: %T.as_wit.iface2: = facet_access_witness %T.2df, element2 [symbolic] // CHECK:STDOUT: %B.facet.abf: %B.type = facet_value %T.as_type, (%T.as_wit.iface2) [symbolic] // CHECK:STDOUT: %.a5b: type = fn_type_with_self_type %BB.type.64d, %B.facet.abf [symbolic] // CHECK:STDOUT: %impl.elem0.097: %.a5b = impl_witness_access %T.as_wit.iface2, element0 [symbolic] -// CHECK:STDOUT: %specific_fn.9fa: = specific_function %impl.elem0.097, @BB.1(%B.facet.abf) [symbolic] +// CHECK:STDOUT: %specific_impl_fn.94f: = specific_impl_function %impl.elem0.097, @BB.1(%B.facet.abf) [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %C.val: %C = struct_value () [concrete] // CHECK:STDOUT: %facet_value: %facet_type.242 = facet_value %C, (%impl_witness.1bc, %impl_witness.97a, %impl_witness.fe4) [concrete] // CHECK:STDOUT: %G.specific_fn: = specific_function %G, @G(%facet_value) [concrete] // CHECK:STDOUT: %.4b2: type = fn_type_with_self_type %AA.type.b97, %A.facet.213 [concrete] -// CHECK:STDOUT: %AA.specific_fn: = specific_function %AA.95d, @AA.1(%A.facet.213) [concrete] // CHECK:STDOUT: %.2b4: type = fn_type_with_self_type %BB.type.64d, %B.facet.f74 [concrete] -// CHECK:STDOUT: %BB.specific_fn: = specific_function %BB.fe8, @BB.1(%B.facet.f74) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -340,12 +338,12 @@ fn F() { // CHECK:STDOUT: %A.facet.loc33: %A.type = facet_value %T.as_type.loc32_28.2, (%T.as_wit.iface1.loc33_4.2) [symbolic = %A.facet.loc33 (constants.%A.facet.5b4)] // CHECK:STDOUT: %.loc33_4.2: type = fn_type_with_self_type constants.%AA.type.b97, %A.facet.loc33 [symbolic = %.loc33_4.2 (constants.%.860)] // CHECK:STDOUT: %impl.elem0.loc33_4.2: @G.%.loc33_4.2 (%.860) = impl_witness_access %T.as_wit.iface1.loc33_4.2, element0 [symbolic = %impl.elem0.loc33_4.2 (constants.%impl.elem0.656)] -// CHECK:STDOUT: %specific_fn.loc33_4.2: = specific_function %impl.elem0.loc33_4.2, @AA.1(%A.facet.loc33) [symbolic = %specific_fn.loc33_4.2 (constants.%specific_fn.74e)] +// CHECK:STDOUT: %specific_impl_fn.loc33_4.2: = specific_impl_function %impl.elem0.loc33_4.2, @AA.1(%A.facet.loc33) [symbolic = %specific_impl_fn.loc33_4.2 (constants.%specific_impl_fn.d89)] // CHECK:STDOUT: %T.as_wit.iface2.loc34_4.2: = facet_access_witness %T.loc32_6.2, element2 [symbolic = %T.as_wit.iface2.loc34_4.2 (constants.%T.as_wit.iface2)] // CHECK:STDOUT: %B.facet.loc34: %B.type = facet_value %T.as_type.loc32_28.2, (%T.as_wit.iface2.loc34_4.2) [symbolic = %B.facet.loc34 (constants.%B.facet.abf)] // CHECK:STDOUT: %.loc34_4.2: type = fn_type_with_self_type constants.%BB.type.64d, %B.facet.loc34 [symbolic = %.loc34_4.2 (constants.%.a5b)] // CHECK:STDOUT: %impl.elem0.loc34_4.2: @G.%.loc34_4.2 (%.a5b) = impl_witness_access %T.as_wit.iface2.loc34_4.2, element0 [symbolic = %impl.elem0.loc34_4.2 (constants.%impl.elem0.097)] -// CHECK:STDOUT: %specific_fn.loc34_4.2: = specific_function %impl.elem0.loc34_4.2, @BB.1(%B.facet.loc34) [symbolic = %specific_fn.loc34_4.2 (constants.%specific_fn.9fa)] +// CHECK:STDOUT: %specific_impl_fn.loc34_4.2: = specific_impl_function %impl.elem0.loc34_4.2, @BB.1(%B.facet.loc34) [symbolic = %specific_impl_fn.loc34_4.2 (constants.%specific_impl_fn.94f)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.patt.loc32_6.1: %facet_type.242](%t.param_patt: @G.%T.as_type.loc32_28.2 (%T.as_type)) { // CHECK:STDOUT: !entry: @@ -355,54 +353,54 @@ fn F() { // CHECK:STDOUT: %.loc33_4.1: type = converted constants.%T.2df, %T.as_type.loc33 [symbolic = %T.as_type.loc32_28.2 (constants.%T.as_type)] // CHECK:STDOUT: %T.as_wit.iface1.loc33_4.1: = facet_access_witness constants.%T.2df, element1 [symbolic = %T.as_wit.iface1.loc33_4.2 (constants.%T.as_wit.iface1)] // CHECK:STDOUT: %impl.elem0.loc33_4.1: @G.%.loc33_4.2 (%.860) = impl_witness_access %T.as_wit.iface1.loc33_4.1, element0 [symbolic = %impl.elem0.loc33_4.2 (constants.%impl.elem0.656)] -// CHECK:STDOUT: %specific_fn.loc33_4.1: = specific_function %impl.elem0.loc33_4.1, @AA.1(constants.%A.facet.5b4) [symbolic = %specific_fn.loc33_4.2 (constants.%specific_fn.74e)] -// CHECK:STDOUT: %AA.call.loc33: init %empty_tuple.type = call %specific_fn.loc33_4.1() +// CHECK:STDOUT: %specific_impl_fn.loc33_4.1: = specific_impl_function %impl.elem0.loc33_4.1, @AA.1(constants.%A.facet.5b4) [symbolic = %specific_impl_fn.loc33_4.2 (constants.%specific_impl_fn.d89)] +// CHECK:STDOUT: %.loc33_8: init %empty_tuple.type = call %specific_impl_fn.loc33_4.1() // CHECK:STDOUT: %t.ref.loc34: @G.%T.as_type.loc32_28.2 (%T.as_type) = name_ref t, %t // CHECK:STDOUT: %BB.ref.loc34: %B.assoc_type = name_ref BB, @B.%assoc0 [concrete = constants.%assoc0.019] // CHECK:STDOUT: %T.as_type.loc34: type = facet_access_type constants.%T.2df [symbolic = %T.as_type.loc32_28.2 (constants.%T.as_type)] // CHECK:STDOUT: %.loc34_4.1: type = converted constants.%T.2df, %T.as_type.loc34 [symbolic = %T.as_type.loc32_28.2 (constants.%T.as_type)] // CHECK:STDOUT: %T.as_wit.iface2.loc34_4.1: = facet_access_witness constants.%T.2df, element2 [symbolic = %T.as_wit.iface2.loc34_4.2 (constants.%T.as_wit.iface2)] // CHECK:STDOUT: %impl.elem0.loc34_4.1: @G.%.loc34_4.2 (%.a5b) = impl_witness_access %T.as_wit.iface2.loc34_4.1, element0 [symbolic = %impl.elem0.loc34_4.2 (constants.%impl.elem0.097)] -// CHECK:STDOUT: %specific_fn.loc34_4.1: = specific_function %impl.elem0.loc34_4.1, @BB.1(constants.%B.facet.abf) [symbolic = %specific_fn.loc34_4.2 (constants.%specific_fn.9fa)] -// CHECK:STDOUT: %BB.call.loc34: init %empty_tuple.type = call %specific_fn.loc34_4.1() +// CHECK:STDOUT: %specific_impl_fn.loc34_4.1: = specific_impl_function %impl.elem0.loc34_4.1, @BB.1(constants.%B.facet.abf) [symbolic = %specific_impl_fn.loc34_4.2 (constants.%specific_impl_fn.94f)] +// CHECK:STDOUT: %.loc34_8: init %empty_tuple.type = call %specific_impl_fn.loc34_4.1() // CHECK:STDOUT: %T.ref.loc36: %facet_type.242 = name_ref T, %T.loc32_6.1 [symbolic = %T.loc32_6.2 (constants.%T.2df)] // CHECK:STDOUT: %AA.ref.loc36: %A.assoc_type = name_ref AA, @A.%assoc0 [concrete = constants.%assoc0.f33] // CHECK:STDOUT: %T.as_type.loc36: type = facet_access_type %T.ref.loc36 [symbolic = %T.as_type.loc32_28.2 (constants.%T.as_type)] -// CHECK:STDOUT: %.loc36: type = converted %T.ref.loc36, %T.as_type.loc36 [symbolic = %T.as_type.loc32_28.2 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc36_4: type = converted %T.ref.loc36, %T.as_type.loc36 [symbolic = %T.as_type.loc32_28.2 (constants.%T.as_type)] // CHECK:STDOUT: %T.as_wit.iface1.loc36: = facet_access_witness %T.ref.loc36, element1 [symbolic = %T.as_wit.iface1.loc33_4.2 (constants.%T.as_wit.iface1)] // CHECK:STDOUT: %impl.elem0.loc36: @G.%.loc33_4.2 (%.860) = impl_witness_access %T.as_wit.iface1.loc36, element0 [symbolic = %impl.elem0.loc33_4.2 (constants.%impl.elem0.656)] -// CHECK:STDOUT: %specific_fn.loc36: = specific_function %impl.elem0.loc36, @AA.1(constants.%A.facet.5b4) [symbolic = %specific_fn.loc33_4.2 (constants.%specific_fn.74e)] -// CHECK:STDOUT: %AA.call.loc36: init %empty_tuple.type = call %specific_fn.loc36() +// CHECK:STDOUT: %specific_impl_fn.loc36: = specific_impl_function %impl.elem0.loc36, @AA.1(constants.%A.facet.5b4) [symbolic = %specific_impl_fn.loc33_4.2 (constants.%specific_impl_fn.d89)] +// CHECK:STDOUT: %.loc36_8: init %empty_tuple.type = call %specific_impl_fn.loc36() // CHECK:STDOUT: %T.ref.loc37: %facet_type.242 = name_ref T, %T.loc32_6.1 [symbolic = %T.loc32_6.2 (constants.%T.2df)] // CHECK:STDOUT: %BB.ref.loc37: %B.assoc_type = name_ref BB, @B.%assoc0 [concrete = constants.%assoc0.019] // CHECK:STDOUT: %T.as_type.loc37: type = facet_access_type %T.ref.loc37 [symbolic = %T.as_type.loc32_28.2 (constants.%T.as_type)] -// CHECK:STDOUT: %.loc37: type = converted %T.ref.loc37, %T.as_type.loc37 [symbolic = %T.as_type.loc32_28.2 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc37_4: type = converted %T.ref.loc37, %T.as_type.loc37 [symbolic = %T.as_type.loc32_28.2 (constants.%T.as_type)] // CHECK:STDOUT: %T.as_wit.iface2.loc37: = facet_access_witness %T.ref.loc37, element2 [symbolic = %T.as_wit.iface2.loc34_4.2 (constants.%T.as_wit.iface2)] // CHECK:STDOUT: %impl.elem0.loc37: @G.%.loc34_4.2 (%.a5b) = impl_witness_access %T.as_wit.iface2.loc37, element0 [symbolic = %impl.elem0.loc34_4.2 (constants.%impl.elem0.097)] -// CHECK:STDOUT: %specific_fn.loc37: = specific_function %impl.elem0.loc37, @BB.1(constants.%B.facet.abf) [symbolic = %specific_fn.loc34_4.2 (constants.%specific_fn.9fa)] -// CHECK:STDOUT: %BB.call.loc37: init %empty_tuple.type = call %specific_fn.loc37() +// CHECK:STDOUT: %specific_impl_fn.loc37: = specific_impl_function %impl.elem0.loc37, @BB.1(constants.%B.facet.abf) [symbolic = %specific_impl_fn.loc34_4.2 (constants.%specific_impl_fn.94f)] +// CHECK:STDOUT: %.loc37_8: init %empty_tuple.type = call %specific_impl_fn.loc37() // CHECK:STDOUT: %T.ref.loc39: %facet_type.242 = name_ref T, %T.loc32_6.1 [symbolic = %T.loc32_6.2 (constants.%T.2df)] // CHECK:STDOUT: %A.ref.loc39: type = name_ref A, file.%A.decl [concrete = constants.%A.type] // CHECK:STDOUT: %AA.ref.loc39: %A.assoc_type = name_ref AA, @A.%assoc0 [concrete = constants.%assoc0.f33] // CHECK:STDOUT: %T.as_wit.iface1.loc39: = facet_access_witness constants.%T.2df, element1 [symbolic = %T.as_wit.iface1.loc33_4.2 (constants.%T.as_wit.iface1)] // CHECK:STDOUT: %T.as_type.loc39: type = facet_access_type constants.%T.2df [symbolic = %T.as_type.loc32_28.2 (constants.%T.as_type)] // CHECK:STDOUT: %A.facet.loc39: %A.type = facet_value %T.as_type.loc39, (%T.as_wit.iface1.loc39) [symbolic = %A.facet.loc33 (constants.%A.facet.5b4)] -// CHECK:STDOUT: %.loc39: %A.type = converted %T.ref.loc39, %A.facet.loc39 [symbolic = %A.facet.loc33 (constants.%A.facet.5b4)] -// CHECK:STDOUT: %as_wit.iface0.loc39: = facet_access_witness %.loc39, element0 [symbolic = %T.as_wit.iface1.loc33_4.2 (constants.%T.as_wit.iface1)] +// CHECK:STDOUT: %.loc39_4: %A.type = converted %T.ref.loc39, %A.facet.loc39 [symbolic = %A.facet.loc33 (constants.%A.facet.5b4)] +// CHECK:STDOUT: %as_wit.iface0.loc39: = facet_access_witness %.loc39_4, element0 [symbolic = %T.as_wit.iface1.loc33_4.2 (constants.%T.as_wit.iface1)] // CHECK:STDOUT: %impl.elem0.loc39: @G.%.loc33_4.2 (%.860) = impl_witness_access %as_wit.iface0.loc39, element0 [symbolic = %impl.elem0.loc33_4.2 (constants.%impl.elem0.656)] -// CHECK:STDOUT: %specific_fn.loc39: = specific_function %impl.elem0.loc39, @AA.1(constants.%A.facet.5b4) [symbolic = %specific_fn.loc33_4.2 (constants.%specific_fn.74e)] -// CHECK:STDOUT: %AA.call.loc39: init %empty_tuple.type = call %specific_fn.loc39() +// CHECK:STDOUT: %specific_impl_fn.loc39: = specific_impl_function %impl.elem0.loc39, @AA.1(constants.%A.facet.5b4) [symbolic = %specific_impl_fn.loc33_4.2 (constants.%specific_impl_fn.d89)] +// CHECK:STDOUT: %.loc39_12: init %empty_tuple.type = call %specific_impl_fn.loc39() // CHECK:STDOUT: %T.ref.loc40: %facet_type.242 = name_ref T, %T.loc32_6.1 [symbolic = %T.loc32_6.2 (constants.%T.2df)] // CHECK:STDOUT: %B.ref.loc40: type = name_ref B, file.%B.decl [concrete = constants.%B.type] // CHECK:STDOUT: %BB.ref.loc40: %B.assoc_type = name_ref BB, @B.%assoc0 [concrete = constants.%assoc0.019] // CHECK:STDOUT: %T.as_wit.iface2.loc40: = facet_access_witness constants.%T.2df, element2 [symbolic = %T.as_wit.iface2.loc34_4.2 (constants.%T.as_wit.iface2)] // CHECK:STDOUT: %T.as_type.loc40: type = facet_access_type constants.%T.2df [symbolic = %T.as_type.loc32_28.2 (constants.%T.as_type)] // CHECK:STDOUT: %B.facet.loc40: %B.type = facet_value %T.as_type.loc40, (%T.as_wit.iface2.loc40) [symbolic = %B.facet.loc34 (constants.%B.facet.abf)] -// CHECK:STDOUT: %.loc40: %B.type = converted %T.ref.loc40, %B.facet.loc40 [symbolic = %B.facet.loc34 (constants.%B.facet.abf)] -// CHECK:STDOUT: %as_wit.iface0.loc40: = facet_access_witness %.loc40, element0 [symbolic = %T.as_wit.iface2.loc34_4.2 (constants.%T.as_wit.iface2)] +// CHECK:STDOUT: %.loc40_4: %B.type = converted %T.ref.loc40, %B.facet.loc40 [symbolic = %B.facet.loc34 (constants.%B.facet.abf)] +// CHECK:STDOUT: %as_wit.iface0.loc40: = facet_access_witness %.loc40_4, element0 [symbolic = %T.as_wit.iface2.loc34_4.2 (constants.%T.as_wit.iface2)] // CHECK:STDOUT: %impl.elem0.loc40: @G.%.loc34_4.2 (%.a5b) = impl_witness_access %as_wit.iface0.loc40, element0 [symbolic = %impl.elem0.loc34_4.2 (constants.%impl.elem0.097)] -// CHECK:STDOUT: %specific_fn.loc40: = specific_function %impl.elem0.loc40, @BB.1(constants.%B.facet.abf) [symbolic = %specific_fn.loc34_4.2 (constants.%specific_fn.9fa)] -// CHECK:STDOUT: %BB.call.loc40: init %empty_tuple.type = call %specific_fn.loc40() +// CHECK:STDOUT: %specific_impl_fn.loc40: = specific_impl_function %impl.elem0.loc40, @BB.1(constants.%B.facet.abf) [symbolic = %specific_impl_fn.loc34_4.2 (constants.%specific_impl_fn.94f)] +// CHECK:STDOUT: %.loc40_12: init %empty_tuple.type = call %specific_impl_fn.loc40() // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -493,12 +491,12 @@ fn F() { // CHECK:STDOUT: %A.facet.loc33 => constants.%A.facet.213 // CHECK:STDOUT: %.loc33_4.2 => constants.%.4b2 // CHECK:STDOUT: %impl.elem0.loc33_4.2 => constants.%AA.95d -// CHECK:STDOUT: %specific_fn.loc33_4.2 => constants.%AA.specific_fn +// CHECK:STDOUT: %specific_impl_fn.loc33_4.2 => constants.%AA.95d // CHECK:STDOUT: %T.as_wit.iface2.loc34_4.2 => constants.%impl_witness.fe4 // CHECK:STDOUT: %B.facet.loc34 => constants.%B.facet.f74 // CHECK:STDOUT: %.loc34_4.2 => constants.%.2b4 // CHECK:STDOUT: %impl.elem0.loc34_4.2 => constants.%BB.fe8 -// CHECK:STDOUT: %specific_fn.loc34_4.2 => constants.%BB.specific_fn +// CHECK:STDOUT: %specific_impl_fn.loc34_4.2 => constants.%BB.fe8 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- toolchain/testing/min_prelude/facet_types.carbon diff --git a/toolchain/check/testdata/facet/min_prelude/convert_class_value_to_generic_facet_value_value.carbon b/toolchain/check/testdata/facet/min_prelude/convert_class_value_to_generic_facet_value_value.carbon index 07b34bc3d9d5..fbe0683948ac 100644 --- a/toolchain/check/testdata/facet/min_prelude/convert_class_value_to_generic_facet_value_value.carbon +++ b/toolchain/check/testdata/facet/min_prelude/convert_class_value_to_generic_facet_value_value.carbon @@ -145,7 +145,7 @@ fn B() { // CHECK:STDOUT: %Generic.facet.0aa: %Generic.type.91ccba.2 = facet_value %U.as_type, (%U.as_wit.iface0) [symbolic] // CHECK:STDOUT: %.10b: type = fn_type_with_self_type %F.type.f439a9.2, %Generic.facet.0aa [symbolic] // CHECK:STDOUT: %impl.elem0: %.10b = impl_witness_access %U.as_wit.iface0, element0 [symbolic] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @F.1(%T, %Generic.facet.0aa) [symbolic] +// CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem0, @F.1(%T, %Generic.facet.0aa) [symbolic] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] // CHECK:STDOUT: %ImplsGeneric.val: %ImplsGeneric = struct_value () [concrete] @@ -153,7 +153,6 @@ fn B() { // CHECK:STDOUT: %CallGenericMethod.specific_fn: = specific_function %CallGenericMethod, @CallGenericMethod(%GenericParam, %Generic.facet.8bd) [concrete] // CHECK:STDOUT: %complete_type.997: = complete_type_witness %Generic.type.769 [concrete] // CHECK:STDOUT: %.1eb: type = fn_type_with_self_type %F.type.4cf, %Generic.facet.8bd [concrete] -// CHECK:STDOUT: %F.specific_fn: = specific_function %F.a56, @F.1(%GenericParam, %Generic.facet.8bd) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -291,7 +290,7 @@ fn B() { // CHECK:STDOUT: %Generic.facet: @CallGenericMethod.%Generic.type.loc15_45.2 (%Generic.type.91ccba.2) = facet_value %U.as_type.loc15_51.2, (%U.as_wit.iface0.loc16_4.2) [symbolic = %Generic.facet (constants.%Generic.facet.0aa)] // CHECK:STDOUT: %.loc16_4.3: type = fn_type_with_self_type %F.type, %Generic.facet [symbolic = %.loc16_4.3 (constants.%.10b)] // CHECK:STDOUT: %impl.elem0.loc16_4.2: @CallGenericMethod.%.loc16_4.3 (%.10b) = impl_witness_access %U.as_wit.iface0.loc16_4.2, element0 [symbolic = %impl.elem0.loc16_4.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %specific_fn.loc16_4.2: = specific_function %impl.elem0.loc16_4.2, @F.1(%T.loc15_22.2, %Generic.facet) [symbolic = %specific_fn.loc16_4.2 (constants.%specific_fn)] +// CHECK:STDOUT: %specific_impl_fn.loc16_4.2: = specific_impl_function %impl.elem0.loc16_4.2, @F.1(%T.loc15_22.2, %Generic.facet) [symbolic = %specific_impl_fn.loc16_4.2 (constants.%specific_impl_fn)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.patt.loc15_22.1: type, %U.patt.loc15_32.1: @CallGenericMethod.%Generic.type.loc15_45.2 (%Generic.type.91ccba.2)](%a.param_patt: @CallGenericMethod.%U.as_type.loc15_51.2 (%U.as_type), %s.param_patt: @CallGenericMethod.%T.loc15_22.2 (%T)) { // CHECK:STDOUT: !entry: @@ -302,8 +301,8 @@ fn B() { // CHECK:STDOUT: %.loc16_4.2: type = converted %U.ref.loc16, %U.as_type.loc16 [symbolic = %U.as_type.loc15_51.2 (constants.%U.as_type)] // CHECK:STDOUT: %U.as_wit.iface0.loc16_4.1: = facet_access_witness %U.ref.loc16, element0 [symbolic = %U.as_wit.iface0.loc16_4.2 (constants.%U.as_wit.iface0)] // CHECK:STDOUT: %impl.elem0.loc16_4.1: @CallGenericMethod.%.loc16_4.3 (%.10b) = impl_witness_access %U.as_wit.iface0.loc16_4.1, element0 [symbolic = %impl.elem0.loc16_4.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %specific_fn.loc16_4.1: = specific_function %impl.elem0.loc16_4.1, @F.1(constants.%T, constants.%Generic.facet.0aa) [symbolic = %specific_fn.loc16_4.2 (constants.%specific_fn)] -// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %specific_fn.loc16_4.1() +// CHECK:STDOUT: %specific_impl_fn.loc16_4.1: = specific_impl_function %impl.elem0.loc16_4.1, @F.1(constants.%T, constants.%Generic.facet.0aa) [symbolic = %specific_impl_fn.loc16_4.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %.loc16_7: init %empty_tuple.type = call %specific_impl_fn.loc16_4.1() // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -403,7 +402,7 @@ fn B() { // CHECK:STDOUT: %Generic.facet => constants.%Generic.facet.8bd // CHECK:STDOUT: %.loc16_4.3 => constants.%.1eb // CHECK:STDOUT: %impl.elem0.loc16_4.2 => constants.%F.a56 -// CHECK:STDOUT: %specific_fn.loc16_4.2 => constants.%F.specific_fn +// CHECK:STDOUT: %specific_impl_fn.loc16_4.2 => constants.%F.a56 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- multiple_generic_params_one_fixed_one_deduced.carbon diff --git a/toolchain/check/testdata/facet/no_prelude/access.carbon b/toolchain/check/testdata/facet/no_prelude/access.carbon index b61721231c1a..0c00883fe0f6 100644 --- a/toolchain/check/testdata/facet/no_prelude/access.carbon +++ b/toolchain/check/testdata/facet/no_prelude/access.carbon @@ -101,7 +101,7 @@ var v: ().(Id(I.T)); // CHECK:STDOUT: %I.facet: %I.type = facet_value %T.as_type, (%T.as_wit.iface0) [symbolic] // CHECK:STDOUT: %.4a9: type = fn_type_with_self_type %DoIt.type, %I.facet [symbolic] // CHECK:STDOUT: %impl.elem0: %.4a9 = impl_witness_access %T.as_wit.iface0, element0 [symbolic] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @DoIt(%I.facet) [symbolic] +// CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem0, @DoIt(%I.facet) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -143,7 +143,7 @@ var v: ().(Id(I.T)); // CHECK:STDOUT: %I.facet: %I.type = facet_value %T.as_type.loc9_4.2, (%T.as_wit.iface0.loc9_4.2) [symbolic = %I.facet (constants.%I.facet)] // CHECK:STDOUT: %.loc9_4.2: type = fn_type_with_self_type constants.%DoIt.type, %I.facet [symbolic = %.loc9_4.2 (constants.%.4a9)] // CHECK:STDOUT: %impl.elem0.loc9_4.2: @Use.%.loc9_4.2 (%.4a9) = impl_witness_access %T.as_wit.iface0.loc9_4.2, element0 [symbolic = %impl.elem0.loc9_4.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %specific_fn.loc9_4.2: = specific_function %impl.elem0.loc9_4.2, @DoIt(%I.facet) [symbolic = %specific_fn.loc9_4.2 (constants.%specific_fn)] +// CHECK:STDOUT: %specific_impl_fn.loc9_4.2: = specific_impl_function %impl.elem0.loc9_4.2, @DoIt(%I.facet) [symbolic = %specific_impl_fn.loc9_4.2 (constants.%specific_impl_fn)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.patt.loc8_8.1: %I.type) { // CHECK:STDOUT: !entry: @@ -153,8 +153,8 @@ var v: ().(Id(I.T)); // CHECK:STDOUT: %.loc9_4.1: type = converted %T.ref, %T.as_type.loc9_4.1 [symbolic = %T.as_type.loc9_4.2 (constants.%T.as_type)] // CHECK:STDOUT: %T.as_wit.iface0.loc9_4.1: = facet_access_witness %T.ref, element0 [symbolic = %T.as_wit.iface0.loc9_4.2 (constants.%T.as_wit.iface0)] // CHECK:STDOUT: %impl.elem0.loc9_4.1: @Use.%.loc9_4.2 (%.4a9) = impl_witness_access %T.as_wit.iface0.loc9_4.1, element0 [symbolic = %impl.elem0.loc9_4.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %specific_fn.loc9_4.1: = specific_function %impl.elem0.loc9_4.1, @DoIt(constants.%I.facet) [symbolic = %specific_fn.loc9_4.2 (constants.%specific_fn)] -// CHECK:STDOUT: %DoIt.call: init %empty_tuple.type = call %specific_fn.loc9_4.1() +// CHECK:STDOUT: %specific_impl_fn.loc9_4.1: = specific_impl_function %impl.elem0.loc9_4.1, @DoIt(constants.%I.facet) [symbolic = %specific_impl_fn.loc9_4.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %.loc9_10: init %empty_tuple.type = call %specific_impl_fn.loc9_4.1() // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -190,7 +190,7 @@ var v: ().(Id(I.T)); // CHECK:STDOUT: %I.facet: %I.type = facet_value %T.as_type, (%T.as_wit.iface0) [symbolic] // CHECK:STDOUT: %.878: type = fn_type_with_self_type %Make.type, %I.facet [symbolic] // CHECK:STDOUT: %impl.elem0: %.878 = impl_witness_access %T.as_wit.iface0, element0 [symbolic] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Make(%I.facet) [symbolic] +// CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem0, @Make(%I.facet) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -252,7 +252,7 @@ var v: ().(Id(I.T)); // CHECK:STDOUT: %I.facet: %I.type = facet_value %T.as_type.loc8_18.2, (%T.as_wit.iface0.loc9_11.2) [symbolic = %I.facet (constants.%I.facet)] // CHECK:STDOUT: %.loc9_11.2: type = fn_type_with_self_type constants.%Make.type, %I.facet [symbolic = %.loc9_11.2 (constants.%.878)] // CHECK:STDOUT: %impl.elem0.loc9_11.2: @Use.%.loc9_11.2 (%.878) = impl_witness_access %T.as_wit.iface0.loc9_11.2, element0 [symbolic = %impl.elem0.loc9_11.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %specific_fn.loc9_11.2: = specific_function %impl.elem0.loc9_11.2, @Make(%I.facet) [symbolic = %specific_fn.loc9_11.2 (constants.%specific_fn)] +// CHECK:STDOUT: %specific_impl_fn.loc9_11.2: = specific_impl_function %impl.elem0.loc9_11.2, @Make(%I.facet) [symbolic = %specific_impl_fn.loc9_11.2 (constants.%specific_impl_fn)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.patt.loc8_8.1: %I.type) -> @Use.%T.as_type.loc8_18.2 (%T.as_type) { // CHECK:STDOUT: !entry: @@ -262,10 +262,10 @@ var v: ().(Id(I.T)); // CHECK:STDOUT: %.loc9_11.1: type = converted %T.ref.loc9, %T.as_type.loc9 [symbolic = %T.as_type.loc8_18.2 (constants.%T.as_type)] // CHECK:STDOUT: %T.as_wit.iface0.loc9_11.1: = facet_access_witness %T.ref.loc9, element0 [symbolic = %T.as_wit.iface0.loc9_11.2 (constants.%T.as_wit.iface0)] // CHECK:STDOUT: %impl.elem0.loc9_11.1: @Use.%.loc9_11.2 (%.878) = impl_witness_access %T.as_wit.iface0.loc9_11.1, element0 [symbolic = %impl.elem0.loc9_11.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %specific_fn.loc9_11.1: = specific_function %impl.elem0.loc9_11.1, @Make(constants.%I.facet) [symbolic = %specific_fn.loc9_11.2 (constants.%specific_fn)] -// CHECK:STDOUT: %Make.call: init @Use.%T.as_type.loc8_18.2 (%T.as_type) = call %specific_fn.loc9_11.1() -// CHECK:STDOUT: %.loc9_18.1: @Use.%T.as_type.loc8_18.2 (%T.as_type) = value_of_initializer %Make.call -// CHECK:STDOUT: %.loc9_18.2: @Use.%T.as_type.loc8_18.2 (%T.as_type) = converted %Make.call, %.loc9_18.1 +// CHECK:STDOUT: %specific_impl_fn.loc9_11.1: = specific_impl_function %impl.elem0.loc9_11.1, @Make(constants.%I.facet) [symbolic = %specific_impl_fn.loc9_11.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %.loc9_17: init @Use.%T.as_type.loc8_18.2 (%T.as_type) = call %specific_impl_fn.loc9_11.1() +// CHECK:STDOUT: %.loc9_18.1: @Use.%T.as_type.loc8_18.2 (%T.as_type) = value_of_initializer %.loc9_17 +// CHECK:STDOUT: %.loc9_18.2: @Use.%T.as_type.loc8_18.2 (%T.as_type) = converted %.loc9_17, %.loc9_18.1 // CHECK:STDOUT: return %.loc9_18.2 // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -308,7 +308,7 @@ var v: ().(Id(I.T)); // CHECK:STDOUT: %I.facet: %I.type = facet_value %T.as_type, (%T.as_wit.iface0) [symbolic] // CHECK:STDOUT: %.f63: type = fn_type_with_self_type %Copy.type, %I.facet [symbolic] // CHECK:STDOUT: %impl.elem0: %.f63 = impl_witness_access %T.as_wit.iface0, element0 [symbolic] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Copy(%I.facet) [symbolic] +// CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem0, @Copy(%I.facet) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -388,7 +388,7 @@ var v: ().(Id(I.T)); // CHECK:STDOUT: %I.facet: %I.type = facet_value %T.as_type.loc8_18.2, (%T.as_wit.iface0.loc9_11.2) [symbolic = %I.facet (constants.%I.facet)] // CHECK:STDOUT: %.loc9_11.2: type = fn_type_with_self_type constants.%Copy.type, %I.facet [symbolic = %.loc9_11.2 (constants.%.f63)] // CHECK:STDOUT: %impl.elem0.loc9_11.2: @Use.%.loc9_11.2 (%.f63) = impl_witness_access %T.as_wit.iface0.loc9_11.2, element0 [symbolic = %impl.elem0.loc9_11.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %specific_fn.loc9_11.2: = specific_function %impl.elem0.loc9_11.2, @Copy(%I.facet) [symbolic = %specific_fn.loc9_11.2 (constants.%specific_fn)] +// CHECK:STDOUT: %specific_impl_fn.loc9_11.2: = specific_impl_function %impl.elem0.loc9_11.2, @Copy(%I.facet) [symbolic = %specific_impl_fn.loc9_11.2 (constants.%specific_impl_fn)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.patt.loc8_8.1: %I.type](%x.param_patt: @Use.%T.as_type.loc8_18.2 (%T.as_type)) -> @Use.%T.as_type.loc8_18.2 (%T.as_type) { // CHECK:STDOUT: !entry: @@ -399,11 +399,11 @@ var v: ().(Id(I.T)); // CHECK:STDOUT: %T.as_wit.iface0.loc9_11.1: = facet_access_witness constants.%T, element0 [symbolic = %T.as_wit.iface0.loc9_11.2 (constants.%T.as_wit.iface0)] // CHECK:STDOUT: %impl.elem0.loc9_11.1: @Use.%.loc9_11.2 (%.f63) = impl_witness_access %T.as_wit.iface0.loc9_11.1, element0 [symbolic = %impl.elem0.loc9_11.2 (constants.%impl.elem0)] // CHECK:STDOUT: %bound_method.loc9_11: = bound_method %x.ref, %impl.elem0.loc9_11.1 -// CHECK:STDOUT: %specific_fn.loc9_11.1: = specific_function %impl.elem0.loc9_11.1, @Copy(constants.%I.facet) [symbolic = %specific_fn.loc9_11.2 (constants.%specific_fn)] -// CHECK:STDOUT: %bound_method.loc9_17: = bound_method %x.ref, %specific_fn.loc9_11.1 -// CHECK:STDOUT: %Copy.call: init @Use.%T.as_type.loc8_18.2 (%T.as_type) = call %bound_method.loc9_17(%x.ref) -// CHECK:STDOUT: %.loc9_18.1: @Use.%T.as_type.loc8_18.2 (%T.as_type) = value_of_initializer %Copy.call -// CHECK:STDOUT: %.loc9_18.2: @Use.%T.as_type.loc8_18.2 (%T.as_type) = converted %Copy.call, %.loc9_18.1 +// CHECK:STDOUT: %specific_impl_fn.loc9_11.1: = specific_impl_function %impl.elem0.loc9_11.1, @Copy(constants.%I.facet) [symbolic = %specific_impl_fn.loc9_11.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %bound_method.loc9_17: = bound_method %x.ref, %specific_impl_fn.loc9_11.1 +// CHECK:STDOUT: %.loc9_17: init @Use.%T.as_type.loc8_18.2 (%T.as_type) = call %bound_method.loc9_17(%x.ref) +// CHECK:STDOUT: %.loc9_18.1: @Use.%T.as_type.loc8_18.2 (%T.as_type) = value_of_initializer %.loc9_17 +// CHECK:STDOUT: %.loc9_18.2: @Use.%T.as_type.loc8_18.2 (%T.as_type) = converted %.loc9_17, %.loc9_18.1 // CHECK:STDOUT: return %.loc9_18.2 // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -446,7 +446,7 @@ var v: ().(Id(I.T)); // CHECK:STDOUT: %I.facet: %I.type = facet_value %T.as_type, (%T.as_wit.iface0) [symbolic] // CHECK:STDOUT: %.d6b: type = fn_type_with_self_type %Hello.type, %I.facet [symbolic] // CHECK:STDOUT: %impl.elem0: %.d6b = impl_witness_access %T.as_wit.iface0, element0 [symbolic] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Hello(%I.facet) [symbolic] +// CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem0, @Hello(%I.facet) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -498,7 +498,7 @@ var v: ().(Id(I.T)); // CHECK:STDOUT: %I.facet: %I.type = facet_value %T.as_type.loc8_18.2, (%T.as_wit.iface0.loc9_4.2) [symbolic = %I.facet (constants.%I.facet)] // CHECK:STDOUT: %.loc9_4.2: type = fn_type_with_self_type constants.%Hello.type, %I.facet [symbolic = %.loc9_4.2 (constants.%.d6b)] // CHECK:STDOUT: %impl.elem0.loc9_4.2: @Use.%.loc9_4.2 (%.d6b) = impl_witness_access %T.as_wit.iface0.loc9_4.2, element0 [symbolic = %impl.elem0.loc9_4.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %specific_fn.loc9_4.2: = specific_function %impl.elem0.loc9_4.2, @Hello(%I.facet) [symbolic = %specific_fn.loc9_4.2 (constants.%specific_fn)] +// CHECK:STDOUT: %specific_impl_fn.loc9_4.2: = specific_impl_function %impl.elem0.loc9_4.2, @Hello(%I.facet) [symbolic = %specific_impl_fn.loc9_4.2 (constants.%specific_impl_fn)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.patt.loc8_8.1: %I.type](%x.param_patt: @Use.%T.as_type.loc8_18.2 (%T.as_type)) { // CHECK:STDOUT: !entry: @@ -508,8 +508,8 @@ var v: ().(Id(I.T)); // CHECK:STDOUT: %.loc9_4.1: type = converted constants.%T, %T.as_type.loc9 [symbolic = %T.as_type.loc8_18.2 (constants.%T.as_type)] // CHECK:STDOUT: %T.as_wit.iface0.loc9_4.1: = facet_access_witness constants.%T, element0 [symbolic = %T.as_wit.iface0.loc9_4.2 (constants.%T.as_wit.iface0)] // CHECK:STDOUT: %impl.elem0.loc9_4.1: @Use.%.loc9_4.2 (%.d6b) = impl_witness_access %T.as_wit.iface0.loc9_4.1, element0 [symbolic = %impl.elem0.loc9_4.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %specific_fn.loc9_4.1: = specific_function %impl.elem0.loc9_4.1, @Hello(constants.%I.facet) [symbolic = %specific_fn.loc9_4.2 (constants.%specific_fn)] -// CHECK:STDOUT: %Hello.call: init %empty_tuple.type = call %specific_fn.loc9_4.1() +// CHECK:STDOUT: %specific_impl_fn.loc9_4.1: = specific_impl_function %impl.elem0.loc9_4.1, @Hello(constants.%I.facet) [symbolic = %specific_impl_fn.loc9_4.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %.loc9_11: init %empty_tuple.type = call %specific_impl_fn.loc9_4.1() // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -546,7 +546,7 @@ var v: ().(Id(I.T)); // CHECK:STDOUT: %I.facet: %I.type = facet_value %T.as_type, (%T.as_wit.iface0) [symbolic] // CHECK:STDOUT: %.f63: type = fn_type_with_self_type %Copy.type, %I.facet [symbolic] // CHECK:STDOUT: %impl.elem0: %.f63 = impl_witness_access %T.as_wit.iface0, element0 [symbolic] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Copy(%I.facet) [symbolic] +// CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem0, @Copy(%I.facet) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -626,7 +626,7 @@ var v: ().(Id(I.T)); // CHECK:STDOUT: %I.facet: %I.type = facet_value %T.as_type.loc8_26.2, (%T.as_wit.iface0.loc9_14.2) [symbolic = %I.facet (constants.%I.facet)] // CHECK:STDOUT: %.loc9_14.2: type = fn_type_with_self_type constants.%Copy.type, %I.facet [symbolic = %.loc9_14.2 (constants.%.f63)] // CHECK:STDOUT: %impl.elem0.loc9_14.2: @UseIndirect.%.loc9_14.2 (%.f63) = impl_witness_access %T.as_wit.iface0.loc9_14.2, element0 [symbolic = %impl.elem0.loc9_14.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %specific_fn.loc9_14.2: = specific_function %impl.elem0.loc9_14.2, @Copy(%I.facet) [symbolic = %specific_fn.loc9_14.2 (constants.%specific_fn)] +// CHECK:STDOUT: %specific_impl_fn.loc9_14.2: = specific_impl_function %impl.elem0.loc9_14.2, @Copy(%I.facet) [symbolic = %specific_impl_fn.loc9_14.2 (constants.%specific_impl_fn)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.patt.loc8_16.1: %I.type](%x.param_patt: @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type)) -> @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) { // CHECK:STDOUT: !entry: @@ -638,11 +638,11 @@ var v: ().(Id(I.T)); // CHECK:STDOUT: %T.as_wit.iface0.loc9_14.1: = facet_access_witness %T.ref.loc9, element0 [symbolic = %T.as_wit.iface0.loc9_14.2 (constants.%T.as_wit.iface0)] // CHECK:STDOUT: %impl.elem0.loc9_14.1: @UseIndirect.%.loc9_14.2 (%.f63) = impl_witness_access %T.as_wit.iface0.loc9_14.1, element0 [symbolic = %impl.elem0.loc9_14.2 (constants.%impl.elem0)] // CHECK:STDOUT: %bound_method.loc9_11: = bound_method %x.ref, %impl.elem0.loc9_14.1 -// CHECK:STDOUT: %specific_fn.loc9_14.1: = specific_function %impl.elem0.loc9_14.1, @Copy(constants.%I.facet) [symbolic = %specific_fn.loc9_14.2 (constants.%specific_fn)] -// CHECK:STDOUT: %bound_method.loc9_21: = bound_method %x.ref, %specific_fn.loc9_14.1 -// CHECK:STDOUT: %Copy.call: init @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) = call %bound_method.loc9_21(%x.ref) -// CHECK:STDOUT: %.loc9_22.1: @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) = value_of_initializer %Copy.call -// CHECK:STDOUT: %.loc9_22.2: @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) = converted %Copy.call, %.loc9_22.1 +// CHECK:STDOUT: %specific_impl_fn.loc9_14.1: = specific_impl_function %impl.elem0.loc9_14.1, @Copy(constants.%I.facet) [symbolic = %specific_impl_fn.loc9_14.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %bound_method.loc9_21: = bound_method %x.ref, %specific_impl_fn.loc9_14.1 +// CHECK:STDOUT: %.loc9_21: init @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) = call %bound_method.loc9_21(%x.ref) +// CHECK:STDOUT: %.loc9_22.1: @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) = value_of_initializer %.loc9_21 +// CHECK:STDOUT: %.loc9_22.2: @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) = converted %.loc9_21, %.loc9_22.1 // CHECK:STDOUT: return %.loc9_22.2 // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/generic/call_method_on_generic_facet.carbon b/toolchain/check/testdata/function/generic/call_method_on_generic_facet.carbon index 103f08b749d9..4e74ee4673d0 100644 --- a/toolchain/check/testdata/function/generic/call_method_on_generic_facet.carbon +++ b/toolchain/check/testdata/function/generic/call_method_on_generic_facet.carbon @@ -88,13 +88,12 @@ fn G() { // CHECK:STDOUT: %Generic.facet.0aa: %Generic.type.91ccba.2 = facet_value %U.as_type, (%U.as_wit.iface0) [symbolic] // CHECK:STDOUT: %.10b: type = fn_type_with_self_type %F.type.f439a9.2, %Generic.facet.0aa [symbolic] // CHECK:STDOUT: %impl.elem0: %.10b = impl_witness_access %U.as_wit.iface0, element0 [symbolic] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @F.1(%T, %Generic.facet.0aa) [symbolic] +// CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem0, @F.1(%T, %Generic.facet.0aa) [symbolic] // CHECK:STDOUT: %G.type.9f9: type = fn_type @G.3 [concrete] // CHECK:STDOUT: %G.57b: %G.type.9f9 = struct_value () [concrete] // CHECK:STDOUT: %CallGenericMethod.specific_fn: = specific_function %CallGenericMethod, @CallGenericMethod(%GenericParam, %Generic.facet.8bd) [concrete] // CHECK:STDOUT: %complete_type.997: = complete_type_witness %Generic.type.769 [concrete] // CHECK:STDOUT: %.1eb: type = fn_type_with_self_type %F.type.4cf, %Generic.facet.8bd [concrete] -// CHECK:STDOUT: %F.specific_fn: = specific_function %F.a56, @F.1(%GenericParam, %Generic.facet.8bd) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -249,7 +248,7 @@ fn G() { // CHECK:STDOUT: %Generic.facet: @CallGenericMethod.%Generic.type.loc29_45.2 (%Generic.type.91ccba.2) = facet_value %U.as_type.loc30_4.2, (%U.as_wit.iface0.loc30_4.2) [symbolic = %Generic.facet (constants.%Generic.facet.0aa)] // CHECK:STDOUT: %.loc30_4.3: type = fn_type_with_self_type %F.type, %Generic.facet [symbolic = %.loc30_4.3 (constants.%.10b)] // CHECK:STDOUT: %impl.elem0.loc30_4.2: @CallGenericMethod.%.loc30_4.3 (%.10b) = impl_witness_access %U.as_wit.iface0.loc30_4.2, element0 [symbolic = %impl.elem0.loc30_4.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %specific_fn.loc30_4.2: = specific_function %impl.elem0.loc30_4.2, @F.1(%T.loc29_22.2, %Generic.facet) [symbolic = %specific_fn.loc30_4.2 (constants.%specific_fn)] +// CHECK:STDOUT: %specific_impl_fn.loc30_4.2: = specific_impl_function %impl.elem0.loc30_4.2, @F.1(%T.loc29_22.2, %Generic.facet) [symbolic = %specific_impl_fn.loc30_4.2 (constants.%specific_impl_fn)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.patt.loc29_22.1: type, %U.patt.loc29_32.1: @CallGenericMethod.%Generic.type.loc29_45.2 (%Generic.type.91ccba.2)) { // CHECK:STDOUT: !entry: @@ -260,8 +259,8 @@ fn G() { // CHECK:STDOUT: %.loc30_4.2: type = converted %U.ref, %U.as_type.loc30_4.1 [symbolic = %U.as_type.loc30_4.2 (constants.%U.as_type)] // CHECK:STDOUT: %U.as_wit.iface0.loc30_4.1: = facet_access_witness %U.ref, element0 [symbolic = %U.as_wit.iface0.loc30_4.2 (constants.%U.as_wit.iface0)] // CHECK:STDOUT: %impl.elem0.loc30_4.1: @CallGenericMethod.%.loc30_4.3 (%.10b) = impl_witness_access %U.as_wit.iface0.loc30_4.1, element0 [symbolic = %impl.elem0.loc30_4.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %specific_fn.loc30_4.1: = specific_function %impl.elem0.loc30_4.1, @F.1(constants.%T, constants.%Generic.facet.0aa) [symbolic = %specific_fn.loc30_4.2 (constants.%specific_fn)] -// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %specific_fn.loc30_4.1() +// CHECK:STDOUT: %specific_impl_fn.loc30_4.1: = specific_impl_function %impl.elem0.loc30_4.1, @F.1(constants.%T, constants.%Generic.facet.0aa) [symbolic = %specific_impl_fn.loc30_4.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %.loc30_7: init %empty_tuple.type = call %specific_impl_fn.loc30_4.1() // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -350,6 +349,6 @@ fn G() { // CHECK:STDOUT: %Generic.facet => constants.%Generic.facet.8bd // CHECK:STDOUT: %.loc30_4.3 => constants.%.1eb // CHECK:STDOUT: %impl.elem0.loc30_4.2 => constants.%F.a56 -// CHECK:STDOUT: %specific_fn.loc30_4.2 => constants.%F.specific_fn +// CHECK:STDOUT: %specific_impl_fn.loc30_4.2 => constants.%F.a56 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/use_assoc_const.carbon b/toolchain/check/testdata/impl/use_assoc_const.carbon index 6ff65782c843..f8a167de5139 100644 --- a/toolchain/check/testdata/impl/use_assoc_const.carbon +++ b/toolchain/check/testdata/impl/use_assoc_const.carbon @@ -963,11 +963,10 @@ fn F() { // CHECK:STDOUT: %require_complete.2a5: = require_complete_type %T.as_type [symbolic] // CHECK:STDOUT: %.4d2: type = fn_type_with_self_type %F.type.c14, %J.facet.085e97.2 [symbolic] // CHECK:STDOUT: %impl.elem1: %.4d2 = impl_witness_access %T.as_wit.iface0, element1 [symbolic] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem1, @F.1(%J.facet.085e97.2) [symbolic] +// CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem1, @F.1(%J.facet.085e97.2) [symbolic] // CHECK:STDOUT: %CallGeneric.type: type = fn_type @CallGeneric [concrete] // CHECK:STDOUT: %CallGeneric: %CallGeneric.type = struct_value () [concrete] // CHECK:STDOUT: %GenericCallF.specific_fn: = specific_function %GenericCallF, @GenericCallF(%J.facet.ccb) [concrete] -// CHECK:STDOUT: %F.specific_fn: = specific_function %F.c81, @F.1(%J.facet.ccb) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1382,7 +1381,7 @@ fn F() { // CHECK:STDOUT: %J.facet: %J.type = facet_value %T.as_type.loc24_27.2, (%T.as_wit.iface0.loc24_34.2) [symbolic = %J.facet (constants.%J.facet.085e97.2)] // CHECK:STDOUT: %.loc25_11.2: type = fn_type_with_self_type constants.%F.type.c14, %J.facet [symbolic = %.loc25_11.2 (constants.%.4d2)] // CHECK:STDOUT: %impl.elem1.loc25_11.2: @GenericCallF.%.loc25_11.2 (%.4d2) = impl_witness_access %T.as_wit.iface0.loc24_34.2, element1 [symbolic = %impl.elem1.loc25_11.2 (constants.%impl.elem1)] -// CHECK:STDOUT: %specific_fn.loc25_11.2: = specific_function %impl.elem1.loc25_11.2, @F.1(%J.facet) [symbolic = %specific_fn.loc25_11.2 (constants.%specific_fn)] +// CHECK:STDOUT: %specific_impl_fn.loc25_11.2: = specific_impl_function %impl.elem1.loc25_11.2, @F.1(%J.facet) [symbolic = %specific_impl_fn.loc25_11.2 (constants.%specific_impl_fn)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.patt.loc24_17.1: %J.type](%t.param_patt: @GenericCallF.%T.as_type.loc24_27.2 (%T.as_type), %u.param_patt: @GenericCallF.%impl.elem0.loc24_34.2 (%impl.elem0.d9c3a6.2)) -> @GenericCallF.%impl.elem0.loc24_34.2 (%impl.elem0.d9c3a6.2) { // CHECK:STDOUT: !entry: @@ -1393,10 +1392,10 @@ fn F() { // CHECK:STDOUT: %T.as_wit.iface0.loc25: = facet_access_witness constants.%T, element0 [symbolic = %T.as_wit.iface0.loc24_34.2 (constants.%T.as_wit.iface0)] // CHECK:STDOUT: %impl.elem1.loc25_11.1: @GenericCallF.%.loc25_11.2 (%.4d2) = impl_witness_access %T.as_wit.iface0.loc25, element1 [symbolic = %impl.elem1.loc25_11.2 (constants.%impl.elem1)] // CHECK:STDOUT: %u.ref: @GenericCallF.%impl.elem0.loc24_34.2 (%impl.elem0.d9c3a6.2) = name_ref u, %u -// CHECK:STDOUT: %specific_fn.loc25_11.1: = specific_function %impl.elem1.loc25_11.1, @F.1(constants.%J.facet.085e97.2) [symbolic = %specific_fn.loc25_11.2 (constants.%specific_fn)] -// CHECK:STDOUT: %F.call: init @GenericCallF.%impl.elem0.loc24_34.2 (%impl.elem0.d9c3a6.2) = call %specific_fn.loc25_11.1(%u.ref) -// CHECK:STDOUT: %.loc25_16.1: @GenericCallF.%impl.elem0.loc24_34.2 (%impl.elem0.d9c3a6.2) = value_of_initializer %F.call -// CHECK:STDOUT: %.loc25_16.2: @GenericCallF.%impl.elem0.loc24_34.2 (%impl.elem0.d9c3a6.2) = converted %F.call, %.loc25_16.1 +// CHECK:STDOUT: %specific_impl_fn.loc25_11.1: = specific_impl_function %impl.elem1.loc25_11.1, @F.1(constants.%J.facet.085e97.2) [symbolic = %specific_impl_fn.loc25_11.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %.loc25_15: init @GenericCallF.%impl.elem0.loc24_34.2 (%impl.elem0.d9c3a6.2) = call %specific_impl_fn.loc25_11.1(%u.ref) +// CHECK:STDOUT: %.loc25_16.1: @GenericCallF.%impl.elem0.loc24_34.2 (%impl.elem0.d9c3a6.2) = value_of_initializer %.loc25_15 +// CHECK:STDOUT: %.loc25_16.2: @GenericCallF.%impl.elem0.loc24_34.2 (%impl.elem0.d9c3a6.2) = converted %.loc25_15, %.loc25_16.1 // CHECK:STDOUT: return %.loc25_16.2 // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -1487,7 +1486,7 @@ fn F() { // CHECK:STDOUT: %J.facet => constants.%J.facet.ccb // CHECK:STDOUT: %.loc25_11.2 => constants.%.dea // CHECK:STDOUT: %impl.elem1.loc25_11.2 => constants.%F.c81 -// CHECK:STDOUT: %specific_fn.loc25_11.2 => constants.%F.specific_fn +// CHECK:STDOUT: %specific_impl_fn.loc25_11.2 => constants.%F.c81 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- use_constraint_on_associated_type.carbon @@ -1519,13 +1518,13 @@ fn F() { // CHECK:STDOUT: %require_complete.2a5: = require_complete_type %T.as_type [symbolic] // CHECK:STDOUT: %.4d2: type = fn_type_with_self_type %F.type, %J.facet.085e97.2 [symbolic] // CHECK:STDOUT: %impl.elem1: %.4d2 = impl_witness_access %T.as_wit.iface0, element1 [symbolic] -// CHECK:STDOUT: %specific_fn.fac: = specific_function %impl.elem1, @F(%J.facet.085e97.2) [symbolic] +// CHECK:STDOUT: %specific_impl_fn.5d8: = specific_impl_function %impl.elem1, @F(%J.facet.085e97.2) [symbolic] // CHECK:STDOUT: %Op.type: type = fn_type @Op [concrete] // CHECK:STDOUT: %as_wit.iface0: = facet_access_witness %impl.elem0.c57618.2, element0 [symbolic] // CHECK:STDOUT: %Add.facet: %Add.type = facet_value %as_type.6b96b1.2, (%as_wit.iface0) [symbolic] // CHECK:STDOUT: %.5a3: type = fn_type_with_self_type %Op.type, %Add.facet [symbolic] // CHECK:STDOUT: %impl.elem0.ab3: %.5a3 = impl_witness_access %as_wit.iface0, element0 [symbolic] -// CHECK:STDOUT: %specific_fn.dd0: = specific_function %impl.elem0.ab3, @Op(%Add.facet) [symbolic] +// CHECK:STDOUT: %specific_impl_fn.e8e: = specific_impl_function %impl.elem0.ab3, @Op(%Add.facet) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1651,12 +1650,12 @@ fn F() { // CHECK:STDOUT: %J.facet: %J.type = facet_value %T.as_type.loc8_31.2, (%T.as_wit.iface0.loc8_38.2) [symbolic = %J.facet (constants.%J.facet.085e97.2)] // CHECK:STDOUT: %.loc9_11.2: type = fn_type_with_self_type constants.%F.type, %J.facet [symbolic = %.loc9_11.2 (constants.%.4d2)] // CHECK:STDOUT: %impl.elem1.loc9_11.2: @GenericAddResult.%.loc9_11.2 (%.4d2) = impl_witness_access %T.as_wit.iface0.loc8_38.2, element1 [symbolic = %impl.elem1.loc9_11.2 (constants.%impl.elem1)] -// CHECK:STDOUT: %specific_fn.loc9_11.2: = specific_function %impl.elem1.loc9_11.2, @F(%J.facet) [symbolic = %specific_fn.loc9_11.2 (constants.%specific_fn.fac)] +// CHECK:STDOUT: %specific_impl_fn.loc9_11.2: = specific_impl_function %impl.elem1.loc9_11.2, @F(%J.facet) [symbolic = %specific_impl_fn.loc9_11.2 (constants.%specific_impl_fn.5d8)] // CHECK:STDOUT: %as_wit.iface0.loc9_17.2: = facet_access_witness %impl.elem0.loc8_38.2, element0 [symbolic = %as_wit.iface0.loc9_17.2 (constants.%as_wit.iface0)] // CHECK:STDOUT: %Add.facet: %Add.type = facet_value %as_type.loc8_38.2, (%as_wit.iface0.loc9_17.2) [symbolic = %Add.facet (constants.%Add.facet)] -// CHECK:STDOUT: %.loc9_17.3: type = fn_type_with_self_type constants.%Op.type, %Add.facet [symbolic = %.loc9_17.3 (constants.%.5a3)] -// CHECK:STDOUT: %impl.elem0.loc9_17.2: @GenericAddResult.%.loc9_17.3 (%.5a3) = impl_witness_access %as_wit.iface0.loc9_17.2, element0 [symbolic = %impl.elem0.loc9_17.2 (constants.%impl.elem0.ab3)] -// CHECK:STDOUT: %specific_fn.loc9_17.2: = specific_function %impl.elem0.loc9_17.2, @Op(%Add.facet) [symbolic = %specific_fn.loc9_17.2 (constants.%specific_fn.dd0)] +// CHECK:STDOUT: %.loc9_17.4: type = fn_type_with_self_type constants.%Op.type, %Add.facet [symbolic = %.loc9_17.4 (constants.%.5a3)] +// CHECK:STDOUT: %impl.elem0.loc9_17.2: @GenericAddResult.%.loc9_17.4 (%.5a3) = impl_witness_access %as_wit.iface0.loc9_17.2, element0 [symbolic = %impl.elem0.loc9_17.2 (constants.%impl.elem0.ab3)] +// CHECK:STDOUT: %specific_impl_fn.loc9_17.2: = specific_impl_function %impl.elem0.loc9_17.2, @Op(%Add.facet) [symbolic = %specific_impl_fn.loc9_17.2 (constants.%specific_impl_fn.e8e)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.patt.loc8_21.1: %J.type](%t.param_patt: @GenericAddResult.%T.as_type.loc8_31.2 (%T.as_type), %u.param_patt: @GenericAddResult.%as_type.loc8_38.2 (%as_type.6b96b1.2)) -> @GenericAddResult.%as_type.loc8_38.2 (%as_type.6b96b1.2) { // CHECK:STDOUT: !entry: @@ -1669,8 +1668,8 @@ fn F() { // CHECK:STDOUT: %u.ref.loc9_14: @GenericAddResult.%as_type.loc8_38.2 (%as_type.6b96b1.2) = name_ref u, %u // CHECK:STDOUT: %.loc9_15.1: %Add.type = converted constants.%as_type.6b96b1.2, constants.%impl.elem0.c57618.2 [symbolic = %impl.elem0.loc8_38.2 (constants.%impl.elem0.c57618.2)] // CHECK:STDOUT: %.loc9_15.2: %Add.type = converted constants.%as_type.6b96b1.2, constants.%impl.elem0.c57618.2 [symbolic = %impl.elem0.loc8_38.2 (constants.%impl.elem0.c57618.2)] -// CHECK:STDOUT: %specific_fn.loc9_11.1: = specific_function %impl.elem1.loc9_11.1, @F(constants.%J.facet.085e97.2) [symbolic = %specific_fn.loc9_11.2 (constants.%specific_fn.fac)] -// CHECK:STDOUT: %F.call.loc9_15: init @GenericAddResult.%as_type.loc8_38.2 (%as_type.6b96b1.2) = call %specific_fn.loc9_11.1(%u.ref.loc9_14) +// CHECK:STDOUT: %specific_impl_fn.loc9_11.1: = specific_impl_function %impl.elem1.loc9_11.1, @F(constants.%J.facet.085e97.2) [symbolic = %specific_impl_fn.loc9_11.2 (constants.%specific_impl_fn.5d8)] +// CHECK:STDOUT: %.loc9_15.3: init @GenericAddResult.%as_type.loc8_38.2 (%as_type.6b96b1.2) = call %specific_impl_fn.loc9_11.1(%u.ref.loc9_14) // CHECK:STDOUT: %T.ref.loc9: %J.type = name_ref T, %T.loc8_21.1 [symbolic = %T.loc8_21.2 (constants.%T)] // CHECK:STDOUT: %F.ref.loc9_20: %J.assoc_type = name_ref F, @J.%assoc1 [concrete = constants.%assoc1] // CHECK:STDOUT: %T.as_type.loc9_20: type = facet_access_type %T.ref.loc9 [symbolic = %T.as_type.loc8_31.2 (constants.%T.as_type)] @@ -1680,22 +1679,22 @@ fn F() { // CHECK:STDOUT: %u.ref.loc9_23: @GenericAddResult.%as_type.loc8_38.2 (%as_type.6b96b1.2) = name_ref u, %u // CHECK:STDOUT: %.loc9_24.1: %Add.type = converted constants.%as_type.6b96b1.2, constants.%impl.elem0.c57618.2 [symbolic = %impl.elem0.loc8_38.2 (constants.%impl.elem0.c57618.2)] // CHECK:STDOUT: %.loc9_24.2: %Add.type = converted constants.%as_type.6b96b1.2, constants.%impl.elem0.c57618.2 [symbolic = %impl.elem0.loc8_38.2 (constants.%impl.elem0.c57618.2)] -// CHECK:STDOUT: %specific_fn.loc9_20: = specific_function %impl.elem1.loc9_20, @F(constants.%J.facet.085e97.2) [symbolic = %specific_fn.loc9_11.2 (constants.%specific_fn.fac)] -// CHECK:STDOUT: %F.call.loc9_24: init @GenericAddResult.%as_type.loc8_38.2 (%as_type.6b96b1.2) = call %specific_fn.loc9_20(%u.ref.loc9_23) +// CHECK:STDOUT: %specific_impl_fn.loc9_20: = specific_impl_function %impl.elem1.loc9_20, @F(constants.%J.facet.085e97.2) [symbolic = %specific_impl_fn.loc9_11.2 (constants.%specific_impl_fn.5d8)] +// CHECK:STDOUT: %.loc9_24.3: init @GenericAddResult.%as_type.loc8_38.2 (%as_type.6b96b1.2) = call %specific_impl_fn.loc9_20(%u.ref.loc9_23) // CHECK:STDOUT: %as_wit.iface0.loc9_17.1: = facet_access_witness constants.%impl.elem0.c57618.2, element0 [symbolic = %as_wit.iface0.loc9_17.2 (constants.%as_wit.iface0)] -// CHECK:STDOUT: %impl.elem0.loc9_17.1: @GenericAddResult.%.loc9_17.3 (%.5a3) = impl_witness_access %as_wit.iface0.loc9_17.1, element0 [symbolic = %impl.elem0.loc9_17.2 (constants.%impl.elem0.ab3)] -// CHECK:STDOUT: %bound_method.loc9_17.1: = bound_method %F.call.loc9_15, %impl.elem0.loc9_17.1 +// CHECK:STDOUT: %impl.elem0.loc9_17.1: @GenericAddResult.%.loc9_17.4 (%.5a3) = impl_witness_access %as_wit.iface0.loc9_17.1, element0 [symbolic = %impl.elem0.loc9_17.2 (constants.%impl.elem0.ab3)] +// CHECK:STDOUT: %bound_method.loc9_17.1: = bound_method %.loc9_15.3, %impl.elem0.loc9_17.1 // CHECK:STDOUT: %.loc9_17.1: %Add.type = converted constants.%as_type.6b96b1.2, constants.%impl.elem0.c57618.2 [symbolic = %impl.elem0.loc8_38.2 (constants.%impl.elem0.c57618.2)] // CHECK:STDOUT: %.loc9_17.2: %Add.type = converted constants.%as_type.6b96b1.2, constants.%impl.elem0.c57618.2 [symbolic = %impl.elem0.loc8_38.2 (constants.%impl.elem0.c57618.2)] -// CHECK:STDOUT: %specific_fn.loc9_17.1: = specific_function %impl.elem0.loc9_17.1, @Op(constants.%Add.facet) [symbolic = %specific_fn.loc9_17.2 (constants.%specific_fn.dd0)] -// CHECK:STDOUT: %bound_method.loc9_17.2: = bound_method %F.call.loc9_15, %specific_fn.loc9_17.1 -// CHECK:STDOUT: %.loc9_15.3: @GenericAddResult.%as_type.loc8_38.2 (%as_type.6b96b1.2) = value_of_initializer %F.call.loc9_15 -// CHECK:STDOUT: %.loc9_15.4: @GenericAddResult.%as_type.loc8_38.2 (%as_type.6b96b1.2) = converted %F.call.loc9_15, %.loc9_15.3 -// CHECK:STDOUT: %.loc9_24.3: @GenericAddResult.%as_type.loc8_38.2 (%as_type.6b96b1.2) = value_of_initializer %F.call.loc9_24 -// CHECK:STDOUT: %.loc9_24.4: @GenericAddResult.%as_type.loc8_38.2 (%as_type.6b96b1.2) = converted %F.call.loc9_24, %.loc9_24.3 -// CHECK:STDOUT: %Op.call: init @GenericAddResult.%as_type.loc8_38.2 (%as_type.6b96b1.2) = call %bound_method.loc9_17.2(%.loc9_15.4, %.loc9_24.4) -// CHECK:STDOUT: %.loc9_25.1: @GenericAddResult.%as_type.loc8_38.2 (%as_type.6b96b1.2) = value_of_initializer %Op.call -// CHECK:STDOUT: %.loc9_25.2: @GenericAddResult.%as_type.loc8_38.2 (%as_type.6b96b1.2) = converted %Op.call, %.loc9_25.1 +// CHECK:STDOUT: %specific_impl_fn.loc9_17.1: = specific_impl_function %impl.elem0.loc9_17.1, @Op(constants.%Add.facet) [symbolic = %specific_impl_fn.loc9_17.2 (constants.%specific_impl_fn.e8e)] +// CHECK:STDOUT: %bound_method.loc9_17.2: = bound_method %.loc9_15.3, %specific_impl_fn.loc9_17.1 +// CHECK:STDOUT: %.loc9_15.4: @GenericAddResult.%as_type.loc8_38.2 (%as_type.6b96b1.2) = value_of_initializer %.loc9_15.3 +// CHECK:STDOUT: %.loc9_15.5: @GenericAddResult.%as_type.loc8_38.2 (%as_type.6b96b1.2) = converted %.loc9_15.3, %.loc9_15.4 +// CHECK:STDOUT: %.loc9_24.4: @GenericAddResult.%as_type.loc8_38.2 (%as_type.6b96b1.2) = value_of_initializer %.loc9_24.3 +// CHECK:STDOUT: %.loc9_24.5: @GenericAddResult.%as_type.loc8_38.2 (%as_type.6b96b1.2) = converted %.loc9_24.3, %.loc9_24.4 +// CHECK:STDOUT: %.loc9_17.3: init @GenericAddResult.%as_type.loc8_38.2 (%as_type.6b96b1.2) = call %bound_method.loc9_17.2(%.loc9_15.5, %.loc9_24.5) +// CHECK:STDOUT: %.loc9_25.1: @GenericAddResult.%as_type.loc8_38.2 (%as_type.6b96b1.2) = value_of_initializer %.loc9_17.3 +// CHECK:STDOUT: %.loc9_25.2: @GenericAddResult.%as_type.loc8_38.2 (%as_type.6b96b1.2) = converted %.loc9_17.3, %.loc9_25.1 // CHECK:STDOUT: return %.loc9_25.2 // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -1757,7 +1756,7 @@ fn F() { // CHECK:STDOUT: %require_complete.2a5: = require_complete_type %T.as_type [symbolic] // CHECK:STDOUT: %.9ac: type = fn_type_with_self_type %G.type, %J.facet.085e97.2 [symbolic] // CHECK:STDOUT: %impl.elem1: %.9ac = impl_witness_access %T.as_wit.iface0, element1 [symbolic] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem1, @G(%J.facet.085e97.2) [symbolic] +// CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem1, @G(%J.facet.085e97.2) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1882,7 +1881,7 @@ fn F() { // CHECK:STDOUT: %J.facet: %J.type = facet_value %T.as_type.loc8_44.2, (%T.as_wit.iface0.loc8_51.2) [symbolic = %J.facet (constants.%J.facet.085e97.2)] // CHECK:STDOUT: %.loc9_11: type = fn_type_with_self_type constants.%G.type, %J.facet [symbolic = %.loc9_11 (constants.%.9ac)] // CHECK:STDOUT: %impl.elem1.loc9_11.2: @GenericCallInterfaceQualified.%.loc9_11 (%.9ac) = impl_witness_access %T.as_wit.iface0.loc8_51.2, element1 [symbolic = %impl.elem1.loc9_11.2 (constants.%impl.elem1)] -// CHECK:STDOUT: %specific_fn.loc9_11.2: = specific_function %impl.elem1.loc9_11.2, @G(%J.facet) [symbolic = %specific_fn.loc9_11.2 (constants.%specific_fn)] +// CHECK:STDOUT: %specific_impl_fn.loc9_11.2: = specific_impl_function %impl.elem1.loc9_11.2, @G(%J.facet) [symbolic = %specific_impl_fn.loc9_11.2 (constants.%specific_impl_fn)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%T.patt.loc8_34.1: %J.type](%t.param_patt: @GenericCallInterfaceQualified.%T.as_type.loc8_44.2 (%T.as_type), %u.param_patt: @GenericCallInterfaceQualified.%impl.elem0.loc8_51.2 (%impl.elem0.d9c3a6.2)) -> @GenericCallInterfaceQualified.%impl.elem0.loc8_51.2 (%impl.elem0.d9c3a6.2) { // CHECK:STDOUT: !entry: @@ -1893,11 +1892,11 @@ fn F() { // CHECK:STDOUT: %impl.elem1.loc9_11.1: @GenericCallInterfaceQualified.%.loc9_11 (%.9ac) = impl_witness_access %T.as_wit.iface0.loc9, element1 [symbolic = %impl.elem1.loc9_11.2 (constants.%impl.elem1)] // CHECK:STDOUT: %bound_method.loc9_11: = bound_method %t.ref, %impl.elem1.loc9_11.1 // CHECK:STDOUT: %u.ref: @GenericCallInterfaceQualified.%impl.elem0.loc8_51.2 (%impl.elem0.d9c3a6.2) = name_ref u, %u -// CHECK:STDOUT: %specific_fn.loc9_11.1: = specific_function %impl.elem1.loc9_11.1, @G(constants.%J.facet.085e97.2) [symbolic = %specific_fn.loc9_11.2 (constants.%specific_fn)] -// CHECK:STDOUT: %bound_method.loc9_19: = bound_method %t.ref, %specific_fn.loc9_11.1 -// CHECK:STDOUT: %G.call: init @GenericCallInterfaceQualified.%impl.elem0.loc8_51.2 (%impl.elem0.d9c3a6.2) = call %bound_method.loc9_19(%t.ref, %u.ref) -// CHECK:STDOUT: %.loc9_20.1: @GenericCallInterfaceQualified.%impl.elem0.loc8_51.2 (%impl.elem0.d9c3a6.2) = value_of_initializer %G.call -// CHECK:STDOUT: %.loc9_20.2: @GenericCallInterfaceQualified.%impl.elem0.loc8_51.2 (%impl.elem0.d9c3a6.2) = converted %G.call, %.loc9_20.1 +// CHECK:STDOUT: %specific_impl_fn.loc9_11.1: = specific_impl_function %impl.elem1.loc9_11.1, @G(constants.%J.facet.085e97.2) [symbolic = %specific_impl_fn.loc9_11.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %bound_method.loc9_19: = bound_method %t.ref, %specific_impl_fn.loc9_11.1 +// CHECK:STDOUT: %.loc9_19: init @GenericCallInterfaceQualified.%impl.elem0.loc8_51.2 (%impl.elem0.d9c3a6.2) = call %bound_method.loc9_19(%t.ref, %u.ref) +// CHECK:STDOUT: %.loc9_20.1: @GenericCallInterfaceQualified.%impl.elem0.loc8_51.2 (%impl.elem0.d9c3a6.2) = value_of_initializer %.loc9_19 +// CHECK:STDOUT: %.loc9_20.2: @GenericCallInterfaceQualified.%impl.elem0.loc8_51.2 (%impl.elem0.d9c3a6.2) = converted %.loc9_19, %.loc9_20.1 // CHECK:STDOUT: return %.loc9_20.2 // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -1966,7 +1965,7 @@ fn F() { // CHECK:STDOUT: %impl.elem1: %.861 = impl_witness_access %T.as_wit.iface0, element1 [symbolic] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete] // CHECK:STDOUT: %impl.elem0.37e: type = impl_witness_access %T.as_wit.iface0, element0 [symbolic] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem1, @F(%J.facet.869) [symbolic] +// CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem1, @F(%J.facet.869) [symbolic] // CHECK:STDOUT: %require_complete.8bd: = require_complete_type %impl.elem0.37e [symbolic] // CHECK:STDOUT: %ImplicitAs.type.820: type = facet_type <@ImplicitAs, @ImplicitAs(%impl.elem0.37e)> [symbolic] // CHECK:STDOUT: %require_complete.1ce: = require_complete_type %ImplicitAs.type.820 [symbolic] @@ -2082,7 +2081,7 @@ fn F() { // CHECK:STDOUT: %J.facet: %J.type = facet_value %T.as_type.loc8_45.2, (%T.as_wit.iface0.loc26_11.2) [symbolic = %J.facet (constants.%J.facet.869)] // CHECK:STDOUT: %.loc26_11.2: type = fn_type_with_self_type constants.%F.type, %J.facet [symbolic = %.loc26_11.2 (constants.%.861)] // CHECK:STDOUT: %impl.elem1.loc26_11.2: @GenericCallFI32.%.loc26_11.2 (%.861) = impl_witness_access %T.as_wit.iface0.loc26_11.2, element1 [symbolic = %impl.elem1.loc26_11.2 (constants.%impl.elem1)] -// CHECK:STDOUT: %specific_fn.loc26_11.2: = specific_function %impl.elem1.loc26_11.2, @F(%J.facet) [symbolic = %specific_fn.loc26_11.2 (constants.%specific_fn)] +// CHECK:STDOUT: %specific_impl_fn.loc26_11.2: = specific_impl_function %impl.elem1.loc26_11.2, @F(%J.facet) [symbolic = %specific_impl_fn.loc26_11.2 (constants.%specific_impl_fn)] // CHECK:STDOUT: %impl.elem0.loc26: type = impl_witness_access %T.as_wit.iface0.loc26_11.2, element0 [symbolic = %impl.elem0.loc26 (constants.%impl.elem0.37e)] // CHECK:STDOUT: %require_complete.loc26_15: = require_complete_type @GenericCallFI32.%impl.elem0.loc26 (%impl.elem0.37e) [symbolic = %require_complete.loc26_15 (constants.%require_complete.8bd)] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%impl.elem0.loc26)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.820)] @@ -2097,10 +2096,10 @@ fn F() { // CHECK:STDOUT: %T.as_wit.iface0.loc26_11.1: = facet_access_witness constants.%T, element0 [symbolic = %T.as_wit.iface0.loc26_11.2 (constants.%T.as_wit.iface0)] // CHECK:STDOUT: %impl.elem1.loc26_11.1: @GenericCallFI32.%.loc26_11.2 (%.861) = impl_witness_access %T.as_wit.iface0.loc26_11.1, element1 [symbolic = %impl.elem1.loc26_11.2 (constants.%impl.elem1)] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2] -// CHECK:STDOUT: %specific_fn.loc26_11.1: = specific_function %impl.elem1.loc26_11.1, @F(constants.%J.facet.869) [symbolic = %specific_fn.loc26_11.2 (constants.%specific_fn)] +// CHECK:STDOUT: %specific_impl_fn.loc26_11.1: = specific_impl_function %impl.elem1.loc26_11.1, @F(constants.%J.facet.869) [symbolic = %specific_impl_fn.loc26_11.2 (constants.%specific_impl_fn)] // CHECK:STDOUT: %.loc26_14: @GenericCallFI32.%impl.elem0.loc26 (%impl.elem0.37e) = converted %int_2, [concrete = ] -// CHECK:STDOUT: %F.call: init @GenericCallFI32.%impl.elem0.loc26 (%impl.elem0.37e) = call %specific_fn.loc26_11.1() -// CHECK:STDOUT: %.loc26_16: %i32 = converted %F.call, [concrete = ] +// CHECK:STDOUT: %.loc26_15: init @GenericCallFI32.%impl.elem0.loc26 (%impl.elem0.37e) = call %specific_impl_fn.loc26_11.1() [concrete = ] +// CHECK:STDOUT: %.loc26_16: %i32 = converted %.loc26_15, [concrete = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/min_prelude/compound_member_access.carbon b/toolchain/check/testdata/interface/min_prelude/compound_member_access.carbon index 2994346330bb..79e6264d9618 100644 --- a/toolchain/check/testdata/interface/min_prelude/compound_member_access.carbon +++ b/toolchain/check/testdata/interface/min_prelude/compound_member_access.carbon @@ -360,7 +360,7 @@ fn Works() { // CHECK:STDOUT: %K1.facet.07e9b4.1: %K1.type = facet_value %T.as_type, (%T.as_wit.iface0) [symbolic] // CHECK:STDOUT: %.d66c00.1: type = fn_type_with_self_type %Q1.type, %K1.facet.07e9b4.1 [symbolic] // CHECK:STDOUT: %impl.elem0.d9a98e.1: %.d66c00.1 = impl_witness_access %T.as_wit.iface0, element0 [symbolic] -// CHECK:STDOUT: %specific_fn.4c5be7.1: = specific_function %impl.elem0.d9a98e.1, @Q1(%K1.facet.07e9b4.1) [symbolic] +// CHECK:STDOUT: %specific_impl_fn.26c74d.1: = specific_impl_function %impl.elem0.d9a98e.1, @Q1(%K1.facet.07e9b4.1) [symbolic] // CHECK:STDOUT: %V: %K1.type = bind_symbolic_name V, 0 [symbolic] // CHECK:STDOUT: %V.patt: %K1.type = symbolic_binding_pattern V, 0 [symbolic] // CHECK:STDOUT: %Compound2.type: type = fn_type @Compound2 [concrete] @@ -370,7 +370,7 @@ fn Works() { // CHECK:STDOUT: %K1.facet.07e9b4.2: %K1.type = facet_value %V.as_type, (%V.as_wit.iface0) [symbolic] // CHECK:STDOUT: %.d66c00.2: type = fn_type_with_self_type %Q1.type, %K1.facet.07e9b4.2 [symbolic] // CHECK:STDOUT: %impl.elem0.d9a98e.2: %.d66c00.2 = impl_witness_access %V.as_wit.iface0, element0 [symbolic] -// CHECK:STDOUT: %specific_fn.4c5be7.2: = specific_function %impl.elem0.d9a98e.2, @Q1(%K1.facet.07e9b4.2) [symbolic] +// CHECK:STDOUT: %specific_impl_fn.26c74d.2: = specific_impl_function %impl.elem0.d9a98e.2, @Q1(%K1.facet.07e9b4.2) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -427,7 +427,7 @@ fn Works() { // CHECK:STDOUT: %K1.facet: %K1.type = facet_value %T.as_type.loc9_4.2, (%T.as_wit.iface0.loc9_4.2) [symbolic = %K1.facet (constants.%K1.facet.07e9b4.1)] // CHECK:STDOUT: %.loc9_4.2: type = fn_type_with_self_type constants.%Q1.type, %K1.facet [symbolic = %.loc9_4.2 (constants.%.d66c00.1)] // CHECK:STDOUT: %impl.elem0.loc9_4.2: @Simple2.%.loc9_4.2 (%.d66c00.1) = impl_witness_access %T.as_wit.iface0.loc9_4.2, element0 [symbolic = %impl.elem0.loc9_4.2 (constants.%impl.elem0.d9a98e.1)] -// CHECK:STDOUT: %specific_fn.loc9_4.2: = specific_function %impl.elem0.loc9_4.2, @Q1(%K1.facet) [symbolic = %specific_fn.loc9_4.2 (constants.%specific_fn.4c5be7.1)] +// CHECK:STDOUT: %specific_impl_fn.loc9_4.2: = specific_impl_function %impl.elem0.loc9_4.2, @Q1(%K1.facet) [symbolic = %specific_impl_fn.loc9_4.2 (constants.%specific_impl_fn.26c74d.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.patt.loc8_12.1: %K1.type) { // CHECK:STDOUT: !entry: @@ -437,8 +437,8 @@ fn Works() { // CHECK:STDOUT: %.loc9_4.1: type = converted %T.ref, %T.as_type.loc9_4.1 [symbolic = %T.as_type.loc9_4.2 (constants.%T.as_type)] // CHECK:STDOUT: %T.as_wit.iface0.loc9_4.1: = facet_access_witness %T.ref, element0 [symbolic = %T.as_wit.iface0.loc9_4.2 (constants.%T.as_wit.iface0)] // CHECK:STDOUT: %impl.elem0.loc9_4.1: @Simple2.%.loc9_4.2 (%.d66c00.1) = impl_witness_access %T.as_wit.iface0.loc9_4.1, element0 [symbolic = %impl.elem0.loc9_4.2 (constants.%impl.elem0.d9a98e.1)] -// CHECK:STDOUT: %specific_fn.loc9_4.1: = specific_function %impl.elem0.loc9_4.1, @Q1(constants.%K1.facet.07e9b4.1) [symbolic = %specific_fn.loc9_4.2 (constants.%specific_fn.4c5be7.1)] -// CHECK:STDOUT: %Q1.call: init %empty_tuple.type = call %specific_fn.loc9_4.1() +// CHECK:STDOUT: %specific_impl_fn.loc9_4.1: = specific_impl_function %impl.elem0.loc9_4.1, @Q1(constants.%K1.facet.07e9b4.1) [symbolic = %specific_impl_fn.loc9_4.2 (constants.%specific_impl_fn.26c74d.1)] +// CHECK:STDOUT: %.loc9_8: init %empty_tuple.type = call %specific_impl_fn.loc9_4.1() // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -451,9 +451,9 @@ fn Works() { // CHECK:STDOUT: %V.as_wit.iface0.loc14_4.2: = facet_access_witness %V.loc13_14.2, element0 [symbolic = %V.as_wit.iface0.loc14_4.2 (constants.%V.as_wit.iface0)] // CHECK:STDOUT: %V.as_type: type = facet_access_type %V.loc13_14.2 [symbolic = %V.as_type (constants.%V.as_type)] // CHECK:STDOUT: %K1.facet: %K1.type = facet_value %V.as_type, (%V.as_wit.iface0.loc14_4.2) [symbolic = %K1.facet (constants.%K1.facet.07e9b4.2)] -// CHECK:STDOUT: %.loc14: type = fn_type_with_self_type constants.%Q1.type, %K1.facet [symbolic = %.loc14 (constants.%.d66c00.2)] -// CHECK:STDOUT: %impl.elem0.loc14_4.2: @Compound2.%.loc14 (%.d66c00.2) = impl_witness_access %V.as_wit.iface0.loc14_4.2, element0 [symbolic = %impl.elem0.loc14_4.2 (constants.%impl.elem0.d9a98e.2)] -// CHECK:STDOUT: %specific_fn.loc14_4.2: = specific_function %impl.elem0.loc14_4.2, @Q1(%K1.facet) [symbolic = %specific_fn.loc14_4.2 (constants.%specific_fn.4c5be7.2)] +// CHECK:STDOUT: %.loc14_4: type = fn_type_with_self_type constants.%Q1.type, %K1.facet [symbolic = %.loc14_4 (constants.%.d66c00.2)] +// CHECK:STDOUT: %impl.elem0.loc14_4.2: @Compound2.%.loc14_4 (%.d66c00.2) = impl_witness_access %V.as_wit.iface0.loc14_4.2, element0 [symbolic = %impl.elem0.loc14_4.2 (constants.%impl.elem0.d9a98e.2)] +// CHECK:STDOUT: %specific_impl_fn.loc14_4.2: = specific_impl_function %impl.elem0.loc14_4.2, @Q1(%K1.facet) [symbolic = %specific_impl_fn.loc14_4.2 (constants.%specific_impl_fn.26c74d.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%V.patt.loc13_14.1: %K1.type) { // CHECK:STDOUT: !entry: @@ -461,9 +461,9 @@ fn Works() { // CHECK:STDOUT: %K1.ref.loc14: type = name_ref K1, file.%K1.decl [concrete = constants.%K1.type] // CHECK:STDOUT: %Q1.ref: %K1.assoc_type = name_ref Q1, @K1.%assoc0 [concrete = constants.%assoc0] // CHECK:STDOUT: %V.as_wit.iface0.loc14_4.1: = facet_access_witness %V.ref, element0 [symbolic = %V.as_wit.iface0.loc14_4.2 (constants.%V.as_wit.iface0)] -// CHECK:STDOUT: %impl.elem0.loc14_4.1: @Compound2.%.loc14 (%.d66c00.2) = impl_witness_access %V.as_wit.iface0.loc14_4.1, element0 [symbolic = %impl.elem0.loc14_4.2 (constants.%impl.elem0.d9a98e.2)] -// CHECK:STDOUT: %specific_fn.loc14_4.1: = specific_function %impl.elem0.loc14_4.1, @Q1(constants.%K1.facet.07e9b4.2) [symbolic = %specific_fn.loc14_4.2 (constants.%specific_fn.4c5be7.2)] -// CHECK:STDOUT: %Q1.call: init %empty_tuple.type = call %specific_fn.loc14_4.1() +// CHECK:STDOUT: %impl.elem0.loc14_4.1: @Compound2.%.loc14_4 (%.d66c00.2) = impl_witness_access %V.as_wit.iface0.loc14_4.1, element0 [symbolic = %impl.elem0.loc14_4.2 (constants.%impl.elem0.d9a98e.2)] +// CHECK:STDOUT: %specific_impl_fn.loc14_4.1: = specific_impl_function %impl.elem0.loc14_4.1, @Q1(constants.%K1.facet.07e9b4.2) [symbolic = %specific_impl_fn.loc14_4.2 (constants.%specific_impl_fn.26c74d.2)] +// CHECK:STDOUT: %.loc14_13: init %empty_tuple.type = call %specific_impl_fn.loc14_4.1() // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -508,7 +508,7 @@ fn Works() { // CHECK:STDOUT: %K2.facet: %K2.type = facet_value %T.as_type, (%T.as_wit.iface0) [symbolic] // CHECK:STDOUT: %.75b: type = fn_type_with_self_type %Q2.type, %K2.facet [symbolic] // CHECK:STDOUT: %impl.elem0: %.75b = impl_witness_access %T.as_wit.iface0, element0 [symbolic] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Q2(%K2.facet) [symbolic] +// CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem0, @Q2(%K2.facet) [symbolic] // CHECK:STDOUT: %V: %K2.type = bind_symbolic_name V, 0 [symbolic] // CHECK:STDOUT: %V.patt: %K2.type = symbolic_binding_pattern V, 0 [symbolic] // CHECK:STDOUT: %V.as_type: type = facet_access_type %V [symbolic] @@ -672,7 +672,7 @@ fn Works() { // CHECK:STDOUT: %K2.facet: %K2.type = facet_value %T.as_type.loc8_23.2, (%T.as_wit.iface0.loc9_4.2) [symbolic = %K2.facet (constants.%K2.facet)] // CHECK:STDOUT: %.loc9_4.2: type = fn_type_with_self_type constants.%Q2.type, %K2.facet [symbolic = %.loc9_4.2 (constants.%.75b)] // CHECK:STDOUT: %impl.elem0.loc9_4.2: @Simple3.%.loc9_4.2 (%.75b) = impl_witness_access %T.as_wit.iface0.loc9_4.2, element0 [symbolic = %impl.elem0.loc9_4.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %specific_fn.loc9_4.2: = specific_function %impl.elem0.loc9_4.2, @Q2(%K2.facet) [symbolic = %specific_fn.loc9_4.2 (constants.%specific_fn)] +// CHECK:STDOUT: %specific_impl_fn.loc9_4.2: = specific_impl_function %impl.elem0.loc9_4.2, @Q2(%K2.facet) [symbolic = %specific_impl_fn.loc9_4.2 (constants.%specific_impl_fn)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.patt.loc8_12.1: %K2.type, %x.param_patt: @Simple3.%T.as_type.loc8_23.2 (%T.as_type)) { // CHECK:STDOUT: !entry: @@ -682,8 +682,8 @@ fn Works() { // CHECK:STDOUT: %.loc9_4.1: type = converted constants.%T.0ce, %T.as_type.loc9 [symbolic = %T.as_type.loc8_23.2 (constants.%T.as_type)] // CHECK:STDOUT: %T.as_wit.iface0.loc9_4.1: = facet_access_witness constants.%T.0ce, element0 [symbolic = %T.as_wit.iface0.loc9_4.2 (constants.%T.as_wit.iface0)] // CHECK:STDOUT: %impl.elem0.loc9_4.1: @Simple3.%.loc9_4.2 (%.75b) = impl_witness_access %T.as_wit.iface0.loc9_4.1, element0 [symbolic = %impl.elem0.loc9_4.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %specific_fn.loc9_4.1: = specific_function %impl.elem0.loc9_4.1, @Q2(constants.%K2.facet) [symbolic = %specific_fn.loc9_4.2 (constants.%specific_fn)] -// CHECK:STDOUT: %Q2.call: init %empty_tuple.type = call %specific_fn.loc9_4.1() +// CHECK:STDOUT: %specific_impl_fn.loc9_4.1: = specific_impl_function %impl.elem0.loc9_4.1, @Q2(constants.%K2.facet) [symbolic = %specific_impl_fn.loc9_4.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %.loc9_8: init %empty_tuple.type = call %specific_impl_fn.loc9_4.1() // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -807,11 +807,11 @@ fn Works() { // CHECK:STDOUT: %L1.facet.4e6342.1: %L1.type = facet_value %T.as_type, (%T.as_wit.iface0) [symbolic] // CHECK:STDOUT: %.0c30d6.1: type = fn_type_with_self_type %R1.type, %L1.facet.4e6342.1 [symbolic] // CHECK:STDOUT: %impl.elem0.b469d1.1: %.0c30d6.1 = impl_witness_access %T.as_wit.iface0, element0 [symbolic] -// CHECK:STDOUT: %specific_fn.11de13.1: = specific_function %impl.elem0.b469d1.1, @R1(%L1.facet.4e6342.1) [symbolic] +// CHECK:STDOUT: %specific_impl_fn.5798a5.1: = specific_impl_function %impl.elem0.b469d1.1, @R1(%L1.facet.4e6342.1) [symbolic] // CHECK:STDOUT: %.e74b40.1: type = fn_type_with_self_type %S1.type, %L1.facet.4e6342.1 [symbolic] // CHECK:STDOUT: %impl.elem1.094686.1: %.e74b40.1 = impl_witness_access %T.as_wit.iface0, element1 [symbolic] // CHECK:STDOUT: %ptr.72f01d.2: type = ptr_type %T.as_type [symbolic] -// CHECK:STDOUT: %specific_fn.622338.1: = specific_function %impl.elem1.094686.1, @S1(%L1.facet.4e6342.1) [symbolic] +// CHECK:STDOUT: %specific_impl_fn.e8e9e6.1: = specific_impl_function %impl.elem1.094686.1, @S1(%L1.facet.4e6342.1) [symbolic] // CHECK:STDOUT: %require_complete.9326df.1: = require_complete_type %ptr.72f01d.2 [symbolic] // CHECK:STDOUT: %V: %L1.type = bind_symbolic_name V, 0 [symbolic] // CHECK:STDOUT: %V.patt: %L1.type = symbolic_binding_pattern V, 0 [symbolic] @@ -823,11 +823,11 @@ fn Works() { // CHECK:STDOUT: %L1.facet.4e6342.2: %L1.type = facet_value %V.as_type, (%V.as_wit.iface0) [symbolic] // CHECK:STDOUT: %.0c30d6.2: type = fn_type_with_self_type %R1.type, %L1.facet.4e6342.2 [symbolic] // CHECK:STDOUT: %impl.elem0.b469d1.2: %.0c30d6.2 = impl_witness_access %V.as_wit.iface0, element0 [symbolic] -// CHECK:STDOUT: %specific_fn.11de13.2: = specific_function %impl.elem0.b469d1.2, @R1(%L1.facet.4e6342.2) [symbolic] +// CHECK:STDOUT: %specific_impl_fn.5798a5.2: = specific_impl_function %impl.elem0.b469d1.2, @R1(%L1.facet.4e6342.2) [symbolic] // CHECK:STDOUT: %.e74b40.2: type = fn_type_with_self_type %S1.type, %L1.facet.4e6342.2 [symbolic] // CHECK:STDOUT: %impl.elem1.094686.2: %.e74b40.2 = impl_witness_access %V.as_wit.iface0, element1 [symbolic] // CHECK:STDOUT: %ptr.72f01d.3: type = ptr_type %V.as_type [symbolic] -// CHECK:STDOUT: %specific_fn.622338.2: = specific_function %impl.elem1.094686.2, @S1(%L1.facet.4e6342.2) [symbolic] +// CHECK:STDOUT: %specific_impl_fn.e8e9e6.2: = specific_impl_function %impl.elem1.094686.2, @S1(%L1.facet.4e6342.2) [symbolic] // CHECK:STDOUT: %require_complete.9326df.2: = require_complete_type %ptr.72f01d.3 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -942,10 +942,10 @@ fn Works() { // CHECK:STDOUT: %L1.facet: %L1.type = facet_value %T.as_type.loc9_23.2, (%T.as_wit.iface0.loc10_4.2) [symbolic = %L1.facet (constants.%L1.facet.4e6342.1)] // CHECK:STDOUT: %.loc10_4.2: type = fn_type_with_self_type constants.%R1.type, %L1.facet [symbolic = %.loc10_4.2 (constants.%.0c30d6.1)] // CHECK:STDOUT: %impl.elem0.loc10_4.2: @Simple4.%.loc10_4.2 (%.0c30d6.1) = impl_witness_access %T.as_wit.iface0.loc10_4.2, element0 [symbolic = %impl.elem0.loc10_4.2 (constants.%impl.elem0.b469d1.1)] -// CHECK:STDOUT: %specific_fn.loc10_4.2: = specific_function %impl.elem0.loc10_4.2, @R1(%L1.facet) [symbolic = %specific_fn.loc10_4.2 (constants.%specific_fn.11de13.1)] +// CHECK:STDOUT: %specific_impl_fn.loc10_4.2: = specific_impl_function %impl.elem0.loc10_4.2, @R1(%L1.facet) [symbolic = %specific_impl_fn.loc10_4.2 (constants.%specific_impl_fn.5798a5.1)] // CHECK:STDOUT: %.loc12_8.2: type = fn_type_with_self_type constants.%S1.type, %L1.facet [symbolic = %.loc12_8.2 (constants.%.e74b40.1)] // CHECK:STDOUT: %impl.elem1.loc12_8.2: @Simple4.%.loc12_8.2 (%.e74b40.1) = impl_witness_access %T.as_wit.iface0.loc10_4.2, element1 [symbolic = %impl.elem1.loc12_8.2 (constants.%impl.elem1.094686.1)] -// CHECK:STDOUT: %specific_fn.loc12_8.2: = specific_function %impl.elem1.loc12_8.2, @S1(%L1.facet) [symbolic = %specific_fn.loc12_8.2 (constants.%specific_fn.622338.1)] +// CHECK:STDOUT: %specific_impl_fn.loc12_8.2: = specific_impl_function %impl.elem1.loc12_8.2, @S1(%L1.facet) [symbolic = %specific_impl_fn.loc12_8.2 (constants.%specific_impl_fn.e8e9e6.1)] // CHECK:STDOUT: %ptr: type = ptr_type @Simple4.%T.as_type.loc9_23.2 (%T.as_type) [symbolic = %ptr (constants.%ptr.72f01d.2)] // CHECK:STDOUT: %require_complete.loc12: = require_complete_type @Simple4.%ptr (%ptr.72f01d.2) [symbolic = %require_complete.loc12 (constants.%require_complete.9326df.1)] // CHECK:STDOUT: @@ -958,9 +958,9 @@ fn Works() { // CHECK:STDOUT: %T.as_wit.iface0.loc10_4.1: = facet_access_witness constants.%T, element0 [symbolic = %T.as_wit.iface0.loc10_4.2 (constants.%T.as_wit.iface0)] // CHECK:STDOUT: %impl.elem0.loc10_4.1: @Simple4.%.loc10_4.2 (%.0c30d6.1) = impl_witness_access %T.as_wit.iface0.loc10_4.1, element0 [symbolic = %impl.elem0.loc10_4.2 (constants.%impl.elem0.b469d1.1)] // CHECK:STDOUT: %bound_method.loc10_4: = bound_method %x.ref.loc10, %impl.elem0.loc10_4.1 -// CHECK:STDOUT: %specific_fn.loc10_4.1: = specific_function %impl.elem0.loc10_4.1, @R1(constants.%L1.facet.4e6342.1) [symbolic = %specific_fn.loc10_4.2 (constants.%specific_fn.11de13.1)] -// CHECK:STDOUT: %bound_method.loc10_8: = bound_method %x.ref.loc10, %specific_fn.loc10_4.1 -// CHECK:STDOUT: %R1.call: init %empty_tuple.type = call %bound_method.loc10_8(%x.ref.loc10) +// CHECK:STDOUT: %specific_impl_fn.loc10_4.1: = specific_impl_function %impl.elem0.loc10_4.1, @R1(constants.%L1.facet.4e6342.1) [symbolic = %specific_impl_fn.loc10_4.2 (constants.%specific_impl_fn.5798a5.1)] +// CHECK:STDOUT: %bound_method.loc10_8: = bound_method %x.ref.loc10, %specific_impl_fn.loc10_4.1 +// CHECK:STDOUT: %.loc10_8: init %empty_tuple.type = call %bound_method.loc10_8(%x.ref.loc10) // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %xcopy.patt: @Simple4.%T.as_type.loc9_23.2 (%T.as_type) = binding_pattern xcopy // CHECK:STDOUT: %.loc11_3: @Simple4.%T.as_type.loc9_23.2 (%T.as_type) = var_pattern %xcopy.patt @@ -981,10 +981,10 @@ fn Works() { // CHECK:STDOUT: %T.as_wit.iface0.loc12: = facet_access_witness constants.%T, element0 [symbolic = %T.as_wit.iface0.loc10_4.2 (constants.%T.as_wit.iface0)] // CHECK:STDOUT: %impl.elem1.loc12_8.1: @Simple4.%.loc12_8.2 (%.e74b40.1) = impl_witness_access %T.as_wit.iface0.loc12, element1 [symbolic = %impl.elem1.loc12_8.2 (constants.%impl.elem1.094686.1)] // CHECK:STDOUT: %bound_method.loc12_8: = bound_method %xcopy.ref, %impl.elem1.loc12_8.1 -// CHECK:STDOUT: %specific_fn.loc12_8.1: = specific_function %impl.elem1.loc12_8.1, @S1(constants.%L1.facet.4e6342.1) [symbolic = %specific_fn.loc12_8.2 (constants.%specific_fn.622338.1)] -// CHECK:STDOUT: %bound_method.loc12_12: = bound_method %xcopy.ref, %specific_fn.loc12_8.1 +// CHECK:STDOUT: %specific_impl_fn.loc12_8.1: = specific_impl_function %impl.elem1.loc12_8.1, @S1(constants.%L1.facet.4e6342.1) [symbolic = %specific_impl_fn.loc12_8.2 (constants.%specific_impl_fn.e8e9e6.1)] +// CHECK:STDOUT: %bound_method.loc12_12: = bound_method %xcopy.ref, %specific_impl_fn.loc12_8.1 // CHECK:STDOUT: %addr: @Simple4.%ptr (%ptr.72f01d.2) = addr_of %xcopy.ref -// CHECK:STDOUT: %S1.call: init %empty_tuple.type = call %bound_method.loc12_12(%addr) +// CHECK:STDOUT: %.loc12_12: init %empty_tuple.type = call %bound_method.loc12_12(%addr) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -998,12 +998,12 @@ fn Works() { // CHECK:STDOUT: %require_complete.loc16: = require_complete_type @Compound4.%V.as_type.loc16_25.2 (%V.as_type) [symbolic = %require_complete.loc16 (constants.%require_complete.97cd40.2)] // CHECK:STDOUT: %V.as_wit.iface0.loc17_4.2: = facet_access_witness %V.loc16_14.2, element0 [symbolic = %V.as_wit.iface0.loc17_4.2 (constants.%V.as_wit.iface0)] // CHECK:STDOUT: %L1.facet: %L1.type = facet_value %V.as_type.loc16_25.2, (%V.as_wit.iface0.loc17_4.2) [symbolic = %L1.facet (constants.%L1.facet.4e6342.2)] -// CHECK:STDOUT: %.loc17: type = fn_type_with_self_type constants.%R1.type, %L1.facet [symbolic = %.loc17 (constants.%.0c30d6.2)] -// CHECK:STDOUT: %impl.elem0.loc17_4.2: @Compound4.%.loc17 (%.0c30d6.2) = impl_witness_access %V.as_wit.iface0.loc17_4.2, element0 [symbolic = %impl.elem0.loc17_4.2 (constants.%impl.elem0.b469d1.2)] -// CHECK:STDOUT: %specific_fn.loc17_4.2: = specific_function %impl.elem0.loc17_4.2, @R1(%L1.facet) [symbolic = %specific_fn.loc17_4.2 (constants.%specific_fn.11de13.2)] -// CHECK:STDOUT: %.loc19: type = fn_type_with_self_type constants.%S1.type, %L1.facet [symbolic = %.loc19 (constants.%.e74b40.2)] -// CHECK:STDOUT: %impl.elem1.loc19_8.2: @Compound4.%.loc19 (%.e74b40.2) = impl_witness_access %V.as_wit.iface0.loc17_4.2, element1 [symbolic = %impl.elem1.loc19_8.2 (constants.%impl.elem1.094686.2)] -// CHECK:STDOUT: %specific_fn.loc19_8.2: = specific_function %impl.elem1.loc19_8.2, @S1(%L1.facet) [symbolic = %specific_fn.loc19_8.2 (constants.%specific_fn.622338.2)] +// CHECK:STDOUT: %.loc17_4: type = fn_type_with_self_type constants.%R1.type, %L1.facet [symbolic = %.loc17_4 (constants.%.0c30d6.2)] +// CHECK:STDOUT: %impl.elem0.loc17_4.2: @Compound4.%.loc17_4 (%.0c30d6.2) = impl_witness_access %V.as_wit.iface0.loc17_4.2, element0 [symbolic = %impl.elem0.loc17_4.2 (constants.%impl.elem0.b469d1.2)] +// CHECK:STDOUT: %specific_impl_fn.loc17_4.2: = specific_impl_function %impl.elem0.loc17_4.2, @R1(%L1.facet) [symbolic = %specific_impl_fn.loc17_4.2 (constants.%specific_impl_fn.5798a5.2)] +// CHECK:STDOUT: %.loc19_8: type = fn_type_with_self_type constants.%S1.type, %L1.facet [symbolic = %.loc19_8 (constants.%.e74b40.2)] +// CHECK:STDOUT: %impl.elem1.loc19_8.2: @Compound4.%.loc19_8 (%.e74b40.2) = impl_witness_access %V.as_wit.iface0.loc17_4.2, element1 [symbolic = %impl.elem1.loc19_8.2 (constants.%impl.elem1.094686.2)] +// CHECK:STDOUT: %specific_impl_fn.loc19_8.2: = specific_impl_function %impl.elem1.loc19_8.2, @S1(%L1.facet) [symbolic = %specific_impl_fn.loc19_8.2 (constants.%specific_impl_fn.e8e9e6.2)] // CHECK:STDOUT: %ptr: type = ptr_type @Compound4.%V.as_type.loc16_25.2 (%V.as_type) [symbolic = %ptr (constants.%ptr.72f01d.3)] // CHECK:STDOUT: %require_complete.loc19: = require_complete_type @Compound4.%ptr (%ptr.72f01d.3) [symbolic = %require_complete.loc19 (constants.%require_complete.9326df.2)] // CHECK:STDOUT: @@ -1013,11 +1013,11 @@ fn Works() { // CHECK:STDOUT: %L1.ref.loc17: type = name_ref L1, file.%L1.decl [concrete = constants.%L1.type] // CHECK:STDOUT: %R1.ref: %L1.assoc_type = name_ref R1, @L1.%assoc0 [concrete = constants.%assoc0] // CHECK:STDOUT: %V.as_wit.iface0.loc17_4.1: = facet_access_witness constants.%V, element0 [symbolic = %V.as_wit.iface0.loc17_4.2 (constants.%V.as_wit.iface0)] -// CHECK:STDOUT: %impl.elem0.loc17_4.1: @Compound4.%.loc17 (%.0c30d6.2) = impl_witness_access %V.as_wit.iface0.loc17_4.1, element0 [symbolic = %impl.elem0.loc17_4.2 (constants.%impl.elem0.b469d1.2)] +// CHECK:STDOUT: %impl.elem0.loc17_4.1: @Compound4.%.loc17_4 (%.0c30d6.2) = impl_witness_access %V.as_wit.iface0.loc17_4.1, element0 [symbolic = %impl.elem0.loc17_4.2 (constants.%impl.elem0.b469d1.2)] // CHECK:STDOUT: %bound_method.loc17_4: = bound_method %y.ref.loc17, %impl.elem0.loc17_4.1 -// CHECK:STDOUT: %specific_fn.loc17_4.1: = specific_function %impl.elem0.loc17_4.1, @R1(constants.%L1.facet.4e6342.2) [symbolic = %specific_fn.loc17_4.2 (constants.%specific_fn.11de13.2)] -// CHECK:STDOUT: %bound_method.loc17_13: = bound_method %y.ref.loc17, %specific_fn.loc17_4.1 -// CHECK:STDOUT: %R1.call: init %empty_tuple.type = call %bound_method.loc17_13(%y.ref.loc17) +// CHECK:STDOUT: %specific_impl_fn.loc17_4.1: = specific_impl_function %impl.elem0.loc17_4.1, @R1(constants.%L1.facet.4e6342.2) [symbolic = %specific_impl_fn.loc17_4.2 (constants.%specific_impl_fn.5798a5.2)] +// CHECK:STDOUT: %bound_method.loc17_13: = bound_method %y.ref.loc17, %specific_impl_fn.loc17_4.1 +// CHECK:STDOUT: %.loc17_13: init %empty_tuple.type = call %bound_method.loc17_13(%y.ref.loc17) // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %ycopy.patt: @Compound4.%V.as_type.loc16_25.2 (%V.as_type) = binding_pattern ycopy // CHECK:STDOUT: %.loc18_3: @Compound4.%V.as_type.loc16_25.2 (%V.as_type) = var_pattern %ycopy.patt @@ -1035,12 +1035,12 @@ fn Works() { // CHECK:STDOUT: %L1.ref.loc19: type = name_ref L1, file.%L1.decl [concrete = constants.%L1.type] // CHECK:STDOUT: %S1.ref: %L1.assoc_type = name_ref S1, @L1.%assoc1 [concrete = constants.%assoc1] // CHECK:STDOUT: %V.as_wit.iface0.loc19: = facet_access_witness constants.%V, element0 [symbolic = %V.as_wit.iface0.loc17_4.2 (constants.%V.as_wit.iface0)] -// CHECK:STDOUT: %impl.elem1.loc19_8.1: @Compound4.%.loc19 (%.e74b40.2) = impl_witness_access %V.as_wit.iface0.loc19, element1 [symbolic = %impl.elem1.loc19_8.2 (constants.%impl.elem1.094686.2)] +// CHECK:STDOUT: %impl.elem1.loc19_8.1: @Compound4.%.loc19_8 (%.e74b40.2) = impl_witness_access %V.as_wit.iface0.loc19, element1 [symbolic = %impl.elem1.loc19_8.2 (constants.%impl.elem1.094686.2)] // CHECK:STDOUT: %bound_method.loc19_8: = bound_method %ycopy.ref, %impl.elem1.loc19_8.1 -// CHECK:STDOUT: %specific_fn.loc19_8.1: = specific_function %impl.elem1.loc19_8.1, @S1(constants.%L1.facet.4e6342.2) [symbolic = %specific_fn.loc19_8.2 (constants.%specific_fn.622338.2)] -// CHECK:STDOUT: %bound_method.loc19_17: = bound_method %ycopy.ref, %specific_fn.loc19_8.1 +// CHECK:STDOUT: %specific_impl_fn.loc19_8.1: = specific_impl_function %impl.elem1.loc19_8.1, @S1(constants.%L1.facet.4e6342.2) [symbolic = %specific_impl_fn.loc19_8.2 (constants.%specific_impl_fn.e8e9e6.2)] +// CHECK:STDOUT: %bound_method.loc19_17: = bound_method %ycopy.ref, %specific_impl_fn.loc19_8.1 // CHECK:STDOUT: %addr: @Compound4.%ptr (%ptr.72f01d.3) = addr_of %ycopy.ref -// CHECK:STDOUT: %S1.call: init %empty_tuple.type = call %bound_method.loc19_17(%addr) +// CHECK:STDOUT: %.loc19_17: init %empty_tuple.type = call %bound_method.loc19_17(%addr) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -1122,11 +1122,11 @@ fn Works() { // CHECK:STDOUT: %L2.facet: %L2.type = facet_value %T.as_type, (%T.as_wit.iface0) [symbolic] // CHECK:STDOUT: %.f52: type = fn_type_with_self_type %R2.type, %L2.facet [symbolic] // CHECK:STDOUT: %impl.elem0: %.f52 = impl_witness_access %T.as_wit.iface0, element0 [symbolic] -// CHECK:STDOUT: %specific_fn.49e: = specific_function %impl.elem0, @R2(%L2.facet) [symbolic] +// CHECK:STDOUT: %specific_impl_fn.298: = specific_impl_function %impl.elem0, @R2(%L2.facet) [symbolic] // CHECK:STDOUT: %.f66: type = fn_type_with_self_type %S2.type, %L2.facet [symbolic] // CHECK:STDOUT: %impl.elem1: %.f66 = impl_witness_access %T.as_wit.iface0, element1 [symbolic] // CHECK:STDOUT: %ptr.f3e54b.2: type = ptr_type %T.as_type [symbolic] -// CHECK:STDOUT: %specific_fn.901: = specific_function %impl.elem1, @S2(%L2.facet) [symbolic] +// CHECK:STDOUT: %specific_impl_fn.b32: = specific_impl_function %impl.elem1, @S2(%L2.facet) [symbolic] // CHECK:STDOUT: %V: %L2.type = bind_symbolic_name V, 0 [symbolic] // CHECK:STDOUT: %V.patt: %L2.type = symbolic_binding_pattern V, 0 [symbolic] // CHECK:STDOUT: %Compound5.type: type = fn_type @Compound5 [concrete] @@ -1225,10 +1225,10 @@ fn Works() { // CHECK:STDOUT: %L2.facet: %L2.type = facet_value %T.as_type.loc18_4.2, (%T.as_wit.iface0.loc18_4.2) [symbolic = %L2.facet (constants.%L2.facet)] // CHECK:STDOUT: %.loc18_4.2: type = fn_type_with_self_type constants.%R2.type, %L2.facet [symbolic = %.loc18_4.2 (constants.%.f52)] // CHECK:STDOUT: %impl.elem0.loc18_4.2: @Simple5.%.loc18_4.2 (%.f52) = impl_witness_access %T.as_wit.iface0.loc18_4.2, element0 [symbolic = %impl.elem0.loc18_4.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %specific_fn.loc18_4.2: = specific_function %impl.elem0.loc18_4.2, @R2(%L2.facet) [symbolic = %specific_fn.loc18_4.2 (constants.%specific_fn.49e)] +// CHECK:STDOUT: %specific_impl_fn.loc18_4.2: = specific_impl_function %impl.elem0.loc18_4.2, @R2(%L2.facet) [symbolic = %specific_impl_fn.loc18_4.2 (constants.%specific_impl_fn.298)] // CHECK:STDOUT: %.loc26_4.2: type = fn_type_with_self_type constants.%S2.type, %L2.facet [symbolic = %.loc26_4.2 (constants.%.f66)] // CHECK:STDOUT: %impl.elem1.loc26_4.2: @Simple5.%.loc26_4.2 (%.f66) = impl_witness_access %T.as_wit.iface0.loc18_4.2, element1 [symbolic = %impl.elem1.loc26_4.2 (constants.%impl.elem1)] -// CHECK:STDOUT: %specific_fn.loc26_4.2: = specific_function %impl.elem1.loc26_4.2, @S2(%L2.facet) [symbolic = %specific_fn.loc26_4.2 (constants.%specific_fn.901)] +// CHECK:STDOUT: %specific_impl_fn.loc26_4.2: = specific_impl_function %impl.elem1.loc26_4.2, @S2(%L2.facet) [symbolic = %specific_impl_fn.loc26_4.2 (constants.%specific_impl_fn.b32)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.patt.loc10_12.1: %L2.type) { // CHECK:STDOUT: !entry: @@ -1238,17 +1238,17 @@ fn Works() { // CHECK:STDOUT: %.loc18_4.1: type = converted %T.ref.loc18, %T.as_type.loc18_4.1 [symbolic = %T.as_type.loc18_4.2 (constants.%T.as_type)] // CHECK:STDOUT: %T.as_wit.iface0.loc18_4.1: = facet_access_witness %T.ref.loc18, element0 [symbolic = %T.as_wit.iface0.loc18_4.2 (constants.%T.as_wit.iface0)] // CHECK:STDOUT: %impl.elem0.loc18_4.1: @Simple5.%.loc18_4.2 (%.f52) = impl_witness_access %T.as_wit.iface0.loc18_4.1, element0 [symbolic = %impl.elem0.loc18_4.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %specific_fn.loc18_4.1: = specific_function %impl.elem0.loc18_4.1, @R2(constants.%L2.facet) [symbolic = %specific_fn.loc18_4.2 (constants.%specific_fn.49e)] -// CHECK:STDOUT: %R2.call: init %empty_tuple.type = call %specific_fn.loc18_4.1() +// CHECK:STDOUT: %specific_impl_fn.loc18_4.1: = specific_impl_function %impl.elem0.loc18_4.1, @R2(constants.%L2.facet) [symbolic = %specific_impl_fn.loc18_4.2 (constants.%specific_impl_fn.298)] +// CHECK:STDOUT: %.loc18_8: init %empty_tuple.type = call %specific_impl_fn.loc18_4.1() [concrete = ] // CHECK:STDOUT: %T.ref.loc26: %L2.type = name_ref T, %T.loc10_12.1 [symbolic = %T.loc10_12.2 (constants.%T)] // CHECK:STDOUT: %S2.ref: %L2.assoc_type = name_ref S2, @L2.%assoc1 [concrete = constants.%assoc1] // CHECK:STDOUT: %T.as_type.loc26: type = facet_access_type %T.ref.loc26 [symbolic = %T.as_type.loc18_4.2 (constants.%T.as_type)] // CHECK:STDOUT: %.loc26_4.1: type = converted %T.ref.loc26, %T.as_type.loc26 [symbolic = %T.as_type.loc18_4.2 (constants.%T.as_type)] // CHECK:STDOUT: %T.as_wit.iface0.loc26: = facet_access_witness %T.ref.loc26, element0 [symbolic = %T.as_wit.iface0.loc18_4.2 (constants.%T.as_wit.iface0)] // CHECK:STDOUT: %impl.elem1.loc26_4.1: @Simple5.%.loc26_4.2 (%.f66) = impl_witness_access %T.as_wit.iface0.loc26, element1 [symbolic = %impl.elem1.loc26_4.2 (constants.%impl.elem1)] -// CHECK:STDOUT: %specific_fn.loc26_4.1: = specific_function %impl.elem1.loc26_4.1, @S2(constants.%L2.facet) [symbolic = %specific_fn.loc26_4.2 (constants.%specific_fn.901)] +// CHECK:STDOUT: %specific_impl_fn.loc26_4.1: = specific_impl_function %impl.elem1.loc26_4.1, @S2(constants.%L2.facet) [symbolic = %specific_impl_fn.loc26_4.2 (constants.%specific_impl_fn.b32)] // CHECK:STDOUT: %addr: = addr_of [concrete = ] -// CHECK:STDOUT: %S2.call: init %empty_tuple.type = call %specific_fn.loc26_4.1() +// CHECK:STDOUT: %.loc26_8: init %empty_tuple.type = call %specific_impl_fn.loc26_4.1() [concrete = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_alias.carbon b/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_alias.carbon index 051adb980421..2a8f09a06e0a 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_alias.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_alias.carbon @@ -714,7 +714,7 @@ interface C { // CHECK:STDOUT: %C.facet: %C.type = facet_value %Self.as_type, (%Self.as_wit.iface0) [symbolic] // CHECK:STDOUT: %.70a: type = fn_type_with_self_type %F.type, %C.facet [symbolic] // CHECK:STDOUT: %impl.elem0: %.70a = impl_witness_access %Self.as_wit.iface0, element0 [symbolic] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @F(%C.facet) [symbolic] +// CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem0, @F(%C.facet) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -785,7 +785,7 @@ interface C { // CHECK:STDOUT: %C.facet: %C.type = facet_value %Self.as_type.loc8_14.1, (%Self.as_wit.iface0.loc10_9.2) [symbolic = %C.facet (constants.%C.facet)] // CHECK:STDOUT: %.loc10_9.2: type = fn_type_with_self_type constants.%F.type, %C.facet [symbolic = %.loc10_9.2 (constants.%.70a)] // CHECK:STDOUT: %impl.elem0.loc10_9.2: @G.%.loc10_9.2 (%.70a) = impl_witness_access %Self.as_wit.iface0.loc10_9.2, element0 [symbolic = %impl.elem0.loc10_9.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %specific_fn.loc10_9.2: = specific_function %impl.elem0.loc10_9.2, @F(%C.facet) [symbolic = %specific_fn.loc10_9.2 (constants.%specific_fn)] +// CHECK:STDOUT: %specific_impl_fn.loc10_9.2: = specific_impl_function %impl.elem0.loc10_9.2, @F(%C.facet) [symbolic = %specific_impl_fn.loc10_9.2 (constants.%specific_impl_fn)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @G.%Self.as_type.loc8_14.1 (%Self.as_type)]() { // CHECK:STDOUT: !entry: @@ -796,9 +796,9 @@ interface C { // CHECK:STDOUT: %Self.as_wit.iface0.loc10_9.1: = facet_access_witness constants.%Self, element0 [symbolic = %Self.as_wit.iface0.loc10_9.2 (constants.%Self.as_wit.iface0)] // CHECK:STDOUT: %impl.elem0.loc10_9.1: @G.%.loc10_9.2 (%.70a) = impl_witness_access %Self.as_wit.iface0.loc10_9.1, element0 [symbolic = %impl.elem0.loc10_9.2 (constants.%impl.elem0)] // CHECK:STDOUT: %bound_method.loc10_9: = bound_method %self.ref.loc10, %impl.elem0.loc10_9.1 -// CHECK:STDOUT: %specific_fn.loc10_9.1: = specific_function %impl.elem0.loc10_9.1, @F(constants.%C.facet) [symbolic = %specific_fn.loc10_9.2 (constants.%specific_fn)] -// CHECK:STDOUT: %bound_method.loc10_12: = bound_method %self.ref.loc10, %specific_fn.loc10_9.1 -// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %bound_method.loc10_12(%self.ref.loc10) +// CHECK:STDOUT: %specific_impl_fn.loc10_9.1: = specific_impl_function %impl.elem0.loc10_9.1, @F(constants.%C.facet) [symbolic = %specific_impl_fn.loc10_9.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %bound_method.loc10_12: = bound_method %self.ref.loc10, %specific_impl_fn.loc10_9.1 +// CHECK:STDOUT: %.loc10_12: init %empty_tuple.type = call %bound_method.loc10_12(%self.ref.loc10) // CHECK:STDOUT: %self.ref.loc15: @G.%Self.as_type.loc8_14.1 (%Self.as_type) = name_ref self, %self // CHECK:STDOUT: %F.ref.loc15: = name_ref F, [concrete = ] // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/interface/no_prelude/generic_method.carbon b/toolchain/check/testdata/interface/no_prelude/generic_method.carbon index a2e96145c5b0..fe37679108c6 100644 --- a/toolchain/check/testdata/interface/no_prelude/generic_method.carbon +++ b/toolchain/check/testdata/interface/no_prelude/generic_method.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/generic_method.carbon -// --- generic_method.carbon +// --- generic_method_fewer_params.carbon library "[[@TEST_NAME]]"; @@ -33,6 +33,28 @@ fn Call() { (Y as A(X)).F(Z, {}); } +fn CallGeneric(T:! A(X)) { + T.F(Z, {}); +} + +fn CallIndirect() { + CallGeneric(Y); +} + +// --- generic_method_more_params.carbon + +library "[[@TEST_NAME]]"; + +// T has index 0, Self has index 1, U has index 2. +interface A(T:! type) { + fn F(U:! type, u: U) -> (T, Self, U); +} + +class X {} +class Y1 {} +class Y2 {} +class Z {} + impl forall [V1:! type, V2:! type, W:! type] (V1, V2) as A(W) { // Here, U has index 3. The specific used for A.F needs to renumber its U from // index 2 to index 3. @@ -41,21 +63,36 @@ impl forall [V1:! type, V2:! type, W:! type] (V1, V2) as A(W) { } } -// CHECK:STDOUT: --- generic_method.carbon +fn Call() { + // TODO: The `as type` here should not be necessary. + (((Y1, Y2) as type) as A(X)).F(Z, {}); +} + +fn CallGeneric(T:! A(X)) { + T.F(Z, {}); +} + +fn CallIndirect() { + // TODO: The `as type` here should not be necessary. + CallGeneric((Y1, Y2) as type); +} + +// CHECK:STDOUT: --- generic_method_fewer_params.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: %T.8b3: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.e01: type = symbolic_binding_pattern T, 0 [symbolic] // CHECK:STDOUT: %A.type.495: type = generic_interface_type @A [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %A.generic: %A.type.495 = struct_value () [concrete] -// CHECK:STDOUT: %A.type.75a: type = facet_type <@A, @A(%T)> [symbolic] +// CHECK:STDOUT: %A.type.75a: type = facet_type <@A, @A(%T.8b3)> [symbolic] // CHECK:STDOUT: %Self: %A.type.75a = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %U.2cb: type = bind_symbolic_name U, 2 [symbolic] // CHECK:STDOUT: %U.patt.b3a: type = symbolic_binding_pattern U, 2 [symbolic] // CHECK:STDOUT: %tuple.type.e59: type = tuple_type (type, %A.type.75a, type) [symbolic] // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic] -// CHECK:STDOUT: %tuple.type.bd2: type = tuple_type (%T, %Self.as_type, %U.2cb) [symbolic] -// CHECK:STDOUT: %F.type.17a: type = fn_type @F.1, @A(%T) [symbolic] +// CHECK:STDOUT: %tuple.type.bd2: type = tuple_type (%T.8b3, %Self.as_type, %U.2cb) [symbolic] +// CHECK:STDOUT: %F.type.17a: type = fn_type @F.1, @A(%T.8b3) [symbolic] // CHECK:STDOUT: %F.0d8: %F.type.17a = struct_value () [symbolic] // CHECK:STDOUT: %A.assoc_type.d48: type = assoc_entity_type %A.type.75a [symbolic] // CHECK:STDOUT: %assoc0.7cb: %A.assoc_type.d48 = assoc_entity element0, @A.%F.decl [symbolic] @@ -69,17 +106,17 @@ impl forall [V1:! type, V2:! type, W:! type] (V1, V2) as A(W) { // CHECK:STDOUT: %F.d83: %F.type.13d = struct_value () [concrete] // CHECK:STDOUT: %A.assoc_type.f41: type = assoc_entity_type %A.type.91f [concrete] // CHECK:STDOUT: %assoc0.929: %A.assoc_type.f41 = assoc_entity element0, @A.%F.decl [concrete] -// CHECK:STDOUT: %impl_witness.ad9: = impl_witness (@impl.5ec.%F.decl) [concrete] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl) [concrete] // CHECK:STDOUT: %U.8b3: type = bind_symbolic_name U, 0 [symbolic] // CHECK:STDOUT: %U.patt.e01: type = symbolic_binding_pattern U, 0 [symbolic] // CHECK:STDOUT: %tuple.type.ff9: type = tuple_type (type, type, type) [concrete] // CHECK:STDOUT: %tuple.type.765: type = tuple_type (%X, %Y, %U.8b3) [symbolic] // CHECK:STDOUT: %F.type.436: type = fn_type @F.2 [concrete] // CHECK:STDOUT: %F.ce9: %F.type.436 = struct_value () [concrete] -// CHECK:STDOUT: %A.facet.166: %A.type.91f = facet_value %Y, (%impl_witness.ad9) [concrete] +// CHECK:STDOUT: %A.facet.166: %A.type.91f = facet_value %Y, (%impl_witness) [concrete] // CHECK:STDOUT: %tuple.type.a0c: type = tuple_type (type, %A.type.91f, type) [concrete] // CHECK:STDOUT: %require_complete.816: = require_complete_type %tuple.type.765 [symbolic] -// CHECK:STDOUT: %require_complete.4aeca8.1: = require_complete_type %U.8b3 [symbolic] +// CHECK:STDOUT: %require_complete.4ae: = require_complete_type %U.8b3 [symbolic] // CHECK:STDOUT: %tuple.type.a41: type = tuple_type (%empty_struct_type, %empty_struct_type, %U.8b3) [symbolic] // CHECK:STDOUT: %X.val: %X = struct_value () [concrete] // CHECK:STDOUT: %Y.val: %Y = struct_value () [concrete] @@ -87,38 +124,23 @@ impl forall [V1:! type, V2:! type, W:! type] (V1, V2) as A(W) { // CHECK:STDOUT: %Call: %Call.type = struct_value () [concrete] // CHECK:STDOUT: %.6fe: type = fn_type_with_self_type %F.type.13d, %A.facet.166 [concrete] // CHECK:STDOUT: %tuple.type.f6b: type = tuple_type (%X, %Y, %Z) [concrete] -// CHECK:STDOUT: %F.specific_fn.f76: = specific_function %F.ce9, @F.2(%Z) [concrete] +// CHECK:STDOUT: %F.specific_fn: = specific_function %F.ce9, @F.2(%Z) [concrete] // CHECK:STDOUT: %Z.val: %Z = struct_value () [concrete] -// CHECK:STDOUT: %V1: type = bind_symbolic_name V1, 0 [symbolic] -// CHECK:STDOUT: %V1.patt: type = symbolic_binding_pattern V1, 0 [symbolic] -// CHECK:STDOUT: %V2: type = bind_symbolic_name V2, 1 [symbolic] -// CHECK:STDOUT: %V2.patt: type = symbolic_binding_pattern V2, 1 [symbolic] -// CHECK:STDOUT: %W: type = bind_symbolic_name W, 2 [symbolic] -// CHECK:STDOUT: %W.patt: type = symbolic_binding_pattern W, 2 [symbolic] -// CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete] -// CHECK:STDOUT: %tuple.type.30b: type = tuple_type (%V1, %V2) [symbolic] -// CHECK:STDOUT: %A.type.f21: type = facet_type <@A, @A(%W)> [symbolic] -// CHECK:STDOUT: %F.type.904: type = fn_type @F.1, @A(%W) [symbolic] -// CHECK:STDOUT: %F.1ee: %F.type.904 = struct_value () [symbolic] -// CHECK:STDOUT: %A.assoc_type.e6d: type = assoc_entity_type %A.type.f21 [symbolic] -// CHECK:STDOUT: %assoc0.4a9: %A.assoc_type.e6d = assoc_entity element0, @A.%F.decl [symbolic] -// CHECK:STDOUT: %require_complete.796: = require_complete_type %A.type.f21 [symbolic] -// CHECK:STDOUT: %impl_witness.0d8: = impl_witness (@impl.220.%F.decl), @impl.220(%V1, %V2, %W) [symbolic] -// CHECK:STDOUT: %U.753: type = bind_symbolic_name U, 3 [symbolic] -// CHECK:STDOUT: %U.patt.cfd: type = symbolic_binding_pattern U, 3 [symbolic] -// CHECK:STDOUT: %tuple.type.11f: type = tuple_type (type, %tuple.type.24b, type) [concrete] -// CHECK:STDOUT: %tuple.type.8ae: type = tuple_type (%W, %tuple.type.30b, %U.753) [symbolic] -// CHECK:STDOUT: %F.type.b3e: type = fn_type @F.3, @impl.220(%V1, %V2, %W) [symbolic] -// CHECK:STDOUT: %F.d79: %F.type.b3e = struct_value () [symbolic] -// CHECK:STDOUT: %A.facet.412: %A.type.f21 = facet_value %tuple.type.30b, (%impl_witness.0d8) [symbolic] -// CHECK:STDOUT: %tuple.type.136: type = tuple_type (type, %A.type.f21, type) [symbolic] -// CHECK:STDOUT: %require_complete.d4d: = require_complete_type %tuple.type.8ae [symbolic] -// CHECK:STDOUT: %require_complete.ed4: = require_complete_type %U.753 [symbolic] -// CHECK:STDOUT: %F.specific_fn.7d9: = specific_function %F.d79, @F.3(%V1, %V2, %W, %U.753) [symbolic] -// CHECK:STDOUT: %require_complete.f7f: = require_complete_type %W [symbolic] -// CHECK:STDOUT: %require_complete.fe1: = require_complete_type %tuple.type.30b [symbolic] -// CHECK:STDOUT: %require_complete.4aeca8.2: = require_complete_type %V1 [symbolic] -// CHECK:STDOUT: %require_complete.b54: = require_complete_type %V2 [symbolic] +// CHECK:STDOUT: %T.9c2: %A.type.91f = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.e81: %A.type.91f = symbolic_binding_pattern T, 0 [symbolic] +// CHECK:STDOUT: %CallGeneric.type: type = fn_type @CallGeneric [concrete] +// CHECK:STDOUT: %CallGeneric: %CallGeneric.type = struct_value () [concrete] +// CHECK:STDOUT: %T.as_type: type = facet_access_type %T.9c2 [symbolic] +// CHECK:STDOUT: %T.as_wit.iface0: = facet_access_witness %T.9c2, element0 [symbolic] +// CHECK:STDOUT: %A.facet.834: %A.type.91f = facet_value %T.as_type, (%T.as_wit.iface0) [symbolic] +// CHECK:STDOUT: %.591: type = fn_type_with_self_type %F.type.13d, %A.facet.834 [symbolic] +// CHECK:STDOUT: %impl.elem0: %.591 = impl_witness_access %T.as_wit.iface0, element0 [symbolic] +// CHECK:STDOUT: %tuple.type.e28: type = tuple_type (%X, %T.as_type, %Z) [symbolic] +// CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem0, @F.1(%X, %A.facet.834, %Z) [symbolic] +// CHECK:STDOUT: %require_complete.500: = require_complete_type %tuple.type.e28 [symbolic] +// CHECK:STDOUT: %CallIndirect.type: type = fn_type @CallIndirect [concrete] +// CHECK:STDOUT: %CallIndirect: %CallIndirect.type = struct_value () [concrete] +// CHECK:STDOUT: %CallGeneric.specific_fn: = specific_function %CallGeneric, @CallGeneric(%A.facet.166) [concrete] // CHECK:STDOUT: %complete_type.a64: = complete_type_witness %tuple.type.f6b [concrete] // CHECK:STDOUT: %tuple.type.9c8: type = tuple_type (%empty_struct_type, %empty_struct_type, %Z) [concrete] // CHECK:STDOUT: } @@ -130,45 +152,41 @@ impl forall [V1:! type, V2:! type, W:! type] (V1, V2) as A(W) { // CHECK:STDOUT: .Y = %Y.decl // CHECK:STDOUT: .Z = %Z.decl // CHECK:STDOUT: .Call = %Call.decl +// CHECK:STDOUT: .CallGeneric = %CallGeneric.decl +// CHECK:STDOUT: .CallIndirect = %CallIndirect.decl // CHECK:STDOUT: } // CHECK:STDOUT: %A.decl: %A.type.495 = interface_decl @A [concrete = constants.%A.generic] { -// CHECK:STDOUT: %T.patt.loc5_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc5_13.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.patt.loc5_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc5_13.2 (constants.%T.patt.e01)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.loc5_13.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc5_13.2 (constants.%T)] +// CHECK:STDOUT: %T.loc5_13.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc5_13.2 (constants.%T.8b3)] // CHECK:STDOUT: } // CHECK:STDOUT: %X.decl: type = class_decl @X [concrete = constants.%X] {} {} // CHECK:STDOUT: %Y.decl: type = class_decl @Y [concrete = constants.%Y] {} {} // CHECK:STDOUT: %Z.decl: type = class_decl @Z [concrete = constants.%Z] {} {} -// CHECK:STDOUT: impl_decl @impl.5ec [concrete] {} { +// CHECK:STDOUT: impl_decl @impl [concrete] {} { // CHECK:STDOUT: %Y.ref: type = name_ref Y, file.%Y.decl [concrete = constants.%Y] // CHECK:STDOUT: %A.ref: %A.type.495 = name_ref A, file.%A.decl [concrete = constants.%A.generic] // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %A.type: type = facet_type <@A, @A(constants.%X)> [concrete = constants.%A.type.91f] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl_witness.loc13: = impl_witness (@impl.5ec.%F.decl) [concrete = constants.%impl_witness.ad9] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl) [concrete = constants.%impl_witness] // CHECK:STDOUT: %Call.decl: %Call.type = fn_decl @Call [concrete = constants.%Call] {} {} -// CHECK:STDOUT: impl_decl @impl.220 [concrete] { -// CHECK:STDOUT: %V1.patt.loc25_14.1: type = symbolic_binding_pattern V1, 0 [symbolic = %V1.patt.loc25_14.2 (constants.%V1.patt)] -// CHECK:STDOUT: %V2.patt.loc25_25.1: type = symbolic_binding_pattern V2, 1 [symbolic = %V2.patt.loc25_25.2 (constants.%V2.patt)] -// CHECK:STDOUT: %W.patt.loc25_36.1: type = symbolic_binding_pattern W, 2 [symbolic = %W.patt.loc25_36.2 (constants.%W.patt)] +// CHECK:STDOUT: %CallGeneric.decl: %CallGeneric.type = fn_decl @CallGeneric [concrete = constants.%CallGeneric] { +// CHECK:STDOUT: %T.patt.loc25_16.1: %A.type.91f = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc25_16.2 (constants.%T.patt.e81)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %V1.ref: type = name_ref V1, %V1.loc25_14.1 [symbolic = %V1.loc25_14.2 (constants.%V1)] -// CHECK:STDOUT: %V2.ref: type = name_ref V2, %V2.loc25_25.1 [symbolic = %V2.loc25_25.2 (constants.%V2)] -// CHECK:STDOUT: %.loc25_53.1: %tuple.type.24b = tuple_literal (%V1.ref, %V2.ref) -// CHECK:STDOUT: %.loc25_53.2: type = converted %.loc25_53.1, constants.%tuple.type.30b [symbolic = %tuple.type (constants.%tuple.type.30b)] -// CHECK:STDOUT: %A.ref: %A.type.495 = name_ref A, file.%A.decl [concrete = constants.%A.generic] -// CHECK:STDOUT: %W.ref: type = name_ref W, %W.loc25_36.1 [symbolic = %W.loc25_36.2 (constants.%W)] -// CHECK:STDOUT: %A.type.loc25_61.1: type = facet_type <@A, @A(constants.%W)> [symbolic = %A.type.loc25_61.2 (constants.%A.type.f21)] -// CHECK:STDOUT: %V1.loc25_14.1: type = bind_symbolic_name V1, 0 [symbolic = %V1.loc25_14.2 (constants.%V1)] -// CHECK:STDOUT: %V2.loc25_25.1: type = bind_symbolic_name V2, 1 [symbolic = %V2.loc25_25.2 (constants.%V2)] -// CHECK:STDOUT: %W.loc25_36.1: type = bind_symbolic_name W, 2 [symbolic = %W.loc25_36.2 (constants.%W)] +// CHECK:STDOUT: %.loc25: type = splice_block %A.type [concrete = constants.%A.type.91f] { +// CHECK:STDOUT: %A.ref: %A.type.495 = name_ref A, file.%A.decl [concrete = constants.%A.generic] +// CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %A.type: type = facet_type <@A, @A(constants.%X)> [concrete = constants.%A.type.91f] +// CHECK:STDOUT: } +// CHECK:STDOUT: %T.loc25_16.1: %A.type.91f = bind_symbolic_name T, 0 [symbolic = %T.loc25_16.2 (constants.%T.9c2)] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl_witness.loc25: = impl_witness (@impl.220.%F.decl), @impl.220(constants.%V1, constants.%V2, constants.%W) [symbolic = @impl.220.%impl_witness (constants.%impl_witness.0d8)] +// CHECK:STDOUT: %CallIndirect.decl: %CallIndirect.type = fn_decl @CallIndirect [concrete = constants.%CallIndirect] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @A(%T.loc5_13.1: type) { -// CHECK:STDOUT: %T.loc5_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc5_13.2 (constants.%T)] -// CHECK:STDOUT: %T.patt.loc5_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc5_13.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.loc5_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc5_13.2 (constants.%T.8b3)] +// CHECK:STDOUT: %T.patt.loc5_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc5_13.2 (constants.%T.patt.e01)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %A.type: type = facet_type <@A, @A(%T.loc5_13.2)> [symbolic = %A.type (constants.%A.type.75a)] @@ -187,8 +205,8 @@ impl forall [V1:! type, V2:! type, W:! type] (V1, V2) as A(W) { // CHECK:STDOUT: %return.patt: @F.1.%tuple.type.loc6_38.2 (%tuple.type.bd2) = return_slot_pattern // CHECK:STDOUT: %return.param_patt: @F.1.%tuple.type.loc6_38.2 (%tuple.type.bd2) = out_param_pattern %return.patt, call_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref: type = name_ref T, @A.%T.loc5_13.1 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %.loc6_31: @F.1.%A.type (%A.type.75a) = specific_constant @A.%Self.1, @A(constants.%T) [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %T.ref: type = name_ref T, @A.%T.loc5_13.1 [symbolic = %T (constants.%T.8b3)] +// CHECK:STDOUT: %.loc6_31: @F.1.%A.type (%A.type.75a) = specific_constant @A.%Self.1, @A(constants.%T.8b3) [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %Self.ref: @F.1.%A.type (%A.type.75a) = name_ref Self, %.loc6_31 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %U.ref.loc6_37: type = name_ref U, %U.loc6_8.2 [symbolic = %U.loc6_8.1 (constants.%U.2cb)] // CHECK:STDOUT: %.loc6_38.1: @F.1.%tuple.type.loc6_38.1 (%tuple.type.e59) = tuple_literal (%T.ref, %Self.ref, %U.ref.loc6_37) @@ -212,7 +230,7 @@ impl forall [V1:! type, V2:! type, W:! type] (V1, V2) as A(W) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.5ec: %Y.ref as %A.type { +// CHECK:STDOUT: impl @impl: %Y.ref as %A.type { // CHECK:STDOUT: %F.decl: %F.type.436 = fn_decl @F.2 [concrete = constants.%F.ce9] { // CHECK:STDOUT: %U.patt.loc16_8.1: type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc16_8.2 (constants.%U.patt.e01)] // CHECK:STDOUT: %u.patt: @F.2.%U.loc16_8.1 (%U.8b3) = binding_pattern u @@ -237,56 +255,7 @@ impl forall [V1:! type, V2:! type, W:! type] (V1, V2) as A(W) { // CHECK:STDOUT: .X = // CHECK:STDOUT: .Y = // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = file.%impl_witness.loc13 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.220(%V1.loc25_14.1: type, %V2.loc25_25.1: type, %W.loc25_36.1: type) { -// CHECK:STDOUT: %V1.loc25_14.2: type = bind_symbolic_name V1, 0 [symbolic = %V1.loc25_14.2 (constants.%V1)] -// CHECK:STDOUT: %V1.patt.loc25_14.2: type = symbolic_binding_pattern V1, 0 [symbolic = %V1.patt.loc25_14.2 (constants.%V1.patt)] -// CHECK:STDOUT: %V2.loc25_25.2: type = bind_symbolic_name V2, 1 [symbolic = %V2.loc25_25.2 (constants.%V2)] -// CHECK:STDOUT: %V2.patt.loc25_25.2: type = symbolic_binding_pattern V2, 1 [symbolic = %V2.patt.loc25_25.2 (constants.%V2.patt)] -// CHECK:STDOUT: %W.loc25_36.2: type = bind_symbolic_name W, 2 [symbolic = %W.loc25_36.2 (constants.%W)] -// CHECK:STDOUT: %W.patt.loc25_36.2: type = symbolic_binding_pattern W, 2 [symbolic = %W.patt.loc25_36.2 (constants.%W.patt)] -// CHECK:STDOUT: %tuple.type: type = tuple_type (@impl.220.%V1.loc25_14.2 (%V1), @impl.220.%V2.loc25_25.2 (%V2)) [symbolic = %tuple.type (constants.%tuple.type.30b)] -// CHECK:STDOUT: %A.type.loc25_61.2: type = facet_type <@A, @A(%W.loc25_36.2)> [symbolic = %A.type.loc25_61.2 (constants.%A.type.f21)] -// CHECK:STDOUT: %require_complete: = require_complete_type @impl.220.%A.type.loc25_61.2 (%A.type.f21) [symbolic = %require_complete (constants.%require_complete.796)] -// CHECK:STDOUT: %impl_witness: = impl_witness (%F.decl), @impl.220(%V1.loc25_14.2, %V2.loc25_25.2, %W.loc25_36.2) [symbolic = %impl_witness (constants.%impl_witness.0d8)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %F.type: type = fn_type @F.3, @impl.220(%V1.loc25_14.2, %V2.loc25_25.2, %W.loc25_36.2) [symbolic = %F.type (constants.%F.type.b3e)] -// CHECK:STDOUT: %F: @impl.220.%F.type (%F.type.b3e) = struct_value () [symbolic = %F (constants.%F.d79)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: %.loc25_53.2 as %A.type.loc25_61.1 { -// CHECK:STDOUT: %F.decl: @impl.220.%F.type (%F.type.b3e) = fn_decl @F.3 [symbolic = @impl.220.%F (constants.%F.d79)] { -// CHECK:STDOUT: %U.patt.loc28_8.1: type = symbolic_binding_pattern U, 3 [symbolic = %U.patt.loc28_8.2 (constants.%U.patt.cfd)] -// CHECK:STDOUT: %u.patt: @F.3.%U.loc28_8.1 (%U.753) = binding_pattern u -// CHECK:STDOUT: %u.param_patt: @F.3.%U.loc28_8.1 (%U.753) = value_param_pattern %u.patt, call_param0 -// CHECK:STDOUT: %return.patt: @F.3.%tuple.type.loc28_42.2 (%tuple.type.8ae) = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: @F.3.%tuple.type.loc28_42.2 (%tuple.type.8ae) = out_param_pattern %return.patt, call_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %W.ref: type = name_ref W, @impl.220.%W.loc25_36.1 [symbolic = %W (constants.%W)] -// CHECK:STDOUT: %V1.ref: type = name_ref V1, @impl.220.%V1.loc25_14.1 [symbolic = %V1 (constants.%V1)] -// CHECK:STDOUT: %V2.ref: type = name_ref V2, @impl.220.%V2.loc25_25.1 [symbolic = %V2 (constants.%V2)] -// CHECK:STDOUT: %.loc28_38: %tuple.type.24b = tuple_literal (%V1.ref, %V2.ref) -// CHECK:STDOUT: %U.ref.loc28_41: type = name_ref U, %U.loc28_8.2 [symbolic = %U.loc28_8.1 (constants.%U.753)] -// CHECK:STDOUT: %.loc28_42.1: %tuple.type.11f = tuple_literal (%W.ref, %.loc28_38, %U.ref.loc28_41) -// CHECK:STDOUT: %.loc28_42.2: type = converted %.loc28_38, constants.%tuple.type.30b [symbolic = %tuple.type.loc28_42.1 (constants.%tuple.type.30b)] -// CHECK:STDOUT: %.loc28_42.3: type = converted %.loc28_42.1, constants.%tuple.type.8ae [symbolic = %tuple.type.loc28_42.2 (constants.%tuple.type.8ae)] -// CHECK:STDOUT: %U.loc28_8.2: type = bind_symbolic_name U, 3 [symbolic = %U.loc28_8.1 (constants.%U.753)] -// CHECK:STDOUT: %u.param: @F.3.%U.loc28_8.1 (%U.753) = value_param call_param0 -// CHECK:STDOUT: %U.ref.loc28_21: type = name_ref U, %U.loc28_8.2 [symbolic = %U.loc28_8.1 (constants.%U.753)] -// CHECK:STDOUT: %u: @F.3.%U.loc28_8.1 (%U.753) = bind_name u, %u.param -// CHECK:STDOUT: %return.param: ref @F.3.%tuple.type.loc28_42.2 (%tuple.type.8ae) = out_param call_param1 -// CHECK:STDOUT: %return: ref @F.3.%tuple.type.loc28_42.2 (%tuple.type.8ae) = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .W = -// CHECK:STDOUT: .V1 = -// CHECK:STDOUT: .V2 = -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = file.%impl_witness.loc25 -// CHECK:STDOUT: } +// CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @X { @@ -316,12 +285,12 @@ impl forall [V1:! type, V2:! type, W:! type] (V1, V2) as A(W) { // CHECK:STDOUT: generic fn @F.1(@A.%T.loc5_13.1: type, @A.%Self.1: @A.%A.type (%A.type.75a), %U.loc6_8.2: type) { // CHECK:STDOUT: %U.loc6_8.1: type = bind_symbolic_name U, 2 [symbolic = %U.loc6_8.1 (constants.%U.2cb)] // CHECK:STDOUT: %U.patt.loc6_8.2: type = symbolic_binding_pattern U, 2 [symbolic = %U.patt.loc6_8.2 (constants.%U.patt.b3a)] -// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T.8b3)] // CHECK:STDOUT: %A.type: type = facet_type <@A, @A(%T)> [symbolic = %A.type (constants.%A.type.75a)] // CHECK:STDOUT: %Self: %A.type.75a = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %tuple.type.loc6_38.1: type = tuple_type (type, @F.1.%A.type (%A.type.75a), type) [symbolic = %tuple.type.loc6_38.1 (constants.%tuple.type.e59)] // CHECK:STDOUT: %Self.as_type.loc6_38.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc6_38.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %tuple.type.loc6_38.2: type = tuple_type (@F.1.%T (%T), @F.1.%Self.as_type.loc6_38.1 (%Self.as_type), @F.1.%U.loc6_8.1 (%U.2cb)) [symbolic = %tuple.type.loc6_38.2 (constants.%tuple.type.bd2)] +// CHECK:STDOUT: %tuple.type.loc6_38.2: type = tuple_type (@F.1.%T (%T.8b3), @F.1.%Self.as_type.loc6_38.1 (%Self.as_type), @F.1.%U.loc6_8.1 (%U.2cb)) [symbolic = %tuple.type.loc6_38.2 (constants.%tuple.type.bd2)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%U.patt.loc6_8.1: type, %u.param_patt: @F.1.%U.loc6_8.1 (%U.2cb)) -> @F.1.%tuple.type.loc6_38.2 (%tuple.type.bd2); // CHECK:STDOUT: } @@ -333,7 +302,7 @@ impl forall [V1:! type, V2:! type, W:! type] (V1, V2) as A(W) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc16_24: = require_complete_type @F.2.%tuple.type.loc16 (%tuple.type.765) [symbolic = %require_complete.loc16_24 (constants.%require_complete.816)] -// CHECK:STDOUT: %require_complete.loc16_19: = require_complete_type @F.2.%U.loc16_8.1 (%U.8b3) [symbolic = %require_complete.loc16_19 (constants.%require_complete.4aeca8.1)] +// CHECK:STDOUT: %require_complete.loc16_19: = require_complete_type @F.2.%U.loc16_8.1 (%U.8b3) [symbolic = %require_complete.loc16_19 (constants.%require_complete.4ae)] // CHECK:STDOUT: %tuple.type.loc17: type = tuple_type (%empty_struct_type, %empty_struct_type, @F.2.%U.loc16_8.1 (%U.8b3)) [symbolic = %tuple.type.loc17 (constants.%tuple.type.a41)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%U.patt.loc16_8.1: type, %u.param_patt: @F.2.%U.loc16_8.1 (%U.8b3)) -> %return.param_patt: @F.2.%tuple.type.loc16 (%tuple.type.765) { @@ -362,17 +331,17 @@ impl forall [V1:! type, V2:! type, W:! type] (V1, V2) as A(W) { // CHECK:STDOUT: %A.ref: %A.type.495 = name_ref A, file.%A.decl [concrete = constants.%A.generic] // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %A.type: type = facet_type <@A, @A(constants.%X)> [concrete = constants.%A.type.91f] -// CHECK:STDOUT: %A.facet: %A.type.91f = facet_value constants.%Y, (constants.%impl_witness.ad9) [concrete = constants.%A.facet.166] +// CHECK:STDOUT: %A.facet: %A.type.91f = facet_value constants.%Y, (constants.%impl_witness) [concrete = constants.%A.facet.166] // CHECK:STDOUT: %.loc22_6: %A.type.91f = converted %Y.ref, %A.facet [concrete = constants.%A.facet.166] // CHECK:STDOUT: %.loc22_14.1: %A.assoc_type.f41 = specific_constant @A.%assoc0.loc6_39.1, @A(constants.%X) [concrete = constants.%assoc0.929] // CHECK:STDOUT: %F.ref: %A.assoc_type.f41 = name_ref F, %.loc22_14.1 [concrete = constants.%assoc0.929] // CHECK:STDOUT: %as_type: type = facet_access_type %.loc22_6 [concrete = constants.%Y] // CHECK:STDOUT: %.loc22_14.2: type = converted %.loc22_6, %as_type [concrete = constants.%Y] -// CHECK:STDOUT: %as_wit.iface0: = facet_access_witness %.loc22_6, element0 [concrete = constants.%impl_witness.ad9] +// CHECK:STDOUT: %as_wit.iface0: = facet_access_witness %.loc22_6, element0 [concrete = constants.%impl_witness] // CHECK:STDOUT: %impl.elem0: %.6fe = impl_witness_access %as_wit.iface0, element0 [concrete = constants.%F.ce9] // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z] // CHECK:STDOUT: %.loc22_21.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @F.2(constants.%Z) [concrete = constants.%F.specific_fn.f76] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @F.2(constants.%Z) [concrete = constants.%F.specific_fn] // CHECK:STDOUT: %.loc22_22.1: ref %tuple.type.f6b = temporary_storage // CHECK:STDOUT: %.loc22_21.2: ref %Z = temporary_storage // CHECK:STDOUT: %.loc22_21.3: init %Z = class_init (), %.loc22_21.2 [concrete = constants.%Z.val] @@ -384,71 +353,64 @@ impl forall [V1:! type, V2:! type, W:! type] (V1, V2) as A(W) { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F.3(@impl.220.%V1.loc25_14.1: type, @impl.220.%V2.loc25_25.1: type, @impl.220.%W.loc25_36.1: type, %U.loc28_8.2: type) { -// CHECK:STDOUT: %U.loc28_8.1: type = bind_symbolic_name U, 3 [symbolic = %U.loc28_8.1 (constants.%U.753)] -// CHECK:STDOUT: %U.patt.loc28_8.2: type = symbolic_binding_pattern U, 3 [symbolic = %U.patt.loc28_8.2 (constants.%U.patt.cfd)] -// CHECK:STDOUT: %W: type = bind_symbolic_name W, 2 [symbolic = %W (constants.%W)] -// CHECK:STDOUT: %V1: type = bind_symbolic_name V1, 0 [symbolic = %V1 (constants.%V1)] -// CHECK:STDOUT: %V2: type = bind_symbolic_name V2, 1 [symbolic = %V2 (constants.%V2)] -// CHECK:STDOUT: %tuple.type.loc28_42.1: type = tuple_type (@F.3.%V1 (%V1), @F.3.%V2 (%V2)) [symbolic = %tuple.type.loc28_42.1 (constants.%tuple.type.30b)] -// CHECK:STDOUT: %tuple.type.loc28_42.2: type = tuple_type (@F.3.%W (%W), @F.3.%tuple.type.loc28_42.1 (%tuple.type.30b), @F.3.%U.loc28_8.1 (%U.753)) [symbolic = %tuple.type.loc28_42.2 (constants.%tuple.type.8ae)] +// CHECK:STDOUT: generic fn @CallGeneric(%T.loc25_16.1: %A.type.91f) { +// CHECK:STDOUT: %T.loc25_16.2: %A.type.91f = bind_symbolic_name T, 0 [symbolic = %T.loc25_16.2 (constants.%T.9c2)] +// CHECK:STDOUT: %T.patt.loc25_16.2: %A.type.91f = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc25_16.2 (constants.%T.patt.e81)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc28_24: = require_complete_type @F.3.%tuple.type.loc28_42.2 (%tuple.type.8ae) [symbolic = %require_complete.loc28_24 (constants.%require_complete.d4d)] -// CHECK:STDOUT: %require_complete.loc28_19: = require_complete_type @F.3.%U.loc28_8.1 (%U.753) [symbolic = %require_complete.loc28_19 (constants.%require_complete.ed4)] -// CHECK:STDOUT: %F.type: type = fn_type @F.3, @impl.220(%V1, %V2, %W) [symbolic = %F.type (constants.%F.type.b3e)] -// CHECK:STDOUT: %F: @F.3.%F.type (%F.type.b3e) = struct_value () [symbolic = %F (constants.%F.d79)] -// CHECK:STDOUT: %F.specific_fn.loc29_12.2: = specific_function %F, @F.3(%V1, %V2, %W, %U.loc28_8.1) [symbolic = %F.specific_fn.loc29_12.2 (constants.%F.specific_fn.7d9)] -// CHECK:STDOUT: %require_complete.loc29_18.1: = require_complete_type @F.3.%W (%W) [symbolic = %require_complete.loc29_18.1 (constants.%require_complete.f7f)] -// CHECK:STDOUT: %require_complete.loc29_18.2: = require_complete_type @F.3.%tuple.type.loc28_42.1 (%tuple.type.30b) [symbolic = %require_complete.loc29_18.2 (constants.%require_complete.fe1)] -// CHECK:STDOUT: %require_complete.loc29_18.3: = require_complete_type @F.3.%V1 (%V1) [symbolic = %require_complete.loc29_18.3 (constants.%require_complete.4aeca8.2)] -// CHECK:STDOUT: %require_complete.loc29_18.4: = require_complete_type @F.3.%V2 (%V2) [symbolic = %require_complete.loc29_18.4 (constants.%require_complete.b54)] +// CHECK:STDOUT: %T.as_type.loc26_4.2: type = facet_access_type %T.loc25_16.2 [symbolic = %T.as_type.loc26_4.2 (constants.%T.as_type)] +// CHECK:STDOUT: %T.as_wit.iface0.loc26_4.2: = facet_access_witness %T.loc25_16.2, element0 [symbolic = %T.as_wit.iface0.loc26_4.2 (constants.%T.as_wit.iface0)] +// CHECK:STDOUT: %A.facet: %A.type.91f = facet_value %T.as_type.loc26_4.2, (%T.as_wit.iface0.loc26_4.2) [symbolic = %A.facet (constants.%A.facet.834)] +// CHECK:STDOUT: %.loc26_4.3: type = fn_type_with_self_type constants.%F.type.13d, %A.facet [symbolic = %.loc26_4.3 (constants.%.591)] +// CHECK:STDOUT: %impl.elem0.loc26_4.2: @CallGeneric.%.loc26_4.3 (%.591) = impl_witness_access %T.as_wit.iface0.loc26_4.2, element0 [symbolic = %impl.elem0.loc26_4.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %specific_impl_fn.loc26_4.2: = specific_impl_function %impl.elem0.loc26_4.2, @F.1(constants.%X, %A.facet, constants.%Z) [symbolic = %specific_impl_fn.loc26_4.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %tuple.type: type = tuple_type (%X, @CallGeneric.%T.as_type.loc26_4.2 (%T.as_type), %Z) [symbolic = %tuple.type (constants.%tuple.type.e28)] +// CHECK:STDOUT: %require_complete: = require_complete_type @CallGeneric.%tuple.type (%tuple.type.e28) [symbolic = %require_complete (constants.%require_complete.500)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%U.patt.loc28_8.1: type, %u.param_patt: @F.3.%U.loc28_8.1 (%U.753)) -> %return.param_patt: @F.3.%tuple.type.loc28_42.2 (%tuple.type.8ae) { +// CHECK:STDOUT: fn(%T.patt.loc25_16.1: %A.type.91f) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc29_12: @F.3.%F.type (%F.type.b3e) = specific_constant @impl.220.%F.decl, @impl.220(constants.%V1, constants.%V2, constants.%W) [symbolic = %F (constants.%F.d79)] -// CHECK:STDOUT: %F.ref: @F.3.%F.type (%F.type.b3e) = name_ref F, %.loc29_12 [symbolic = %F (constants.%F.d79)] -// CHECK:STDOUT: %U.ref.loc29: type = name_ref U, %U.loc28_8.2 [symbolic = %U.loc28_8.1 (constants.%U.753)] -// CHECK:STDOUT: %u.ref: @F.3.%U.loc28_8.1 (%U.753) = name_ref u, %u -// CHECK:STDOUT: %F.specific_fn.loc29_12.1: = specific_function %F.ref, @F.3(constants.%V1, constants.%V2, constants.%W, constants.%U.753) [symbolic = %F.specific_fn.loc29_12.2 (constants.%F.specific_fn.7d9)] -// CHECK:STDOUT: %.loc29_18.1: ref @F.3.%tuple.type.loc28_42.2 (%tuple.type.8ae) = temporary_storage -// CHECK:STDOUT: %F.call: init @F.3.%tuple.type.loc28_42.2 (%tuple.type.8ae) = call %F.specific_fn.loc29_12.1(%u.ref) to %.loc29_18.1 -// CHECK:STDOUT: %.loc29_18.2: ref @F.3.%tuple.type.loc28_42.2 (%tuple.type.8ae) = temporary %.loc29_18.1, %F.call -// CHECK:STDOUT: %tuple.elem0.loc29_18.1: ref @F.3.%W (%W) = tuple_access %.loc29_18.2, element0 -// CHECK:STDOUT: %.loc29_18.3: @F.3.%W (%W) = bind_value %tuple.elem0.loc29_18.1 -// CHECK:STDOUT: %tuple.elem0.loc29_18.2: ref @F.3.%W (%W) = tuple_access %return, element0 -// CHECK:STDOUT: %.loc29_18.4: init @F.3.%W (%W) = initialize_from %.loc29_18.3 to %tuple.elem0.loc29_18.2 -// CHECK:STDOUT: %tuple.elem1.loc29_18.1: ref @F.3.%tuple.type.loc28_42.1 (%tuple.type.30b) = tuple_access %.loc29_18.2, element1 -// CHECK:STDOUT: %tuple.elem0.loc29_18.3: ref @F.3.%V1 (%V1) = tuple_access %tuple.elem1.loc29_18.1, element0 -// CHECK:STDOUT: %.loc29_18.5: @F.3.%V1 (%V1) = bind_value %tuple.elem0.loc29_18.3 -// CHECK:STDOUT: %tuple.elem1.loc29_18.2: ref @F.3.%tuple.type.loc28_42.1 (%tuple.type.30b) = tuple_access %return, element1 -// CHECK:STDOUT: %tuple.elem0.loc29_18.4: ref @F.3.%V1 (%V1) = tuple_access %tuple.elem1.loc29_18.2, element0 -// CHECK:STDOUT: %.loc29_18.6: init @F.3.%V1 (%V1) = initialize_from %.loc29_18.5 to %tuple.elem0.loc29_18.4 -// CHECK:STDOUT: %tuple.elem1.loc29_18.3: ref @F.3.%V2 (%V2) = tuple_access %tuple.elem1.loc29_18.1, element1 -// CHECK:STDOUT: %.loc29_18.7: @F.3.%V2 (%V2) = bind_value %tuple.elem1.loc29_18.3 -// CHECK:STDOUT: %tuple.elem1.loc29_18.4: ref @F.3.%V2 (%V2) = tuple_access %tuple.elem1.loc29_18.2, element1 -// CHECK:STDOUT: %.loc29_18.8: init @F.3.%V2 (%V2) = initialize_from %.loc29_18.7 to %tuple.elem1.loc29_18.4 -// CHECK:STDOUT: %.loc29_18.9: init @F.3.%tuple.type.loc28_42.1 (%tuple.type.30b) = tuple_init (%.loc29_18.6, %.loc29_18.8) to %tuple.elem1.loc29_18.2 -// CHECK:STDOUT: %.loc29_18.10: init @F.3.%tuple.type.loc28_42.1 (%tuple.type.30b) = converted %tuple.elem1.loc29_18.1, %.loc29_18.9 -// CHECK:STDOUT: %tuple.elem2.loc29_18.1: ref @F.3.%U.loc28_8.1 (%U.753) = tuple_access %.loc29_18.2, element2 -// CHECK:STDOUT: %.loc29_18.11: @F.3.%U.loc28_8.1 (%U.753) = bind_value %tuple.elem2.loc29_18.1 -// CHECK:STDOUT: %tuple.elem2.loc29_18.2: ref @F.3.%U.loc28_8.1 (%U.753) = tuple_access %return, element2 -// CHECK:STDOUT: %.loc29_18.12: init @F.3.%U.loc28_8.1 (%U.753) = initialize_from %.loc29_18.11 to %tuple.elem2.loc29_18.2 -// CHECK:STDOUT: %.loc29_18.13: init @F.3.%tuple.type.loc28_42.2 (%tuple.type.8ae) = tuple_init (%.loc29_18.4, %.loc29_18.10, %.loc29_18.12) to %return -// CHECK:STDOUT: %.loc29_19: init @F.3.%tuple.type.loc28_42.2 (%tuple.type.8ae) = converted %F.call, %.loc29_18.13 -// CHECK:STDOUT: return %.loc29_19 to %return +// CHECK:STDOUT: %T.ref: %A.type.91f = name_ref T, %T.loc25_16.1 [symbolic = %T.loc25_16.2 (constants.%T.9c2)] +// CHECK:STDOUT: %.loc26_4.1: %A.assoc_type.f41 = specific_constant @A.%assoc0.loc6_39.1, @A(constants.%X) [concrete = constants.%assoc0.929] +// CHECK:STDOUT: %F.ref: %A.assoc_type.f41 = name_ref F, %.loc26_4.1 [concrete = constants.%assoc0.929] +// CHECK:STDOUT: %T.as_type.loc26_4.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc26_4.2 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc26_4.2: type = converted %T.ref, %T.as_type.loc26_4.1 [symbolic = %T.as_type.loc26_4.2 (constants.%T.as_type)] +// CHECK:STDOUT: %T.as_wit.iface0.loc26_4.1: = facet_access_witness %T.ref, element0 [symbolic = %T.as_wit.iface0.loc26_4.2 (constants.%T.as_wit.iface0)] +// CHECK:STDOUT: %impl.elem0.loc26_4.1: @CallGeneric.%.loc26_4.3 (%.591) = impl_witness_access %T.as_wit.iface0.loc26_4.1, element0 [symbolic = %impl.elem0.loc26_4.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z] +// CHECK:STDOUT: %.loc26_11.1: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %specific_impl_fn.loc26_4.1: = specific_impl_function %impl.elem0.loc26_4.1, @F.1(constants.%X, constants.%A.facet.834, constants.%Z) [symbolic = %specific_impl_fn.loc26_4.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %.loc26_12.1: ref @CallGeneric.%tuple.type (%tuple.type.e28) = temporary_storage +// CHECK:STDOUT: %.loc26_11.2: ref %Z = temporary_storage +// CHECK:STDOUT: %.loc26_11.3: init %Z = class_init (), %.loc26_11.2 [concrete = constants.%Z.val] +// CHECK:STDOUT: %.loc26_11.4: ref %Z = temporary %.loc26_11.2, %.loc26_11.3 +// CHECK:STDOUT: %.loc26_11.5: ref %Z = converted %.loc26_11.1, %.loc26_11.4 +// CHECK:STDOUT: %.loc26_11.6: %Z = bind_value %.loc26_11.5 +// CHECK:STDOUT: %.loc26_12.2: init @CallGeneric.%tuple.type (%tuple.type.e28) = call %specific_impl_fn.loc26_4.1(%.loc26_11.6) to %.loc26_12.1 +// CHECK:STDOUT: %.loc26_12.3: ref @CallGeneric.%tuple.type (%tuple.type.e28) = temporary %.loc26_12.1, %.loc26_12.2 +// CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @A(constants.%T) { -// CHECK:STDOUT: %T.loc5_13.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc5_13.2 => constants.%T +// CHECK:STDOUT: fn @CallIndirect() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %CallGeneric.ref: %CallGeneric.type = name_ref CallGeneric, file.%CallGeneric.decl [concrete = constants.%CallGeneric] +// CHECK:STDOUT: %Y.ref: type = name_ref Y, file.%Y.decl [concrete = constants.%Y] +// CHECK:STDOUT: %A.facet: %A.type.91f = facet_value constants.%Y, (constants.%impl_witness) [concrete = constants.%A.facet.166] +// CHECK:STDOUT: %.loc30: %A.type.91f = converted %Y.ref, %A.facet [concrete = constants.%A.facet.166] +// CHECK:STDOUT: %CallGeneric.specific_fn: = specific_function %CallGeneric.ref, @CallGeneric(constants.%A.facet.166) [concrete = constants.%CallGeneric.specific_fn] +// CHECK:STDOUT: %CallGeneric.call: init %empty_tuple.type = call %CallGeneric.specific_fn() +// CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F.1(constants.%T, constants.%Self, constants.%U.2cb) { +// CHECK:STDOUT: specific @A(constants.%T.8b3) { +// CHECK:STDOUT: %T.loc5_13.2 => constants.%T.8b3 +// CHECK:STDOUT: %T.patt.loc5_13.2 => constants.%T.8b3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @F.1(constants.%T.8b3, constants.%Self, constants.%U.2cb) { // CHECK:STDOUT: %U.loc6_8.1 => constants.%U.2cb // CHECK:STDOUT: %U.patt.loc6_8.2 => constants.%U.2cb -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: %T => constants.%T.8b3 // CHECK:STDOUT: %A.type => constants.%A.type.75a // CHECK:STDOUT: %Self => constants.%Self // CHECK:STDOUT: %tuple.type.loc6_38.1 => constants.%tuple.type.e59 @@ -501,6 +463,492 @@ impl forall [V1:! type, V2:! type, W:! type] (V1, V2) as A(W) { // CHECK:STDOUT: %tuple.type.loc17 => constants.%tuple.type.9c8 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @CallGeneric(constants.%T.9c2) { +// CHECK:STDOUT: %T.loc25_16.2 => constants.%T.9c2 +// CHECK:STDOUT: %T.patt.loc25_16.2 => constants.%T.9c2 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @F.1(constants.%X, constants.%A.facet.834, constants.%Z) { +// CHECK:STDOUT: %U.loc6_8.1 => constants.%Z +// CHECK:STDOUT: %U.patt.loc6_8.2 => constants.%Z +// CHECK:STDOUT: %T => constants.%X +// CHECK:STDOUT: %A.type => constants.%A.type.91f +// CHECK:STDOUT: %Self => constants.%A.facet.834 +// CHECK:STDOUT: %tuple.type.loc6_38.1 => constants.%tuple.type.a0c +// CHECK:STDOUT: %Self.as_type.loc6_38.1 => constants.%T.as_type +// CHECK:STDOUT: %tuple.type.loc6_38.2 => constants.%tuple.type.e28 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @F.1(constants.%X, @CallGeneric.%A.facet, constants.%Z) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @CallGeneric(constants.%A.facet.166) { +// CHECK:STDOUT: %T.loc25_16.2 => constants.%A.facet.166 +// CHECK:STDOUT: %T.patt.loc25_16.2 => constants.%A.facet.166 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %T.as_type.loc26_4.2 => constants.%Y +// CHECK:STDOUT: %T.as_wit.iface0.loc26_4.2 => constants.%impl_witness +// CHECK:STDOUT: %A.facet => constants.%A.facet.166 +// CHECK:STDOUT: %.loc26_4.3 => constants.%.6fe +// CHECK:STDOUT: %impl.elem0.loc26_4.2 => constants.%F.ce9 +// CHECK:STDOUT: %specific_impl_fn.loc26_4.2 => constants.%F.specific_fn +// CHECK:STDOUT: %tuple.type => constants.%tuple.type.f6b +// CHECK:STDOUT: %require_complete => constants.%complete_type.a64 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @F.1(constants.%X, constants.%A.facet.166, constants.%Z) { +// CHECK:STDOUT: %U.loc6_8.1 => constants.%Z +// CHECK:STDOUT: %U.patt.loc6_8.2 => constants.%Z +// CHECK:STDOUT: %T => constants.%X +// CHECK:STDOUT: %A.type => constants.%A.type.91f +// CHECK:STDOUT: %Self => constants.%A.facet.166 +// CHECK:STDOUT: %tuple.type.loc6_38.1 => constants.%tuple.type.a0c +// CHECK:STDOUT: %Self.as_type.loc6_38.1 => constants.%Y +// CHECK:STDOUT: %tuple.type.loc6_38.2 => constants.%tuple.type.f6b +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- generic_method_more_params.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.e01: type = symbolic_binding_pattern T, 0 [symbolic] +// CHECK:STDOUT: %A.type.495: type = generic_interface_type @A [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %A.generic: %A.type.495 = struct_value () [concrete] +// CHECK:STDOUT: %A.type.75a: type = facet_type <@A, @A(%T.8b3)> [symbolic] +// CHECK:STDOUT: %Self: %A.type.75a = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %U.2cb: type = bind_symbolic_name U, 2 [symbolic] +// CHECK:STDOUT: %U.patt.b3a: type = symbolic_binding_pattern U, 2 [symbolic] +// CHECK:STDOUT: %tuple.type.e59: type = tuple_type (type, %A.type.75a, type) [symbolic] +// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic] +// CHECK:STDOUT: %tuple.type.bd2: type = tuple_type (%T.8b3, %Self.as_type, %U.2cb) [symbolic] +// CHECK:STDOUT: %F.type.17a: type = fn_type @F.1, @A(%T.8b3) [symbolic] +// CHECK:STDOUT: %F.0d8: %F.type.17a = struct_value () [symbolic] +// CHECK:STDOUT: %A.assoc_type.d48: type = assoc_entity_type %A.type.75a [symbolic] +// CHECK:STDOUT: %assoc0.7cb: %A.assoc_type.d48 = assoc_entity element0, @A.%F.decl [symbolic] +// CHECK:STDOUT: %X: type = class_type @X [concrete] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] +// CHECK:STDOUT: %Y1: type = class_type @Y1 [concrete] +// CHECK:STDOUT: %Y2: type = class_type @Y2 [concrete] +// CHECK:STDOUT: %Z: type = class_type @Z [concrete] +// CHECK:STDOUT: %V1: type = bind_symbolic_name V1, 0 [symbolic] +// CHECK:STDOUT: %V1.patt: type = symbolic_binding_pattern V1, 0 [symbolic] +// CHECK:STDOUT: %V2: type = bind_symbolic_name V2, 1 [symbolic] +// CHECK:STDOUT: %V2.patt: type = symbolic_binding_pattern V2, 1 [symbolic] +// CHECK:STDOUT: %W: type = bind_symbolic_name W, 2 [symbolic] +// CHECK:STDOUT: %W.patt: type = symbolic_binding_pattern W, 2 [symbolic] +// CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete] +// CHECK:STDOUT: %tuple.type.30b: type = tuple_type (%V1, %V2) [symbolic] +// CHECK:STDOUT: %A.type.f21: type = facet_type <@A, @A(%W)> [symbolic] +// CHECK:STDOUT: %F.type.904: type = fn_type @F.1, @A(%W) [symbolic] +// CHECK:STDOUT: %F.1ee: %F.type.904 = struct_value () [symbolic] +// CHECK:STDOUT: %A.assoc_type.e6d: type = assoc_entity_type %A.type.f21 [symbolic] +// CHECK:STDOUT: %assoc0.4a9: %A.assoc_type.e6d = assoc_entity element0, @A.%F.decl [symbolic] +// CHECK:STDOUT: %require_complete.796: = require_complete_type %A.type.f21 [symbolic] +// CHECK:STDOUT: %impl_witness.0d8: = impl_witness (@impl.%F.decl), @impl(%V1, %V2, %W) [symbolic] +// CHECK:STDOUT: %U.753: type = bind_symbolic_name U, 3 [symbolic] +// CHECK:STDOUT: %U.patt.cfd: type = symbolic_binding_pattern U, 3 [symbolic] +// CHECK:STDOUT: %tuple.type.11f: type = tuple_type (type, %tuple.type.24b, type) [concrete] +// CHECK:STDOUT: %tuple.type.8ae: type = tuple_type (%W, %tuple.type.30b, %U.753) [symbolic] +// CHECK:STDOUT: %F.type.b3e: type = fn_type @F.2, @impl(%V1, %V2, %W) [symbolic] +// CHECK:STDOUT: %F.d79: %F.type.b3e = struct_value () [symbolic] +// CHECK:STDOUT: %A.facet.412: %A.type.f21 = facet_value %tuple.type.30b, (%impl_witness.0d8) [symbolic] +// CHECK:STDOUT: %tuple.type.136: type = tuple_type (type, %A.type.f21, type) [symbolic] +// CHECK:STDOUT: %require_complete.d4d: = require_complete_type %tuple.type.8ae [symbolic] +// CHECK:STDOUT: %require_complete.ed4: = require_complete_type %U.753 [symbolic] +// CHECK:STDOUT: %F.specific_fn.7d9: = specific_function %F.d79, @F.2(%V1, %V2, %W, %U.753) [symbolic] +// CHECK:STDOUT: %require_complete.f7f: = require_complete_type %W [symbolic] +// CHECK:STDOUT: %require_complete.fe1: = require_complete_type %tuple.type.30b [symbolic] +// CHECK:STDOUT: %require_complete.4ae: = require_complete_type %V1 [symbolic] +// CHECK:STDOUT: %require_complete.b54: = require_complete_type %V2 [symbolic] +// CHECK:STDOUT: %Call.type: type = fn_type @Call [concrete] +// CHECK:STDOUT: %Call: %Call.type = struct_value () [concrete] +// CHECK:STDOUT: %tuple.type.a46: type = tuple_type (%Y1, %Y2) [concrete] +// CHECK:STDOUT: %A.type.91f: type = facet_type <@A, @A(%X)> [concrete] +// CHECK:STDOUT: %F.type.13d: type = fn_type @F.1, @A(%X) [concrete] +// CHECK:STDOUT: %F.d83: %F.type.13d = struct_value () [concrete] +// CHECK:STDOUT: %A.assoc_type.f41: type = assoc_entity_type %A.type.91f [concrete] +// CHECK:STDOUT: %assoc0.929: %A.assoc_type.f41 = assoc_entity element0, @A.%F.decl [concrete] +// CHECK:STDOUT: %complete_type.d76: = complete_type_witness %A.type.91f [concrete] +// CHECK:STDOUT: %impl_witness.14a: = impl_witness (@impl.%F.decl), @impl(%Y1, %Y2, %X) [concrete] +// CHECK:STDOUT: %F.type.bf7: type = fn_type @F.2, @impl(%Y1, %Y2, %X) [concrete] +// CHECK:STDOUT: %F.93b: %F.type.bf7 = struct_value () [concrete] +// CHECK:STDOUT: %A.facet.058: %A.type.91f = facet_value %tuple.type.a46, (%impl_witness.14a) [concrete] +// CHECK:STDOUT: %.0b0: type = fn_type_with_self_type %F.type.13d, %A.facet.058 [concrete] +// CHECK:STDOUT: %tuple.type.415: type = tuple_type (%X, %tuple.type.a46, %Z) [concrete] +// CHECK:STDOUT: %F.specific_fn.79b: = specific_function %F.93b, @F.2(%Y1, %Y2, %X, %Z) [concrete] +// CHECK:STDOUT: %Z.val: %Z = struct_value () [concrete] +// CHECK:STDOUT: %T.9c2: %A.type.91f = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt.e81: %A.type.91f = symbolic_binding_pattern T, 0 [symbolic] +// CHECK:STDOUT: %CallGeneric.type: type = fn_type @CallGeneric [concrete] +// CHECK:STDOUT: %CallGeneric: %CallGeneric.type = struct_value () [concrete] +// CHECK:STDOUT: %T.as_type: type = facet_access_type %T.9c2 [symbolic] +// CHECK:STDOUT: %T.as_wit.iface0: = facet_access_witness %T.9c2, element0 [symbolic] +// CHECK:STDOUT: %A.facet.834: %A.type.91f = facet_value %T.as_type, (%T.as_wit.iface0) [symbolic] +// CHECK:STDOUT: %.591: type = fn_type_with_self_type %F.type.13d, %A.facet.834 [symbolic] +// CHECK:STDOUT: %impl.elem0: %.591 = impl_witness_access %T.as_wit.iface0, element0 [symbolic] +// CHECK:STDOUT: %tuple.type.a0c: type = tuple_type (type, %A.type.91f, type) [concrete] +// CHECK:STDOUT: %tuple.type.e28: type = tuple_type (%X, %T.as_type, %Z) [symbolic] +// CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem0, @F.1(%X, %A.facet.834, %Z) [symbolic] +// CHECK:STDOUT: %require_complete.500: = require_complete_type %tuple.type.e28 [symbolic] +// CHECK:STDOUT: %CallIndirect.type: type = fn_type @CallIndirect [concrete] +// CHECK:STDOUT: %CallIndirect: %CallIndirect.type = struct_value () [concrete] +// CHECK:STDOUT: %CallGeneric.specific_fn: = specific_function %CallGeneric, @CallGeneric(%A.facet.058) [concrete] +// CHECK:STDOUT: %complete_type.aa8: = complete_type_witness %tuple.type.415 [concrete] +// CHECK:STDOUT: %complete_type.4d1: = complete_type_witness %tuple.type.a46 [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [concrete] { +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: .X = %X.decl +// CHECK:STDOUT: .Y1 = %Y1.decl +// CHECK:STDOUT: .Y2 = %Y2.decl +// CHECK:STDOUT: .Z = %Z.decl +// CHECK:STDOUT: .Call = %Call.decl +// CHECK:STDOUT: .CallGeneric = %CallGeneric.decl +// CHECK:STDOUT: .CallIndirect = %CallIndirect.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %A.decl: %A.type.495 = interface_decl @A [concrete = constants.%A.generic] { +// CHECK:STDOUT: %T.patt.loc5_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc5_13.2 (constants.%T.patt.e01)] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.loc5_13.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc5_13.2 (constants.%T.8b3)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %X.decl: type = class_decl @X [concrete = constants.%X] {} {} +// CHECK:STDOUT: %Y1.decl: type = class_decl @Y1 [concrete = constants.%Y1] {} {} +// CHECK:STDOUT: %Y2.decl: type = class_decl @Y2 [concrete = constants.%Y2] {} {} +// CHECK:STDOUT: %Z.decl: type = class_decl @Z [concrete = constants.%Z] {} {} +// CHECK:STDOUT: impl_decl @impl [concrete] { +// CHECK:STDOUT: %V1.patt.loc14_14.1: type = symbolic_binding_pattern V1, 0 [symbolic = %V1.patt.loc14_14.2 (constants.%V1.patt)] +// CHECK:STDOUT: %V2.patt.loc14_25.1: type = symbolic_binding_pattern V2, 1 [symbolic = %V2.patt.loc14_25.2 (constants.%V2.patt)] +// CHECK:STDOUT: %W.patt.loc14_36.1: type = symbolic_binding_pattern W, 2 [symbolic = %W.patt.loc14_36.2 (constants.%W.patt)] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %V1.ref: type = name_ref V1, %V1.loc14_14.1 [symbolic = %V1.loc14_14.2 (constants.%V1)] +// CHECK:STDOUT: %V2.ref: type = name_ref V2, %V2.loc14_25.1 [symbolic = %V2.loc14_25.2 (constants.%V2)] +// CHECK:STDOUT: %.loc14_53.1: %tuple.type.24b = tuple_literal (%V1.ref, %V2.ref) +// CHECK:STDOUT: %.loc14_53.2: type = converted %.loc14_53.1, constants.%tuple.type.30b [symbolic = %tuple.type (constants.%tuple.type.30b)] +// CHECK:STDOUT: %A.ref: %A.type.495 = name_ref A, file.%A.decl [concrete = constants.%A.generic] +// CHECK:STDOUT: %W.ref: type = name_ref W, %W.loc14_36.1 [symbolic = %W.loc14_36.2 (constants.%W)] +// CHECK:STDOUT: %A.type.loc14_61.1: type = facet_type <@A, @A(constants.%W)> [symbolic = %A.type.loc14_61.2 (constants.%A.type.f21)] +// CHECK:STDOUT: %V1.loc14_14.1: type = bind_symbolic_name V1, 0 [symbolic = %V1.loc14_14.2 (constants.%V1)] +// CHECK:STDOUT: %V2.loc14_25.1: type = bind_symbolic_name V2, 1 [symbolic = %V2.loc14_25.2 (constants.%V2)] +// CHECK:STDOUT: %W.loc14_36.1: type = bind_symbolic_name W, 2 [symbolic = %W.loc14_36.2 (constants.%W)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl), @impl(constants.%V1, constants.%V2, constants.%W) [symbolic = @impl.%impl_witness (constants.%impl_witness.0d8)] +// CHECK:STDOUT: %Call.decl: %Call.type = fn_decl @Call [concrete = constants.%Call] {} {} +// CHECK:STDOUT: %CallGeneric.decl: %CallGeneric.type = fn_decl @CallGeneric [concrete = constants.%CallGeneric] { +// CHECK:STDOUT: %T.patt.loc27_16.1: %A.type.91f = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc27_16.2 (constants.%T.patt.e81)] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %.loc27: type = splice_block %A.type [concrete = constants.%A.type.91f] { +// CHECK:STDOUT: %A.ref: %A.type.495 = name_ref A, file.%A.decl [concrete = constants.%A.generic] +// CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %A.type: type = facet_type <@A, @A(constants.%X)> [concrete = constants.%A.type.91f] +// CHECK:STDOUT: } +// CHECK:STDOUT: %T.loc27_16.1: %A.type.91f = bind_symbolic_name T, 0 [symbolic = %T.loc27_16.2 (constants.%T.9c2)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %CallIndirect.decl: %CallIndirect.type = fn_decl @CallIndirect [concrete = constants.%CallIndirect] {} {} +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @A(%T.loc5_13.1: type) { +// CHECK:STDOUT: %T.loc5_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc5_13.2 (constants.%T.8b3)] +// CHECK:STDOUT: %T.patt.loc5_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc5_13.2 (constants.%T.patt.e01)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %A.type: type = facet_type <@A, @A(%T.loc5_13.2)> [symbolic = %A.type (constants.%A.type.75a)] +// CHECK:STDOUT: %Self.2: %A.type.75a = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)] +// CHECK:STDOUT: %F.type: type = fn_type @F.1, @A(%T.loc5_13.2) [symbolic = %F.type (constants.%F.type.17a)] +// CHECK:STDOUT: %F: @A.%F.type (%F.type.17a) = struct_value () [symbolic = %F (constants.%F.0d8)] +// CHECK:STDOUT: %A.assoc_type: type = assoc_entity_type @A.%A.type (%A.type.75a) [symbolic = %A.assoc_type (constants.%A.assoc_type.d48)] +// CHECK:STDOUT: %assoc0.loc6_39.2: @A.%A.assoc_type (%A.assoc_type.d48) = assoc_entity element0, %F.decl [symbolic = %assoc0.loc6_39.2 (constants.%assoc0.7cb)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: %Self.1: @A.%A.type (%A.type.75a) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)] +// CHECK:STDOUT: %F.decl: @A.%F.type (%F.type.17a) = fn_decl @F.1 [symbolic = @A.%F (constants.%F.0d8)] { +// CHECK:STDOUT: %U.patt.loc6_8.1: type = symbolic_binding_pattern U, 2 [symbolic = %U.patt.loc6_8.2 (constants.%U.patt.b3a)] +// CHECK:STDOUT: %u.patt: @F.1.%U.loc6_8.1 (%U.2cb) = binding_pattern u +// CHECK:STDOUT: %u.param_patt: @F.1.%U.loc6_8.1 (%U.2cb) = value_param_pattern %u.patt, call_param0 +// CHECK:STDOUT: %return.patt: @F.1.%tuple.type.loc6_38.2 (%tuple.type.bd2) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @F.1.%tuple.type.loc6_38.2 (%tuple.type.bd2) = out_param_pattern %return.patt, call_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.ref: type = name_ref T, @A.%T.loc5_13.1 [symbolic = %T (constants.%T.8b3)] +// CHECK:STDOUT: %.loc6_31: @F.1.%A.type (%A.type.75a) = specific_constant @A.%Self.1, @A(constants.%T.8b3) [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.ref: @F.1.%A.type (%A.type.75a) = name_ref Self, %.loc6_31 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %U.ref.loc6_37: type = name_ref U, %U.loc6_8.2 [symbolic = %U.loc6_8.1 (constants.%U.2cb)] +// CHECK:STDOUT: %.loc6_38.1: @F.1.%tuple.type.loc6_38.1 (%tuple.type.e59) = tuple_literal (%T.ref, %Self.ref, %U.ref.loc6_37) +// CHECK:STDOUT: %Self.as_type.loc6_38.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc6_38.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc6_38.2: type = converted %Self.ref, %Self.as_type.loc6_38.2 [symbolic = %Self.as_type.loc6_38.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc6_38.3: type = converted %.loc6_38.1, constants.%tuple.type.bd2 [symbolic = %tuple.type.loc6_38.2 (constants.%tuple.type.bd2)] +// CHECK:STDOUT: %U.loc6_8.2: type = bind_symbolic_name U, 2 [symbolic = %U.loc6_8.1 (constants.%U.2cb)] +// CHECK:STDOUT: %u.param: @F.1.%U.loc6_8.1 (%U.2cb) = value_param call_param0 +// CHECK:STDOUT: %U.ref.loc6_21: type = name_ref U, %U.loc6_8.2 [symbolic = %U.loc6_8.1 (constants.%U.2cb)] +// CHECK:STDOUT: %u: @F.1.%U.loc6_8.1 (%U.2cb) = bind_name u, %u.param +// CHECK:STDOUT: %return.param: ref @F.1.%tuple.type.loc6_38.2 (%tuple.type.bd2) = out_param call_param1 +// CHECK:STDOUT: %return: ref @F.1.%tuple.type.loc6_38.2 (%tuple.type.bd2) = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %assoc0.loc6_39.1: @A.%A.assoc_type (%A.assoc_type.d48) = assoc_entity element0, %F.decl [symbolic = %assoc0.loc6_39.2 (constants.%assoc0.7cb)] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self.1 +// CHECK:STDOUT: .T = +// CHECK:STDOUT: .F = %assoc0.loc6_39.1 +// CHECK:STDOUT: witness = (%F.decl) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl(%V1.loc14_14.1: type, %V2.loc14_25.1: type, %W.loc14_36.1: type) { +// CHECK:STDOUT: %V1.loc14_14.2: type = bind_symbolic_name V1, 0 [symbolic = %V1.loc14_14.2 (constants.%V1)] +// CHECK:STDOUT: %V1.patt.loc14_14.2: type = symbolic_binding_pattern V1, 0 [symbolic = %V1.patt.loc14_14.2 (constants.%V1.patt)] +// CHECK:STDOUT: %V2.loc14_25.2: type = bind_symbolic_name V2, 1 [symbolic = %V2.loc14_25.2 (constants.%V2)] +// CHECK:STDOUT: %V2.patt.loc14_25.2: type = symbolic_binding_pattern V2, 1 [symbolic = %V2.patt.loc14_25.2 (constants.%V2.patt)] +// CHECK:STDOUT: %W.loc14_36.2: type = bind_symbolic_name W, 2 [symbolic = %W.loc14_36.2 (constants.%W)] +// CHECK:STDOUT: %W.patt.loc14_36.2: type = symbolic_binding_pattern W, 2 [symbolic = %W.patt.loc14_36.2 (constants.%W.patt)] +// CHECK:STDOUT: %tuple.type: type = tuple_type (@impl.%V1.loc14_14.2 (%V1), @impl.%V2.loc14_25.2 (%V2)) [symbolic = %tuple.type (constants.%tuple.type.30b)] +// CHECK:STDOUT: %A.type.loc14_61.2: type = facet_type <@A, @A(%W.loc14_36.2)> [symbolic = %A.type.loc14_61.2 (constants.%A.type.f21)] +// CHECK:STDOUT: %require_complete: = require_complete_type @impl.%A.type.loc14_61.2 (%A.type.f21) [symbolic = %require_complete (constants.%require_complete.796)] +// CHECK:STDOUT: %impl_witness: = impl_witness (%F.decl), @impl(%V1.loc14_14.2, %V2.loc14_25.2, %W.loc14_36.2) [symbolic = %impl_witness (constants.%impl_witness.0d8)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%V1.loc14_14.2, %V2.loc14_25.2, %W.loc14_36.2) [symbolic = %F.type (constants.%F.type.b3e)] +// CHECK:STDOUT: %F: @impl.%F.type (%F.type.b3e) = struct_value () [symbolic = %F (constants.%F.d79)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: %.loc14_53.2 as %A.type.loc14_61.1 { +// CHECK:STDOUT: %F.decl: @impl.%F.type (%F.type.b3e) = fn_decl @F.2 [symbolic = @impl.%F (constants.%F.d79)] { +// CHECK:STDOUT: %U.patt.loc17_8.1: type = symbolic_binding_pattern U, 3 [symbolic = %U.patt.loc17_8.2 (constants.%U.patt.cfd)] +// CHECK:STDOUT: %u.patt: @F.2.%U.loc17_8.1 (%U.753) = binding_pattern u +// CHECK:STDOUT: %u.param_patt: @F.2.%U.loc17_8.1 (%U.753) = value_param_pattern %u.patt, call_param0 +// CHECK:STDOUT: %return.patt: @F.2.%tuple.type.loc17_42.2 (%tuple.type.8ae) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @F.2.%tuple.type.loc17_42.2 (%tuple.type.8ae) = out_param_pattern %return.patt, call_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %W.ref: type = name_ref W, @impl.%W.loc14_36.1 [symbolic = %W (constants.%W)] +// CHECK:STDOUT: %V1.ref: type = name_ref V1, @impl.%V1.loc14_14.1 [symbolic = %V1 (constants.%V1)] +// CHECK:STDOUT: %V2.ref: type = name_ref V2, @impl.%V2.loc14_25.1 [symbolic = %V2 (constants.%V2)] +// CHECK:STDOUT: %.loc17_38: %tuple.type.24b = tuple_literal (%V1.ref, %V2.ref) +// CHECK:STDOUT: %U.ref.loc17_41: type = name_ref U, %U.loc17_8.2 [symbolic = %U.loc17_8.1 (constants.%U.753)] +// CHECK:STDOUT: %.loc17_42.1: %tuple.type.11f = tuple_literal (%W.ref, %.loc17_38, %U.ref.loc17_41) +// CHECK:STDOUT: %.loc17_42.2: type = converted %.loc17_38, constants.%tuple.type.30b [symbolic = %tuple.type.loc17_42.1 (constants.%tuple.type.30b)] +// CHECK:STDOUT: %.loc17_42.3: type = converted %.loc17_42.1, constants.%tuple.type.8ae [symbolic = %tuple.type.loc17_42.2 (constants.%tuple.type.8ae)] +// CHECK:STDOUT: %U.loc17_8.2: type = bind_symbolic_name U, 3 [symbolic = %U.loc17_8.1 (constants.%U.753)] +// CHECK:STDOUT: %u.param: @F.2.%U.loc17_8.1 (%U.753) = value_param call_param0 +// CHECK:STDOUT: %U.ref.loc17_21: type = name_ref U, %U.loc17_8.2 [symbolic = %U.loc17_8.1 (constants.%U.753)] +// CHECK:STDOUT: %u: @F.2.%U.loc17_8.1 (%U.753) = bind_name u, %u.param +// CHECK:STDOUT: %return.param: ref @F.2.%tuple.type.loc17_42.2 (%tuple.type.8ae) = out_param call_param1 +// CHECK:STDOUT: %return: ref @F.2.%tuple.type.loc17_42.2 (%tuple.type.8ae) = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .W = +// CHECK:STDOUT: .V1 = +// CHECK:STDOUT: .V2 = +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: witness = file.%impl_witness +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @X { +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357] +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%X +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @Y1 { +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357] +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%Y1 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @Y2 { +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357] +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%Y2 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @Z { +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357] +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%Z +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @F.1(@A.%T.loc5_13.1: type, @A.%Self.1: @A.%A.type (%A.type.75a), %U.loc6_8.2: type) { +// CHECK:STDOUT: %U.loc6_8.1: type = bind_symbolic_name U, 2 [symbolic = %U.loc6_8.1 (constants.%U.2cb)] +// CHECK:STDOUT: %U.patt.loc6_8.2: type = symbolic_binding_pattern U, 2 [symbolic = %U.patt.loc6_8.2 (constants.%U.patt.b3a)] +// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T.8b3)] +// CHECK:STDOUT: %A.type: type = facet_type <@A, @A(%T)> [symbolic = %A.type (constants.%A.type.75a)] +// CHECK:STDOUT: %Self: %A.type.75a = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %tuple.type.loc6_38.1: type = tuple_type (type, @F.1.%A.type (%A.type.75a), type) [symbolic = %tuple.type.loc6_38.1 (constants.%tuple.type.e59)] +// CHECK:STDOUT: %Self.as_type.loc6_38.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc6_38.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %tuple.type.loc6_38.2: type = tuple_type (@F.1.%T (%T.8b3), @F.1.%Self.as_type.loc6_38.1 (%Self.as_type), @F.1.%U.loc6_8.1 (%U.2cb)) [symbolic = %tuple.type.loc6_38.2 (constants.%tuple.type.bd2)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn(%U.patt.loc6_8.1: type, %u.param_patt: @F.1.%U.loc6_8.1 (%U.2cb)) -> @F.1.%tuple.type.loc6_38.2 (%tuple.type.bd2); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @F.2(@impl.%V1.loc14_14.1: type, @impl.%V2.loc14_25.1: type, @impl.%W.loc14_36.1: type, %U.loc17_8.2: type) { +// CHECK:STDOUT: %U.loc17_8.1: type = bind_symbolic_name U, 3 [symbolic = %U.loc17_8.1 (constants.%U.753)] +// CHECK:STDOUT: %U.patt.loc17_8.2: type = symbolic_binding_pattern U, 3 [symbolic = %U.patt.loc17_8.2 (constants.%U.patt.cfd)] +// CHECK:STDOUT: %W: type = bind_symbolic_name W, 2 [symbolic = %W (constants.%W)] +// CHECK:STDOUT: %V1: type = bind_symbolic_name V1, 0 [symbolic = %V1 (constants.%V1)] +// CHECK:STDOUT: %V2: type = bind_symbolic_name V2, 1 [symbolic = %V2 (constants.%V2)] +// CHECK:STDOUT: %tuple.type.loc17_42.1: type = tuple_type (@F.2.%V1 (%V1), @F.2.%V2 (%V2)) [symbolic = %tuple.type.loc17_42.1 (constants.%tuple.type.30b)] +// CHECK:STDOUT: %tuple.type.loc17_42.2: type = tuple_type (@F.2.%W (%W), @F.2.%tuple.type.loc17_42.1 (%tuple.type.30b), @F.2.%U.loc17_8.1 (%U.753)) [symbolic = %tuple.type.loc17_42.2 (constants.%tuple.type.8ae)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc17_24: = require_complete_type @F.2.%tuple.type.loc17_42.2 (%tuple.type.8ae) [symbolic = %require_complete.loc17_24 (constants.%require_complete.d4d)] +// CHECK:STDOUT: %require_complete.loc17_19: = require_complete_type @F.2.%U.loc17_8.1 (%U.753) [symbolic = %require_complete.loc17_19 (constants.%require_complete.ed4)] +// CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%V1, %V2, %W) [symbolic = %F.type (constants.%F.type.b3e)] +// CHECK:STDOUT: %F: @F.2.%F.type (%F.type.b3e) = struct_value () [symbolic = %F (constants.%F.d79)] +// CHECK:STDOUT: %F.specific_fn.loc18_12.2: = specific_function %F, @F.2(%V1, %V2, %W, %U.loc17_8.1) [symbolic = %F.specific_fn.loc18_12.2 (constants.%F.specific_fn.7d9)] +// CHECK:STDOUT: %require_complete.loc18_18.1: = require_complete_type @F.2.%W (%W) [symbolic = %require_complete.loc18_18.1 (constants.%require_complete.f7f)] +// CHECK:STDOUT: %require_complete.loc18_18.2: = require_complete_type @F.2.%tuple.type.loc17_42.1 (%tuple.type.30b) [symbolic = %require_complete.loc18_18.2 (constants.%require_complete.fe1)] +// CHECK:STDOUT: %require_complete.loc18_18.3: = require_complete_type @F.2.%V1 (%V1) [symbolic = %require_complete.loc18_18.3 (constants.%require_complete.4ae)] +// CHECK:STDOUT: %require_complete.loc18_18.4: = require_complete_type @F.2.%V2 (%V2) [symbolic = %require_complete.loc18_18.4 (constants.%require_complete.b54)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn(%U.patt.loc17_8.1: type, %u.param_patt: @F.2.%U.loc17_8.1 (%U.753)) -> %return.param_patt: @F.2.%tuple.type.loc17_42.2 (%tuple.type.8ae) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %.loc18_12: @F.2.%F.type (%F.type.b3e) = specific_constant @impl.%F.decl, @impl(constants.%V1, constants.%V2, constants.%W) [symbolic = %F (constants.%F.d79)] +// CHECK:STDOUT: %F.ref: @F.2.%F.type (%F.type.b3e) = name_ref F, %.loc18_12 [symbolic = %F (constants.%F.d79)] +// CHECK:STDOUT: %U.ref.loc18: type = name_ref U, %U.loc17_8.2 [symbolic = %U.loc17_8.1 (constants.%U.753)] +// CHECK:STDOUT: %u.ref: @F.2.%U.loc17_8.1 (%U.753) = name_ref u, %u +// CHECK:STDOUT: %F.specific_fn.loc18_12.1: = specific_function %F.ref, @F.2(constants.%V1, constants.%V2, constants.%W, constants.%U.753) [symbolic = %F.specific_fn.loc18_12.2 (constants.%F.specific_fn.7d9)] +// CHECK:STDOUT: %.loc18_18.1: ref @F.2.%tuple.type.loc17_42.2 (%tuple.type.8ae) = temporary_storage +// CHECK:STDOUT: %F.call: init @F.2.%tuple.type.loc17_42.2 (%tuple.type.8ae) = call %F.specific_fn.loc18_12.1(%u.ref) to %.loc18_18.1 +// CHECK:STDOUT: %.loc18_18.2: ref @F.2.%tuple.type.loc17_42.2 (%tuple.type.8ae) = temporary %.loc18_18.1, %F.call +// CHECK:STDOUT: %tuple.elem0.loc18_18.1: ref @F.2.%W (%W) = tuple_access %.loc18_18.2, element0 +// CHECK:STDOUT: %.loc18_18.3: @F.2.%W (%W) = bind_value %tuple.elem0.loc18_18.1 +// CHECK:STDOUT: %tuple.elem0.loc18_18.2: ref @F.2.%W (%W) = tuple_access %return, element0 +// CHECK:STDOUT: %.loc18_18.4: init @F.2.%W (%W) = initialize_from %.loc18_18.3 to %tuple.elem0.loc18_18.2 +// CHECK:STDOUT: %tuple.elem1.loc18_18.1: ref @F.2.%tuple.type.loc17_42.1 (%tuple.type.30b) = tuple_access %.loc18_18.2, element1 +// CHECK:STDOUT: %tuple.elem0.loc18_18.3: ref @F.2.%V1 (%V1) = tuple_access %tuple.elem1.loc18_18.1, element0 +// CHECK:STDOUT: %.loc18_18.5: @F.2.%V1 (%V1) = bind_value %tuple.elem0.loc18_18.3 +// CHECK:STDOUT: %tuple.elem1.loc18_18.2: ref @F.2.%tuple.type.loc17_42.1 (%tuple.type.30b) = tuple_access %return, element1 +// CHECK:STDOUT: %tuple.elem0.loc18_18.4: ref @F.2.%V1 (%V1) = tuple_access %tuple.elem1.loc18_18.2, element0 +// CHECK:STDOUT: %.loc18_18.6: init @F.2.%V1 (%V1) = initialize_from %.loc18_18.5 to %tuple.elem0.loc18_18.4 +// CHECK:STDOUT: %tuple.elem1.loc18_18.3: ref @F.2.%V2 (%V2) = tuple_access %tuple.elem1.loc18_18.1, element1 +// CHECK:STDOUT: %.loc18_18.7: @F.2.%V2 (%V2) = bind_value %tuple.elem1.loc18_18.3 +// CHECK:STDOUT: %tuple.elem1.loc18_18.4: ref @F.2.%V2 (%V2) = tuple_access %tuple.elem1.loc18_18.2, element1 +// CHECK:STDOUT: %.loc18_18.8: init @F.2.%V2 (%V2) = initialize_from %.loc18_18.7 to %tuple.elem1.loc18_18.4 +// CHECK:STDOUT: %.loc18_18.9: init @F.2.%tuple.type.loc17_42.1 (%tuple.type.30b) = tuple_init (%.loc18_18.6, %.loc18_18.8) to %tuple.elem1.loc18_18.2 +// CHECK:STDOUT: %.loc18_18.10: init @F.2.%tuple.type.loc17_42.1 (%tuple.type.30b) = converted %tuple.elem1.loc18_18.1, %.loc18_18.9 +// CHECK:STDOUT: %tuple.elem2.loc18_18.1: ref @F.2.%U.loc17_8.1 (%U.753) = tuple_access %.loc18_18.2, element2 +// CHECK:STDOUT: %.loc18_18.11: @F.2.%U.loc17_8.1 (%U.753) = bind_value %tuple.elem2.loc18_18.1 +// CHECK:STDOUT: %tuple.elem2.loc18_18.2: ref @F.2.%U.loc17_8.1 (%U.753) = tuple_access %return, element2 +// CHECK:STDOUT: %.loc18_18.12: init @F.2.%U.loc17_8.1 (%U.753) = initialize_from %.loc18_18.11 to %tuple.elem2.loc18_18.2 +// CHECK:STDOUT: %.loc18_18.13: init @F.2.%tuple.type.loc17_42.2 (%tuple.type.8ae) = tuple_init (%.loc18_18.4, %.loc18_18.10, %.loc18_18.12) to %return +// CHECK:STDOUT: %.loc18_19: init @F.2.%tuple.type.loc17_42.2 (%tuple.type.8ae) = converted %F.call, %.loc18_18.13 +// CHECK:STDOUT: return %.loc18_19 to %return +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Call() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Y1.ref: type = name_ref Y1, file.%Y1.decl [concrete = constants.%Y1] +// CHECK:STDOUT: %Y2.ref: type = name_ref Y2, file.%Y2.decl [concrete = constants.%Y2] +// CHECK:STDOUT: %.loc24_12: %tuple.type.24b = tuple_literal (%Y1.ref, %Y2.ref) +// CHECK:STDOUT: %.loc24_14: type = converted %.loc24_12, constants.%tuple.type.a46 [concrete = constants.%tuple.type.a46] +// CHECK:STDOUT: %A.ref: %A.type.495 = name_ref A, file.%A.decl [concrete = constants.%A.generic] +// CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X] +// CHECK:STDOUT: %A.type: type = facet_type <@A, @A(constants.%X)> [concrete = constants.%A.type.91f] +// CHECK:STDOUT: %A.facet: %A.type.91f = facet_value constants.%tuple.type.a46, (constants.%impl_witness.14a) [concrete = constants.%A.facet.058] +// CHECK:STDOUT: %.loc24_23: %A.type.91f = converted %.loc24_14, %A.facet [concrete = constants.%A.facet.058] +// CHECK:STDOUT: %.loc24_31.1: %A.assoc_type.f41 = specific_constant @A.%assoc0.loc6_39.1, @A(constants.%X) [concrete = constants.%assoc0.929] +// CHECK:STDOUT: %F.ref: %A.assoc_type.f41 = name_ref F, %.loc24_31.1 [concrete = constants.%assoc0.929] +// CHECK:STDOUT: %as_type: type = facet_access_type %.loc24_23 [concrete = constants.%tuple.type.a46] +// CHECK:STDOUT: %.loc24_31.2: type = converted %.loc24_23, %as_type [concrete = constants.%tuple.type.a46] +// CHECK:STDOUT: %as_wit.iface0: = facet_access_witness %.loc24_23, element0 [concrete = constants.%impl_witness.14a] +// CHECK:STDOUT: %impl.elem0: %.0b0 = impl_witness_access %as_wit.iface0, element0 [concrete = constants.%F.93b] +// CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z] +// CHECK:STDOUT: %.loc24_38.1: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @F.2(constants.%Y1, constants.%Y2, constants.%X, constants.%Z) [concrete = constants.%F.specific_fn.79b] +// CHECK:STDOUT: %.loc24_39.1: ref %tuple.type.415 = temporary_storage +// CHECK:STDOUT: %.loc24_38.2: ref %Z = temporary_storage +// CHECK:STDOUT: %.loc24_38.3: init %Z = class_init (), %.loc24_38.2 [concrete = constants.%Z.val] +// CHECK:STDOUT: %.loc24_38.4: ref %Z = temporary %.loc24_38.2, %.loc24_38.3 +// CHECK:STDOUT: %.loc24_38.5: ref %Z = converted %.loc24_38.1, %.loc24_38.4 +// CHECK:STDOUT: %.loc24_38.6: %Z = bind_value %.loc24_38.5 +// CHECK:STDOUT: %F.call: init %tuple.type.415 = call %specific_fn(%.loc24_38.6) to %.loc24_39.1 +// CHECK:STDOUT: %.loc24_39.2: ref %tuple.type.415 = temporary %.loc24_39.1, %F.call +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @CallGeneric(%T.loc27_16.1: %A.type.91f) { +// CHECK:STDOUT: %T.loc27_16.2: %A.type.91f = bind_symbolic_name T, 0 [symbolic = %T.loc27_16.2 (constants.%T.9c2)] +// CHECK:STDOUT: %T.patt.loc27_16.2: %A.type.91f = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc27_16.2 (constants.%T.patt.e81)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %T.as_type.loc28_4.2: type = facet_access_type %T.loc27_16.2 [symbolic = %T.as_type.loc28_4.2 (constants.%T.as_type)] +// CHECK:STDOUT: %T.as_wit.iface0.loc28_4.2: = facet_access_witness %T.loc27_16.2, element0 [symbolic = %T.as_wit.iface0.loc28_4.2 (constants.%T.as_wit.iface0)] +// CHECK:STDOUT: %A.facet: %A.type.91f = facet_value %T.as_type.loc28_4.2, (%T.as_wit.iface0.loc28_4.2) [symbolic = %A.facet (constants.%A.facet.834)] +// CHECK:STDOUT: %.loc28_4.3: type = fn_type_with_self_type constants.%F.type.13d, %A.facet [symbolic = %.loc28_4.3 (constants.%.591)] +// CHECK:STDOUT: %impl.elem0.loc28_4.2: @CallGeneric.%.loc28_4.3 (%.591) = impl_witness_access %T.as_wit.iface0.loc28_4.2, element0 [symbolic = %impl.elem0.loc28_4.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %specific_impl_fn.loc28_4.2: = specific_impl_function %impl.elem0.loc28_4.2, @F.1(constants.%X, %A.facet, constants.%Z) [symbolic = %specific_impl_fn.loc28_4.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %tuple.type: type = tuple_type (%X, @CallGeneric.%T.as_type.loc28_4.2 (%T.as_type), %Z) [symbolic = %tuple.type (constants.%tuple.type.e28)] +// CHECK:STDOUT: %require_complete: = require_complete_type @CallGeneric.%tuple.type (%tuple.type.e28) [symbolic = %require_complete (constants.%require_complete.500)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn(%T.patt.loc27_16.1: %A.type.91f) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %T.ref: %A.type.91f = name_ref T, %T.loc27_16.1 [symbolic = %T.loc27_16.2 (constants.%T.9c2)] +// CHECK:STDOUT: %.loc28_4.1: %A.assoc_type.f41 = specific_constant @A.%assoc0.loc6_39.1, @A(constants.%X) [concrete = constants.%assoc0.929] +// CHECK:STDOUT: %F.ref: %A.assoc_type.f41 = name_ref F, %.loc28_4.1 [concrete = constants.%assoc0.929] +// CHECK:STDOUT: %T.as_type.loc28_4.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc28_4.2 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc28_4.2: type = converted %T.ref, %T.as_type.loc28_4.1 [symbolic = %T.as_type.loc28_4.2 (constants.%T.as_type)] +// CHECK:STDOUT: %T.as_wit.iface0.loc28_4.1: = facet_access_witness %T.ref, element0 [symbolic = %T.as_wit.iface0.loc28_4.2 (constants.%T.as_wit.iface0)] +// CHECK:STDOUT: %impl.elem0.loc28_4.1: @CallGeneric.%.loc28_4.3 (%.591) = impl_witness_access %T.as_wit.iface0.loc28_4.1, element0 [symbolic = %impl.elem0.loc28_4.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z] +// CHECK:STDOUT: %.loc28_11.1: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %specific_impl_fn.loc28_4.1: = specific_impl_function %impl.elem0.loc28_4.1, @F.1(constants.%X, constants.%A.facet.834, constants.%Z) [symbolic = %specific_impl_fn.loc28_4.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %.loc28_12.1: ref @CallGeneric.%tuple.type (%tuple.type.e28) = temporary_storage +// CHECK:STDOUT: %.loc28_11.2: ref %Z = temporary_storage +// CHECK:STDOUT: %.loc28_11.3: init %Z = class_init (), %.loc28_11.2 [concrete = constants.%Z.val] +// CHECK:STDOUT: %.loc28_11.4: ref %Z = temporary %.loc28_11.2, %.loc28_11.3 +// CHECK:STDOUT: %.loc28_11.5: ref %Z = converted %.loc28_11.1, %.loc28_11.4 +// CHECK:STDOUT: %.loc28_11.6: %Z = bind_value %.loc28_11.5 +// CHECK:STDOUT: %.loc28_12.2: init @CallGeneric.%tuple.type (%tuple.type.e28) = call %specific_impl_fn.loc28_4.1(%.loc28_11.6) to %.loc28_12.1 +// CHECK:STDOUT: %.loc28_12.3: ref @CallGeneric.%tuple.type (%tuple.type.e28) = temporary %.loc28_12.1, %.loc28_12.2 +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @CallIndirect() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %CallGeneric.ref: %CallGeneric.type = name_ref CallGeneric, file.%CallGeneric.decl [concrete = constants.%CallGeneric] +// CHECK:STDOUT: %Y1.ref: type = name_ref Y1, file.%Y1.decl [concrete = constants.%Y1] +// CHECK:STDOUT: %Y2.ref: type = name_ref Y2, file.%Y2.decl [concrete = constants.%Y2] +// CHECK:STDOUT: %.loc33_22: %tuple.type.24b = tuple_literal (%Y1.ref, %Y2.ref) +// CHECK:STDOUT: %.loc33_24: type = converted %.loc33_22, constants.%tuple.type.a46 [concrete = constants.%tuple.type.a46] +// CHECK:STDOUT: %A.facet: %A.type.91f = facet_value constants.%tuple.type.a46, (constants.%impl_witness.14a) [concrete = constants.%A.facet.058] +// CHECK:STDOUT: %.loc33_31: %A.type.91f = converted %.loc33_24, %A.facet [concrete = constants.%A.facet.058] +// CHECK:STDOUT: %CallGeneric.specific_fn: = specific_function %CallGeneric.ref, @CallGeneric(constants.%A.facet.058) [concrete = constants.%CallGeneric.specific_fn] +// CHECK:STDOUT: %CallGeneric.call: init %empty_tuple.type = call %CallGeneric.specific_fn() +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @A(constants.%T.8b3) { +// CHECK:STDOUT: %T.loc5_13.2 => constants.%T.8b3 +// CHECK:STDOUT: %T.patt.loc5_13.2 => constants.%T.8b3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @F.1(constants.%T.8b3, constants.%Self, constants.%U.2cb) { +// CHECK:STDOUT: %U.loc6_8.1 => constants.%U.2cb +// CHECK:STDOUT: %U.patt.loc6_8.2 => constants.%U.2cb +// CHECK:STDOUT: %T => constants.%T.8b3 +// CHECK:STDOUT: %A.type => constants.%A.type.75a +// CHECK:STDOUT: %Self => constants.%Self +// CHECK:STDOUT: %tuple.type.loc6_38.1 => constants.%tuple.type.e59 +// CHECK:STDOUT: %Self.as_type.loc6_38.1 => constants.%Self.as_type +// CHECK:STDOUT: %tuple.type.loc6_38.2 => constants.%tuple.type.bd2 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @A(@F.1.%T) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @A(%T.loc5_13.2) {} +// CHECK:STDOUT: // CHECK:STDOUT: specific @A(constants.%W) { // CHECK:STDOUT: %T.loc5_13.2 => constants.%W // CHECK:STDOUT: %T.patt.loc5_13.2 => constants.%W @@ -514,15 +962,15 @@ impl forall [V1:! type, V2:! type, W:! type] (V1, V2) as A(W) { // CHECK:STDOUT: %assoc0.loc6_39.2 => constants.%assoc0.4a9 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.220(constants.%V1, constants.%V2, constants.%W) { -// CHECK:STDOUT: %V1.loc25_14.2 => constants.%V1 -// CHECK:STDOUT: %V1.patt.loc25_14.2 => constants.%V1 -// CHECK:STDOUT: %V2.loc25_25.2 => constants.%V2 -// CHECK:STDOUT: %V2.patt.loc25_25.2 => constants.%V2 -// CHECK:STDOUT: %W.loc25_36.2 => constants.%W -// CHECK:STDOUT: %W.patt.loc25_36.2 => constants.%W +// CHECK:STDOUT: specific @impl(constants.%V1, constants.%V2, constants.%W) { +// CHECK:STDOUT: %V1.loc14_14.2 => constants.%V1 +// CHECK:STDOUT: %V1.patt.loc14_14.2 => constants.%V1 +// CHECK:STDOUT: %V2.loc14_25.2 => constants.%V2 +// CHECK:STDOUT: %V2.patt.loc14_25.2 => constants.%V2 +// CHECK:STDOUT: %W.loc14_36.2 => constants.%W +// CHECK:STDOUT: %W.patt.loc14_36.2 => constants.%W // CHECK:STDOUT: %tuple.type => constants.%tuple.type.30b -// CHECK:STDOUT: %A.type.loc25_61.2 => constants.%A.type.f21 +// CHECK:STDOUT: %A.type.loc14_61.2 => constants.%A.type.f21 // CHECK:STDOUT: %require_complete => constants.%require_complete.796 // CHECK:STDOUT: %impl_witness => constants.%impl_witness.0d8 // CHECK:STDOUT: @@ -531,29 +979,29 @@ impl forall [V1:! type, V2:! type, W:! type] (V1, V2) as A(W) { // CHECK:STDOUT: %F => constants.%F.d79 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @A(@impl.220.%W.loc25_36.2) {} +// CHECK:STDOUT: specific @A(@impl.%W.loc14_36.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.220(%V1.loc25_14.2, %V2.loc25_25.2, %W.loc25_36.2) {} +// CHECK:STDOUT: specific @impl(%V1.loc14_14.2, %V2.loc14_25.2, %W.loc14_36.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @F.3(constants.%V1, constants.%V2, constants.%W, constants.%U.753) { -// CHECK:STDOUT: %U.loc28_8.1 => constants.%U.753 -// CHECK:STDOUT: %U.patt.loc28_8.2 => constants.%U.753 +// CHECK:STDOUT: specific @F.2(constants.%V1, constants.%V2, constants.%W, constants.%U.753) { +// CHECK:STDOUT: %U.loc17_8.1 => constants.%U.753 +// CHECK:STDOUT: %U.patt.loc17_8.2 => constants.%U.753 // CHECK:STDOUT: %W => constants.%W // CHECK:STDOUT: %V1 => constants.%V1 // CHECK:STDOUT: %V2 => constants.%V2 -// CHECK:STDOUT: %tuple.type.loc28_42.1 => constants.%tuple.type.30b -// CHECK:STDOUT: %tuple.type.loc28_42.2 => constants.%tuple.type.8ae +// CHECK:STDOUT: %tuple.type.loc17_42.1 => constants.%tuple.type.30b +// CHECK:STDOUT: %tuple.type.loc17_42.2 => constants.%tuple.type.8ae // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc28_24 => constants.%require_complete.d4d -// CHECK:STDOUT: %require_complete.loc28_19 => constants.%require_complete.ed4 +// CHECK:STDOUT: %require_complete.loc17_24 => constants.%require_complete.d4d +// CHECK:STDOUT: %require_complete.loc17_19 => constants.%require_complete.ed4 // CHECK:STDOUT: %F.type => constants.%F.type.b3e // CHECK:STDOUT: %F => constants.%F.d79 -// CHECK:STDOUT: %F.specific_fn.loc29_12.2 => constants.%F.specific_fn.7d9 -// CHECK:STDOUT: %require_complete.loc29_18.1 => constants.%require_complete.f7f -// CHECK:STDOUT: %require_complete.loc29_18.2 => constants.%require_complete.fe1 -// CHECK:STDOUT: %require_complete.loc29_18.3 => constants.%require_complete.4aeca8.2 -// CHECK:STDOUT: %require_complete.loc29_18.4 => constants.%require_complete.b54 +// CHECK:STDOUT: %F.specific_fn.loc18_12.2 => constants.%F.specific_fn.7d9 +// CHECK:STDOUT: %require_complete.loc18_18.1 => constants.%require_complete.f7f +// CHECK:STDOUT: %require_complete.loc18_18.2 => constants.%require_complete.fe1 +// CHECK:STDOUT: %require_complete.loc18_18.3 => constants.%require_complete.4ae +// CHECK:STDOUT: %require_complete.loc18_18.4 => constants.%require_complete.b54 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%W, constants.%A.facet.412, constants.%U.753) { @@ -567,7 +1015,102 @@ impl forall [V1:! type, V2:! type, W:! type] (V1, V2) as A(W) { // CHECK:STDOUT: %tuple.type.loc6_38.2 => constants.%tuple.type.8ae // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.220(@F.3.%V1, @F.3.%V2, @F.3.%W) {} +// CHECK:STDOUT: specific @impl(@F.2.%V1, @F.2.%V2, @F.2.%W) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @F.3(%V1, %V2, %W, %U.loc28_8.1) {} +// CHECK:STDOUT: specific @F.2(%V1, %V2, %W, %U.loc17_8.1) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @A(constants.%X) { +// CHECK:STDOUT: %T.loc5_13.2 => constants.%X +// CHECK:STDOUT: %T.patt.loc5_13.2 => constants.%X +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %A.type => constants.%A.type.91f +// CHECK:STDOUT: %Self.2 => constants.%Self +// CHECK:STDOUT: %F.type => constants.%F.type.13d +// CHECK:STDOUT: %F => constants.%F.d83 +// CHECK:STDOUT: %A.assoc_type => constants.%A.assoc_type.f41 +// CHECK:STDOUT: %assoc0.loc6_39.2 => constants.%assoc0.929 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl(constants.%Y1, constants.%Y2, constants.%X) { +// CHECK:STDOUT: %V1.loc14_14.2 => constants.%Y1 +// CHECK:STDOUT: %V1.patt.loc14_14.2 => constants.%Y1 +// CHECK:STDOUT: %V2.loc14_25.2 => constants.%Y2 +// CHECK:STDOUT: %V2.patt.loc14_25.2 => constants.%Y2 +// CHECK:STDOUT: %W.loc14_36.2 => constants.%X +// CHECK:STDOUT: %W.patt.loc14_36.2 => constants.%X +// CHECK:STDOUT: %tuple.type => constants.%tuple.type.a46 +// CHECK:STDOUT: %A.type.loc14_61.2 => constants.%A.type.91f +// CHECK:STDOUT: %require_complete => constants.%complete_type.d76 +// CHECK:STDOUT: %impl_witness => constants.%impl_witness.14a +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %F.type => constants.%F.type.bf7 +// CHECK:STDOUT: %F => constants.%F.93b +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @F.2(constants.%Y1, constants.%Y2, constants.%X, constants.%Z) { +// CHECK:STDOUT: %U.loc17_8.1 => constants.%Z +// CHECK:STDOUT: %U.patt.loc17_8.2 => constants.%Z +// CHECK:STDOUT: %W => constants.%X +// CHECK:STDOUT: %V1 => constants.%Y1 +// CHECK:STDOUT: %V2 => constants.%Y2 +// CHECK:STDOUT: %tuple.type.loc17_42.1 => constants.%tuple.type.a46 +// CHECK:STDOUT: %tuple.type.loc17_42.2 => constants.%tuple.type.415 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc17_24 => constants.%complete_type.aa8 +// CHECK:STDOUT: %require_complete.loc17_19 => constants.%complete_type.357 +// CHECK:STDOUT: %F.type => constants.%F.type.bf7 +// CHECK:STDOUT: %F => constants.%F.93b +// CHECK:STDOUT: %F.specific_fn.loc18_12.2 => constants.%F.specific_fn.79b +// CHECK:STDOUT: %require_complete.loc18_18.1 => constants.%complete_type.357 +// CHECK:STDOUT: %require_complete.loc18_18.2 => constants.%complete_type.4d1 +// CHECK:STDOUT: %require_complete.loc18_18.3 => constants.%complete_type.357 +// CHECK:STDOUT: %require_complete.loc18_18.4 => constants.%complete_type.357 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @CallGeneric(constants.%T.9c2) { +// CHECK:STDOUT: %T.loc27_16.2 => constants.%T.9c2 +// CHECK:STDOUT: %T.patt.loc27_16.2 => constants.%T.9c2 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @F.1(constants.%X, constants.%A.facet.834, constants.%Z) { +// CHECK:STDOUT: %U.loc6_8.1 => constants.%Z +// CHECK:STDOUT: %U.patt.loc6_8.2 => constants.%Z +// CHECK:STDOUT: %T => constants.%X +// CHECK:STDOUT: %A.type => constants.%A.type.91f +// CHECK:STDOUT: %Self => constants.%A.facet.834 +// CHECK:STDOUT: %tuple.type.loc6_38.1 => constants.%tuple.type.a0c +// CHECK:STDOUT: %Self.as_type.loc6_38.1 => constants.%T.as_type +// CHECK:STDOUT: %tuple.type.loc6_38.2 => constants.%tuple.type.e28 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @F.1(constants.%X, @CallGeneric.%A.facet, constants.%Z) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @CallGeneric(constants.%A.facet.058) { +// CHECK:STDOUT: %T.loc27_16.2 => constants.%A.facet.058 +// CHECK:STDOUT: %T.patt.loc27_16.2 => constants.%A.facet.058 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %T.as_type.loc28_4.2 => constants.%tuple.type.a46 +// CHECK:STDOUT: %T.as_wit.iface0.loc28_4.2 => constants.%impl_witness.14a +// CHECK:STDOUT: %A.facet => constants.%A.facet.058 +// CHECK:STDOUT: %.loc28_4.3 => constants.%.0b0 +// CHECK:STDOUT: %impl.elem0.loc28_4.2 => constants.%F.93b +// CHECK:STDOUT: %specific_impl_fn.loc28_4.2 => constants.%F.specific_fn.79b +// CHECK:STDOUT: %tuple.type => constants.%tuple.type.415 +// CHECK:STDOUT: %require_complete => constants.%complete_type.aa8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @F.1(constants.%X, constants.%A.facet.058, constants.%Z) { +// CHECK:STDOUT: %U.loc6_8.1 => constants.%Z +// CHECK:STDOUT: %U.patt.loc6_8.2 => constants.%Z +// CHECK:STDOUT: %T => constants.%X +// CHECK:STDOUT: %A.type => constants.%A.type.91f +// CHECK:STDOUT: %Self => constants.%A.facet.058 +// CHECK:STDOUT: %tuple.type.loc6_38.1 => constants.%tuple.type.a0c +// CHECK:STDOUT: %Self.as_type.loc6_38.1 => constants.%tuple.type.a46 +// CHECK:STDOUT: %tuple.type.loc6_38.2 => constants.%tuple.type.415 +// CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/lower/handle.cpp b/toolchain/lower/handle.cpp index 0a460ad52f8b..9365b8783abd 100644 --- a/toolchain/lower/handle.cpp +++ b/toolchain/lower/handle.cpp @@ -260,6 +260,11 @@ auto HandleInst(FunctionContext& /*context*/, SemIR::InstId /*inst_id*/, // Nothing to do. This value should never be consumed. } +auto HandleInst(FunctionContext& /*context*/, SemIR::InstId /*inst_id*/, + SemIR::SpecificImplFunction /*inst*/) -> void { + // Nothing to do. This value should never be consumed. +} + auto HandleInst(FunctionContext& context, SemIR::InstId inst_id, SemIR::SpliceBlock inst) -> void { context.LowerBlockContents(inst.block_id); diff --git a/toolchain/lower/testdata/function/generic/call_impl_function.carbon b/toolchain/lower/testdata/function/generic/call_impl_function.carbon index 3c81f19c024b..274928c933a9 100644 --- a/toolchain/lower/testdata/function/generic/call_impl_function.carbon +++ b/toolchain/lower/testdata/function/generic/call_impl_function.carbon @@ -18,7 +18,6 @@ class SomeParam {} class ImplsSomeInterface {} impl ImplsSomeInterface as SomeInterface(i32) { - // TODO: There are two identical definitions generated for this, one is unused fn F(x: i32) -> i32 { return x + x; } @@ -62,8 +61,8 @@ fn G() { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 4, ptr %out.var), !dbg !10 // CHECK:STDOUT: %CallGenericMethod.call = call i32 @_CCallGenericMethod.Main.2b28d1a7fa793cbc(i32 10), !dbg !11 // CHECK:STDOUT: store i32 %CallGenericMethod.call, ptr %out.var, align 4, !dbg !10 -// CHECK:STDOUT: %.loc41 = load i32, ptr %out.var, align 4, !dbg !12 -// CHECK:STDOUT: %print.int = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 %.loc41), !dbg !13 +// CHECK:STDOUT: %.loc40 = load i32, ptr %out.var, align 4, !dbg !12 +// CHECK:STDOUT: %print.int = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 %.loc40), !dbg !13 // CHECK:STDOUT: ret void, !dbg !14 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -72,18 +71,12 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: define i32 @_CCallGenericMethod.Main.2b28d1a7fa793cbc(i32 %x) !dbg !15 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %F.call = call i32 @"_CF.ImplsSomeInterface.Main:SomeInterface.Main.2b28d1a7fa793cbc"(i32 %x), !dbg !16 -// CHECK:STDOUT: ret i32 %F.call, !dbg !17 +// CHECK:STDOUT: %.loc35_15 = call i32 @"_CF.ImplsSomeInterface.Main:SomeInterface.Main"(i32 %x), !dbg !16 +// CHECK:STDOUT: ret i32 %.loc35_15, !dbg !17 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare i32 @printf(ptr, ...) // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @"_CF.ImplsSomeInterface.Main:SomeInterface.Main.2b28d1a7fa793cbc"(i32 %x) !dbg !18 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %int.sadd = add i32 %x, %x, !dbg !19 -// CHECK:STDOUT: ret i32 %int.sadd, !dbg !20 -// CHECK:STDOUT: } -// CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} @@ -93,20 +86,17 @@ fn G() { // CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) // CHECK:STDOUT: !3 = !DIFile(filename: "call_impl_function.carbon", directory: "") -// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.ImplsSomeInterface.Main:SomeInterface.Main", scope: null, file: !3, line: 22, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.ImplsSomeInterface.Main:SomeInterface.Main", scope: null, file: !3, line: 21, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} -// CHECK:STDOUT: !7 = !DILocation(line: 23, column: 12, scope: !4) -// CHECK:STDOUT: !8 = !DILocation(line: 23, column: 5, scope: !4) -// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !3, line: 39, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !10 = !DILocation(line: 40, column: 3, scope: !9) -// CHECK:STDOUT: !11 = !DILocation(line: 40, column: 19, scope: !9) -// CHECK:STDOUT: !12 = !DILocation(line: 41, column: 14, scope: !9) -// CHECK:STDOUT: !13 = !DILocation(line: 41, column: 3, scope: !9) -// CHECK:STDOUT: !14 = !DILocation(line: 39, column: 1, scope: !9) -// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "CallGenericMethod", linkageName: "_CCallGenericMethod.Main.2b28d1a7fa793cbc", scope: null, file: !3, line: 35, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !16 = !DILocation(line: 36, column: 10, scope: !15) -// CHECK:STDOUT: !17 = !DILocation(line: 36, column: 3, scope: !15) -// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "F", linkageName: "_CF.ImplsSomeInterface.Main:SomeInterface.Main.2b28d1a7fa793cbc", scope: null, file: !3, line: 22, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !19 = !DILocation(line: 23, column: 12, scope: !18) -// CHECK:STDOUT: !20 = !DILocation(line: 23, column: 5, scope: !18) +// CHECK:STDOUT: !7 = !DILocation(line: 22, column: 12, scope: !4) +// CHECK:STDOUT: !8 = !DILocation(line: 22, column: 5, scope: !4) +// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !3, line: 38, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !10 = !DILocation(line: 39, column: 3, scope: !9) +// CHECK:STDOUT: !11 = !DILocation(line: 39, column: 19, scope: !9) +// CHECK:STDOUT: !12 = !DILocation(line: 40, column: 14, scope: !9) +// CHECK:STDOUT: !13 = !DILocation(line: 40, column: 3, scope: !9) +// CHECK:STDOUT: !14 = !DILocation(line: 38, column: 1, scope: !9) +// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "CallGenericMethod", linkageName: "_CCallGenericMethod.Main.2b28d1a7fa793cbc", scope: null, file: !3, line: 34, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !16 = !DILocation(line: 35, column: 10, scope: !15) +// CHECK:STDOUT: !17 = !DILocation(line: 35, column: 3, scope: !15) diff --git a/toolchain/sem_ir/file.cpp b/toolchain/sem_ir/file.cpp index f8a9198ee9ac..d5d2143c4a84 100644 --- a/toolchain/sem_ir/file.cpp +++ b/toolchain/sem_ir/file.cpp @@ -282,6 +282,7 @@ auto GetExprCategory(const File& file, InstId inst_id) -> ExprCategory { case RequireCompleteType::Kind: case SpecificFunction::Kind: case SpecificFunctionType::Kind: + case SpecificImplFunction::Kind: case StringLiteral::Kind: case StringType::Kind: case StructType::Kind: diff --git a/toolchain/sem_ir/inst_kind.def b/toolchain/sem_ir/inst_kind.def index 6f43f8fe7422..0129a25f12a3 100644 --- a/toolchain/sem_ir/inst_kind.def +++ b/toolchain/sem_ir/inst_kind.def @@ -100,6 +100,7 @@ CARBON_SEM_IR_INST_KIND(ReturnSlotPattern) CARBON_SEM_IR_INST_KIND(SpecificConstant) CARBON_SEM_IR_INST_KIND(SpecificFunction) CARBON_SEM_IR_INST_KIND(SpecificFunctionType) +CARBON_SEM_IR_INST_KIND(SpecificImplFunction) CARBON_SEM_IR_INST_KIND(SpliceBlock) CARBON_SEM_IR_INST_KIND(StringLiteral) CARBON_SEM_IR_INST_KIND(StringType) diff --git a/toolchain/sem_ir/inst_namer.cpp b/toolchain/sem_ir/inst_namer.cpp index ddc50ffd212d..9a9ee3dc0b65 100644 --- a/toolchain/sem_ir/inst_namer.cpp +++ b/toolchain/sem_ir/inst_namer.cpp @@ -823,11 +823,7 @@ auto InstNamer::CollectNamesInBlock(ScopeId top_scope_id, continue; } case CARBON_KIND(SpecificFunction inst): { - InstId callee_id = inst.callee_id; - if (auto method = sem_ir_->insts().TryGetAs(callee_id)) { - callee_id = method->function_decl_id; - } - auto type_id = sem_ir_->insts().Get(callee_id).type_id(); + auto type_id = sem_ir_->insts().Get(inst.callee_id).type_id(); if (auto fn_ty = sem_ir_->types().TryGetAs(type_id)) { add_inst_name_id(sem_ir_->functions().Get(fn_ty->function_id).name_id, ".specific_fn"); @@ -836,6 +832,16 @@ auto InstNamer::CollectNamesInBlock(ScopeId top_scope_id, } continue; } + case CARBON_KIND(SpecificImplFunction inst): { + auto type_id = sem_ir_->insts().Get(inst.callee_id).type_id(); + if (auto fn_ty = sem_ir_->types().TryGetAs(type_id)) { + add_inst_name_id(sem_ir_->functions().Get(fn_ty->function_id).name_id, + ".specific_impl_fn"); + } else { + add_inst_name("specific_impl_fn"); + } + continue; + } case ReturnSlot::Kind: { add_inst_name_id(NameId::ReturnSlot); break; diff --git a/toolchain/sem_ir/stringify_type.cpp b/toolchain/sem_ir/stringify_type.cpp index 5a5e0a42fd40..febb7406f355 100644 --- a/toolchain/sem_ir/stringify_type.cpp +++ b/toolchain/sem_ir/stringify_type.cpp @@ -473,6 +473,19 @@ auto StringifyTypeExpr(const SemIR::File& sem_ir, InstId outer_inst_id) } break; } + case CARBON_KIND(SpecificImplFunction inst): { + auto callee = SemIR::GetCalleeFunction(sem_ir, inst.callee_id); + if (callee.function_id.has_value()) { + // TODO: The specific_id here is for the interface member, but the + // entity we're passing is the impl member. This might result in + // strange output once we render specific arguments properly. + step_stack.PushEntityName(sem_ir.functions().Get(callee.function_id), + inst.specific_id); + } else { + step_stack.PushString(""); + } + break; + } case CARBON_KIND(StructType inst): { auto fields = sem_ir.struct_type_fields().Get(inst.fields_id); if (fields.empty()) { diff --git a/toolchain/sem_ir/typed_insts.h b/toolchain/sem_ir/typed_insts.h index 829a2bacd97d..d63a46c82381 100644 --- a/toolchain/sem_ir/typed_insts.h +++ b/toolchain/sem_ir/typed_insts.h @@ -1339,6 +1339,29 @@ struct SpecificFunctionType { TypeId type_id; }; +// A specific instance of a function from an impl, named as the function from +// the interface. +// +// This value is the callee in a call of the form `(T as Interface).F()`. The +// specific that we determine for such a call is a specific for `Interface.F`, +// but what we need is a specific for the function in the `impl`. This +// instruction computes that specific function. +struct SpecificImplFunction { + static constexpr auto Kind = + InstKind::SpecificImplFunction.Define( + {.ir_name = "specific_impl_function", + .constant_kind = InstConstantKind::SymbolicOnly}); + + // Always the builtin SpecificFunctionType. + TypeId type_id; + // The expression denoting the callee. This will be a function from an impl + // witness. + InstId callee_id; + // The specific instance of the interface function that was called, including + // all the compile-time arguments. + SpecificId specific_id; +}; + // Splices a block into the location where this appears. This may be an // expression, producing a result with a given type. For example, when // constructing from aggregates we may figure out which conversions are required