mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Add template action for compound member access. (#7657)
This allows various templated constructs to get further through checking, but typically we hit another unsupported action such as a conversion or call, so it's not enough to make much work.
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include "toolchain/check/inst.h"
|
||||
#include "toolchain/sem_ir/ids.h"
|
||||
#include "toolchain/sem_ir/inst.h"
|
||||
#include "toolchain/sem_ir/typed_insts.h"
|
||||
|
||||
namespace Carbon::Check {
|
||||
|
||||
@@ -38,6 +39,10 @@ auto PerformAction(Context& context, SemIR::LocId loc_id,
|
||||
auto PerformAction(Context& context, SemIR::LocId loc_id,
|
||||
SemIR::CalleePatternMatchAction action) -> SemIR::InstId;
|
||||
|
||||
// Performs a compound member access action. Defined in member_access.cpp.
|
||||
auto PerformAction(Context& context, SemIR::LocId loc_id,
|
||||
SemIR::CompoundMemberAccessAction action) -> SemIR::InstId;
|
||||
|
||||
// Performs a type refinement action, by creating a conversion from an
|
||||
// instruction with a template-dependent symbolic type to the corresponding
|
||||
// instantiated type.
|
||||
@@ -75,6 +80,26 @@ auto AddDependentActionSplice(Context& context, LocT loc, InstT inst,
|
||||
result_type_inst_id);
|
||||
}
|
||||
|
||||
// Handles a new action if necessary. If the action is not dependent, returns
|
||||
// InstId::None. Otherwise, adds the action to the enclosing template's eval
|
||||
// block and creates an instruction to splice in the result of the action.
|
||||
// `result_type_inst_id` is the type of inst produced by the action. If not
|
||||
// known, it can be set to `None`, and a `TypeOfInst` instruction will be added
|
||||
// to act as the type of the splice.
|
||||
template <typename ActionT, typename LocIdT>
|
||||
auto AddActionSpliceIfDependent(Context& context, LocIdT loc_id,
|
||||
SemIR::TypeInstId expected_result_type_inst_id,
|
||||
ActionT action_inst) -> SemIR::InstId {
|
||||
CARBON_CHECK(action_inst.type_id == SemIR::InstType::TypeId);
|
||||
if (ActionIsPerformable(context, action_inst)) {
|
||||
return SemIR::InstId::None;
|
||||
}
|
||||
return AddDependentActionSplice(context,
|
||||
SemIR::LocIdAndInst::RuntimeVerified(
|
||||
context.sem_ir(), loc_id, action_inst),
|
||||
expected_result_type_inst_id);
|
||||
}
|
||||
|
||||
// Handles a new action. If the action is not dependent, it is performed
|
||||
// immediately. Otherwise, adds the action to the enclosing template's eval
|
||||
// block and creates an instruction to splice in the result of the action.
|
||||
@@ -85,12 +110,10 @@ template <typename ActionT, typename LocIdT>
|
||||
auto HandleAction(Context& context, LocIdT loc_id,
|
||||
SemIR::TypeInstId expected_result_type_inst_id,
|
||||
ActionT action_inst) -> SemIR::InstId {
|
||||
CARBON_CHECK(action_inst.type_id == SemIR::InstType::TypeId);
|
||||
if (!ActionIsPerformable(context, action_inst)) {
|
||||
return AddDependentActionSplice(context,
|
||||
SemIR::LocIdAndInst::RuntimeVerified(
|
||||
context.sem_ir(), loc_id, action_inst),
|
||||
expected_result_type_inst_id);
|
||||
if (auto splice_inst_id = AddActionSpliceIfDependent(
|
||||
context, loc_id, expected_result_type_inst_id, action_inst);
|
||||
splice_inst_id.has_value()) {
|
||||
return splice_inst_id;
|
||||
}
|
||||
|
||||
auto expected_result_type_id =
|
||||
|
||||
@@ -2063,15 +2063,16 @@ auto Convert(Context& context, SemIR::LocId loc_id, SemIR::InstId expr_id,
|
||||
if (sem_ir.insts().Get(expr_id).type_id() != target.type_id &&
|
||||
target.kind == ConversionTarget::Value) {
|
||||
auto target_type_inst_id = context.types().GetTypeInstId(target.type_id);
|
||||
SemIR::ConvertToValueAction convert_action = {
|
||||
.type_id = SemIR::InstType::TypeId,
|
||||
.inst_id = expr_id,
|
||||
.target_type_inst_id = target_type_inst_id};
|
||||
// We don't use `HandleAction` here because it would call `PerformAction`
|
||||
// inline if it's performable, which would lead to infinite recursion.
|
||||
if (!ActionIsPerformable(context, convert_action)) {
|
||||
return AddDependentActionSplice(context, loc_id, convert_action,
|
||||
target_type_inst_id);
|
||||
if (auto splice_inst_id = AddActionSpliceIfDependent(
|
||||
context, loc_id, target_type_inst_id,
|
||||
SemIR::ConvertToValueAction{
|
||||
.type_id = SemIR::InstType::TypeId,
|
||||
.inst_id = expr_id,
|
||||
.target_type_inst_id = target_type_inst_id});
|
||||
splice_inst_id.has_value()) {
|
||||
return splice_inst_id;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -765,10 +765,11 @@ auto GetAssociatedValue(Context& context, SemIR::LocId loc_id,
|
||||
specific_interface);
|
||||
}
|
||||
|
||||
auto PerformCompoundMemberAccess(
|
||||
static auto PerformCompoundMemberAccessAction(
|
||||
Context& context, SemIR::LocId loc_id, SemIR::InstId base_id,
|
||||
SemIR::InstId member_expr_id, bool diagnose,
|
||||
DiagnosticContextFn missing_impl_diagnostic_context) -> SemIR::InstId {
|
||||
SemIR::InstId member_expr_id, bool diagnose = true,
|
||||
DiagnosticContextFn missing_impl_diagnostic_context = nullptr)
|
||||
-> SemIR::InstId {
|
||||
auto base_type_id = context.insts().Get(base_id).type_id();
|
||||
auto base_type_const_id = context.types().GetConstantId(base_type_id);
|
||||
|
||||
@@ -839,6 +840,31 @@ auto PerformCompoundMemberAccess(
|
||||
return member_id;
|
||||
}
|
||||
|
||||
auto PerformCompoundMemberAccess(
|
||||
Context& context, SemIR::LocId loc_id, SemIR::InstId base_id,
|
||||
SemIR::InstId member_expr_id, bool diagnose,
|
||||
DiagnosticContextFn missing_impl_diagnostic_context) -> SemIR::InstId {
|
||||
if (auto splice_inst_id = AddActionSpliceIfDependent(
|
||||
context, loc_id, SemIR::TypeInstId::None,
|
||||
SemIR::CompoundMemberAccessAction{.type_id = SemIR::InstType::TypeId,
|
||||
.base_id = base_id,
|
||||
.member_expr_id = member_expr_id});
|
||||
splice_inst_id.has_value()) {
|
||||
// TODO: CHECK-fail if diagnose is false. The caller shouldn't be asking us
|
||||
// to check whether a template-dependent compound member access is valid.
|
||||
return splice_inst_id;
|
||||
}
|
||||
return PerformCompoundMemberAccessAction(context, loc_id, base_id,
|
||||
member_expr_id, diagnose,
|
||||
missing_impl_diagnostic_context);
|
||||
}
|
||||
|
||||
auto PerformAction(Context& context, SemIR::LocId loc_id,
|
||||
SemIR::CompoundMemberAccessAction action) -> SemIR::InstId {
|
||||
return PerformCompoundMemberAccessAction(context, loc_id, action.base_id,
|
||||
action.member_expr_id);
|
||||
}
|
||||
|
||||
auto PerformTupleAccess(Context& context, SemIR::LocId loc_id,
|
||||
SemIR::InstId tuple_inst_id,
|
||||
SemIR::InstId index_inst_id) -> SemIR::InstId {
|
||||
|
||||
+198
-50
@@ -76,10 +76,27 @@ fn F() {
|
||||
// --- generic_use_inside_generic.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
class C(T: type) {}
|
||||
|
||||
//@dump-sem-ir-begin
|
||||
fn F(generic T: type) {
|
||||
var unused v: C(T) = {};
|
||||
}
|
||||
//@dump-sem-ir-end
|
||||
|
||||
fn G() { F({}); }
|
||||
|
||||
// --- fail_todo_generic_use_inside_template.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
class C(template T: type) {}
|
||||
|
||||
//@dump-sem-ir-begin
|
||||
fn F(template T: type) {
|
||||
// CHECK:STDERR: fail_todo_generic_use_inside_template.carbon:[[@LINE+4]]:3: error: value of type `<dependent type>` is not callable [CallToNonCallable]
|
||||
// CHECK:STDERR: var unused v: C(T) = {};
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
var unused v: C(T) = {};
|
||||
}
|
||||
//@dump-sem-ir-end
|
||||
@@ -416,10 +433,142 @@ fn G() { F({}); }
|
||||
// CHECK:STDOUT: %type: type = facet_type <type> [concrete]
|
||||
// CHECK:STDOUT: %.Self.frozen: %type = symbolic_binding .Self [symbolic_self]
|
||||
// CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
|
||||
// CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [symbolic]
|
||||
// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
|
||||
// CHECK:STDOUT: %C.type: type = generic_class_type @C [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %C.generic: %C.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %C.1d0: type = class_type @C, @C(%T) [symbolic]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %C.1d0 [symbolic]
|
||||
// CHECK:STDOUT: %pattern_type.ebe: type = pattern_type %C.1d0 [symbolic]
|
||||
// CHECK:STDOUT: %v.patt.f9d: %pattern_type.ebe = ref_binding_pattern v [symbolic]
|
||||
// CHECK:STDOUT: %v.var_patt.ca3: %pattern_type.ebe = var_pattern %v.patt.f9d [symbolic]
|
||||
// CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %C.val.d4f: %C.1d0 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
|
||||
// CHECK:STDOUT: %Destroy.lookup_impl_witness: <witness> = lookup_impl_witness %C.1d0, @Destroy [symbolic]
|
||||
// CHECK:STDOUT: %Destroy.facet.19f: %Destroy.type = facet_value %C.1d0, (%Destroy.lookup_impl_witness) [symbolic]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.fc4: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.19f) [symbolic]
|
||||
// CHECK:STDOUT: %.cb3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.fc4, %Destroy.facet.19f [symbolic]
|
||||
// CHECK:STDOUT: %impl.elem0: %.cb3 = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic]
|
||||
// CHECK:STDOUT: %specific_impl_fn: <specific function> = specific_impl_function %impl.elem0, @Destroy.WithSelf.Op(%Destroy.facet.19f) [symbolic]
|
||||
// CHECK:STDOUT: %C.d8e: type = class_type @C, @C(%empty_struct_type) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.2fd: type = pattern_type %C.d8e [concrete]
|
||||
// CHECK:STDOUT: %v.patt.0e7: %pattern_type.2fd = ref_binding_pattern v [concrete]
|
||||
// CHECK:STDOUT: %v.var_patt.259: %pattern_type.2fd = var_pattern %v.patt.0e7 [concrete]
|
||||
// CHECK:STDOUT: %C.val.58e: %C.d8e = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.2: type = fn_type @Destroy.Op.loc7_3.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.1a2547.2: %Destroy.Op.type.1d8f74.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %custom_witness.df9cc1.2: <witness> = custom_witness (%Destroy.Op.1a2547.2), @Destroy [concrete]
|
||||
// CHECK:STDOUT: %Destroy.facet.da3: %Destroy.type = facet_value %C.d8e, (%custom_witness.df9cc1.2) [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.294: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.da3) [concrete]
|
||||
// CHECK:STDOUT: %.98c: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.294, %Destroy.facet.da3 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
||||
// CHECK:STDOUT: %T.patt.loc6_15.1: %pattern_type.98f = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_15.2 (constants.%T.patt)]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc6_17.1: type = splice_block %.loc6_17.2 [concrete = type] {
|
||||
// CHECK:STDOUT: %.Self.frozen: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
|
||||
// CHECK:STDOUT: %.loc6_17.2: type = type_literal type [concrete = type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %T.loc6_15.2: type = symbolic_binding T, 0 [symbolic = %T.loc6_15.1 (constants.%T)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @F(%T.loc6_15.2: type) {
|
||||
// CHECK:STDOUT: %T.patt.loc6_15.2: %pattern_type.98f = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_15.2 (constants.%T.patt)]
|
||||
// CHECK:STDOUT: %T.loc6_15.1: type = symbolic_binding T, 0 [symbolic = %T.loc6_15.1 (constants.%T)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %C.loc7_20.2: type = class_type @C, @C(%T.loc6_15.1) [symbolic = %C.loc7_20.2 (constants.%C.1d0)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %C.loc7_20.2 [symbolic = %require_complete (constants.%require_complete)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %C.loc7_20.2 [symbolic = %pattern_type (constants.%pattern_type.ebe)]
|
||||
// CHECK:STDOUT: %v.patt.loc7_15.2: @F.%pattern_type (%pattern_type.ebe) = ref_binding_pattern v [symbolic = %v.patt.loc7_15.2 (constants.%v.patt.f9d)]
|
||||
// CHECK:STDOUT: %v.var_patt.loc7_3.2: @F.%pattern_type (%pattern_type.ebe) = var_pattern %v.patt.loc7_15.2 [symbolic = %v.var_patt.loc7_3.2 (constants.%v.var_patt.ca3)]
|
||||
// CHECK:STDOUT: %C.val: @F.%C.loc7_20.2 (%C.1d0) = struct_value () [symbolic = %C.val (constants.%C.val.d4f)]
|
||||
// CHECK:STDOUT: %Destroy.lookup_impl_witness: <witness> = lookup_impl_witness %C.loc7_20.2, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc7_3.3: %Destroy.type = facet_value %C.loc7_20.2, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc7_3.3 (constants.%Destroy.facet.19f)]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc7_3.3) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.fc4)]
|
||||
// CHECK:STDOUT: %.loc7_3.4: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet.loc7_3.3 [symbolic = %.loc7_3.4 (constants.%.cb3)]
|
||||
// CHECK:STDOUT: %impl.elem0.loc7_3.2: @F.%.loc7_3.4 (%.cb3) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc7_3.2 (constants.%impl.elem0)]
|
||||
// CHECK:STDOUT: %specific_impl_fn.loc7_3.2: <specific function> = specific_impl_function %impl.elem0.loc7_3.2, @Destroy.WithSelf.Op(%Destroy.facet.loc7_3.3) [symbolic = %specific_impl_fn.loc7_3.2 (constants.%specific_impl_fn)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %v.var: ref @F.%C.loc7_20.2 (%C.1d0) = var_storage %v.var_patt.loc7_3.1
|
||||
// CHECK:STDOUT: %.loc7_25.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc7_25.2: init @F.%C.loc7_20.2 (%C.1d0) to %v.var = class_init () [symbolic = %C.val (constants.%C.val.d4f)]
|
||||
// CHECK:STDOUT: %.loc7_3.1: init @F.%C.loc7_20.2 (%C.1d0) = converted %.loc7_25.1, %.loc7_25.2 [symbolic = %C.val (constants.%C.val.d4f)]
|
||||
// CHECK:STDOUT: assign %v.var, %.loc7_3.1
|
||||
// CHECK:STDOUT: %.loc7_20: type = splice_block %C.loc7_20.1 [symbolic = %C.loc7_20.2 (constants.%C.1d0)] {
|
||||
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc6_15.2 [symbolic = %T.loc6_15.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %C.loc7_20.1: type = class_type @C, @C(constants.%T) [symbolic = %C.loc7_20.2 (constants.%C.1d0)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %v: ref @F.%C.loc7_20.2 (%C.1d0) = wrapper_binding v, %v.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %v.patt.loc7_15.1: @F.%pattern_type (%pattern_type.ebe) = ref_binding_pattern v [symbolic = %v.patt.loc7_15.2 (constants.%v.patt.f9d)]
|
||||
// CHECK:STDOUT: %v.var_patt.loc7_3.1: @F.%pattern_type (%pattern_type.ebe) = var_pattern %v.patt.loc7_15.1 [symbolic = %v.var_patt.loc7_3.2 (constants.%v.var_patt.ca3)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %impl.elem0.loc7_3.1: @F.%.loc7_3.4 (%.cb3) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc7_3.2 (constants.%impl.elem0)]
|
||||
// CHECK:STDOUT: %bound_method.loc7_3.1: <bound method> = bound_method %v.var, %impl.elem0.loc7_3.1
|
||||
// CHECK:STDOUT: %Destroy.facet.loc7_3.1: %Destroy.type = facet_value constants.%C.1d0, (constants.%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc7_3.3 (constants.%Destroy.facet.19f)]
|
||||
// CHECK:STDOUT: %.loc7_3.2: %Destroy.type = converted constants.%C.1d0, %Destroy.facet.loc7_3.1 [symbolic = %Destroy.facet.loc7_3.3 (constants.%Destroy.facet.19f)]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc7_3.2: %Destroy.type = facet_value constants.%C.1d0, (constants.%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc7_3.3 (constants.%Destroy.facet.19f)]
|
||||
// CHECK:STDOUT: %.loc7_3.3: %Destroy.type = converted constants.%C.1d0, %Destroy.facet.loc7_3.2 [symbolic = %Destroy.facet.loc7_3.3 (constants.%Destroy.facet.19f)]
|
||||
// CHECK:STDOUT: %specific_impl_fn.loc7_3.1: <specific function> = specific_impl_function %impl.elem0.loc7_3.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.19f) [symbolic = %specific_impl_fn.loc7_3.2 (constants.%specific_impl_fn)]
|
||||
// CHECK:STDOUT: %bound_method.loc7_3.2: <bound method> = bound_method %v.var, %specific_impl_fn.loc7_3.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc7_3.2(%v.var)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc7_3.1(%self.param: ref %empty_struct_type) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc7_3.2(%self.param: ref %C.d8e) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @F(constants.%T) {
|
||||
// CHECK:STDOUT: %T.patt.loc6_15.2 => constants.%T.patt
|
||||
// CHECK:STDOUT: %T.loc6_15.1 => constants.%T
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @F(constants.%empty_struct_type) {
|
||||
// CHECK:STDOUT: %T.patt.loc6_15.2 => constants.%T.patt
|
||||
// CHECK:STDOUT: %T.loc6_15.1 => constants.%empty_struct_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %C.loc7_20.2 => constants.%C.d8e
|
||||
// CHECK:STDOUT: %require_complete => constants.%complete_type
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.2fd
|
||||
// CHECK:STDOUT: %v.patt.loc7_15.2 => constants.%v.patt.0e7
|
||||
// CHECK:STDOUT: %v.var_patt.loc7_3.2 => constants.%v.var_patt.259
|
||||
// CHECK:STDOUT: %C.val => constants.%C.val.58e
|
||||
// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.df9cc1.2
|
||||
// CHECK:STDOUT: %Destroy.facet.loc7_3.3 => constants.%Destroy.facet.da3
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.294
|
||||
// CHECK:STDOUT: %.loc7_3.4 => constants.%.98c
|
||||
// CHECK:STDOUT: %impl.elem0.loc7_3.2 => constants.%Destroy.Op.1a2547.2
|
||||
// CHECK:STDOUT: %specific_impl_fn.loc7_3.2 => constants.%Destroy.Op.1a2547.2
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_todo_generic_use_inside_template.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %type: type = facet_type <type> [concrete]
|
||||
// CHECK:STDOUT: %.Self.frozen: %type = symbolic_binding .Self [symbolic_self]
|
||||
// CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
|
||||
// CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0, template [template]
|
||||
// CHECK:STDOUT: %T: type = symbolic_binding T, 0, template [template]
|
||||
// CHECK:STDOUT: %C.type: type = generic_class_type @C [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %C.generic: %C.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %C.1d0: type = class_type @C, @C(%T) [template]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
@@ -433,23 +582,35 @@ fn G() { F({}); }
|
||||
// CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %C.val.d4f: %C.1d0 = struct_value () [template]
|
||||
// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
|
||||
// CHECK:STDOUT: %Destroy.lookup_impl_witness: <witness> = lookup_impl_witness %C.1d0, @Destroy [template]
|
||||
// CHECK:STDOUT: %Destroy.facet.19f: %Destroy.type = facet_value %C.1d0, (%Destroy.lookup_impl_witness) [template]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.fc4: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.19f) [template]
|
||||
// CHECK:STDOUT: %.cb3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.fc4, %Destroy.facet.19f [template]
|
||||
// CHECK:STDOUT: %impl.elem0: %.cb3 = impl_witness_access %Destroy.lookup_impl_witness, element0 [template]
|
||||
// CHECK:STDOUT: %specific_impl_fn: <specific function> = specific_impl_function %impl.elem0, @Destroy.WithSelf.Op(%Destroy.facet.19f) [template]
|
||||
// CHECK:STDOUT: %Self: %Destroy.type = symbolic_binding Self, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.d3e: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Self) [symbolic]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.42b: %Destroy.WithSelf.Op.type.d3e = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %Destroy.assoc_type: type = assoc_entity_type @Destroy [concrete]
|
||||
// CHECK:STDOUT: %assoc0: %Destroy.assoc_type = assoc_entity element0, imports.%Core.import_ref.918 [concrete]
|
||||
// CHECK:STDOUT: %C.d8e: type = class_type @C, @C(%empty_struct_type) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.2fd: type = pattern_type %C.d8e [concrete]
|
||||
// CHECK:STDOUT: %v.patt.0e7: %pattern_type.2fd = ref_binding_pattern v [concrete]
|
||||
// CHECK:STDOUT: %v.var_patt.259: %pattern_type.2fd = var_pattern %v.patt.0e7 [concrete]
|
||||
// CHECK:STDOUT: %C.val.58e: %C.d8e = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.2: type = fn_type @Destroy.Op.loc7_3.2 [concrete]
|
||||
// CHECK:STDOUT: %inst.as_compatible: <instruction> = inst_value [concrete] {
|
||||
// CHECK:STDOUT: %.a67: ref %C.d8e = as_compatible @F.%v.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.2: type = fn_type @Destroy.Op.loc11_3.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.1a2547.2: %Destroy.Op.type.1d8f74.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %custom_witness.df9cc1.2: <witness> = custom_witness (%Destroy.Op.1a2547.2), @Destroy [concrete]
|
||||
// CHECK:STDOUT: %Destroy.facet.da3: %Destroy.type = facet_value %C.d8e, (%custom_witness.df9cc1.2) [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.294: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.da3) [concrete]
|
||||
// CHECK:STDOUT: %.98c: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.294, %Destroy.facet.da3 [concrete]
|
||||
// CHECK:STDOUT: %inst.splice_block: <instruction> = inst_value [concrete] {
|
||||
// CHECK:STDOUT: %.136: <bound method> = splice_block %bound_method {
|
||||
// CHECK:STDOUT: %impl.elem0: %.98c = impl_witness_access %custom_witness.df9cc1.2, element0 [concrete = %Destroy.Op.1a2547.2]
|
||||
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %.a67, %impl.elem0
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core.import_ref.918: @Destroy.WithSelf.%Destroy.WithSelf.Op.type (%Destroy.WithSelf.Op.type.d3e) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @Destroy.WithSelf.%Destroy.WithSelf.Op (constants.%Destroy.WithSelf.Op.42b)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -469,52 +630,42 @@ fn G() { F({}); }
|
||||
// CHECK:STDOUT: %T.loc6_16.1: type = symbolic_binding T, 0, template [template = %T.loc6_16.1 (constants.%T)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %C.loc7_20.2: type = class_type @C, @C(%T.loc6_16.1) [template = %C.loc7_20.2 (constants.%C.1d0)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %C.loc7_20.2 [template = %require_complete (constants.%require_complete)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %C.loc7_20.2 [template = %pattern_type (constants.%pattern_type.ebe)]
|
||||
// CHECK:STDOUT: %v.patt.loc7_15.2: @F.%pattern_type (%pattern_type.ebe) = ref_binding_pattern v [template = %v.patt.loc7_15.2 (constants.%v.patt.f9d)]
|
||||
// CHECK:STDOUT: %v.var_patt.loc7_3.2: @F.%pattern_type (%pattern_type.ebe) = var_pattern %v.patt.loc7_15.2 [template = %v.var_patt.loc7_3.2 (constants.%v.var_patt.ca3)]
|
||||
// CHECK:STDOUT: %C.val: @F.%C.loc7_20.2 (%C.1d0) = struct_value () [template = %C.val (constants.%C.val.d4f)]
|
||||
// CHECK:STDOUT: %Destroy.lookup_impl_witness: <witness> = lookup_impl_witness %C.loc7_20.2, @Destroy [template = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc7_3.3: %Destroy.type = facet_value %C.loc7_20.2, (%Destroy.lookup_impl_witness) [template = %Destroy.facet.loc7_3.3 (constants.%Destroy.facet.19f)]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc7_3.3) [template = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.fc4)]
|
||||
// CHECK:STDOUT: %.loc7_3.4: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet.loc7_3.3 [template = %.loc7_3.4 (constants.%.cb3)]
|
||||
// CHECK:STDOUT: %impl.elem0.loc7_3.2: @F.%.loc7_3.4 (%.cb3) = impl_witness_access %Destroy.lookup_impl_witness, element0 [template = %impl.elem0.loc7_3.2 (constants.%impl.elem0)]
|
||||
// CHECK:STDOUT: %specific_impl_fn.loc7_3.2: <specific function> = specific_impl_function %impl.elem0.loc7_3.2, @Destroy.WithSelf.Op(%Destroy.facet.loc7_3.3) [template = %specific_impl_fn.loc7_3.2 (constants.%specific_impl_fn)]
|
||||
// CHECK:STDOUT: %C.loc11_20.2: type = class_type @C, @C(%T.loc6_16.1) [template = %C.loc11_20.2 (constants.%C.1d0)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %C.loc11_20.2 [template = %require_complete (constants.%require_complete)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %C.loc11_20.2 [template = %pattern_type (constants.%pattern_type.ebe)]
|
||||
// CHECK:STDOUT: %v.patt.loc11_15.2: @F.%pattern_type (%pattern_type.ebe) = ref_binding_pattern v [template = %v.patt.loc11_15.2 (constants.%v.patt.f9d)]
|
||||
// CHECK:STDOUT: %v.var_patt.loc11_3.2: @F.%pattern_type (%pattern_type.ebe) = var_pattern %v.patt.loc11_15.2 [template = %v.var_patt.loc11_3.2 (constants.%v.var_patt.ca3)]
|
||||
// CHECK:STDOUT: %C.val: @F.%C.loc11_20.2 (%C.1d0) = struct_value () [template = %C.val (constants.%C.val.d4f)]
|
||||
// CHECK:STDOUT: %.loc11_3.4: <instruction> = refine_type_action %v.var, %C.loc11_20.2 [template]
|
||||
// CHECK:STDOUT: %.loc11_3.5: <instruction> = compound_member_access_action %.loc11_3.2, constants.%assoc0 [template]
|
||||
// CHECK:STDOUT: %.loc11_3.6: type = type_of_inst %.loc11_3.5 [template]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %v.var: ref @F.%C.loc7_20.2 (%C.1d0) = var_storage %v.var_patt.loc7_3.1
|
||||
// CHECK:STDOUT: %.loc7_25.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc7_25.2: init @F.%C.loc7_20.2 (%C.1d0) to %v.var = class_init () [template = %C.val (constants.%C.val.d4f)]
|
||||
// CHECK:STDOUT: %.loc7_3.1: init @F.%C.loc7_20.2 (%C.1d0) = converted %.loc7_25.1, %.loc7_25.2 [template = %C.val (constants.%C.val.d4f)]
|
||||
// CHECK:STDOUT: assign %v.var, %.loc7_3.1
|
||||
// CHECK:STDOUT: %.loc7_20: type = splice_block %C.loc7_20.1 [template = %C.loc7_20.2 (constants.%C.1d0)] {
|
||||
// CHECK:STDOUT: %v.var: ref @F.%C.loc11_20.2 (%C.1d0) = var_storage %v.var_patt.loc11_3.1
|
||||
// CHECK:STDOUT: %.loc11_25.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc11_25.2: init @F.%C.loc11_20.2 (%C.1d0) to %v.var = class_init () [template = %C.val (constants.%C.val.d4f)]
|
||||
// CHECK:STDOUT: %.loc11_3.1: init @F.%C.loc11_20.2 (%C.1d0) = converted %.loc11_25.1, %.loc11_25.2 [template = %C.val (constants.%C.val.d4f)]
|
||||
// CHECK:STDOUT: assign %v.var, %.loc11_3.1
|
||||
// CHECK:STDOUT: %.loc11_20: type = splice_block %C.loc11_20.1 [template = %C.loc11_20.2 (constants.%C.1d0)] {
|
||||
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc6_16.2 [template = %T.loc6_16.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %C.loc7_20.1: type = class_type @C, @C(constants.%T) [template = %C.loc7_20.2 (constants.%C.1d0)]
|
||||
// CHECK:STDOUT: %C.loc11_20.1: type = class_type @C, @C(constants.%T) [template = %C.loc11_20.2 (constants.%C.1d0)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %v: ref @F.%C.loc7_20.2 (%C.1d0) = wrapper_binding v, %v.var
|
||||
// CHECK:STDOUT: %v: ref @F.%C.loc11_20.2 (%C.1d0) = wrapper_binding v, %v.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %v.patt.loc7_15.1: @F.%pattern_type (%pattern_type.ebe) = ref_binding_pattern v [template = %v.patt.loc7_15.2 (constants.%v.patt.f9d)]
|
||||
// CHECK:STDOUT: %v.var_patt.loc7_3.1: @F.%pattern_type (%pattern_type.ebe) = var_pattern %v.patt.loc7_15.1 [template = %v.var_patt.loc7_3.2 (constants.%v.var_patt.ca3)]
|
||||
// CHECK:STDOUT: %v.patt.loc11_15.1: @F.%pattern_type (%pattern_type.ebe) = ref_binding_pattern v [template = %v.patt.loc11_15.2 (constants.%v.patt.f9d)]
|
||||
// CHECK:STDOUT: %v.var_patt.loc11_3.1: @F.%pattern_type (%pattern_type.ebe) = var_pattern %v.patt.loc11_15.1 [template = %v.var_patt.loc11_3.2 (constants.%v.var_patt.ca3)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %impl.elem0.loc7_3.1: @F.%.loc7_3.4 (%.cb3) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [template = %impl.elem0.loc7_3.2 (constants.%impl.elem0)]
|
||||
// CHECK:STDOUT: %bound_method.loc7_3.1: <bound method> = bound_method %v.var, %impl.elem0.loc7_3.1
|
||||
// CHECK:STDOUT: %Destroy.facet.loc7_3.1: %Destroy.type = facet_value constants.%C.1d0, (constants.%Destroy.lookup_impl_witness) [template = %Destroy.facet.loc7_3.3 (constants.%Destroy.facet.19f)]
|
||||
// CHECK:STDOUT: %.loc7_3.2: %Destroy.type = converted constants.%C.1d0, %Destroy.facet.loc7_3.1 [template = %Destroy.facet.loc7_3.3 (constants.%Destroy.facet.19f)]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc7_3.2: %Destroy.type = facet_value constants.%C.1d0, (constants.%Destroy.lookup_impl_witness) [template = %Destroy.facet.loc7_3.3 (constants.%Destroy.facet.19f)]
|
||||
// CHECK:STDOUT: %.loc7_3.3: %Destroy.type = converted constants.%C.1d0, %Destroy.facet.loc7_3.2 [template = %Destroy.facet.loc7_3.3 (constants.%Destroy.facet.19f)]
|
||||
// CHECK:STDOUT: %specific_impl_fn.loc7_3.1: <specific function> = specific_impl_function %impl.elem0.loc7_3.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.19f) [template = %specific_impl_fn.loc7_3.2 (constants.%specific_impl_fn)]
|
||||
// CHECK:STDOUT: %bound_method.loc7_3.2: <bound method> = bound_method %v.var, %specific_impl_fn.loc7_3.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc7_3.2(%v.var)
|
||||
// CHECK:STDOUT: %.loc11_3.2: @F.%C.loc11_20.2 (%C.1d0) = splice_inst %.loc11_3.4
|
||||
// CHECK:STDOUT: %.loc11_3.3: @F.%.loc11_3.6 (@F.%.loc11_3.6) = splice_inst %.loc11_3.5
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc7_3.1(%self.param: ref %empty_struct_type) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc11_3.1(%self.param: ref %empty_struct_type) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc7_3.2(%self.param: ref %C.d8e) {
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc11_3.2(%self.param: ref %C.d8e) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
@@ -529,17 +680,14 @@ fn G() { F({}); }
|
||||
// CHECK:STDOUT: %T.loc6_16.1 => constants.%empty_struct_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %C.loc7_20.2 => constants.%C.d8e
|
||||
// CHECK:STDOUT: %C.loc11_20.2 => constants.%C.d8e
|
||||
// CHECK:STDOUT: %require_complete => constants.%complete_type
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.2fd
|
||||
// CHECK:STDOUT: %v.patt.loc7_15.2 => constants.%v.patt.0e7
|
||||
// CHECK:STDOUT: %v.var_patt.loc7_3.2 => constants.%v.var_patt.259
|
||||
// CHECK:STDOUT: %v.patt.loc11_15.2 => constants.%v.patt.0e7
|
||||
// CHECK:STDOUT: %v.var_patt.loc11_3.2 => constants.%v.var_patt.259
|
||||
// CHECK:STDOUT: %C.val => constants.%C.val.58e
|
||||
// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.df9cc1.2
|
||||
// CHECK:STDOUT: %Destroy.facet.loc7_3.3 => constants.%Destroy.facet.da3
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.294
|
||||
// CHECK:STDOUT: %.loc7_3.4 => constants.%.98c
|
||||
// CHECK:STDOUT: %impl.elem0.loc7_3.2 => constants.%Destroy.Op.1a2547.2
|
||||
// CHECK:STDOUT: %specific_impl_fn.loc7_3.2 => constants.%Destroy.Op.1a2547.2
|
||||
// CHECK:STDOUT: %.loc11_3.4 => constants.%inst.as_compatible
|
||||
// CHECK:STDOUT: %.loc11_3.5 => constants.%inst.splice_block
|
||||
// CHECK:STDOUT: %.loc11_3.6 => <bound method>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+8
-5
@@ -91,15 +91,11 @@ eval fn F(_: i32) -> type {
|
||||
}
|
||||
|
||||
fn UseFGenerically(generic X: i32) {
|
||||
// CHECK:STDERR: fail_todo_dependent_call_type.carbon:[[@LINE+12]]:3: error: member name of type `<dependent type>` in compound member access is not an instance member or an interface member [CompoundMemberAccessDoesNotUseBase]
|
||||
// CHECK:STDERR: var unused v: F(X) = {};
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_dependent_call_type.carbon:[[@LINE+8]]:3: error: value of type `<dependent type>` is not callable [CallToNonCallable]
|
||||
// CHECK:STDERR: var unused v: F(X) = {};
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_dependent_call_type.carbon:[[@LINE+4]]:3: error: cannot access member of interface `Core.Destroy` in type `<cannot stringify inst7C000219: {kind: Call, arg0: inst7C000044, arg1: inst_block7C00008B, type: type(TypeType)}>` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: fail_todo_dependent_call_type.carbon:[[@LINE+4]]:3: error: value of type `<dependent type>` is not callable [CallToNonCallable]
|
||||
// CHECK:STDERR: var unused v: F(X) = {};
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -107,6 +103,13 @@ fn UseFGenerically(generic X: i32) {
|
||||
}
|
||||
|
||||
fn UseFSpecifically() {
|
||||
// CHECK:STDERR: fail_todo_dependent_call_type.carbon:[[@LINE+7]]:3: error: unable to monomorphize specific `UseFGenerically(3)` [ResolvingSpecificHere]
|
||||
// CHECK:STDERR: UseFGenerically(3);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_dependent_call_type.carbon:[[@LINE-7]]:3: note: cannot access member of interface `Core.ImplicitAs(C)` in type `{}` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: var unused v: F(X) = {};
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
UseFGenerically(3);
|
||||
}
|
||||
|
||||
|
||||
+322
-324
@@ -3,8 +3,6 @@
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/int.carbon
|
||||
// TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
|
||||
// EXTRA-ARGS: --dump-sem-ir-ranges=if-present
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
@@ -16,10 +14,12 @@
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
//@dump-sem-ir-begin
|
||||
fn F[template T: type](x: T) -> i32 {
|
||||
let n: i32 = x;
|
||||
return n;
|
||||
}
|
||||
//@dump-sem-ir-end
|
||||
|
||||
fn Test1(n: i32) -> i32 {
|
||||
return F(n);
|
||||
@@ -61,6 +61,68 @@ fn Test(d: D) -> i32 {
|
||||
return F(d);
|
||||
}
|
||||
|
||||
// --- fail_todo_as.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
//@dump-sem-ir-begin
|
||||
fn AsI32[template T: type](x: T) -> i32 {
|
||||
// CHECK:STDERR: fail_todo_as.carbon:[[@LINE+4]]:10: error: value of type `<dependent type>` is not callable [CallToNonCallable]
|
||||
// CHECK:STDERR: return x as i32;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
return x as i32;
|
||||
}
|
||||
//@dump-sem-ir-end
|
||||
|
||||
fn Test1(n: i32) {
|
||||
// CHECK:STDERR: fail_todo_as.carbon:[[@LINE+7]]:16: error: unable to monomorphize specific `AsI32(i32)` [ResolvingSpecificHere]
|
||||
// CHECK:STDERR: let _: i32 = AsI32(n);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_todo_as.carbon:[[@LINE-8]]:10: note: cannot access member of interface `Core.As(i32)` in type `i32` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: return x as i32;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
let _: i32 = AsI32(n);
|
||||
}
|
||||
|
||||
class C {
|
||||
var n: i32;
|
||||
impl as Core.As(i32) {
|
||||
fn Convert(self) -> i32 { return self.n; }
|
||||
}
|
||||
}
|
||||
|
||||
fn Test2(c: C) {
|
||||
let _: i32 = AsI32(c);
|
||||
}
|
||||
|
||||
// --- fail_cannot_as.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
//@dump-sem-ir-begin
|
||||
fn AsI32[template T: type](x: T) -> i32 {
|
||||
// CHECK:STDERR: fail_cannot_as.carbon:[[@LINE+4]]:10: error: value of type `<dependent type>` is not callable [CallToNonCallable]
|
||||
// CHECK:STDERR: return x as i32;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
return x as i32;
|
||||
}
|
||||
//@dump-sem-ir-end
|
||||
|
||||
class D {}
|
||||
|
||||
fn Test(d: D) {
|
||||
// CHECK:STDERR: fail_cannot_as.carbon:[[@LINE+7]]:16: error: unable to monomorphize specific `AsI32(D)` [ResolvingSpecificHere]
|
||||
// CHECK:STDERR: let _: i32 = AsI32(d);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_cannot_as.carbon:[[@LINE-10]]:10: note: cannot access member of interface `Core.As(i32)` in type `D` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: return x as i32;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
let _: i32 = AsI32(d);
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: --- convert.carbon
|
||||
// CHECK:STDOUT:
|
||||
@@ -74,8 +136,6 @@ fn Test(d: D) -> i32 {
|
||||
// CHECK:STDOUT: %x.param_patt.91d: %pattern_type.51d1c4.1 = value_param_pattern [template]
|
||||
// CHECK:STDOUT: %x.patt.260: %pattern_type.51d1c4.1 = wrapper_binding_pattern x, %x.param_patt.91d [template]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %.795f: Core.Form = init_form %i32 [concrete]
|
||||
@@ -98,36 +158,20 @@ fn Test(d: D) -> i32 {
|
||||
// CHECK:STDOUT: %Copy.WithSelf.Op.type.381: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet) [concrete]
|
||||
// CHECK:STDOUT: %.737: type = fn_type_with_self_type %Copy.WithSelf.Op.type.381, %Copy.facet [concrete]
|
||||
// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: <specific function> = specific_function %Int.as.Copy.impl.Op.4f6, @Int.as.Copy.impl.Op(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %n.param_patt: %pattern_type.6b6 = value_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %n.patt.ae8: %pattern_type.6b6 = wrapper_binding_pattern n, %n.param_patt [concrete]
|
||||
// CHECK:STDOUT: %Test1.type: type = fn_type @Test1 [concrete]
|
||||
// CHECK:STDOUT: %Test1: %Test1.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %x.param_patt.cee: %pattern_type.6b6 = value_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %x.patt.e3b: %pattern_type.6b6 = wrapper_binding_pattern x, %x.param_patt.cee [concrete]
|
||||
// CHECK:STDOUT: %F.specific_fn.6c3: <specific function> = specific_function %F, @F(%i32) [concrete]
|
||||
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
||||
// CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %i32 [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.0ff: type = generic_interface_type @ImplicitAs [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.0ff = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.914: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
|
||||
// CHECK:STDOUT: %.bc7: <witness> = impl_self_witness %C, @ImplicitAs, @ImplicitAs(%i32) [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness.edb: <witness> = impl_witness @C.as.ImplicitAs.impl.%ImplicitAs.impl_witness_table [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.98b: type = pattern_type %C [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt.303: %pattern_type.98b = value_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt.36a: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt.303 [concrete]
|
||||
// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.type: type = fn_type @C.as.ImplicitAs.impl.Convert [concrete]
|
||||
// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert: %C.as.ImplicitAs.impl.Convert.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.914 = facet_value %C, (%ImplicitAs.impl_witness.edb) [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.5bd: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%i32, %ImplicitAs.facet) [concrete]
|
||||
// CHECK:STDOUT: %struct_type.n: type = struct_type {.n: %i32} [concrete]
|
||||
// CHECK:STDOUT: %complete_type.cdf: <witness> = complete_type_witness %struct_type.n [concrete]
|
||||
// CHECK:STDOUT: %c.param_patt: %pattern_type.98b = value_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %c.patt: %pattern_type.98b = wrapper_binding_pattern c, %c.param_patt [concrete]
|
||||
// CHECK:STDOUT: %Test2.type: type = fn_type @Test2 [concrete]
|
||||
// CHECK:STDOUT: %Test2: %Test2.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %x.param_patt.0f9: %pattern_type.98b = value_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %x.patt.953: %pattern_type.98b = wrapper_binding_pattern x, %x.param_patt.0f9 [concrete]
|
||||
// CHECK:STDOUT: %F.specific_fn.e0d: <specific function> = specific_function %F, @F(%C) [concrete]
|
||||
// CHECK:STDOUT: %inst.as_compatible.1ff: <instruction> = inst_value [concrete] {
|
||||
// CHECK:STDOUT: %.775: %i32 = as_compatible @F.%x.ref
|
||||
// CHECK:STDOUT: }
|
||||
@@ -150,221 +194,100 @@ fn Test(d: D) -> i32 {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: .Copy = %Core.Copy
|
||||
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type]
|
||||
// CHECK:STDOUT: %Core.import_ref.cd6: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.ac8) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.5e0)]
|
||||
// CHECK:STDOUT: %Copy.impl_witness_table.8d2 = impl_witness_table (%Core.import_ref.cd6), @Int.as.Copy.impl [concrete]
|
||||
// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.0ff = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .F = %F.decl
|
||||
// CHECK:STDOUT: .Test1 = %Test1.decl
|
||||
// CHECK:STDOUT: .C = %C.decl
|
||||
// CHECK:STDOUT: .Test2 = %Test2.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
||||
// CHECK:STDOUT: %T.patt.loc4_16.1: %pattern_type.98f = symbolic_binding_pattern T, 0, template [template = %T.patt.loc4_16.2 (constants.%T.patt.d47011.1)]
|
||||
// CHECK:STDOUT: %x.param_patt.loc4_25.1: @F.%pattern_type (%pattern_type.51d1c4.1) = value_param_pattern [template = %x.param_patt.loc4_25.2 (constants.%x.param_patt.91d)]
|
||||
// CHECK:STDOUT: %x.patt.loc4_25.1: @F.%pattern_type (%pattern_type.51d1c4.1) = wrapper_binding_pattern x, %x.param_patt.loc4_25.1 [template = %x.patt.loc4_25.2 (constants.%x.patt.260)]
|
||||
// CHECK:STDOUT: %T.patt.loc5_16.1: %pattern_type.98f = symbolic_binding_pattern T, 0, template [template = %T.patt.loc5_16.2 (constants.%T.patt.d47011.1)]
|
||||
// CHECK:STDOUT: %x.param_patt.loc5_25.1: @F.%pattern_type (%pattern_type.51d1c4.1) = value_param_pattern [template = %x.param_patt.loc5_25.2 (constants.%x.param_patt.91d)]
|
||||
// CHECK:STDOUT: %x.patt.loc5_25.1: @F.%pattern_type (%pattern_type.51d1c4.1) = wrapper_binding_pattern x, %x.param_patt.loc5_25.1 [template = %x.patt.loc5_25.2 (constants.%x.patt.260)]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.6b6 = out_param_pattern [concrete = constants.%return.param_patt.a9a]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.6b6 = return_slot_pattern %return.param_patt, %i32.loc4 [concrete = constants.%return.patt.e1b]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.6b6 = return_slot_pattern %return.param_patt, %i32.loc5 [concrete = constants.%return.patt.e1b]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %i32.loc4: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc4_33: Core.Form = init_form %i32.loc4 [concrete = constants.%.795f]
|
||||
// CHECK:STDOUT: %.loc4_18.1: type = splice_block %.loc4_18.2 [concrete = type] {
|
||||
// CHECK:STDOUT: %i32.loc5: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc5_33: Core.Form = init_form %i32.loc5 [concrete = constants.%.795f]
|
||||
// CHECK:STDOUT: %.loc5_18.1: type = splice_block %.loc5_18.2 [concrete = type] {
|
||||
// CHECK:STDOUT: %.Self.frozen: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
|
||||
// CHECK:STDOUT: %.loc4_18.2: type = type_literal type [concrete = type]
|
||||
// CHECK:STDOUT: %.loc5_18.2: type = type_literal type [concrete = type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %T.loc4_16.2: type = symbolic_binding T, 0, template [template = %T.loc4_16.1 (constants.%T.67db0b.1)]
|
||||
// CHECK:STDOUT: %x.param: @F.%T.loc4_16.1 (%T.67db0b.1) = value_param call_param0
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_16.2 [template = %T.loc4_16.1 (constants.%T.67db0b.1)]
|
||||
// CHECK:STDOUT: %x: @F.%T.loc4_16.1 (%T.67db0b.1) = wrapper_binding x, %x.param
|
||||
// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
|
||||
// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Test1.decl: %Test1.type = fn_decl @Test1 [concrete = constants.%Test1] {
|
||||
// CHECK:STDOUT: %n.param_patt: %pattern_type.6b6 = value_param_pattern [concrete = constants.%n.param_patt]
|
||||
// CHECK:STDOUT: %n.patt: %pattern_type.6b6 = wrapper_binding_pattern n, %n.param_patt [concrete = constants.%n.patt.ae8]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.6b6 = out_param_pattern [concrete = constants.%return.param_patt.a9a]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.6b6 = return_slot_pattern %return.param_patt, %i32.loc9_21 [concrete = constants.%return.patt.e1b]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %i32.loc9_21: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc9: Core.Form = init_form %i32.loc9_21 [concrete = constants.%.795f]
|
||||
// CHECK:STDOUT: %n.param: %i32 = value_param call_param0
|
||||
// CHECK:STDOUT: %i32.loc9_13: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %n: %i32 = wrapper_binding n, %n.param
|
||||
// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
|
||||
// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
|
||||
// CHECK:STDOUT: %Test2.decl: %Test2.type = fn_decl @Test2 [concrete = constants.%Test2] {
|
||||
// CHECK:STDOUT: %c.param_patt: %pattern_type.98b = value_param_pattern [concrete = constants.%c.param_patt]
|
||||
// CHECK:STDOUT: %c.patt: %pattern_type.98b = wrapper_binding_pattern c, %c.param_patt [concrete = constants.%c.patt]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.6b6 = out_param_pattern [concrete = constants.%return.param_patt.a9a]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.6b6 = return_slot_pattern %return.param_patt, %i32 [concrete = constants.%return.patt.e1b]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc20: Core.Form = init_form %i32 [concrete = constants.%.795f]
|
||||
// CHECK:STDOUT: %c.param: %C = value_param call_param0
|
||||
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %c: %C = wrapper_binding c, %c.param
|
||||
// CHECK:STDOUT: %T.loc5_16.2: type = symbolic_binding T, 0, template [template = %T.loc5_16.1 (constants.%T.67db0b.1)]
|
||||
// CHECK:STDOUT: %x.param: @F.%T.loc5_16.1 (%T.67db0b.1) = value_param call_param0
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc5_16.2 [template = %T.loc5_16.1 (constants.%T.67db0b.1)]
|
||||
// CHECK:STDOUT: %x: @F.%T.loc5_16.1 (%T.67db0b.1) = wrapper_binding x, %x.param
|
||||
// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
|
||||
// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: impl @C.as.ImplicitAs.impl: %Self.ref as %ImplicitAs.type {
|
||||
// CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.decl: %C.as.ImplicitAs.impl.Convert.type = fn_decl @C.as.ImplicitAs.impl.Convert [concrete = constants.%C.as.ImplicitAs.impl.Convert] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = value_param_pattern [concrete = constants.%self.param_patt.303]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.36a]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.6b6 = out_param_pattern [concrete = constants.%return.param_patt.a9a]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.6b6 = return_slot_pattern %return.param_patt, %i32 [concrete = constants.%return.patt.e1b]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc16_25: Core.Form = init_form %i32 [concrete = constants.%.795f]
|
||||
// CHECK:STDOUT: %self.param: %C = value_param call_param0
|
||||
// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %self: %C = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
|
||||
// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness_table = impl_witness_table (%C.as.ImplicitAs.impl.Convert.decl), @C.as.ImplicitAs.impl [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness: <witness> = impl_witness %ImplicitAs.impl_witness_table [concrete = constants.%ImplicitAs.impl_witness.edb]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Convert = %C.as.ImplicitAs.impl.Convert.decl
|
||||
// CHECK:STDOUT: extend %ImplicitAs.type
|
||||
// CHECK:STDOUT: witness = %ImplicitAs.impl_witness
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @C {
|
||||
// CHECK:STDOUT: %.loc14: %C.elem = field_decl n, element0 [concrete]
|
||||
// CHECK:STDOUT: impl_decl @C.as.ImplicitAs.impl [concrete] {} {
|
||||
// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
|
||||
// CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type.0ff = name_ref ImplicitAs, imports.%Core.ImplicitAs [concrete = constants.%ImplicitAs.generic]
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%i32)> [concrete = constants.%ImplicitAs.type.914]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.loc15: <witness> = impl_self_witness @C.as.ImplicitAs.impl.%Self.ref, @ImplicitAs, @ImplicitAs(constants.%i32) [concrete = constants.%.bc7]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.n [concrete = constants.%complete_type.cdf]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = constants.%C
|
||||
// CHECK:STDOUT: .n = %.loc14
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @F(%T.loc4_16.2: type) {
|
||||
// CHECK:STDOUT: %T.patt.loc4_16.2: %pattern_type.98f = symbolic_binding_pattern T, 0, template [template = %T.patt.loc4_16.2 (constants.%T.patt.d47011.1)]
|
||||
// CHECK:STDOUT: %T.loc4_16.1: type = symbolic_binding T, 0, template [template = %T.loc4_16.1 (constants.%T.67db0b.1)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %T.loc4_16.1 [template = %pattern_type (constants.%pattern_type.51d1c4.1)]
|
||||
// CHECK:STDOUT: %x.param_patt.loc4_25.2: @F.%pattern_type (%pattern_type.51d1c4.1) = value_param_pattern [template = %x.param_patt.loc4_25.2 (constants.%x.param_patt.91d)]
|
||||
// CHECK:STDOUT: %x.patt.loc4_25.2: @F.%pattern_type (%pattern_type.51d1c4.1) = wrapper_binding_pattern x, %x.param_patt.loc4_25.2 [template = %x.patt.loc4_25.2 (constants.%x.patt.260)]
|
||||
// CHECK:STDOUT: generic fn @F(%T.loc5_16.2: type) {
|
||||
// CHECK:STDOUT: %T.patt.loc5_16.2: %pattern_type.98f = symbolic_binding_pattern T, 0, template [template = %T.patt.loc5_16.2 (constants.%T.patt.d47011.1)]
|
||||
// CHECK:STDOUT: %T.loc5_16.1: type = symbolic_binding T, 0, template [template = %T.loc5_16.1 (constants.%T.67db0b.1)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %T.loc5_16.1 [template = %pattern_type (constants.%pattern_type.51d1c4.1)]
|
||||
// CHECK:STDOUT: %x.param_patt.loc5_25.2: @F.%pattern_type (%pattern_type.51d1c4.1) = value_param_pattern [template = %x.param_patt.loc5_25.2 (constants.%x.param_patt.91d)]
|
||||
// CHECK:STDOUT: %x.patt.loc5_25.2: @F.%pattern_type (%pattern_type.51d1c4.1) = wrapper_binding_pattern x, %x.param_patt.loc5_25.2 [template = %x.patt.loc5_25.2 (constants.%x.patt.260)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.loc4_16.1 [template = %require_complete (constants.%require_complete.944)]
|
||||
// CHECK:STDOUT: %.loc5_16.3: <instruction> = refine_type_action %x.ref, %T.loc4_16.1 [template]
|
||||
// CHECK:STDOUT: %.loc5_16.4: <instruction> = convert_to_value_action %.loc5_16.1, constants.%i32 [template]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.loc5_16.1 [template = %require_complete (constants.%require_complete.944)]
|
||||
// CHECK:STDOUT: %.loc6_16.3: <instruction> = refine_type_action %x.ref, %T.loc5_16.1 [template]
|
||||
// CHECK:STDOUT: %.loc6_16.4: <instruction> = convert_to_value_action %.loc6_16.1, constants.%i32 [template]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%x.param: @F.%T.loc4_16.1 (%T.67db0b.1)) -> out %return.param: %i32 {
|
||||
// CHECK:STDOUT: fn(%x.param: @F.%T.loc5_16.1 (%T.67db0b.1)) -> out %return.param: %i32 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %x.ref: @F.%T.loc4_16.1 (%T.67db0b.1) = name_ref x, %x
|
||||
// CHECK:STDOUT: %.loc5_16.1: @F.%T.loc4_16.1 (%T.67db0b.1) = splice_inst %.loc5_16.3
|
||||
// CHECK:STDOUT: %.loc5_16.2: %i32 = splice_inst %.loc5_16.4
|
||||
// CHECK:STDOUT: %i32.loc5: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %n: %i32 = wrapper_binding n, %.loc5_16.2
|
||||
// CHECK:STDOUT: %x.ref: @F.%T.loc5_16.1 (%T.67db0b.1) = name_ref x, %x
|
||||
// CHECK:STDOUT: %.loc6_16.1: @F.%T.loc5_16.1 (%T.67db0b.1) = splice_inst %.loc6_16.3
|
||||
// CHECK:STDOUT: %.loc6_16.2: %i32 = splice_inst %.loc6_16.4
|
||||
// CHECK:STDOUT: %i32.loc6: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %n: %i32 = wrapper_binding n, %.loc6_16.2
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %n.patt: %pattern_type.6b6 = value_binding_pattern n [concrete = constants.%n.patt.c48]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n
|
||||
// CHECK:STDOUT: %impl.elem0: %.737 = impl_witness_access constants.%Copy.impl_witness.b51, element0 [concrete = constants.%Int.as.Copy.impl.Op.4f6]
|
||||
// CHECK:STDOUT: %bound_method.loc6_10.1: <bound method> = bound_method %n.ref, %impl.elem0
|
||||
// CHECK:STDOUT: %bound_method.loc7_10.1: <bound method> = bound_method %n.ref, %impl.elem0
|
||||
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc6_10.2: <bound method> = bound_method %n.ref, %specific_fn
|
||||
// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc6_10.2(%n.ref)
|
||||
// CHECK:STDOUT: %bound_method.loc7_10.2: <bound method> = bound_method %n.ref, %specific_fn
|
||||
// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc7_10.2(%n.ref)
|
||||
// CHECK:STDOUT: return %Int.as.Copy.impl.Op.call
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Test1(%n.param: %i32) -> out %return.param: %i32 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
|
||||
// CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n
|
||||
// CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.ref, @F(constants.%i32) [concrete = constants.%F.specific_fn.6c3]
|
||||
// CHECK:STDOUT: %F.call: init %i32 = call %F.specific_fn(%n.ref)
|
||||
// CHECK:STDOUT: return %F.call
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @C.as.ImplicitAs.impl.Convert(%self.param: %C) -> out %return.param: %i32 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %self.ref: %C = name_ref self, %self
|
||||
// CHECK:STDOUT: %n.ref: %C.elem = name_ref n, @C.%.loc14 [concrete = @C.%.loc14]
|
||||
// CHECK:STDOUT: %.loc16_42.1: ref %i32 = class_element_access %self.ref, element0
|
||||
// CHECK:STDOUT: %.loc16_42.2: %i32 = acquire_value %.loc16_42.1
|
||||
// CHECK:STDOUT: %impl.elem0: %.737 = impl_witness_access constants.%Copy.impl_witness.b51, element0 [concrete = constants.%Int.as.Copy.impl.Op.4f6]
|
||||
// CHECK:STDOUT: %bound_method.loc16_42.1: <bound method> = bound_method %.loc16_42.2, %impl.elem0
|
||||
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc16_42.2: <bound method> = bound_method %.loc16_42.2, %specific_fn
|
||||
// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc16_42.2(%.loc16_42.2)
|
||||
// CHECK:STDOUT: return %Int.as.Copy.impl.Op.call
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Test2(%c.param: %C) -> out %return.param: %i32 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
|
||||
// CHECK:STDOUT: %c.ref: %C = name_ref c, %c
|
||||
// CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.ref, @F(constants.%C) [concrete = constants.%F.specific_fn.e0d]
|
||||
// CHECK:STDOUT: %F.call: init %i32 = call %F.specific_fn(%c.ref)
|
||||
// CHECK:STDOUT: return %F.call
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @F(constants.%T.67db0b.1) {
|
||||
// CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%T.patt.d47011.1
|
||||
// CHECK:STDOUT: %T.loc4_16.1 => constants.%T.67db0b.1
|
||||
// CHECK:STDOUT: %T.patt.loc5_16.2 => constants.%T.patt.d47011.1
|
||||
// CHECK:STDOUT: %T.loc5_16.1 => constants.%T.67db0b.1
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.51d1c4.1
|
||||
// CHECK:STDOUT: %x.param_patt.loc4_25.2 => constants.%x.param_patt.91d
|
||||
// CHECK:STDOUT: %x.patt.loc4_25.2 => constants.%x.patt.260
|
||||
// CHECK:STDOUT: %x.param_patt.loc5_25.2 => constants.%x.param_patt.91d
|
||||
// CHECK:STDOUT: %x.patt.loc5_25.2 => constants.%x.patt.260
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @F(constants.%i32) {
|
||||
// CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%T.patt.d47011.1
|
||||
// CHECK:STDOUT: %T.loc4_16.1 => constants.%i32
|
||||
// CHECK:STDOUT: %T.patt.loc5_16.2 => constants.%T.patt.d47011.1
|
||||
// CHECK:STDOUT: %T.loc5_16.1 => constants.%i32
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.6b6
|
||||
// CHECK:STDOUT: %x.param_patt.loc4_25.2 => constants.%x.param_patt.cee
|
||||
// CHECK:STDOUT: %x.patt.loc4_25.2 => constants.%x.patt.e3b
|
||||
// CHECK:STDOUT: %x.param_patt.loc5_25.2 => constants.%x.param_patt.cee
|
||||
// CHECK:STDOUT: %x.patt.loc5_25.2 => constants.%x.patt.e3b
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete => constants.%complete_type.f8a
|
||||
// CHECK:STDOUT: %.loc5_16.3 => constants.%inst.as_compatible.1ff
|
||||
// CHECK:STDOUT: %.loc5_16.4 => constants.%inst.splice_block.5e1
|
||||
// CHECK:STDOUT: %.loc6_16.3 => constants.%inst.as_compatible.1ff
|
||||
// CHECK:STDOUT: %.loc6_16.4 => constants.%inst.splice_block.5e1
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @F(constants.%C) {
|
||||
// CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%T.patt.d47011.1
|
||||
// CHECK:STDOUT: %T.loc4_16.1 => constants.%C
|
||||
// CHECK:STDOUT: %T.patt.loc5_16.2 => constants.%T.patt.d47011.1
|
||||
// CHECK:STDOUT: %T.loc5_16.1 => constants.%C
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.98b
|
||||
// CHECK:STDOUT: %x.param_patt.loc4_25.2 => constants.%x.param_patt.0f9
|
||||
// CHECK:STDOUT: %x.patt.loc4_25.2 => constants.%x.patt.953
|
||||
// CHECK:STDOUT: %x.param_patt.loc5_25.2 => constants.%x.param_patt.0f9
|
||||
// CHECK:STDOUT: %x.patt.loc5_25.2 => constants.%x.patt.953
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete => constants.%complete_type.cdf
|
||||
// CHECK:STDOUT: %.loc5_16.3 => constants.%inst.as_compatible.d98
|
||||
// CHECK:STDOUT: %.loc5_16.4 => constants.%inst.splice_block.da9
|
||||
// CHECK:STDOUT: %.loc6_16.3 => constants.%inst.as_compatible.d98
|
||||
// CHECK:STDOUT: %.loc6_16.4 => constants.%inst.splice_block.da9
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_cannot_convert.carbon
|
||||
// CHECK:STDOUT: --- fail_todo_as.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %type: type = facet_type <type> [concrete]
|
||||
@@ -376,178 +299,253 @@ fn Test(d: D) -> i32 {
|
||||
// CHECK:STDOUT: %x.param_patt.91d: %pattern_type.51d1c4.1 = value_param_pattern [template]
|
||||
// CHECK:STDOUT: %x.patt.260: %pattern_type.51d1c4.1 = wrapper_binding_pattern x, %x.param_patt.91d [template]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %.795f: Core.Form = init_form %i32 [concrete]
|
||||
// CHECK:STDOUT: %.795: Core.Form = init_form %i32 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt.a9a: %pattern_type.6b6 = out_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.patt.e1b: %pattern_type.6b6 = return_slot_pattern %return.param_patt.a9a, %i32 [concrete]
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %AsI32.type: type = fn_type @AsI32 [concrete]
|
||||
// CHECK:STDOUT: %AsI32: %AsI32.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %require_complete.944: <witness> = require_complete_type %T.67db0b.1 [template]
|
||||
// CHECK:STDOUT: %n.patt: %pattern_type.6b6 = value_binding_pattern n [concrete]
|
||||
// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
|
||||
// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.ac8: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic]
|
||||
// CHECK:STDOUT: %Int.as.Copy.impl.Op.5e0: %Int.as.Copy.impl.Op.type.ac8 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %Copy.impl_witness.b51: <witness> = impl_witness imports.%Copy.impl_witness_table.8d2, @Int.as.Copy.impl(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.3f6: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Int.as.Copy.impl.Op.4f6: %Int.as.Copy.impl.Op.type.3f6 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %i32, (%Copy.impl_witness.b51) [concrete]
|
||||
// CHECK:STDOUT: %Copy.WithSelf.Op.type.381: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet) [concrete]
|
||||
// CHECK:STDOUT: %.737: type = fn_type_with_self_type %Copy.WithSelf.Op.type.381, %Copy.facet [concrete]
|
||||
// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: <specific function> = specific_function %Int.as.Copy.impl.Op.4f6, @Int.as.Copy.impl.Op(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %D: type = class_type @D [concrete]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.d8d: type = pattern_type %D [concrete]
|
||||
// CHECK:STDOUT: %d.param_patt: %pattern_type.d8d = value_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %d.patt: %pattern_type.d8d = wrapper_binding_pattern d, %d.param_patt [concrete]
|
||||
// CHECK:STDOUT: %Test.type: type = fn_type @Test [concrete]
|
||||
// CHECK:STDOUT: %Test: %Test.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %x.param_patt.23b: %pattern_type.d8d = value_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %x.patt.c51: %pattern_type.d8d = wrapper_binding_pattern x, %x.param_patt.23b [concrete]
|
||||
// CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F, @F(%D) [concrete]
|
||||
// CHECK:STDOUT: %inst.as_compatible: <instruction> = inst_value [concrete] {
|
||||
// CHECK:STDOUT: %.602: %D = as_compatible @F.%x.ref
|
||||
// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete]
|
||||
// CHECK:STDOUT: %complete_type.f8a: <witness> = complete_type_witness %i32.builtin [concrete]
|
||||
// CHECK:STDOUT: %Dest: type = symbolic_binding Dest, 0 [symbolic]
|
||||
// CHECK:STDOUT: %As.type.c5f: type = facet_type <@As, @As(%Dest)> [symbolic]
|
||||
// CHECK:STDOUT: %Self.37a: %As.type.c5f = symbolic_binding Self, 1 [symbolic]
|
||||
// CHECK:STDOUT: %As.WithSelf.Convert.type.ff8: type = fn_type @As.WithSelf.Convert, @As.WithSelf(%Dest, %Self.37a) [symbolic]
|
||||
// CHECK:STDOUT: %As.WithSelf.Convert.87d: %As.WithSelf.Convert.type.ff8 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %As.type.155: type = facet_type <@As, @As(%i32)> [concrete]
|
||||
// CHECK:STDOUT: %As.assoc_type.d16: type = assoc_entity_type @As, @As(%i32) [concrete]
|
||||
// CHECK:STDOUT: %assoc0.667: %As.assoc_type.d16 = assoc_entity element0, imports.%Core.import_ref.967 [concrete]
|
||||
// CHECK:STDOUT: %x.param_patt.cee: %pattern_type.6b6 = value_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %x.patt.e3b: %pattern_type.6b6 = wrapper_binding_pattern x, %x.param_patt.cee [concrete]
|
||||
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
||||
// CHECK:STDOUT: %As.impl_witness.80e: <witness> = impl_witness @C.as.As.impl.%As.impl_witness_table [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.98b: type = pattern_type %C [concrete]
|
||||
// CHECK:STDOUT: %C.as.As.impl.Convert.type: type = fn_type @C.as.As.impl.Convert [concrete]
|
||||
// CHECK:STDOUT: %C.as.As.impl.Convert: %C.as.As.impl.Convert.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %As.facet: %As.type.155 = facet_value %C, (%As.impl_witness.80e) [concrete]
|
||||
// CHECK:STDOUT: %As.WithSelf.Convert.type.087: type = fn_type @As.WithSelf.Convert, @As.WithSelf(%i32, %As.facet) [concrete]
|
||||
// CHECK:STDOUT: %struct_type.n: type = struct_type {.n: %i32} [concrete]
|
||||
// CHECK:STDOUT: %complete_type.cdf: <witness> = complete_type_witness %struct_type.n [concrete]
|
||||
// CHECK:STDOUT: %x.param_patt.0f9: %pattern_type.98b = value_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %x.patt.953: %pattern_type.98b = wrapper_binding_pattern x, %x.param_patt.0f9 [concrete]
|
||||
// CHECK:STDOUT: %inst.as_compatible.1ff: <instruction> = inst_value [concrete] {
|
||||
// CHECK:STDOUT: %.775: %i32 = as_compatible @AsI32.%x.ref
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %ImplicitAs.type.0ff: type = generic_interface_type @ImplicitAs [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.0ff = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %inst.splice_block: <instruction> = inst_value [concrete] {
|
||||
// CHECK:STDOUT: %.759: <error> = splice_block <error> [concrete = <error>] {
|
||||
// CHECK:STDOUT: %.f8b: %i32 = converted %.602, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %inst.splice_block.edd: <instruction> = inst_value [concrete] {
|
||||
// CHECK:STDOUT: %.432: <error> = splice_block <error> [concrete = <error>] {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %inst.as_compatible.d98: <instruction> = inst_value [concrete] {
|
||||
// CHECK:STDOUT: %.f8c: %C = as_compatible @AsI32.%x.ref
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.419: type = fn_type_with_self_type %As.WithSelf.Convert.type.087, %As.facet [concrete]
|
||||
// CHECK:STDOUT: %inst.splice_block.ba7: <instruction> = inst_value [concrete] {
|
||||
// CHECK:STDOUT: %.061: <bound method> = splice_block %bound_method {
|
||||
// CHECK:STDOUT: %impl.elem0.47b: %.419 = impl_witness_access %As.impl_witness.80e, element0 [concrete = %C.as.As.impl.Convert]
|
||||
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %.f8c, %impl.elem0.47b
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: .Copy = %Core.Copy
|
||||
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type]
|
||||
// CHECK:STDOUT: %Core.import_ref.cd6: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.ac8) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.5e0)]
|
||||
// CHECK:STDOUT: %Copy.impl_witness_table.8d2 = impl_witness_table (%Core.import_ref.cd6), @Int.as.Copy.impl [concrete]
|
||||
// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.0ff = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
|
||||
// CHECK:STDOUT: %Core.import_ref.967: @As.WithSelf.%As.WithSelf.Convert.type (%As.WithSelf.Convert.type.ff8) = import_ref Core//prelude/parts/as, loc{{\d+_\d+}}, loaded [symbolic = @As.WithSelf.%As.WithSelf.Convert (constants.%As.WithSelf.Convert.87d)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .F = %F.decl
|
||||
// CHECK:STDOUT: .D = %D.decl
|
||||
// CHECK:STDOUT: .Test = %Test.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
||||
// CHECK:STDOUT: %T.patt.loc4_16.1: %pattern_type.98f = symbolic_binding_pattern T, 0, template [template = %T.patt.loc4_16.2 (constants.%T.patt.d47011.1)]
|
||||
// CHECK:STDOUT: %x.param_patt.loc4_25.1: @F.%pattern_type (%pattern_type.51d1c4.1) = value_param_pattern [template = %x.param_patt.loc4_25.2 (constants.%x.param_patt.91d)]
|
||||
// CHECK:STDOUT: %x.patt.loc4_25.1: @F.%pattern_type (%pattern_type.51d1c4.1) = wrapper_binding_pattern x, %x.param_patt.loc4_25.1 [template = %x.patt.loc4_25.2 (constants.%x.patt.260)]
|
||||
// CHECK:STDOUT: %AsI32.decl: %AsI32.type = fn_decl @AsI32 [concrete = constants.%AsI32] {
|
||||
// CHECK:STDOUT: %T.patt.loc5_20.1: %pattern_type.98f = symbolic_binding_pattern T, 0, template [template = %T.patt.loc5_20.2 (constants.%T.patt.d47011.1)]
|
||||
// CHECK:STDOUT: %x.param_patt.loc5_29.1: @AsI32.%pattern_type (%pattern_type.51d1c4.1) = value_param_pattern [template = %x.param_patt.loc5_29.2 (constants.%x.param_patt.91d)]
|
||||
// CHECK:STDOUT: %x.patt.loc5_29.1: @AsI32.%pattern_type (%pattern_type.51d1c4.1) = wrapper_binding_pattern x, %x.param_patt.loc5_29.1 [template = %x.patt.loc5_29.2 (constants.%x.patt.260)]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.6b6 = out_param_pattern [concrete = constants.%return.param_patt.a9a]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.6b6 = return_slot_pattern %return.param_patt, %i32.loc4 [concrete = constants.%return.patt.e1b]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.6b6 = return_slot_pattern %return.param_patt, %i32.loc5 [concrete = constants.%return.patt.e1b]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %i32.loc4: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc4_33: Core.Form = init_form %i32.loc4 [concrete = constants.%.795f]
|
||||
// CHECK:STDOUT: %.loc4_18.1: type = splice_block %.loc4_18.2 [concrete = type] {
|
||||
// CHECK:STDOUT: %i32.loc5: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc5_37: Core.Form = init_form %i32.loc5 [concrete = constants.%.795]
|
||||
// CHECK:STDOUT: %.loc5_22.1: type = splice_block %.loc5_22.2 [concrete = type] {
|
||||
// CHECK:STDOUT: %.Self.frozen: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
|
||||
// CHECK:STDOUT: %.loc4_18.2: type = type_literal type [concrete = type]
|
||||
// CHECK:STDOUT: %.loc5_22.2: type = type_literal type [concrete = type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %T.loc4_16.2: type = symbolic_binding T, 0, template [template = %T.loc4_16.1 (constants.%T.67db0b.1)]
|
||||
// CHECK:STDOUT: %x.param: @F.%T.loc4_16.1 (%T.67db0b.1) = value_param call_param0
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_16.2 [template = %T.loc4_16.1 (constants.%T.67db0b.1)]
|
||||
// CHECK:STDOUT: %x: @F.%T.loc4_16.1 (%T.67db0b.1) = wrapper_binding x, %x.param
|
||||
// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
|
||||
// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %D.decl: type = class_decl @D [concrete = constants.%D] {} {}
|
||||
// CHECK:STDOUT: %Test.decl: %Test.type = fn_decl @Test [concrete = constants.%Test] {
|
||||
// CHECK:STDOUT: %d.param_patt: %pattern_type.d8d = value_param_pattern [concrete = constants.%d.param_patt]
|
||||
// CHECK:STDOUT: %d.patt: %pattern_type.d8d = wrapper_binding_pattern d, %d.param_patt [concrete = constants.%d.patt]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.6b6 = out_param_pattern [concrete = constants.%return.param_patt.a9a]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.6b6 = return_slot_pattern %return.param_patt, %i32 [concrete = constants.%return.patt.e1b]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc11: Core.Form = init_form %i32 [concrete = constants.%.795f]
|
||||
// CHECK:STDOUT: %d.param: %D = value_param call_param0
|
||||
// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D]
|
||||
// CHECK:STDOUT: %d: %D = wrapper_binding d, %d.param
|
||||
// CHECK:STDOUT: %T.loc5_20.2: type = symbolic_binding T, 0, template [template = %T.loc5_20.1 (constants.%T.67db0b.1)]
|
||||
// CHECK:STDOUT: %x.param: @AsI32.%T.loc5_20.1 (%T.67db0b.1) = value_param call_param0
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc5_20.2 [template = %T.loc5_20.1 (constants.%T.67db0b.1)]
|
||||
// CHECK:STDOUT: %x: @AsI32.%T.loc5_20.1 (%T.67db0b.1) = wrapper_binding x, %x.param
|
||||
// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
|
||||
// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @D {
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = constants.%D
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @F(%T.loc4_16.2: type) {
|
||||
// CHECK:STDOUT: %T.patt.loc4_16.2: %pattern_type.98f = symbolic_binding_pattern T, 0, template [template = %T.patt.loc4_16.2 (constants.%T.patt.d47011.1)]
|
||||
// CHECK:STDOUT: %T.loc4_16.1: type = symbolic_binding T, 0, template [template = %T.loc4_16.1 (constants.%T.67db0b.1)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %T.loc4_16.1 [template = %pattern_type (constants.%pattern_type.51d1c4.1)]
|
||||
// CHECK:STDOUT: %x.param_patt.loc4_25.2: @F.%pattern_type (%pattern_type.51d1c4.1) = value_param_pattern [template = %x.param_patt.loc4_25.2 (constants.%x.param_patt.91d)]
|
||||
// CHECK:STDOUT: %x.patt.loc4_25.2: @F.%pattern_type (%pattern_type.51d1c4.1) = wrapper_binding_pattern x, %x.param_patt.loc4_25.2 [template = %x.patt.loc4_25.2 (constants.%x.patt.260)]
|
||||
// CHECK:STDOUT: generic fn @AsI32(%T.loc5_20.2: type) {
|
||||
// CHECK:STDOUT: %T.patt.loc5_20.2: %pattern_type.98f = symbolic_binding_pattern T, 0, template [template = %T.patt.loc5_20.2 (constants.%T.patt.d47011.1)]
|
||||
// CHECK:STDOUT: %T.loc5_20.1: type = symbolic_binding T, 0, template [template = %T.loc5_20.1 (constants.%T.67db0b.1)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %T.loc5_20.1 [template = %pattern_type (constants.%pattern_type.51d1c4.1)]
|
||||
// CHECK:STDOUT: %x.param_patt.loc5_29.2: @AsI32.%pattern_type (%pattern_type.51d1c4.1) = value_param_pattern [template = %x.param_patt.loc5_29.2 (constants.%x.param_patt.91d)]
|
||||
// CHECK:STDOUT: %x.patt.loc5_29.2: @AsI32.%pattern_type (%pattern_type.51d1c4.1) = wrapper_binding_pattern x, %x.param_patt.loc5_29.2 [template = %x.patt.loc5_29.2 (constants.%x.patt.260)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.loc4_16.1 [template = %require_complete (constants.%require_complete.944)]
|
||||
// CHECK:STDOUT: %.loc5_16.3: <instruction> = refine_type_action %x.ref, %T.loc4_16.1 [template]
|
||||
// CHECK:STDOUT: %.loc5_16.4: <instruction> = convert_to_value_action %.loc5_16.1, constants.%i32 [template]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.loc5_20.1 [template = %require_complete (constants.%require_complete.944)]
|
||||
// CHECK:STDOUT: %.loc10_12.4: <instruction> = refine_type_action %x.ref, %T.loc5_20.1 [template]
|
||||
// CHECK:STDOUT: %.loc10_12.5: <instruction> = compound_member_access_action %.loc10_12.1, constants.%assoc0.667 [template]
|
||||
// CHECK:STDOUT: %.loc10_12.6: type = type_of_inst %.loc10_12.5 [template]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%x.param: @F.%T.loc4_16.1 (%T.67db0b.1)) -> out %return.param: %i32 {
|
||||
// CHECK:STDOUT: fn(%x.param: @AsI32.%T.loc5_20.1 (%T.67db0b.1)) -> out %return.param: %i32 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %x.ref: @F.%T.loc4_16.1 (%T.67db0b.1) = name_ref x, %x
|
||||
// CHECK:STDOUT: %.loc5_16.1: @F.%T.loc4_16.1 (%T.67db0b.1) = splice_inst %.loc5_16.3
|
||||
// CHECK:STDOUT: %.loc5_16.2: %i32 = splice_inst %.loc5_16.4
|
||||
// CHECK:STDOUT: %i32.loc5: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %n: %i32 = wrapper_binding n, %.loc5_16.2
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %n.patt: %pattern_type.6b6 = value_binding_pattern n [concrete = constants.%n.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n
|
||||
// CHECK:STDOUT: %impl.elem0: %.737 = impl_witness_access constants.%Copy.impl_witness.b51, element0 [concrete = constants.%Int.as.Copy.impl.Op.4f6]
|
||||
// CHECK:STDOUT: %bound_method.loc6_10.1: <bound method> = bound_method %n.ref, %impl.elem0
|
||||
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc6_10.2: <bound method> = bound_method %n.ref, %specific_fn
|
||||
// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc6_10.2(%n.ref)
|
||||
// CHECK:STDOUT: return %Int.as.Copy.impl.Op.call
|
||||
// CHECK:STDOUT: %x.ref: @AsI32.%T.loc5_20.1 (%T.67db0b.1) = name_ref x, %x
|
||||
// CHECK:STDOUT: %i32.loc10: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc10_12.1: @AsI32.%T.loc5_20.1 (%T.67db0b.1) = splice_inst %.loc10_12.4
|
||||
// CHECK:STDOUT: %.loc10_12.2: @AsI32.%.loc10_12.6 (@AsI32.%.loc10_12.6) = splice_inst %.loc10_12.5
|
||||
// CHECK:STDOUT: %.loc10_12.3: %i32 = converted %x.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: return <error>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Test(%d.param: %D) -> out %return.param: %i32 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
|
||||
// CHECK:STDOUT: %d.ref: %D = name_ref d, %d
|
||||
// CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.ref, @F(constants.%D) [concrete = constants.%F.specific_fn]
|
||||
// CHECK:STDOUT: %F.call: init %i32 = call %F.specific_fn(%d.ref)
|
||||
// CHECK:STDOUT: return %F.call
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @F(constants.%T.67db0b.1) {
|
||||
// CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%T.patt.d47011.1
|
||||
// CHECK:STDOUT: %T.loc4_16.1 => constants.%T.67db0b.1
|
||||
// CHECK:STDOUT: specific @AsI32(constants.%T.67db0b.1) {
|
||||
// CHECK:STDOUT: %T.patt.loc5_20.2 => constants.%T.patt.d47011.1
|
||||
// CHECK:STDOUT: %T.loc5_20.1 => constants.%T.67db0b.1
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.51d1c4.1
|
||||
// CHECK:STDOUT: %x.param_patt.loc4_25.2 => constants.%x.param_patt.91d
|
||||
// CHECK:STDOUT: %x.patt.loc4_25.2 => constants.%x.patt.260
|
||||
// CHECK:STDOUT: %x.param_patt.loc5_29.2 => constants.%x.param_patt.91d
|
||||
// CHECK:STDOUT: %x.patt.loc5_29.2 => constants.%x.patt.260
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @F(constants.%D) {
|
||||
// CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%T.patt.d47011.1
|
||||
// CHECK:STDOUT: %T.loc4_16.1 => constants.%D
|
||||
// CHECK:STDOUT: specific @AsI32(constants.%i32) {
|
||||
// CHECK:STDOUT: %T.patt.loc5_20.2 => constants.%T.patt.d47011.1
|
||||
// CHECK:STDOUT: %T.loc5_20.1 => constants.%i32
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.6b6
|
||||
// CHECK:STDOUT: %x.param_patt.loc5_29.2 => constants.%x.param_patt.cee
|
||||
// CHECK:STDOUT: %x.patt.loc5_29.2 => constants.%x.patt.e3b
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete => constants.%complete_type.f8a
|
||||
// CHECK:STDOUT: %.loc10_12.4 => constants.%inst.as_compatible.1ff
|
||||
// CHECK:STDOUT: %.loc10_12.5 => constants.%inst.splice_block.edd
|
||||
// CHECK:STDOUT: %.loc10_12.6 => <error>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @AsI32(constants.%C) {
|
||||
// CHECK:STDOUT: %T.patt.loc5_20.2 => constants.%T.patt.d47011.1
|
||||
// CHECK:STDOUT: %T.loc5_20.1 => constants.%C
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.98b
|
||||
// CHECK:STDOUT: %x.param_patt.loc5_29.2 => constants.%x.param_patt.0f9
|
||||
// CHECK:STDOUT: %x.patt.loc5_29.2 => constants.%x.patt.953
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete => constants.%complete_type.cdf
|
||||
// CHECK:STDOUT: %.loc10_12.4 => constants.%inst.as_compatible.d98
|
||||
// CHECK:STDOUT: %.loc10_12.5 => constants.%inst.splice_block.ba7
|
||||
// CHECK:STDOUT: %.loc10_12.6 => <bound method>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_cannot_as.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %type: type = facet_type <type> [concrete]
|
||||
// CHECK:STDOUT: %.Self.frozen: %type = symbolic_binding .Self [symbolic_self]
|
||||
// CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
|
||||
// CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0, template [template]
|
||||
// CHECK:STDOUT: %T: type = symbolic_binding T, 0, template [template]
|
||||
// CHECK:STDOUT: %pattern_type.51d1c4.1: type = pattern_type %T [template]
|
||||
// CHECK:STDOUT: %x.param_patt.91d: %pattern_type.51d1c4.1 = value_param_pattern [template]
|
||||
// CHECK:STDOUT: %x.patt.260: %pattern_type.51d1c4.1 = wrapper_binding_pattern x, %x.param_patt.91d [template]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %.795: Core.Form = init_form %i32 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt.a9a: %pattern_type.6b6 = out_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.patt.e1b: %pattern_type.6b6 = return_slot_pattern %return.param_patt.a9a, %i32 [concrete]
|
||||
// CHECK:STDOUT: %AsI32.type: type = fn_type @AsI32 [concrete]
|
||||
// CHECK:STDOUT: %AsI32: %AsI32.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %require_complete.944: <witness> = require_complete_type %T [template]
|
||||
// CHECK:STDOUT: %Dest: type = symbolic_binding Dest, 0 [symbolic]
|
||||
// CHECK:STDOUT: %As.type.c5f: type = facet_type <@As, @As(%Dest)> [symbolic]
|
||||
// CHECK:STDOUT: %Self.37a: %As.type.c5f = symbolic_binding Self, 1 [symbolic]
|
||||
// CHECK:STDOUT: %As.WithSelf.Convert.type.ff8: type = fn_type @As.WithSelf.Convert, @As.WithSelf(%Dest, %Self.37a) [symbolic]
|
||||
// CHECK:STDOUT: %As.WithSelf.Convert.87d: %As.WithSelf.Convert.type.ff8 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %As.assoc_type.d16: type = assoc_entity_type @As, @As(%i32) [concrete]
|
||||
// CHECK:STDOUT: %assoc0.667: %As.assoc_type.d16 = assoc_entity element0, imports.%Core.import_ref.967 [concrete]
|
||||
// CHECK:STDOUT: %D: type = class_type @D [concrete]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.d8d: type = pattern_type %D [concrete]
|
||||
// CHECK:STDOUT: %x.param_patt.23b: %pattern_type.d8d = value_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %x.patt.c51: %pattern_type.d8d = wrapper_binding_pattern x, %x.param_patt.23b [concrete]
|
||||
// CHECK:STDOUT: %inst.as_compatible: <instruction> = inst_value [concrete] {
|
||||
// CHECK:STDOUT: %.602: %D = as_compatible @AsI32.%x.ref
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %inst.splice_block: <instruction> = inst_value [concrete] {
|
||||
// CHECK:STDOUT: %.432: <error> = splice_block <error> [concrete = <error>] {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core.import_ref.967: @As.WithSelf.%As.WithSelf.Convert.type (%As.WithSelf.Convert.type.ff8) = import_ref Core//prelude/parts/as, loc{{\d+_\d+}}, loaded [symbolic = @As.WithSelf.%As.WithSelf.Convert (constants.%As.WithSelf.Convert.87d)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: %AsI32.decl: %AsI32.type = fn_decl @AsI32 [concrete = constants.%AsI32] {
|
||||
// CHECK:STDOUT: %T.patt.loc5_20.1: %pattern_type.98f = symbolic_binding_pattern T, 0, template [template = %T.patt.loc5_20.2 (constants.%T.patt)]
|
||||
// CHECK:STDOUT: %x.param_patt.loc5_29.1: @AsI32.%pattern_type (%pattern_type.51d1c4.1) = value_param_pattern [template = %x.param_patt.loc5_29.2 (constants.%x.param_patt.91d)]
|
||||
// CHECK:STDOUT: %x.patt.loc5_29.1: @AsI32.%pattern_type (%pattern_type.51d1c4.1) = wrapper_binding_pattern x, %x.param_patt.loc5_29.1 [template = %x.patt.loc5_29.2 (constants.%x.patt.260)]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.6b6 = out_param_pattern [concrete = constants.%return.param_patt.a9a]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.6b6 = return_slot_pattern %return.param_patt, %i32.loc5 [concrete = constants.%return.patt.e1b]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %i32.loc5: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc5_37: Core.Form = init_form %i32.loc5 [concrete = constants.%.795]
|
||||
// CHECK:STDOUT: %.loc5_22.1: type = splice_block %.loc5_22.2 [concrete = type] {
|
||||
// CHECK:STDOUT: %.Self.frozen: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
|
||||
// CHECK:STDOUT: %.loc5_22.2: type = type_literal type [concrete = type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %T.loc5_20.2: type = symbolic_binding T, 0, template [template = %T.loc5_20.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %x.param: @AsI32.%T.loc5_20.1 (%T) = value_param call_param0
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc5_20.2 [template = %T.loc5_20.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %x: @AsI32.%T.loc5_20.1 (%T) = wrapper_binding x, %x.param
|
||||
// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
|
||||
// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @AsI32(%T.loc5_20.2: type) {
|
||||
// CHECK:STDOUT: %T.patt.loc5_20.2: %pattern_type.98f = symbolic_binding_pattern T, 0, template [template = %T.patt.loc5_20.2 (constants.%T.patt)]
|
||||
// CHECK:STDOUT: %T.loc5_20.1: type = symbolic_binding T, 0, template [template = %T.loc5_20.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %T.loc5_20.1 [template = %pattern_type (constants.%pattern_type.51d1c4.1)]
|
||||
// CHECK:STDOUT: %x.param_patt.loc5_29.2: @AsI32.%pattern_type (%pattern_type.51d1c4.1) = value_param_pattern [template = %x.param_patt.loc5_29.2 (constants.%x.param_patt.91d)]
|
||||
// CHECK:STDOUT: %x.patt.loc5_29.2: @AsI32.%pattern_type (%pattern_type.51d1c4.1) = wrapper_binding_pattern x, %x.param_patt.loc5_29.2 [template = %x.patt.loc5_29.2 (constants.%x.patt.260)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.loc5_20.1 [template = %require_complete (constants.%require_complete.944)]
|
||||
// CHECK:STDOUT: %.loc10_12.4: <instruction> = refine_type_action %x.ref, %T.loc5_20.1 [template]
|
||||
// CHECK:STDOUT: %.loc10_12.5: <instruction> = compound_member_access_action %.loc10_12.1, constants.%assoc0.667 [template]
|
||||
// CHECK:STDOUT: %.loc10_12.6: type = type_of_inst %.loc10_12.5 [template]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%x.param: @AsI32.%T.loc5_20.1 (%T)) -> out %return.param: %i32 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %x.ref: @AsI32.%T.loc5_20.1 (%T) = name_ref x, %x
|
||||
// CHECK:STDOUT: %i32.loc10: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc10_12.1: @AsI32.%T.loc5_20.1 (%T) = splice_inst %.loc10_12.4
|
||||
// CHECK:STDOUT: %.loc10_12.2: @AsI32.%.loc10_12.6 (@AsI32.%.loc10_12.6) = splice_inst %.loc10_12.5
|
||||
// CHECK:STDOUT: %.loc10_12.3: %i32 = converted %x.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: return <error>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @AsI32(constants.%T) {
|
||||
// CHECK:STDOUT: %T.patt.loc5_20.2 => constants.%T.patt
|
||||
// CHECK:STDOUT: %T.loc5_20.1 => constants.%T
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.51d1c4.1
|
||||
// CHECK:STDOUT: %x.param_patt.loc5_29.2 => constants.%x.param_patt.91d
|
||||
// CHECK:STDOUT: %x.patt.loc5_29.2 => constants.%x.patt.260
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @AsI32(constants.%D) {
|
||||
// CHECK:STDOUT: %T.patt.loc5_20.2 => constants.%T.patt
|
||||
// CHECK:STDOUT: %T.loc5_20.1 => constants.%D
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.d8d
|
||||
// CHECK:STDOUT: %x.param_patt.loc4_25.2 => constants.%x.param_patt.23b
|
||||
// CHECK:STDOUT: %x.patt.loc4_25.2 => constants.%x.patt.c51
|
||||
// CHECK:STDOUT: %x.param_patt.loc5_29.2 => constants.%x.param_patt.23b
|
||||
// CHECK:STDOUT: %x.patt.loc5_29.2 => constants.%x.patt.c51
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete => constants.%complete_type.357
|
||||
// CHECK:STDOUT: %.loc5_16.3 => constants.%inst.as_compatible
|
||||
// CHECK:STDOUT: %.loc5_16.4 => constants.%inst.splice_block
|
||||
// CHECK:STDOUT: %.loc10_12.4 => constants.%inst.as_compatible
|
||||
// CHECK:STDOUT: %.loc10_12.5 => constants.%inst.splice_block
|
||||
// CHECK:STDOUT: %.loc10_12.6 => <error>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+171
-479
@@ -3,8 +3,6 @@
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/int.carbon
|
||||
// TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
|
||||
// EXTRA-ARGS: --dump-sem-ir-ranges=if-present
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
@@ -12,14 +10,16 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/generic/template/member_access.carbon
|
||||
|
||||
// --- member_access.carbon
|
||||
// --- simple_member_access.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
//@dump-sem-ir-begin
|
||||
fn F[template T: type](x: T) -> i32 {
|
||||
let n: i32 = x.n;
|
||||
return n;
|
||||
}
|
||||
//@dump-sem-ir-end
|
||||
|
||||
class C {
|
||||
var n: i32;
|
||||
@@ -85,7 +85,40 @@ fn Test(e: E) {
|
||||
F(e);
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: --- member_access.carbon
|
||||
// --- fail_todo_compound_member_access.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
base class C {
|
||||
var n: i32;
|
||||
}
|
||||
|
||||
//@dump-sem-ir-begin
|
||||
fn F[template T: type](x: T) -> i32 {
|
||||
// CHECK:STDERR: fail_todo_compound_member_access.carbon:[[@LINE+4]]:3: error: value of type `<dependent type>` is not callable [CallToNonCallable]
|
||||
// CHECK:STDERR: return x.(C.n);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
return x.(C.n);
|
||||
}
|
||||
//@dump-sem-ir-end
|
||||
|
||||
class D {
|
||||
extend base: C;
|
||||
}
|
||||
|
||||
fn G(d: D) -> i32 {
|
||||
// CHECK:STDERR: fail_todo_compound_member_access.carbon:[[@LINE+7]]:12: error: unable to monomorphize specific `F(D)` [ResolvingSpecificHere]
|
||||
// CHECK:STDERR: return F(d);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_compound_member_access.carbon:[[@LINE-12]]:3: note: cannot access member of interface `Core.ImplicitAs(i32)` in type `i32` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: return x.(C.n);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
return F(d);
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: --- simple_member_access.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %type: type = facet_type <type> [concrete]
|
||||
@@ -97,8 +130,6 @@ fn Test(e: E) {
|
||||
// CHECK:STDOUT: %x.param_patt.91d: %pattern_type.51d = value_param_pattern [template]
|
||||
// CHECK:STDOUT: %x.patt.260: %pattern_type.51d = wrapper_binding_pattern x, %x.param_patt.91d [template]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %.795: Core.Form = init_form %i32 [concrete]
|
||||
@@ -124,26 +155,18 @@ fn Test(e: E) {
|
||||
// CHECK:STDOUT: %struct_type.n: type = struct_type {.n: %i32} [concrete]
|
||||
// CHECK:STDOUT: %complete_type.cdf: <witness> = complete_type_witness %struct_type.n [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.98b: type = pattern_type %C [concrete]
|
||||
// CHECK:STDOUT: %c.param_patt: %pattern_type.98b = value_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %c.patt: %pattern_type.98b = wrapper_binding_pattern c, %c.param_patt [concrete]
|
||||
// CHECK:STDOUT: %Test1.type: type = fn_type @Test1 [concrete]
|
||||
// CHECK:STDOUT: %Test1: %Test1.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %x.param_patt.0f9: %pattern_type.98b = value_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %x.patt.953: %pattern_type.98b = wrapper_binding_pattern x, %x.param_patt.0f9 [concrete]
|
||||
// CHECK:STDOUT: %F.specific_fn.e0d: <specific function> = specific_function %F, @F(%C) [concrete]
|
||||
// CHECK:STDOUT: %struct_type.m.n: type = struct_type {.m: %i32, .n: %i32} [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.860: type = pattern_type %struct_type.m.n [concrete]
|
||||
// CHECK:STDOUT: %x.param_patt.c8a: %pattern_type.860 = value_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %x.patt.3a7: %pattern_type.860 = wrapper_binding_pattern x, %x.param_patt.c8a [concrete]
|
||||
// CHECK:STDOUT: %Test2.type: type = fn_type @Test2 [concrete]
|
||||
// CHECK:STDOUT: %Test2: %Test2.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %F.specific_fn.4da: <specific function> = specific_function %F, @F(%struct_type.m.n) [concrete]
|
||||
// CHECK:STDOUT: %inst.as_compatible.d98: <instruction> = inst_value [concrete] {
|
||||
// CHECK:STDOUT: %.f8c: %C = as_compatible @F.%x.ref
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %inst.splice_block.351: <instruction> = inst_value [concrete] {
|
||||
// CHECK:STDOUT: %.5f2: %i32 = splice_block %.1e9 {
|
||||
// CHECK:STDOUT: %n.ref: %C.elem = name_ref n, @C.%.loc10 [concrete = @C.%.loc10]
|
||||
// CHECK:STDOUT: %n.ref: %C.elem = name_ref n, @C.%.loc12 [concrete = @C.%.loc12]
|
||||
// CHECK:STDOUT: %.a48: ref %i32 = class_element_access %.f8c, element0
|
||||
// CHECK:STDOUT: %.1e9: %i32 = acquire_value %.a48
|
||||
// CHECK:STDOUT: }
|
||||
@@ -164,564 +187,233 @@ fn Test(e: E) {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: .Copy = %Core.Copy
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type]
|
||||
// CHECK:STDOUT: %Core.import_ref.cd6: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.ac8) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.5e0)]
|
||||
// CHECK:STDOUT: %Copy.impl_witness_table.8d2 = impl_witness_table (%Core.import_ref.cd6), @Int.as.Copy.impl [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .F = %F.decl
|
||||
// CHECK:STDOUT: .C = %C.decl
|
||||
// CHECK:STDOUT: .Test1 = %Test1.decl
|
||||
// CHECK:STDOUT: .Test2 = %Test2.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
||||
// CHECK:STDOUT: %T.patt.loc4_16.1: %pattern_type.98f = symbolic_binding_pattern T, 0, template [template = %T.patt.loc4_16.2 (constants.%T.patt.d47011.1)]
|
||||
// CHECK:STDOUT: %x.param_patt.loc4_25.1: @F.%pattern_type (%pattern_type.51d) = value_param_pattern [template = %x.param_patt.loc4_25.2 (constants.%x.param_patt.91d)]
|
||||
// CHECK:STDOUT: %x.patt.loc4_25.1: @F.%pattern_type (%pattern_type.51d) = wrapper_binding_pattern x, %x.param_patt.loc4_25.1 [template = %x.patt.loc4_25.2 (constants.%x.patt.260)]
|
||||
// CHECK:STDOUT: %T.patt.loc5_16.1: %pattern_type.98f = symbolic_binding_pattern T, 0, template [template = %T.patt.loc5_16.2 (constants.%T.patt.d47011.1)]
|
||||
// CHECK:STDOUT: %x.param_patt.loc5_25.1: @F.%pattern_type (%pattern_type.51d) = value_param_pattern [template = %x.param_patt.loc5_25.2 (constants.%x.param_patt.91d)]
|
||||
// CHECK:STDOUT: %x.patt.loc5_25.1: @F.%pattern_type (%pattern_type.51d) = wrapper_binding_pattern x, %x.param_patt.loc5_25.1 [template = %x.patt.loc5_25.2 (constants.%x.patt.260)]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.6b6 = out_param_pattern [concrete = constants.%return.param_patt.a9a]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.6b6 = return_slot_pattern %return.param_patt, %i32.loc4 [concrete = constants.%return.patt.e1b]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.6b6 = return_slot_pattern %return.param_patt, %i32.loc5 [concrete = constants.%return.patt.e1b]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %i32.loc4: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc4_33: Core.Form = init_form %i32.loc4 [concrete = constants.%.795]
|
||||
// CHECK:STDOUT: %.loc4_18.1: type = splice_block %.loc4_18.2 [concrete = type] {
|
||||
// CHECK:STDOUT: %i32.loc5: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc5_33: Core.Form = init_form %i32.loc5 [concrete = constants.%.795]
|
||||
// CHECK:STDOUT: %.loc5_18.1: type = splice_block %.loc5_18.2 [concrete = type] {
|
||||
// CHECK:STDOUT: %.Self.frozen: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
|
||||
// CHECK:STDOUT: %.loc4_18.2: type = type_literal type [concrete = type]
|
||||
// CHECK:STDOUT: %.loc5_18.2: type = type_literal type [concrete = type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %T.loc4_16.2: type = symbolic_binding T, 0, template [template = %T.loc4_16.1 (constants.%T.67db0b.1)]
|
||||
// CHECK:STDOUT: %x.param: @F.%T.loc4_16.1 (%T.67db0b.1) = value_param call_param0
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_16.2 [template = %T.loc4_16.1 (constants.%T.67db0b.1)]
|
||||
// CHECK:STDOUT: %x: @F.%T.loc4_16.1 (%T.67db0b.1) = wrapper_binding x, %x.param
|
||||
// CHECK:STDOUT: %T.loc5_16.2: type = symbolic_binding T, 0, template [template = %T.loc5_16.1 (constants.%T.67db0b.1)]
|
||||
// CHECK:STDOUT: %x.param: @F.%T.loc5_16.1 (%T.67db0b.1) = value_param call_param0
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc5_16.2 [template = %T.loc5_16.1 (constants.%T.67db0b.1)]
|
||||
// CHECK:STDOUT: %x: @F.%T.loc5_16.1 (%T.67db0b.1) = wrapper_binding x, %x.param
|
||||
// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
|
||||
// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
|
||||
// CHECK:STDOUT: %Test1.decl: %Test1.type = fn_decl @Test1 [concrete = constants.%Test1] {
|
||||
// CHECK:STDOUT: %c.param_patt: %pattern_type.98b = value_param_pattern [concrete = constants.%c.param_patt]
|
||||
// CHECK:STDOUT: %c.patt: %pattern_type.98b = wrapper_binding_pattern c, %c.param_patt [concrete = constants.%c.patt]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %c.param: %C = value_param call_param0
|
||||
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %c: %C = wrapper_binding c, %c.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Test2.decl: %Test2.type = fn_decl @Test2 [concrete = constants.%Test2] {
|
||||
// CHECK:STDOUT: %x.param_patt: %pattern_type.860 = value_param_pattern [concrete = constants.%x.param_patt.c8a]
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type.860 = wrapper_binding_pattern x, %x.param_patt [concrete = constants.%x.patt.3a7]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %x.param: %struct_type.m.n = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc17: type = splice_block %struct_type.m.n [concrete = constants.%struct_type.m.n] {
|
||||
// CHECK:STDOUT: %i32.loc17_18: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %i32.loc17_27: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %struct_type.m.n: type = struct_type {.m: %i32, .n: %i32} [concrete = constants.%struct_type.m.n]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: %struct_type.m.n = wrapper_binding x, %x.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @C {
|
||||
// CHECK:STDOUT: %.loc10: %C.elem = field_decl n, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.n [concrete = constants.%complete_type.cdf]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = constants.%C
|
||||
// CHECK:STDOUT: .n = %.loc10
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @F(%T.loc4_16.2: type) {
|
||||
// CHECK:STDOUT: %T.patt.loc4_16.2: %pattern_type.98f = symbolic_binding_pattern T, 0, template [template = %T.patt.loc4_16.2 (constants.%T.patt.d47011.1)]
|
||||
// CHECK:STDOUT: %T.loc4_16.1: type = symbolic_binding T, 0, template [template = %T.loc4_16.1 (constants.%T.67db0b.1)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %T.loc4_16.1 [template = %pattern_type (constants.%pattern_type.51d)]
|
||||
// CHECK:STDOUT: %x.param_patt.loc4_25.2: @F.%pattern_type (%pattern_type.51d) = value_param_pattern [template = %x.param_patt.loc4_25.2 (constants.%x.param_patt.91d)]
|
||||
// CHECK:STDOUT: %x.patt.loc4_25.2: @F.%pattern_type (%pattern_type.51d) = wrapper_binding_pattern x, %x.param_patt.loc4_25.2 [template = %x.patt.loc4_25.2 (constants.%x.patt.260)]
|
||||
// CHECK:STDOUT: generic fn @F(%T.loc5_16.2: type) {
|
||||
// CHECK:STDOUT: %T.patt.loc5_16.2: %pattern_type.98f = symbolic_binding_pattern T, 0, template [template = %T.patt.loc5_16.2 (constants.%T.patt.d47011.1)]
|
||||
// CHECK:STDOUT: %T.loc5_16.1: type = symbolic_binding T, 0, template [template = %T.loc5_16.1 (constants.%T.67db0b.1)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %T.loc5_16.1 [template = %pattern_type (constants.%pattern_type.51d)]
|
||||
// CHECK:STDOUT: %x.param_patt.loc5_25.2: @F.%pattern_type (%pattern_type.51d) = value_param_pattern [template = %x.param_patt.loc5_25.2 (constants.%x.param_patt.91d)]
|
||||
// CHECK:STDOUT: %x.patt.loc5_25.2: @F.%pattern_type (%pattern_type.51d) = wrapper_binding_pattern x, %x.param_patt.loc5_25.2 [template = %x.patt.loc5_25.2 (constants.%x.patt.260)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.loc4_16.1 [template = %require_complete (constants.%require_complete.944)]
|
||||
// CHECK:STDOUT: %.loc5_17.4: <instruction> = refine_type_action %x.ref, %T.loc4_16.1 [template]
|
||||
// CHECK:STDOUT: %.loc5_17.5: <instruction> = access_member_action %.loc5_17.1, n [template]
|
||||
// CHECK:STDOUT: %.loc5_17.6: type = type_of_inst %.loc5_17.5 [template]
|
||||
// CHECK:STDOUT: %.loc5_17.7: <instruction> = convert_to_value_action %.loc5_17.2, constants.%i32 [template]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.loc5_16.1 [template = %require_complete (constants.%require_complete.944)]
|
||||
// CHECK:STDOUT: %.loc6_17.4: <instruction> = refine_type_action %x.ref, %T.loc5_16.1 [template]
|
||||
// CHECK:STDOUT: %.loc6_17.5: <instruction> = access_member_action %.loc6_17.1, n [template]
|
||||
// CHECK:STDOUT: %.loc6_17.6: type = type_of_inst %.loc6_17.5 [template]
|
||||
// CHECK:STDOUT: %.loc6_17.7: <instruction> = convert_to_value_action %.loc6_17.2, constants.%i32 [template]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%x.param: @F.%T.loc4_16.1 (%T.67db0b.1)) -> out %return.param: %i32 {
|
||||
// CHECK:STDOUT: fn(%x.param: @F.%T.loc5_16.1 (%T.67db0b.1)) -> out %return.param: %i32 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %x.ref: @F.%T.loc4_16.1 (%T.67db0b.1) = name_ref x, %x
|
||||
// CHECK:STDOUT: %.loc5_17.1: @F.%T.loc4_16.1 (%T.67db0b.1) = splice_inst %.loc5_17.4
|
||||
// CHECK:STDOUT: %.loc5_17.2: @F.%.loc5_17.6 (@F.%.loc5_17.6) = splice_inst %.loc5_17.5
|
||||
// CHECK:STDOUT: %.loc5_17.3: %i32 = splice_inst %.loc5_17.7
|
||||
// CHECK:STDOUT: %i32.loc5: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %n: %i32 = wrapper_binding n, %.loc5_17.3
|
||||
// CHECK:STDOUT: %x.ref: @F.%T.loc5_16.1 (%T.67db0b.1) = name_ref x, %x
|
||||
// CHECK:STDOUT: %.loc6_17.1: @F.%T.loc5_16.1 (%T.67db0b.1) = splice_inst %.loc6_17.4
|
||||
// CHECK:STDOUT: %.loc6_17.2: @F.%.loc6_17.6 (@F.%.loc6_17.6) = splice_inst %.loc6_17.5
|
||||
// CHECK:STDOUT: %.loc6_17.3: %i32 = splice_inst %.loc6_17.7
|
||||
// CHECK:STDOUT: %i32.loc6: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %n: %i32 = wrapper_binding n, %.loc6_17.3
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %n.patt: %pattern_type.6b6 = value_binding_pattern n [concrete = constants.%n.patt.c48]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n
|
||||
// CHECK:STDOUT: %impl.elem0: %.737 = impl_witness_access constants.%Copy.impl_witness.b51, element0 [concrete = constants.%Int.as.Copy.impl.Op.4f6]
|
||||
// CHECK:STDOUT: %bound_method.loc6_10.1: <bound method> = bound_method %n.ref, %impl.elem0
|
||||
// CHECK:STDOUT: %bound_method.loc7_10.1: <bound method> = bound_method %n.ref, %impl.elem0
|
||||
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc6_10.2: <bound method> = bound_method %n.ref, %specific_fn
|
||||
// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc6_10.2(%n.ref)
|
||||
// CHECK:STDOUT: %bound_method.loc7_10.2: <bound method> = bound_method %n.ref, %specific_fn
|
||||
// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc7_10.2(%n.ref)
|
||||
// CHECK:STDOUT: return %Int.as.Copy.impl.Op.call
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Test1(%c.param: %C) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
|
||||
// CHECK:STDOUT: %c.ref: %C = name_ref c, %c
|
||||
// CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.ref, @F(constants.%C) [concrete = constants.%F.specific_fn.e0d]
|
||||
// CHECK:STDOUT: %F.call: init %i32 = call %F.specific_fn(%c.ref)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Test2(%x.param: %struct_type.m.n) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
|
||||
// CHECK:STDOUT: %x.ref: %struct_type.m.n = name_ref x, %x
|
||||
// CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.ref, @F(constants.%struct_type.m.n) [concrete = constants.%F.specific_fn.4da]
|
||||
// CHECK:STDOUT: %F.call: init %i32 = call %F.specific_fn(%x.ref)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @F(constants.%T.67db0b.1) {
|
||||
// CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%T.patt.d47011.1
|
||||
// CHECK:STDOUT: %T.loc4_16.1 => constants.%T.67db0b.1
|
||||
// CHECK:STDOUT: %T.patt.loc5_16.2 => constants.%T.patt.d47011.1
|
||||
// CHECK:STDOUT: %T.loc5_16.1 => constants.%T.67db0b.1
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.51d
|
||||
// CHECK:STDOUT: %x.param_patt.loc4_25.2 => constants.%x.param_patt.91d
|
||||
// CHECK:STDOUT: %x.patt.loc4_25.2 => constants.%x.patt.260
|
||||
// CHECK:STDOUT: %x.param_patt.loc5_25.2 => constants.%x.param_patt.91d
|
||||
// CHECK:STDOUT: %x.patt.loc5_25.2 => constants.%x.patt.260
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @F(constants.%C) {
|
||||
// CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%T.patt.d47011.1
|
||||
// CHECK:STDOUT: %T.loc4_16.1 => constants.%C
|
||||
// CHECK:STDOUT: %T.patt.loc5_16.2 => constants.%T.patt.d47011.1
|
||||
// CHECK:STDOUT: %T.loc5_16.1 => constants.%C
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.98b
|
||||
// CHECK:STDOUT: %x.param_patt.loc4_25.2 => constants.%x.param_patt.0f9
|
||||
// CHECK:STDOUT: %x.patt.loc4_25.2 => constants.%x.patt.953
|
||||
// CHECK:STDOUT: %x.param_patt.loc5_25.2 => constants.%x.param_patt.0f9
|
||||
// CHECK:STDOUT: %x.patt.loc5_25.2 => constants.%x.patt.953
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete => constants.%complete_type.cdf
|
||||
// CHECK:STDOUT: %.loc5_17.4 => constants.%inst.as_compatible.d98
|
||||
// CHECK:STDOUT: %.loc5_17.5 => constants.%inst.splice_block.351
|
||||
// CHECK:STDOUT: %.loc5_17.6 => constants.%i32
|
||||
// CHECK:STDOUT: %.loc5_17.7 => constants.%inst.splice_block.f4f
|
||||
// CHECK:STDOUT: %.loc6_17.4 => constants.%inst.as_compatible.d98
|
||||
// CHECK:STDOUT: %.loc6_17.5 => constants.%inst.splice_block.351
|
||||
// CHECK:STDOUT: %.loc6_17.6 => constants.%i32
|
||||
// CHECK:STDOUT: %.loc6_17.7 => constants.%inst.splice_block.f4f
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @F(constants.%struct_type.m.n) {
|
||||
// CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%T.patt.d47011.1
|
||||
// CHECK:STDOUT: %T.loc4_16.1 => constants.%struct_type.m.n
|
||||
// CHECK:STDOUT: %T.patt.loc5_16.2 => constants.%T.patt.d47011.1
|
||||
// CHECK:STDOUT: %T.loc5_16.1 => constants.%struct_type.m.n
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.860
|
||||
// CHECK:STDOUT: %x.param_patt.loc4_25.2 => constants.%x.param_patt.c8a
|
||||
// CHECK:STDOUT: %x.patt.loc4_25.2 => constants.%x.patt.3a7
|
||||
// CHECK:STDOUT: %x.param_patt.loc5_25.2 => constants.%x.param_patt.c8a
|
||||
// CHECK:STDOUT: %x.patt.loc5_25.2 => constants.%x.patt.3a7
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete => constants.%complete_type.08f
|
||||
// CHECK:STDOUT: %.loc5_17.4 => constants.%inst.as_compatible.bba
|
||||
// CHECK:STDOUT: %.loc5_17.5 => constants.%inst.struct_access
|
||||
// CHECK:STDOUT: %.loc5_17.6 => constants.%i32
|
||||
// CHECK:STDOUT: %.loc5_17.7 => constants.%inst.splice_block.1b4
|
||||
// CHECK:STDOUT: %.loc6_17.4 => constants.%inst.as_compatible.bba
|
||||
// CHECK:STDOUT: %.loc6_17.5 => constants.%inst.struct_access
|
||||
// CHECK:STDOUT: %.loc6_17.6 => constants.%i32
|
||||
// CHECK:STDOUT: %.loc6_17.7 => constants.%inst.splice_block.1b4
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_no_such_member.carbon
|
||||
// CHECK:STDOUT: --- fail_todo_compound_member_access.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %i32 [concrete]
|
||||
// CHECK:STDOUT: %type: type = facet_type <type> [concrete]
|
||||
// CHECK:STDOUT: %.Self.frozen: %type = symbolic_binding .Self [symbolic_self]
|
||||
// CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
|
||||
// CHECK:STDOUT: %T.patt.d47011.1: %pattern_type.98f = symbolic_binding_pattern T, 0, template [template]
|
||||
// CHECK:STDOUT: %T.67db0b.1: type = symbolic_binding T, 0, template [template]
|
||||
// CHECK:STDOUT: %pattern_type.51d: type = pattern_type %T.67db0b.1 [template]
|
||||
// CHECK:STDOUT: %x.param_patt.91d: %pattern_type.51d = value_param_pattern [template]
|
||||
// CHECK:STDOUT: %x.patt.260: %pattern_type.51d = wrapper_binding_pattern x, %x.param_patt.91d [template]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %.795: Core.Form = init_form %i32 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0, template [template]
|
||||
// CHECK:STDOUT: %T: type = symbolic_binding T, 0, template [template]
|
||||
// CHECK:STDOUT: %pattern_type.51d1c4.1: type = pattern_type %T [template]
|
||||
// CHECK:STDOUT: %x.param_patt.91d: %pattern_type.51d1c4.1 = value_param_pattern [template]
|
||||
// CHECK:STDOUT: %x.patt.260: %pattern_type.51d1c4.1 = wrapper_binding_pattern x, %x.param_patt.91d [template]
|
||||
// CHECK:STDOUT: %.795f: Core.Form = init_form %i32 [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt.a9a: %pattern_type.6b6 = out_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.patt.e1b: %pattern_type.6b6 = return_slot_pattern %return.param_patt.a9a, %i32 [concrete]
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %require_complete.944: <witness> = require_complete_type %T.67db0b.1 [template]
|
||||
// CHECK:STDOUT: %n.patt: %pattern_type.6b6 = value_binding_pattern n [concrete]
|
||||
// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
|
||||
// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.ac8: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic]
|
||||
// CHECK:STDOUT: %Int.as.Copy.impl.Op.5e0: %Int.as.Copy.impl.Op.type.ac8 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %Copy.impl_witness.b51: <witness> = impl_witness imports.%Copy.impl_witness_table.8d2, @Int.as.Copy.impl(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.3f6: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Int.as.Copy.impl.Op.4f6: %Int.as.Copy.impl.Op.type.3f6 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %i32, (%Copy.impl_witness.b51) [concrete]
|
||||
// CHECK:STDOUT: %Copy.WithSelf.Op.type.381: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet) [concrete]
|
||||
// CHECK:STDOUT: %.737: type = fn_type_with_self_type %Copy.WithSelf.Op.type.381, %Copy.facet [concrete]
|
||||
// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: <specific function> = specific_function %Int.as.Copy.impl.Op.4f6, @Int.as.Copy.impl.Op(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %require_complete.944: <witness> = require_complete_type %T [template]
|
||||
// CHECK:STDOUT: %Dest: type = symbolic_binding Dest, 0 [symbolic]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.3aa: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic]
|
||||
// CHECK:STDOUT: %Self.294: %ImplicitAs.type.3aa = symbolic_binding Self, 1 [symbolic]
|
||||
// CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.97e: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%Dest, %Self.294) [symbolic]
|
||||
// CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.945: %ImplicitAs.WithSelf.Convert.type.97e = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %ImplicitAs.assoc_type.e23: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%i32) [concrete]
|
||||
// CHECK:STDOUT: %assoc0.368: %ImplicitAs.assoc_type.e23 = assoc_entity element0, imports.%Core.import_ref.cb2 [concrete]
|
||||
// CHECK:STDOUT: %D: type = class_type @D [concrete]
|
||||
// CHECK:STDOUT: %D.elem: type = unbound_element_type %D, %i32 [concrete]
|
||||
// CHECK:STDOUT: %struct_type.m: type = struct_type {.m: %i32} [concrete]
|
||||
// CHECK:STDOUT: %complete_type.37d: <witness> = complete_type_witness %struct_type.m [concrete]
|
||||
// CHECK:STDOUT: %struct_type.base.085: type = struct_type {.base: %C} [concrete]
|
||||
// CHECK:STDOUT: %complete_type.756: <witness> = complete_type_witness %struct_type.base.085 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.d8d: type = pattern_type %D [concrete]
|
||||
// CHECK:STDOUT: %d.param_patt: %pattern_type.d8d = value_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %d.patt: %pattern_type.d8d = wrapper_binding_pattern d, %d.param_patt [concrete]
|
||||
// CHECK:STDOUT: %Test.type: type = fn_type @Test [concrete]
|
||||
// CHECK:STDOUT: %Test: %Test.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %x.param_patt.23b: %pattern_type.d8d = value_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %x.patt.c51: %pattern_type.d8d = wrapper_binding_pattern x, %x.param_patt.23b [concrete]
|
||||
// CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F, @F(%D) [concrete]
|
||||
// CHECK:STDOUT: %inst.as_compatible: <instruction> = inst_value [concrete] {
|
||||
// CHECK:STDOUT: %.602: %D = as_compatible @F.%x.ref
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %inst.name_ref: <instruction> = inst_value [concrete] {
|
||||
// CHECK:STDOUT: %n.ref: <error> = name_ref n, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %inst.splice_block.08b: <instruction> = inst_value [concrete] {
|
||||
// CHECK:STDOUT: %.1843e: ref %i32 = splice_block %.a6d {
|
||||
// CHECK:STDOUT: %.68a: %C = as_compatible %.602
|
||||
// CHECK:STDOUT: %.c3b: ref %C = class_element_access %.68a, element0
|
||||
// CHECK:STDOUT: %.59a: ref %C = converted %.602, %.c3b
|
||||
// CHECK:STDOUT: %.a6d: ref %i32 = class_element_access %.59a, element0
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %inst.splice_block: <instruction> = inst_value [concrete] {
|
||||
// CHECK:STDOUT: %inst.splice_block.edd: <instruction> = inst_value [concrete] {
|
||||
// CHECK:STDOUT: %.432: <error> = splice_block <error> [concrete = <error>] {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: .Copy = %Core.Copy
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type]
|
||||
// CHECK:STDOUT: %Core.import_ref.cd6: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.ac8) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.5e0)]
|
||||
// CHECK:STDOUT: %Copy.impl_witness_table.8d2 = impl_witness_table (%Core.import_ref.cd6), @Int.as.Copy.impl [concrete]
|
||||
// CHECK:STDOUT: %Core.import_ref.cb2: @ImplicitAs.WithSelf.%ImplicitAs.WithSelf.Convert.type (%ImplicitAs.WithSelf.Convert.type.97e) = import_ref Core//prelude/parts/as, loc{{\d+_\d+}}, loaded [symbolic = @ImplicitAs.WithSelf.%ImplicitAs.WithSelf.Convert (constants.%ImplicitAs.WithSelf.Convert.945)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .F = %F.decl
|
||||
// CHECK:STDOUT: .D = %D.decl
|
||||
// CHECK:STDOUT: .Test = %Test.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
||||
// CHECK:STDOUT: %T.patt.loc4_16.1: %pattern_type.98f = symbolic_binding_pattern T, 0, template [template = %T.patt.loc4_16.2 (constants.%T.patt.d47011.1)]
|
||||
// CHECK:STDOUT: %x.param_patt.loc4_25.1: @F.%pattern_type (%pattern_type.51d) = value_param_pattern [template = %x.param_patt.loc4_25.2 (constants.%x.param_patt.91d)]
|
||||
// CHECK:STDOUT: %x.patt.loc4_25.1: @F.%pattern_type (%pattern_type.51d) = wrapper_binding_pattern x, %x.param_patt.loc4_25.1 [template = %x.patt.loc4_25.2 (constants.%x.patt.260)]
|
||||
// CHECK:STDOUT: %T.patt.loc9_16.1: %pattern_type.98f = symbolic_binding_pattern T, 0, template [template = %T.patt.loc9_16.2 (constants.%T.patt)]
|
||||
// CHECK:STDOUT: %x.param_patt.loc9_25.1: @F.%pattern_type (%pattern_type.51d1c4.1) = value_param_pattern [template = %x.param_patt.loc9_25.2 (constants.%x.param_patt.91d)]
|
||||
// CHECK:STDOUT: %x.patt.loc9_25.1: @F.%pattern_type (%pattern_type.51d1c4.1) = wrapper_binding_pattern x, %x.param_patt.loc9_25.1 [template = %x.patt.loc9_25.2 (constants.%x.patt.260)]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.6b6 = out_param_pattern [concrete = constants.%return.param_patt.a9a]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.6b6 = return_slot_pattern %return.param_patt, %i32.loc4 [concrete = constants.%return.patt.e1b]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.6b6 = return_slot_pattern %return.param_patt, %i32 [concrete = constants.%return.patt.e1b]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %i32.loc4: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc4_33: Core.Form = init_form %i32.loc4 [concrete = constants.%.795]
|
||||
// CHECK:STDOUT: %.loc4_18.1: type = splice_block %.loc4_18.2 [concrete = type] {
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc9_33: Core.Form = init_form %i32 [concrete = constants.%.795f]
|
||||
// CHECK:STDOUT: %.loc9_18.1: type = splice_block %.loc9_18.2 [concrete = type] {
|
||||
// CHECK:STDOUT: %.Self.frozen: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
|
||||
// CHECK:STDOUT: %.loc4_18.2: type = type_literal type [concrete = type]
|
||||
// CHECK:STDOUT: %.loc9_18.2: type = type_literal type [concrete = type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %T.loc4_16.2: type = symbolic_binding T, 0, template [template = %T.loc4_16.1 (constants.%T.67db0b.1)]
|
||||
// CHECK:STDOUT: %x.param: @F.%T.loc4_16.1 (%T.67db0b.1) = value_param call_param0
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_16.2 [template = %T.loc4_16.1 (constants.%T.67db0b.1)]
|
||||
// CHECK:STDOUT: %x: @F.%T.loc4_16.1 (%T.67db0b.1) = wrapper_binding x, %x.param
|
||||
// CHECK:STDOUT: %T.loc9_16.2: type = symbolic_binding T, 0, template [template = %T.loc9_16.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %x.param: @F.%T.loc9_16.1 (%T) = value_param call_param0
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc9_16.2 [template = %T.loc9_16.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %x: @F.%T.loc9_16.1 (%T) = wrapper_binding x, %x.param
|
||||
// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
|
||||
// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %D.decl: type = class_decl @D [concrete = constants.%D] {} {}
|
||||
// CHECK:STDOUT: %Test.decl: %Test.type = fn_decl @Test [concrete = constants.%Test] {
|
||||
// CHECK:STDOUT: %d.param_patt: %pattern_type.d8d = value_param_pattern [concrete = constants.%d.param_patt]
|
||||
// CHECK:STDOUT: %d.patt: %pattern_type.d8d = wrapper_binding_pattern d, %d.param_patt [concrete = constants.%d.patt]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %d.param: %D = value_param call_param0
|
||||
// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D]
|
||||
// CHECK:STDOUT: %d: %D = wrapper_binding d, %d.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @D {
|
||||
// CHECK:STDOUT: %.loc10: %D.elem = field_decl m, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.m [concrete = constants.%complete_type.37d]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = constants.%D
|
||||
// CHECK:STDOUT: .m = %.loc10
|
||||
// CHECK:STDOUT: .n = <poisoned>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @F(%T.loc4_16.2: type) {
|
||||
// CHECK:STDOUT: %T.patt.loc4_16.2: %pattern_type.98f = symbolic_binding_pattern T, 0, template [template = %T.patt.loc4_16.2 (constants.%T.patt.d47011.1)]
|
||||
// CHECK:STDOUT: %T.loc4_16.1: type = symbolic_binding T, 0, template [template = %T.loc4_16.1 (constants.%T.67db0b.1)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %T.loc4_16.1 [template = %pattern_type (constants.%pattern_type.51d)]
|
||||
// CHECK:STDOUT: %x.param_patt.loc4_25.2: @F.%pattern_type (%pattern_type.51d) = value_param_pattern [template = %x.param_patt.loc4_25.2 (constants.%x.param_patt.91d)]
|
||||
// CHECK:STDOUT: %x.patt.loc4_25.2: @F.%pattern_type (%pattern_type.51d) = wrapper_binding_pattern x, %x.param_patt.loc4_25.2 [template = %x.patt.loc4_25.2 (constants.%x.patt.260)]
|
||||
// CHECK:STDOUT: generic fn @F(%T.loc9_16.2: type) {
|
||||
// CHECK:STDOUT: %T.patt.loc9_16.2: %pattern_type.98f = symbolic_binding_pattern T, 0, template [template = %T.patt.loc9_16.2 (constants.%T.patt)]
|
||||
// CHECK:STDOUT: %T.loc9_16.1: type = symbolic_binding T, 0, template [template = %T.loc9_16.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %T.loc9_16.1 [template = %pattern_type (constants.%pattern_type.51d1c4.1)]
|
||||
// CHECK:STDOUT: %x.param_patt.loc9_25.2: @F.%pattern_type (%pattern_type.51d1c4.1) = value_param_pattern [template = %x.param_patt.loc9_25.2 (constants.%x.param_patt.91d)]
|
||||
// CHECK:STDOUT: %x.patt.loc9_25.2: @F.%pattern_type (%pattern_type.51d1c4.1) = wrapper_binding_pattern x, %x.param_patt.loc9_25.2 [template = %x.patt.loc9_25.2 (constants.%x.patt.260)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.loc4_16.1 [template = %require_complete (constants.%require_complete.944)]
|
||||
// CHECK:STDOUT: %.loc5_17.4: <instruction> = refine_type_action %x.ref, %T.loc4_16.1 [template]
|
||||
// CHECK:STDOUT: %.loc5_17.5: <instruction> = access_member_action %.loc5_17.1, n [template]
|
||||
// CHECK:STDOUT: %.loc5_17.6: type = type_of_inst %.loc5_17.5 [template]
|
||||
// CHECK:STDOUT: %.loc5_17.7: <instruction> = convert_to_value_action %.loc5_17.2, constants.%i32 [template]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.loc9_16.1 [template = %require_complete (constants.%require_complete.944)]
|
||||
// CHECK:STDOUT: %.loc14_11.3: <instruction> = refine_type_action %x.ref, %T.loc9_16.1 [template]
|
||||
// CHECK:STDOUT: %.loc14_11.4: <instruction> = compound_member_access_action %.loc14_11.1, %n.ref [template]
|
||||
// CHECK:STDOUT: %.loc14_11.5: type = type_of_inst %.loc14_11.4 [template]
|
||||
// CHECK:STDOUT: %.loc14_17.3: <instruction> = compound_member_access_action %.loc14_11.2, constants.%assoc0.368 [template]
|
||||
// CHECK:STDOUT: %.loc14_17.4: type = type_of_inst %.loc14_17.3 [template]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%x.param: @F.%T.loc4_16.1 (%T.67db0b.1)) -> out %return.param: %i32 {
|
||||
// CHECK:STDOUT: fn(%x.param: @F.%T.loc9_16.1 (%T)) -> out %return.param: %i32 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %x.ref: @F.%T.loc4_16.1 (%T.67db0b.1) = name_ref x, %x
|
||||
// CHECK:STDOUT: %.loc5_17.1: @F.%T.loc4_16.1 (%T.67db0b.1) = splice_inst %.loc5_17.4
|
||||
// CHECK:STDOUT: %.loc5_17.2: @F.%.loc5_17.6 (@F.%.loc5_17.6) = splice_inst %.loc5_17.5
|
||||
// CHECK:STDOUT: %.loc5_17.3: %i32 = splice_inst %.loc5_17.7
|
||||
// CHECK:STDOUT: %i32.loc5: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %n: %i32 = wrapper_binding n, %.loc5_17.3
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %n.patt: %pattern_type.6b6 = value_binding_pattern n [concrete = constants.%n.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n
|
||||
// CHECK:STDOUT: %impl.elem0: %.737 = impl_witness_access constants.%Copy.impl_witness.b51, element0 [concrete = constants.%Int.as.Copy.impl.Op.4f6]
|
||||
// CHECK:STDOUT: %bound_method.loc6_10.1: <bound method> = bound_method %n.ref, %impl.elem0
|
||||
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc6_10.2: <bound method> = bound_method %n.ref, %specific_fn
|
||||
// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc6_10.2(%n.ref)
|
||||
// CHECK:STDOUT: return %Int.as.Copy.impl.Op.call
|
||||
// CHECK:STDOUT: %x.ref: @F.%T.loc9_16.1 (%T) = name_ref x, %x
|
||||
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %n.ref: %C.elem = name_ref n, @C.%.loc5 [concrete = @C.%.loc5]
|
||||
// CHECK:STDOUT: %.loc14_11.1: @F.%T.loc9_16.1 (%T) = splice_inst %.loc14_11.3
|
||||
// CHECK:STDOUT: %.loc14_11.2: @F.%.loc14_11.5 (@F.%.loc14_11.5) = splice_inst %.loc14_11.4
|
||||
// CHECK:STDOUT: %.loc14_17.1: @F.%.loc14_17.4 (@F.%.loc14_17.4) = splice_inst %.loc14_17.3
|
||||
// CHECK:STDOUT: %.loc14_17.2: %i32 = converted %.loc14_11.2, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: return <error>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Test(%d.param: %D) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
|
||||
// CHECK:STDOUT: %d.ref: %D = name_ref d, %d
|
||||
// CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.ref, @F(constants.%D) [concrete = constants.%F.specific_fn]
|
||||
// CHECK:STDOUT: %F.call: init %i32 = call %F.specific_fn(%d.ref)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @F(constants.%T.67db0b.1) {
|
||||
// CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%T.patt.d47011.1
|
||||
// CHECK:STDOUT: %T.loc4_16.1 => constants.%T.67db0b.1
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.51d
|
||||
// CHECK:STDOUT: %x.param_patt.loc4_25.2 => constants.%x.param_patt.91d
|
||||
// CHECK:STDOUT: %x.patt.loc4_25.2 => constants.%x.patt.260
|
||||
// CHECK:STDOUT: specific @F(constants.%T) {
|
||||
// CHECK:STDOUT: %T.patt.loc9_16.2 => constants.%T.patt
|
||||
// CHECK:STDOUT: %T.loc9_16.1 => constants.%T
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.51d1c4.1
|
||||
// CHECK:STDOUT: %x.param_patt.loc9_25.2 => constants.%x.param_patt.91d
|
||||
// CHECK:STDOUT: %x.patt.loc9_25.2 => constants.%x.patt.260
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @F(constants.%D) {
|
||||
// CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%T.patt.d47011.1
|
||||
// CHECK:STDOUT: %T.loc4_16.1 => constants.%D
|
||||
// CHECK:STDOUT: %T.patt.loc9_16.2 => constants.%T.patt
|
||||
// CHECK:STDOUT: %T.loc9_16.1 => constants.%D
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.d8d
|
||||
// CHECK:STDOUT: %x.param_patt.loc4_25.2 => constants.%x.param_patt.23b
|
||||
// CHECK:STDOUT: %x.patt.loc4_25.2 => constants.%x.patt.c51
|
||||
// CHECK:STDOUT: %x.param_patt.loc9_25.2 => constants.%x.param_patt.23b
|
||||
// CHECK:STDOUT: %x.patt.loc9_25.2 => constants.%x.patt.c51
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete => constants.%complete_type.37d
|
||||
// CHECK:STDOUT: %.loc5_17.4 => constants.%inst.as_compatible
|
||||
// CHECK:STDOUT: %.loc5_17.5 => constants.%inst.name_ref
|
||||
// CHECK:STDOUT: %.loc5_17.6 => <error>
|
||||
// CHECK:STDOUT: %.loc5_17.7 => constants.%inst.splice_block
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_member_wrong_type.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %type: type = facet_type <type> [concrete]
|
||||
// CHECK:STDOUT: %.Self.frozen: %type = symbolic_binding .Self [symbolic_self]
|
||||
// CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
|
||||
// CHECK:STDOUT: %T.patt.d47011.1: %pattern_type.98f = symbolic_binding_pattern T, 0, template [template]
|
||||
// CHECK:STDOUT: %T.67db0b.1: type = symbolic_binding T, 0, template [template]
|
||||
// CHECK:STDOUT: %pattern_type.51d1c4.1: type = pattern_type %T.67db0b.1 [template]
|
||||
// CHECK:STDOUT: %x.param_patt.91d: %pattern_type.51d1c4.1 = value_param_pattern [template]
|
||||
// CHECK:STDOUT: %x.patt.260: %pattern_type.51d1c4.1 = wrapper_binding_pattern x, %x.param_patt.91d [template]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %.795f: Core.Form = init_form %i32 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt.a9a: %pattern_type.6b6 = out_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.patt.e1b: %pattern_type.6b6 = return_slot_pattern %return.param_patt.a9a, %i32 [concrete]
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F.loc4 [concrete]
|
||||
// CHECK:STDOUT: %F.708: %F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %require_complete.944: <witness> = require_complete_type %T.67db0b.1 [template]
|
||||
// CHECK:STDOUT: %n.patt.c48: %pattern_type.6b6 = value_binding_pattern n [concrete]
|
||||
// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
|
||||
// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.ac8: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic]
|
||||
// CHECK:STDOUT: %Int.as.Copy.impl.Op.5e0: %Int.as.Copy.impl.Op.type.ac8 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %Copy.impl_witness.b51: <witness> = impl_witness imports.%Copy.impl_witness_table.8d2, @Int.as.Copy.impl(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.3f6: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Int.as.Copy.impl.Op.4f6: %Int.as.Copy.impl.Op.type.3f6 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %i32, (%Copy.impl_witness.b51) [concrete]
|
||||
// CHECK:STDOUT: %Copy.WithSelf.Op.type.381: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet) [concrete]
|
||||
// CHECK:STDOUT: %.737: type = fn_type_with_self_type %Copy.WithSelf.Op.type.381, %Copy.facet [concrete]
|
||||
// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: <specific function> = specific_function %Int.as.Copy.impl.Op.4f6, @Int.as.Copy.impl.Op(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %E: type = class_type @E [concrete]
|
||||
// CHECK:STDOUT: %F.76a: type = class_type @F.loc10 [concrete]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %E.elem: type = unbound_element_type %E, %F.76a [concrete]
|
||||
// CHECK:STDOUT: %struct_type.n.88b: type = struct_type {.n: %F.76a} [concrete]
|
||||
// CHECK:STDOUT: %complete_type.15a: <witness> = complete_type_witness %struct_type.n.88b [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.849: type = pattern_type %E [concrete]
|
||||
// CHECK:STDOUT: %e.param_patt: %pattern_type.849 = value_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %e.patt: %pattern_type.849 = wrapper_binding_pattern e, %e.param_patt [concrete]
|
||||
// CHECK:STDOUT: %Test.type: type = fn_type @Test [concrete]
|
||||
// CHECK:STDOUT: %Test: %Test.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %x.param_patt.209: %pattern_type.849 = value_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %x.patt.aab: %pattern_type.849 = wrapper_binding_pattern x, %x.param_patt.209 [concrete]
|
||||
// CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.708, @F.loc4(%E) [concrete]
|
||||
// CHECK:STDOUT: %inst.as_compatible: <instruction> = inst_value [concrete] {
|
||||
// CHECK:STDOUT: %.4a8: %E = as_compatible @F.loc4.%x.ref
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %inst.splice_block.e5a: <instruction> = inst_value [concrete] {
|
||||
// CHECK:STDOUT: %.39a: %F.76a = splice_block %.088 {
|
||||
// CHECK:STDOUT: %n.ref: %E.elem = name_ref n, @E.%.loc11 [concrete = @E.%.loc11]
|
||||
// CHECK:STDOUT: %.c40: ref %F.76a = class_element_access %.4a8, element0
|
||||
// CHECK:STDOUT: %.088: %F.76a = acquire_value %.c40
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %ImplicitAs.type.0ff: type = generic_interface_type @ImplicitAs [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.0ff = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %inst.splice_block.d6b: <instruction> = inst_value [concrete] {
|
||||
// CHECK:STDOUT: %.ccd: <error> = splice_block <error> [concrete = <error>] {
|
||||
// CHECK:STDOUT: %.abd: %i32 = converted %.39a, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: .Copy = %Core.Copy
|
||||
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type]
|
||||
// CHECK:STDOUT: %Core.import_ref.cd6: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.ac8) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.5e0)]
|
||||
// CHECK:STDOUT: %Copy.impl_witness_table.8d2 = impl_witness_table (%Core.import_ref.cd6), @Int.as.Copy.impl [concrete]
|
||||
// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.0ff = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .F = %F.decl
|
||||
// CHECK:STDOUT: .E = %E.decl
|
||||
// CHECK:STDOUT: .Test = %Test.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F.loc4 [concrete = constants.%F.708] {
|
||||
// CHECK:STDOUT: %T.patt.loc4_16.1: %pattern_type.98f = symbolic_binding_pattern T, 0, template [template = %T.patt.loc4_16.2 (constants.%T.patt.d47011.1)]
|
||||
// CHECK:STDOUT: %x.param_patt.loc4_25.1: @F.loc4.%pattern_type (%pattern_type.51d1c4.1) = value_param_pattern [template = %x.param_patt.loc4_25.2 (constants.%x.param_patt.91d)]
|
||||
// CHECK:STDOUT: %x.patt.loc4_25.1: @F.loc4.%pattern_type (%pattern_type.51d1c4.1) = wrapper_binding_pattern x, %x.param_patt.loc4_25.1 [template = %x.patt.loc4_25.2 (constants.%x.patt.260)]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.6b6 = out_param_pattern [concrete = constants.%return.param_patt.a9a]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.6b6 = return_slot_pattern %return.param_patt, %i32.loc4 [concrete = constants.%return.patt.e1b]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %i32.loc4: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc4_33: Core.Form = init_form %i32.loc4 [concrete = constants.%.795f]
|
||||
// CHECK:STDOUT: %.loc4_18.1: type = splice_block %.loc4_18.2 [concrete = type] {
|
||||
// CHECK:STDOUT: %.Self.frozen: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
|
||||
// CHECK:STDOUT: %.loc4_18.2: type = type_literal type [concrete = type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %T.loc4_16.2: type = symbolic_binding T, 0, template [template = %T.loc4_16.1 (constants.%T.67db0b.1)]
|
||||
// CHECK:STDOUT: %x.param: @F.loc4.%T.loc4_16.1 (%T.67db0b.1) = value_param call_param0
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_16.2 [template = %T.loc4_16.1 (constants.%T.67db0b.1)]
|
||||
// CHECK:STDOUT: %x: @F.loc4.%T.loc4_16.1 (%T.67db0b.1) = wrapper_binding x, %x.param
|
||||
// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
|
||||
// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %E.decl: type = class_decl @E [concrete = constants.%E] {} {}
|
||||
// CHECK:STDOUT: %Test.decl: %Test.type = fn_decl @Test [concrete = constants.%Test] {
|
||||
// CHECK:STDOUT: %e.param_patt: %pattern_type.849 = value_param_pattern [concrete = constants.%e.param_patt]
|
||||
// CHECK:STDOUT: %e.patt: %pattern_type.849 = wrapper_binding_pattern e, %e.param_patt [concrete = constants.%e.patt]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %e.param: %E = value_param call_param0
|
||||
// CHECK:STDOUT: %E.ref: type = name_ref E, file.%E.decl [concrete = constants.%E]
|
||||
// CHECK:STDOUT: %e: %E = wrapper_binding e, %e.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @E {
|
||||
// CHECK:STDOUT: %F.decl: type = class_decl @F.loc10 [concrete = constants.%F.76a] {} {}
|
||||
// CHECK:STDOUT: %.loc11: %E.elem = field_decl n, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.n.88b [concrete = constants.%complete_type.15a]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = constants.%E
|
||||
// CHECK:STDOUT: .F = %F.decl
|
||||
// CHECK:STDOUT: .n = %.loc11
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @F.loc10 {
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = constants.%F.76a
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @F.loc4(%T.loc4_16.2: type) {
|
||||
// CHECK:STDOUT: %T.patt.loc4_16.2: %pattern_type.98f = symbolic_binding_pattern T, 0, template [template = %T.patt.loc4_16.2 (constants.%T.patt.d47011.1)]
|
||||
// CHECK:STDOUT: %T.loc4_16.1: type = symbolic_binding T, 0, template [template = %T.loc4_16.1 (constants.%T.67db0b.1)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %T.loc4_16.1 [template = %pattern_type (constants.%pattern_type.51d1c4.1)]
|
||||
// CHECK:STDOUT: %x.param_patt.loc4_25.2: @F.loc4.%pattern_type (%pattern_type.51d1c4.1) = value_param_pattern [template = %x.param_patt.loc4_25.2 (constants.%x.param_patt.91d)]
|
||||
// CHECK:STDOUT: %x.patt.loc4_25.2: @F.loc4.%pattern_type (%pattern_type.51d1c4.1) = wrapper_binding_pattern x, %x.param_patt.loc4_25.2 [template = %x.patt.loc4_25.2 (constants.%x.patt.260)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.loc4_16.1 [template = %require_complete (constants.%require_complete.944)]
|
||||
// CHECK:STDOUT: %.loc5_17.4: <instruction> = refine_type_action %x.ref, %T.loc4_16.1 [template]
|
||||
// CHECK:STDOUT: %.loc5_17.5: <instruction> = access_member_action %.loc5_17.1, n [template]
|
||||
// CHECK:STDOUT: %.loc5_17.6: type = type_of_inst %.loc5_17.5 [template]
|
||||
// CHECK:STDOUT: %.loc5_17.7: <instruction> = convert_to_value_action %.loc5_17.2, constants.%i32 [template]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%x.param: @F.loc4.%T.loc4_16.1 (%T.67db0b.1)) -> out %return.param: %i32 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %x.ref: @F.loc4.%T.loc4_16.1 (%T.67db0b.1) = name_ref x, %x
|
||||
// CHECK:STDOUT: %.loc5_17.1: @F.loc4.%T.loc4_16.1 (%T.67db0b.1) = splice_inst %.loc5_17.4
|
||||
// CHECK:STDOUT: %.loc5_17.2: @F.loc4.%.loc5_17.6 (@F.loc4.%.loc5_17.6) = splice_inst %.loc5_17.5
|
||||
// CHECK:STDOUT: %.loc5_17.3: %i32 = splice_inst %.loc5_17.7
|
||||
// CHECK:STDOUT: %i32.loc5: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %n: %i32 = wrapper_binding n, %.loc5_17.3
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %n.patt: %pattern_type.6b6 = value_binding_pattern n [concrete = constants.%n.patt.c48]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n
|
||||
// CHECK:STDOUT: %impl.elem0: %.737 = impl_witness_access constants.%Copy.impl_witness.b51, element0 [concrete = constants.%Int.as.Copy.impl.Op.4f6]
|
||||
// CHECK:STDOUT: %bound_method.loc6_10.1: <bound method> = bound_method %n.ref, %impl.elem0
|
||||
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc6_10.2: <bound method> = bound_method %n.ref, %specific_fn
|
||||
// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc6_10.2(%n.ref)
|
||||
// CHECK:STDOUT: return %Int.as.Copy.impl.Op.call
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Test(%e.param: %E) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F.708]
|
||||
// CHECK:STDOUT: %e.ref: %E = name_ref e, %e
|
||||
// CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.ref, @F.loc4(constants.%E) [concrete = constants.%F.specific_fn]
|
||||
// CHECK:STDOUT: %F.call: init %i32 = call %F.specific_fn(%e.ref)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @F.loc4(constants.%T.67db0b.1) {
|
||||
// CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%T.patt.d47011.1
|
||||
// CHECK:STDOUT: %T.loc4_16.1 => constants.%T.67db0b.1
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.51d1c4.1
|
||||
// CHECK:STDOUT: %x.param_patt.loc4_25.2 => constants.%x.param_patt.91d
|
||||
// CHECK:STDOUT: %x.patt.loc4_25.2 => constants.%x.patt.260
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @F.loc4(constants.%E) {
|
||||
// CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%T.patt.d47011.1
|
||||
// CHECK:STDOUT: %T.loc4_16.1 => constants.%E
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.849
|
||||
// CHECK:STDOUT: %x.param_patt.loc4_25.2 => constants.%x.param_patt.209
|
||||
// CHECK:STDOUT: %x.patt.loc4_25.2 => constants.%x.patt.aab
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete => constants.%complete_type.15a
|
||||
// CHECK:STDOUT: %.loc5_17.4 => constants.%inst.as_compatible
|
||||
// CHECK:STDOUT: %.loc5_17.5 => constants.%inst.splice_block.e5a
|
||||
// CHECK:STDOUT: %.loc5_17.6 => constants.%F.76a
|
||||
// CHECK:STDOUT: %.loc5_17.7 => constants.%inst.splice_block.d6b
|
||||
// CHECK:STDOUT: %require_complete => constants.%complete_type.756
|
||||
// CHECK:STDOUT: %.loc14_11.3 => constants.%inst.as_compatible
|
||||
// CHECK:STDOUT: %.loc14_11.4 => constants.%inst.splice_block.08b
|
||||
// CHECK:STDOUT: %.loc14_11.5 => constants.%i32
|
||||
// CHECK:STDOUT: %.loc14_17.3 => constants.%inst.splice_block.edd
|
||||
// CHECK:STDOUT: %.loc14_17.4 => <error>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+84
-70
@@ -19,7 +19,7 @@ library "[[@TEST_NAME]]";
|
||||
// Check that we get a reasonable diagnostic for an unimplemented operation on a
|
||||
// template dependent expression.
|
||||
fn F[template T: type](x: T) -> i32 {
|
||||
// CHECK:STDERR: fail_todo_unimplemented_operator.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Core.MulWith(Core.IntLiteral)` in type `<dependent type>` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: fail_todo_unimplemented_operator.carbon:[[@LINE+4]]:10: error: value of type `<dependent type>` is not callable [CallToNonCallable]
|
||||
// CHECK:STDERR: return x.n * 3;
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -38,7 +38,7 @@ class C {
|
||||
// template dependent value where the type is concrete but determined through
|
||||
// the template dependent value.
|
||||
fn F(template c: C) -> i32 {
|
||||
// CHECK:STDERR: fail_todo_unimplemented_value.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Core.MulWith(Core.IntLiteral)` in type `<dependent type>` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: fail_todo_unimplemented_value.carbon:[[@LINE+4]]:10: error: value of type `<dependent type>` is not callable [CallToNonCallable]
|
||||
// CHECK:STDERR: return c.n * 3;
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -51,22 +51,19 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
fn F[template T: Core.Destroy](x: T) {
|
||||
// TODO: These diagnostics aren't very good, and we should only produce one error here.
|
||||
// CHECK:STDERR: fail_todo_unimplemented_convert.carbon:[[@LINE+8]]:3: error: member name of type `<dependent type>` in compound member access is not an instance member or an interface member [CompoundMemberAccessDoesNotUseBase]
|
||||
// CHECK:STDERR: var unused v: T = 0;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_unimplemented_convert.carbon:[[@LINE+4]]:3: error: value of type `<dependent type>` is not callable [CallToNonCallable]
|
||||
// CHECK:STDERR: var unused v: T = 0;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
var unused v: T = 0;
|
||||
// CHECK:STDERR: fail_todo_unimplemented_convert.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `T` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: var unused w: i32 = x;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_unimplemented_convert.carbon:[[@LINE+4]]:3: note: type `T` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: fail_todo_unimplemented_convert.carbon:[[@LINE+8]]:3: error: value of type `<dependent type>` is not callable [CallToNonCallable]
|
||||
// CHECK:STDERR: var unused w: i32 = x;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_unimplemented_convert.carbon:[[@LINE-5]]:3: error: value of type `<dependent type>` is not callable [CallToNonCallable]
|
||||
// CHECK:STDERR: var unused v: T = 0;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
var unused w: i32 = x;
|
||||
}
|
||||
|
||||
@@ -96,6 +93,8 @@ fn F[template T: Core.Destroy](x: T) {
|
||||
// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete]
|
||||
// CHECK:STDOUT: %MulWith.type.9f9: type = generic_interface_type @MulWith [concrete]
|
||||
// CHECK:STDOUT: %MulWith.generic: %MulWith.type.9f9 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %MulWith.assoc_type.4dd: type = assoc_entity_type @MulWith, @MulWith(Core.IntLiteral) [concrete]
|
||||
// CHECK:STDOUT: %assoc1.37c: %MulWith.assoc_type.4dd = assoc_entity element1, imports.%Core.import_ref.9555a9.1 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -107,6 +106,7 @@ fn F[template T: Core.Destroy](x: T) {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: %Core.MulWith: %MulWith.type.9f9 = import_ref Core//prelude/operators/arithmetic, MulWith, loaded [concrete = constants.%MulWith.generic]
|
||||
// CHECK:STDOUT: %Core.import_ref.9555a9.1 = import_ref Core//prelude/operators/arithmetic, loc{{\d+_\d+}}, unloaded
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -149,6 +149,8 @@ fn F[template T: Core.Destroy](x: T) {
|
||||
// CHECK:STDOUT: %.loc11_11.3: <instruction> = refine_type_action %x.ref, %T.loc6_16.1 [template]
|
||||
// CHECK:STDOUT: %.loc11_11.4: <instruction> = access_member_action %.loc11_11.1, n [template]
|
||||
// CHECK:STDOUT: %.loc11_11.5: type = type_of_inst %.loc11_11.4 [template]
|
||||
// CHECK:STDOUT: %.loc11_14.2: <instruction> = compound_member_access_action %.loc11_11.2, constants.%assoc1.37c [template]
|
||||
// CHECK:STDOUT: %.loc11_14.3: type = type_of_inst %.loc11_14.2 [template]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%x.param: @F.%T.loc6_16.1 (%T)) -> out %return.param: %i32 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
@@ -156,6 +158,7 @@ fn F[template T: Core.Destroy](x: T) {
|
||||
// CHECK:STDOUT: %.loc11_11.1: @F.%T.loc6_16.1 (%T) = splice_inst %.loc11_11.3
|
||||
// CHECK:STDOUT: %.loc11_11.2: @F.%.loc11_11.5 (@F.%.loc11_11.5) = splice_inst %.loc11_11.4
|
||||
// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3]
|
||||
// CHECK:STDOUT: %.loc11_14.1: @F.%.loc11_14.3 (@F.%.loc11_14.3) = splice_inst %.loc11_14.2
|
||||
// CHECK:STDOUT: return <error>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
@@ -193,6 +196,8 @@ fn F[template T: Core.Destroy](x: T) {
|
||||
// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete]
|
||||
// CHECK:STDOUT: %MulWith.type.9f9: type = generic_interface_type @MulWith [concrete]
|
||||
// CHECK:STDOUT: %MulWith.generic: %MulWith.type.9f9 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %MulWith.assoc_type.4dd: type = assoc_entity_type @MulWith, @MulWith(Core.IntLiteral) [concrete]
|
||||
// CHECK:STDOUT: %assoc1.37c: %MulWith.assoc_type.4dd = assoc_entity element1, imports.%Core.import_ref.9555a9.1 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -204,6 +209,7 @@ fn F[template T: Core.Destroy](x: T) {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: %Core.MulWith: %MulWith.type.9f9 = import_ref Core//prelude/operators/arithmetic, MulWith, loaded [concrete = constants.%MulWith.generic]
|
||||
// CHECK:STDOUT: %Core.import_ref.9555a9.1 = import_ref Core//prelude/operators/arithmetic, loc{{\d+_\d+}}, unloaded
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -248,12 +254,15 @@ fn F[template T: Core.Destroy](x: T) {
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %.loc16_11.2: <instruction> = access_member_action %c.ref, n [template]
|
||||
// CHECK:STDOUT: %.loc16_11.3: type = type_of_inst %.loc16_11.2 [template]
|
||||
// CHECK:STDOUT: %.loc16_14.2: <instruction> = compound_member_access_action %.loc16_11.1, constants.%assoc1.37c [template]
|
||||
// CHECK:STDOUT: %.loc16_14.3: type = type_of_inst %.loc16_14.2 [template]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn() -> out %return.param: %i32 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %c.ref: %C = name_ref c, %c.loc11_16.2 [template = %c.loc11_16.1 (constants.%c)]
|
||||
// CHECK:STDOUT: %.loc16_11.1: @F.%.loc16_11.3 (@F.%.loc16_11.3) = splice_inst %.loc16_11.2
|
||||
// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3]
|
||||
// CHECK:STDOUT: %.loc16_14.1: @F.%.loc16_14.3 (@F.%.loc16_14.3) = splice_inst %.loc16_14.2
|
||||
// CHECK:STDOUT: return <error>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
@@ -269,23 +278,26 @@ fn F[template T: Core.Destroy](x: T) {
|
||||
// CHECK:STDOUT: %type: type = facet_type <type> [concrete]
|
||||
// CHECK:STDOUT: %.Self.frozen: %type = symbolic_binding .Self [symbolic_self]
|
||||
// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
|
||||
// CHECK:STDOUT: %Self.0e7: %Destroy.type = symbolic_binding Self, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.d3e: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Self.0e7) [symbolic]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.42b: %Destroy.WithSelf.Op.type.d3e = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %pattern_type.429: type = pattern_type %Destroy.type [concrete]
|
||||
// CHECK:STDOUT: %T.patt.351: %pattern_type.429 = symbolic_binding_pattern T, 0, template [template]
|
||||
// CHECK:STDOUT: %T.0e7: %Destroy.type = symbolic_binding T, 0, template [template]
|
||||
// CHECK:STDOUT: %T.as_type.700: type = facet_access_type %T.0e7 [template]
|
||||
// CHECK:STDOUT: %pattern_type.f4e485.2: type = pattern_type %T.as_type.700 [template]
|
||||
// CHECK:STDOUT: %T.patt: %pattern_type.429 = symbolic_binding_pattern T, 0, template [template]
|
||||
// CHECK:STDOUT: %T: %Destroy.type = symbolic_binding T, 0, template [template]
|
||||
// CHECK:STDOUT: %T.as_type: type = facet_access_type %T [template]
|
||||
// CHECK:STDOUT: %pattern_type.f4e485.2: type = pattern_type %T.as_type [template]
|
||||
// CHECK:STDOUT: %x.param_patt: %pattern_type.f4e485.2 = value_param_pattern [template]
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type.f4e485.2 = wrapper_binding_pattern x, %x.param_patt [template]
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %require_complete.14c: <witness> = require_complete_type %T.as_type.700 [template]
|
||||
// CHECK:STDOUT: %require_complete.14c: <witness> = require_complete_type %T.as_type [template]
|
||||
// CHECK:STDOUT: %v.patt: %pattern_type.f4e485.2 = ref_binding_pattern v [template]
|
||||
// CHECK:STDOUT: %v.var_patt: %pattern_type.f4e485.2 = var_pattern %v.patt [template]
|
||||
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.0ff: type = generic_interface_type @ImplicitAs [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.0ff = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.f42: type = facet_type <@ImplicitAs, @ImplicitAs(%T.as_type.700)> [template]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.f42: type = facet_type <@ImplicitAs, @ImplicitAs(%T.as_type)> [template]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
@@ -294,13 +306,12 @@ fn F[template T: Core.Destroy](x: T) {
|
||||
// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %w.patt: %pattern_type.6b6 = ref_binding_pattern w [concrete]
|
||||
// CHECK:STDOUT: %w.var_patt: %pattern_type.6b6 = var_pattern %w.patt [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.2: type = fn_type @Destroy.Op.loc22_3.2 [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.assoc_type.e23: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%i32) [concrete]
|
||||
// CHECK:STDOUT: %assoc0.e1a: %ImplicitAs.assoc_type.e23 = assoc_entity element0, imports.%Core.import_ref.f9d913.1 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.assoc_type: type = assoc_entity_type @Destroy [concrete]
|
||||
// CHECK:STDOUT: %assoc0.ae8: %Destroy.assoc_type = assoc_entity element0, imports.%Core.import_ref.918 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.2: type = fn_type @Destroy.Op.loc19_3.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.1a2547.2: %Destroy.Op.type.1d8f74.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.lookup_impl_witness: <witness> = lookup_impl_witness %T.0e7, @Destroy [template]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.d3ece9.2: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%T.0e7) [template]
|
||||
// CHECK:STDOUT: %.53a: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.d3ece9.2, %T.0e7 [template]
|
||||
// CHECK:STDOUT: %impl.elem0.0f9: %.53a = impl_witness_access %Destroy.lookup_impl_witness, element0 [template]
|
||||
// CHECK:STDOUT: %specific_impl_fn.afc: <specific function> = specific_impl_function %impl.elem0.0f9, @Destroy.WithSelf.Op(%T.0e7) [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -313,7 +324,9 @@ fn F[template T: Core.Destroy](x: T) {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
|
||||
// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.0ff = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
|
||||
// CHECK:STDOUT: %Core.import_ref.f9d913.1 = import_ref Core//prelude/operators/as, loc{{\d+_\d+}}, unloaded
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: %Core.import_ref.918: @Destroy.WithSelf.%Destroy.WithSelf.Op.type (%Destroy.WithSelf.Op.type.d3e) = import_ref Core//prelude/destroy, loc{{\d+_\d+}}, loaded [symbolic = @Destroy.WithSelf.%Destroy.WithSelf.Op (constants.%Destroy.WithSelf.Op.42b)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -323,7 +336,7 @@ fn F[template T: Core.Destroy](x: T) {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
||||
// CHECK:STDOUT: %T.patt.loc4_16.1: %pattern_type.429 = symbolic_binding_pattern T, 0, template [template = %T.patt.loc4_16.2 (constants.%T.patt.351)]
|
||||
// CHECK:STDOUT: %T.patt.loc4_16.1: %pattern_type.429 = symbolic_binding_pattern T, 0, template [template = %T.patt.loc4_16.2 (constants.%T.patt)]
|
||||
// CHECK:STDOUT: %x.param_patt.loc4_33.1: @F.%pattern_type (%pattern_type.f4e485.2) = value_param_pattern [template = %x.param_patt.loc4_33.2 (constants.%x.param_patt)]
|
||||
// CHECK:STDOUT: %x.patt.loc4_33.1: @F.%pattern_type (%pattern_type.f4e485.2) = wrapper_binding_pattern x, %x.param_patt.loc4_33.1 [template = %x.patt.loc4_33.2 (constants.%x.patt)]
|
||||
// CHECK:STDOUT: } {
|
||||
@@ -332,59 +345,65 @@ fn F[template T: Core.Destroy](x: T) {
|
||||
// CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
|
||||
// CHECK:STDOUT: %Destroy.ref: type = name_ref Destroy, imports.%Core.Destroy [concrete = constants.%Destroy.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %T.loc4_16.2: %Destroy.type = symbolic_binding T, 0, template [template = %T.loc4_16.1 (constants.%T.0e7)]
|
||||
// CHECK:STDOUT: %x.param: @F.%T.as_type.loc4_35.1 (%T.as_type.700) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc4_35.1: type = splice_block %.loc4_35.2 [template = %T.as_type.loc4_35.1 (constants.%T.as_type.700)] {
|
||||
// CHECK:STDOUT: %T.ref.loc4: %Destroy.type = name_ref T, %T.loc4_16.2 [template = %T.loc4_16.1 (constants.%T.0e7)]
|
||||
// CHECK:STDOUT: %T.as_type.loc4_35.2: type = facet_access_type %T.ref.loc4 [template = %T.as_type.loc4_35.1 (constants.%T.as_type.700)]
|
||||
// CHECK:STDOUT: %.loc4_35.2: type = converted %T.ref.loc4, %T.as_type.loc4_35.2 [template = %T.as_type.loc4_35.1 (constants.%T.as_type.700)]
|
||||
// CHECK:STDOUT: %T.loc4_16.2: %Destroy.type = symbolic_binding T, 0, template [template = %T.loc4_16.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %x.param: @F.%T.as_type.loc4_35.1 (%T.as_type) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc4_35.1: type = splice_block %.loc4_35.2 [template = %T.as_type.loc4_35.1 (constants.%T.as_type)] {
|
||||
// CHECK:STDOUT: %T.ref.loc4: %Destroy.type = name_ref T, %T.loc4_16.2 [template = %T.loc4_16.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %T.as_type.loc4_35.2: type = facet_access_type %T.ref.loc4 [template = %T.as_type.loc4_35.1 (constants.%T.as_type)]
|
||||
// CHECK:STDOUT: %.loc4_35.2: type = converted %T.ref.loc4, %T.as_type.loc4_35.2 [template = %T.as_type.loc4_35.1 (constants.%T.as_type)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: @F.%T.as_type.loc4_35.1 (%T.as_type.700) = wrapper_binding x, %x.param
|
||||
// CHECK:STDOUT: %x: @F.%T.as_type.loc4_35.1 (%T.as_type) = wrapper_binding x, %x.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @F(%T.loc4_16.2: %Destroy.type) {
|
||||
// CHECK:STDOUT: %T.patt.loc4_16.2: %pattern_type.429 = symbolic_binding_pattern T, 0, template [template = %T.patt.loc4_16.2 (constants.%T.patt.351)]
|
||||
// CHECK:STDOUT: %T.loc4_16.1: %Destroy.type = symbolic_binding T, 0, template [template = %T.loc4_16.1 (constants.%T.0e7)]
|
||||
// CHECK:STDOUT: %T.as_type.loc4_35.1: type = facet_access_type %T.loc4_16.1 [template = %T.as_type.loc4_35.1 (constants.%T.as_type.700)]
|
||||
// CHECK:STDOUT: %T.patt.loc4_16.2: %pattern_type.429 = symbolic_binding_pattern T, 0, template [template = %T.patt.loc4_16.2 (constants.%T.patt)]
|
||||
// CHECK:STDOUT: %T.loc4_16.1: %Destroy.type = symbolic_binding T, 0, template [template = %T.loc4_16.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %T.as_type.loc4_35.1: type = facet_access_type %T.loc4_16.1 [template = %T.as_type.loc4_35.1 (constants.%T.as_type)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %T.as_type.loc4_35.1 [template = %pattern_type (constants.%pattern_type.f4e485.2)]
|
||||
// CHECK:STDOUT: %x.param_patt.loc4_33.2: @F.%pattern_type (%pattern_type.f4e485.2) = value_param_pattern [template = %x.param_patt.loc4_33.2 (constants.%x.param_patt)]
|
||||
// CHECK:STDOUT: %x.patt.loc4_33.2: @F.%pattern_type (%pattern_type.f4e485.2) = wrapper_binding_pattern x, %x.param_patt.loc4_33.2 [template = %x.patt.loc4_33.2 (constants.%x.patt)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.as_type.loc4_35.1 [template = %require_complete (constants.%require_complete.14c)]
|
||||
// CHECK:STDOUT: %v.patt.loc14_15.2: @F.%pattern_type (%pattern_type.f4e485.2) = ref_binding_pattern v [template = %v.patt.loc14_15.2 (constants.%v.patt)]
|
||||
// CHECK:STDOUT: %v.var_patt.loc14_3.2: @F.%pattern_type (%pattern_type.f4e485.2) = var_pattern %v.patt.loc14_15.2 [template = %v.var_patt.loc14_3.2 (constants.%v.var_patt)]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.loc14_3.2: type = facet_type <@ImplicitAs, @ImplicitAs(%T.as_type.loc4_35.1)> [template = %ImplicitAs.type.loc14_3.2 (constants.%ImplicitAs.type.f42)]
|
||||
// CHECK:STDOUT: %.loc14_3.5: <instruction> = access_member_action %ImplicitAs.type.loc14_3.1, Convert [template]
|
||||
// CHECK:STDOUT: %.loc14_3.6: type = type_of_inst %.loc14_3.5 [template]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%T.loc4_16.1) [template = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.d3ece9.2)]
|
||||
// CHECK:STDOUT: %.loc14_3.7: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %T.loc4_16.1 [template = %.loc14_3.7 (constants.%.53a)]
|
||||
// CHECK:STDOUT: %Destroy.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc4_16.1, @Destroy [template = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)]
|
||||
// CHECK:STDOUT: %impl.elem0.loc14_3.2: @F.%.loc14_3.7 (%.53a) = impl_witness_access %Destroy.lookup_impl_witness, element0 [template = %impl.elem0.loc14_3.2 (constants.%impl.elem0.0f9)]
|
||||
// CHECK:STDOUT: %specific_impl_fn.loc14_3.2: <specific function> = specific_impl_function %impl.elem0.loc14_3.2, @Destroy.WithSelf.Op(%T.loc4_16.1) [template = %specific_impl_fn.loc14_3.2 (constants.%specific_impl_fn.afc)]
|
||||
// CHECK:STDOUT: %v.patt.loc10_15.2: @F.%pattern_type (%pattern_type.f4e485.2) = ref_binding_pattern v [template = %v.patt.loc10_15.2 (constants.%v.patt)]
|
||||
// CHECK:STDOUT: %v.var_patt.loc10_3.2: @F.%pattern_type (%pattern_type.f4e485.2) = var_pattern %v.patt.loc10_15.2 [template = %v.var_patt.loc10_3.2 (constants.%v.var_patt)]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.loc10_3.2: type = facet_type <@ImplicitAs, @ImplicitAs(%T.as_type.loc4_35.1)> [template = %ImplicitAs.type.loc10_3.2 (constants.%ImplicitAs.type.f42)]
|
||||
// CHECK:STDOUT: %.loc10_3.6: <instruction> = access_member_action %ImplicitAs.type.loc10_3.1, Convert [template]
|
||||
// CHECK:STDOUT: %.loc10_3.7: type = type_of_inst %.loc10_3.6 [template]
|
||||
// CHECK:STDOUT: %.loc10_3.8: <instruction> = compound_member_access_action %int_0, %.loc10_3.1 [template]
|
||||
// CHECK:STDOUT: %.loc10_3.9: type = type_of_inst %.loc10_3.8 [template]
|
||||
// CHECK:STDOUT: %.loc19_3.4: <instruction> = refine_type_action %x.ref, %T.as_type.loc4_35.1 [template]
|
||||
// CHECK:STDOUT: %.loc19_3.5: <instruction> = compound_member_access_action %.loc19_3.1, constants.%assoc0.e1a [template]
|
||||
// CHECK:STDOUT: %.loc19_3.6: type = type_of_inst %.loc19_3.5 [template]
|
||||
// CHECK:STDOUT: %.loc10_3.10: <instruction> = refine_type_action %v.var, %T.as_type.loc4_35.1 [template]
|
||||
// CHECK:STDOUT: %.loc10_3.11: <instruction> = compound_member_access_action %.loc10_3.4, constants.%assoc0.ae8 [template]
|
||||
// CHECK:STDOUT: %.loc10_3.12: type = type_of_inst %.loc10_3.11 [template]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%x.param: @F.%T.as_type.loc4_35.1 (%T.as_type.700)) {
|
||||
// CHECK:STDOUT: fn(%x.param: @F.%T.as_type.loc4_35.1 (%T.as_type)) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %v.var: ref @F.%T.as_type.loc4_35.1 (%T.as_type.700) = var_storage %v.var_patt.loc14_3.1
|
||||
// CHECK:STDOUT: %v.var: ref @F.%T.as_type.loc4_35.1 (%T.as_type) = var_storage %v.var_patt.loc10_3.1
|
||||
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.loc14_3.1: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%T.as_type.700)> [template = %ImplicitAs.type.loc14_3.2 (constants.%ImplicitAs.type.f42)]
|
||||
// CHECK:STDOUT: %.loc14_3.1: @F.%.loc14_3.6 (@F.%.loc14_3.6) = splice_inst %.loc14_3.5
|
||||
// CHECK:STDOUT: %.loc14_3.2: @F.%T.as_type.loc4_35.1 (%T.as_type.700) = converted %int_0, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.loc10_3.1: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%T.as_type)> [template = %ImplicitAs.type.loc10_3.2 (constants.%ImplicitAs.type.f42)]
|
||||
// CHECK:STDOUT: %.loc10_3.1: @F.%.loc10_3.7 (@F.%.loc10_3.7) = splice_inst %.loc10_3.6
|
||||
// CHECK:STDOUT: %.loc10_3.2: @F.%.loc10_3.9 (@F.%.loc10_3.9) = splice_inst %.loc10_3.8
|
||||
// CHECK:STDOUT: %.loc10_3.3: @F.%T.as_type.loc4_35.1 (%T.as_type) = converted %int_0, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: assign %v.var, <error>
|
||||
// CHECK:STDOUT: %.loc14_17.1: type = splice_block %.loc14_17.2 [template = %T.as_type.loc4_35.1 (constants.%T.as_type.700)] {
|
||||
// CHECK:STDOUT: %T.ref.loc14: %Destroy.type = name_ref T, %T.loc4_16.2 [template = %T.loc4_16.1 (constants.%T.0e7)]
|
||||
// CHECK:STDOUT: %T.as_type.loc14: type = facet_access_type %T.ref.loc14 [template = %T.as_type.loc4_35.1 (constants.%T.as_type.700)]
|
||||
// CHECK:STDOUT: %.loc14_17.2: type = converted %T.ref.loc14, %T.as_type.loc14 [template = %T.as_type.loc4_35.1 (constants.%T.as_type.700)]
|
||||
// CHECK:STDOUT: %.loc10_17.1: type = splice_block %.loc10_17.2 [template = %T.as_type.loc4_35.1 (constants.%T.as_type)] {
|
||||
// CHECK:STDOUT: %T.ref.loc10: %Destroy.type = name_ref T, %T.loc4_16.2 [template = %T.loc4_16.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %T.as_type.loc10: type = facet_access_type %T.ref.loc10 [template = %T.as_type.loc4_35.1 (constants.%T.as_type)]
|
||||
// CHECK:STDOUT: %.loc10_17.2: type = converted %T.ref.loc10, %T.as_type.loc10 [template = %T.as_type.loc4_35.1 (constants.%T.as_type)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %v: ref @F.%T.as_type.loc4_35.1 (%T.as_type.700) = wrapper_binding v, %v.var
|
||||
// CHECK:STDOUT: %v: ref @F.%T.as_type.loc4_35.1 (%T.as_type) = wrapper_binding v, %v.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %v.patt.loc14_15.1: @F.%pattern_type (%pattern_type.f4e485.2) = ref_binding_pattern v [template = %v.patt.loc14_15.2 (constants.%v.patt)]
|
||||
// CHECK:STDOUT: %v.var_patt.loc14_3.1: @F.%pattern_type (%pattern_type.f4e485.2) = var_pattern %v.patt.loc14_15.1 [template = %v.var_patt.loc14_3.2 (constants.%v.var_patt)]
|
||||
// CHECK:STDOUT: %v.patt.loc10_15.1: @F.%pattern_type (%pattern_type.f4e485.2) = ref_binding_pattern v [template = %v.patt.loc10_15.2 (constants.%v.patt)]
|
||||
// CHECK:STDOUT: %v.var_patt.loc10_3.1: @F.%pattern_type (%pattern_type.f4e485.2) = var_pattern %v.patt.loc10_15.1 [template = %v.var_patt.loc10_3.2 (constants.%v.var_patt)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %w.var: ref %i32 = var_storage %w.var_patt
|
||||
// CHECK:STDOUT: %x.ref: @F.%T.as_type.loc4_35.1 (%T.as_type.700) = name_ref x, %x
|
||||
// CHECK:STDOUT: %.loc22: %i32 = converted %x.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %x.ref: @F.%T.as_type.loc4_35.1 (%T.as_type) = name_ref x, %x
|
||||
// CHECK:STDOUT: %.loc19_3.1: @F.%T.as_type.loc4_35.1 (%T.as_type) = splice_inst %.loc19_3.4
|
||||
// CHECK:STDOUT: %.loc19_3.2: @F.%.loc19_3.6 (@F.%.loc19_3.6) = splice_inst %.loc19_3.5
|
||||
// CHECK:STDOUT: %.loc19_3.3: %i32 = converted %x.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: assign %w.var, <error>
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %w: ref %i32 = wrapper_binding w, %w.var
|
||||
@@ -394,28 +413,23 @@ fn F[template T: Core.Destroy](x: T) {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %w.var, constants.%Destroy.Op.1a2547.2
|
||||
// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%w.var)
|
||||
// CHECK:STDOUT: %impl.elem0.loc14_3.1: @F.%.loc14_3.7 (%.53a) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [template = %impl.elem0.loc14_3.2 (constants.%impl.elem0.0f9)]
|
||||
// CHECK:STDOUT: %bound_method.loc14_3.1: <bound method> = bound_method %v.var, %impl.elem0.loc14_3.1
|
||||
// CHECK:STDOUT: %.loc14_3.3: %Destroy.type = converted constants.%T.as_type.700, constants.%T.0e7 [template = %T.loc4_16.1 (constants.%T.0e7)]
|
||||
// CHECK:STDOUT: %.loc14_3.4: %Destroy.type = converted constants.%T.as_type.700, constants.%T.0e7 [template = %T.loc4_16.1 (constants.%T.0e7)]
|
||||
// CHECK:STDOUT: %specific_impl_fn.loc14_3.1: <specific function> = specific_impl_function %impl.elem0.loc14_3.1, @Destroy.WithSelf.Op(constants.%T.0e7) [template = %specific_impl_fn.loc14_3.2 (constants.%specific_impl_fn.afc)]
|
||||
// CHECK:STDOUT: %bound_method.loc14_3.2: <bound method> = bound_method %v.var, %specific_impl_fn.loc14_3.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc14_3.2(%v.var)
|
||||
// CHECK:STDOUT: %.loc10_3.4: @F.%T.as_type.loc4_35.1 (%T.as_type) = splice_inst %.loc10_3.10
|
||||
// CHECK:STDOUT: %.loc10_3.5: @F.%.loc10_3.12 (@F.%.loc10_3.12) = splice_inst %.loc10_3.11
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc22_3.1(%self.param: ref %i32.builtin) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc19_3.1(%self.param: ref %i32.builtin) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc22_3.2(%self.param: ref %i32) {
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc19_3.2(%self.param: ref %i32) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @F(constants.%T.0e7) {
|
||||
// CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%T.patt.351
|
||||
// CHECK:STDOUT: %T.loc4_16.1 => constants.%T.0e7
|
||||
// CHECK:STDOUT: %T.as_type.loc4_35.1 => constants.%T.as_type.700
|
||||
// CHECK:STDOUT: specific @F(constants.%T) {
|
||||
// CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%T.patt
|
||||
// CHECK:STDOUT: %T.loc4_16.1 => constants.%T
|
||||
// CHECK:STDOUT: %T.as_type.loc4_35.1 => constants.%T.as_type
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.f4e485.2
|
||||
// CHECK:STDOUT: %x.param_patt.loc4_33.2 => constants.%x.param_patt
|
||||
// CHECK:STDOUT: %x.patt.loc4_33.2 => constants.%x.patt
|
||||
|
||||
+56
-65
@@ -10,12 +10,16 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/generic/template_dependence.carbon
|
||||
|
||||
// --- type.carbon
|
||||
// --- fail_todo_type.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
//@dump-sem-ir-begin
|
||||
fn F[template T: type](x: T**) -> T* {
|
||||
// CHECK:STDERR: fail_todo_type.carbon:[[@LINE+4]]:10: error: value of type `<dependent type>` is not callable [CallToNonCallable]
|
||||
// CHECK:STDERR: return *x;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR:
|
||||
return *x;
|
||||
}
|
||||
//@dump-sem-ir-end
|
||||
@@ -31,118 +35,105 @@ fn F(template T: type, generic U: type) -> (T, U) {
|
||||
//@dump-sem-ir-end
|
||||
|
||||
|
||||
// CHECK:STDOUT: --- type.carbon
|
||||
// CHECK:STDOUT: --- fail_todo_type.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %type: type = facet_type <type> [concrete]
|
||||
// CHECK:STDOUT: %.Self.frozen: %type = symbolic_binding .Self [symbolic_self]
|
||||
// CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
|
||||
// CHECK:STDOUT: %T.patt.d47011.1: %pattern_type.98f = symbolic_binding_pattern T, 0, template [template]
|
||||
// CHECK:STDOUT: %T.67db0b.1: type = symbolic_binding T, 0, template [template]
|
||||
// CHECK:STDOUT: %ptr.e8f8f9.1: type = ptr_type %T.67db0b.1 [template]
|
||||
// CHECK:STDOUT: %ptr.125: type = ptr_type %ptr.e8f8f9.1 [template]
|
||||
// CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0, template [template]
|
||||
// CHECK:STDOUT: %T: type = symbolic_binding T, 0, template [template]
|
||||
// CHECK:STDOUT: %ptr.e8f: type = ptr_type %T [template]
|
||||
// CHECK:STDOUT: %ptr.125: type = ptr_type %ptr.e8f [template]
|
||||
// CHECK:STDOUT: %pattern_type.8bb: type = pattern_type %ptr.125 [template]
|
||||
// CHECK:STDOUT: %x.param_patt: %pattern_type.8bb = value_param_pattern [template]
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type.8bb = wrapper_binding_pattern x, %x.param_patt [template]
|
||||
// CHECK:STDOUT: %.cb6cb9.1: Core.Form = init_form %ptr.e8f8f9.1 [template]
|
||||
// CHECK:STDOUT: %pattern_type.4f4b84.1: type = pattern_type %ptr.e8f8f9.1 [template]
|
||||
// CHECK:STDOUT: %return.param_patt.27f587.1: %pattern_type.4f4b84.1 = out_param_pattern [template]
|
||||
// CHECK:STDOUT: %return.patt.d67: %pattern_type.4f4b84.1 = return_slot_pattern %return.param_patt.27f587.1, %ptr.e8f8f9.1 [template]
|
||||
// CHECK:STDOUT: %.cb6: Core.Form = init_form %ptr.e8f [template]
|
||||
// CHECK:STDOUT: %pattern_type.4f4: type = pattern_type %ptr.e8f [template]
|
||||
// CHECK:STDOUT: %return.param_patt.27f: %pattern_type.4f4 = out_param_pattern [template]
|
||||
// CHECK:STDOUT: %return.patt.d67: %pattern_type.4f4 = return_slot_pattern %return.param_patt.27f, %ptr.e8f [template]
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %require_complete.fbe: <witness> = require_complete_type %ptr.125 [template]
|
||||
// CHECK:STDOUT: %require_complete.ef162c.1: <witness> = require_complete_type %ptr.e8f8f9.1 [template]
|
||||
// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
|
||||
// CHECK:STDOUT: %Copy.lookup_impl_witness.1da: <witness> = lookup_impl_witness %ptr.e8f8f9.1, @Copy [template]
|
||||
// CHECK:STDOUT: %.0e9: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.67db0b.1) [template]
|
||||
// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.e8f8f9.1, (%Copy.lookup_impl_witness.1da) [template]
|
||||
// CHECK:STDOUT: %Copy.WithSelf.Op.type.884: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet) [template]
|
||||
// CHECK:STDOUT: %.be5: type = fn_type_with_self_type %Copy.WithSelf.Op.type.884, %Copy.facet [template]
|
||||
// CHECK:STDOUT: %impl.elem0.484: %.be5 = impl_witness_access %Copy.lookup_impl_witness.1da, element0 [template]
|
||||
// CHECK:STDOUT: %specific_impl_fn.a76: <specific function> = specific_impl_function %impl.elem0.484, @Copy.WithSelf.Op(%Copy.facet) [template]
|
||||
// CHECK:STDOUT: %require_complete.ef1: <witness> = require_complete_type %ptr.e8f [template]
|
||||
// CHECK:STDOUT: %Copy.assoc_type: type = assoc_entity_type @Copy [concrete]
|
||||
// CHECK:STDOUT: %assoc0: %Copy.assoc_type = assoc_entity element0, imports.%Core.import_ref.098 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core.import_ref.098 = import_ref Core//prelude/parts/copy, loc{{\d+_\d+}}, unloaded
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
||||
// CHECK:STDOUT: %T.patt.loc5_16.1: %pattern_type.98f = symbolic_binding_pattern T, 0, template [template = %T.patt.loc5_16.2 (constants.%T.patt.d47011.1)]
|
||||
// CHECK:STDOUT: %T.patt.loc5_16.1: %pattern_type.98f = symbolic_binding_pattern T, 0, template [template = %T.patt.loc5_16.2 (constants.%T.patt)]
|
||||
// CHECK:STDOUT: %x.param_patt.loc5_25.1: @F.%pattern_type.loc5_25 (%pattern_type.8bb) = value_param_pattern [template = %x.param_patt.loc5_25.2 (constants.%x.param_patt)]
|
||||
// CHECK:STDOUT: %x.patt.loc5_25.1: @F.%pattern_type.loc5_25 (%pattern_type.8bb) = wrapper_binding_pattern x, %x.param_patt.loc5_25.1 [template = %x.patt.loc5_25.2 (constants.%x.patt)]
|
||||
// CHECK:STDOUT: %return.param_patt.loc5_36.1: @F.%pattern_type.loc5_36 (%pattern_type.4f4b84.1) = out_param_pattern [template = %return.param_patt.loc5_36.2 (constants.%return.param_patt.27f587.1)]
|
||||
// CHECK:STDOUT: %return.patt.loc5_32.1: @F.%pattern_type.loc5_36 (%pattern_type.4f4b84.1) = return_slot_pattern %return.param_patt.loc5_36.1, %ptr.loc5_36 [template = %return.patt.loc5_32.2 (constants.%return.patt.d67)]
|
||||
// CHECK:STDOUT: %return.param_patt.loc5_36.1: @F.%pattern_type.loc5_36 (%pattern_type.4f4) = out_param_pattern [template = %return.param_patt.loc5_36.2 (constants.%return.param_patt.27f)]
|
||||
// CHECK:STDOUT: %return.patt.loc5_32.1: @F.%pattern_type.loc5_36 (%pattern_type.4f4) = return_slot_pattern %return.param_patt.loc5_36.1, %ptr.loc5_36 [template = %return.patt.loc5_32.2 (constants.%return.patt.d67)]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %T.ref.loc5_35: type = name_ref T, %T.loc5_16.2 [template = %T.loc5_16.1 (constants.%T.67db0b.1)]
|
||||
// CHECK:STDOUT: %ptr.loc5_36: type = ptr_type %T.ref.loc5_35 [template = %ptr.loc5_28.1 (constants.%ptr.e8f8f9.1)]
|
||||
// CHECK:STDOUT: %.loc5_36.2: Core.Form = init_form %ptr.loc5_36 [template = %.loc5_36.1 (constants.%.cb6cb9.1)]
|
||||
// CHECK:STDOUT: %T.ref.loc5_35: type = name_ref T, %T.loc5_16.2 [template = %T.loc5_16.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %ptr.loc5_36: type = ptr_type %T.ref.loc5_35 [template = %ptr.loc5_28.1 (constants.%ptr.e8f)]
|
||||
// CHECK:STDOUT: %.loc5_36.2: Core.Form = init_form %ptr.loc5_36 [template = %.loc5_36.1 (constants.%.cb6)]
|
||||
// CHECK:STDOUT: %.loc5_18.1: type = splice_block %.loc5_18.2 [concrete = type] {
|
||||
// CHECK:STDOUT: %.Self.frozen: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
|
||||
// CHECK:STDOUT: %.loc5_18.2: type = type_literal type [concrete = type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %T.loc5_16.2: type = symbolic_binding T, 0, template [template = %T.loc5_16.1 (constants.%T.67db0b.1)]
|
||||
// CHECK:STDOUT: %T.loc5_16.2: type = symbolic_binding T, 0, template [template = %T.loc5_16.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %x.param: @F.%ptr.loc5_29.1 (%ptr.125) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc5_29: type = splice_block %ptr.loc5_29.2 [template = %ptr.loc5_29.1 (constants.%ptr.125)] {
|
||||
// CHECK:STDOUT: %T.ref.loc5_27: type = name_ref T, %T.loc5_16.2 [template = %T.loc5_16.1 (constants.%T.67db0b.1)]
|
||||
// CHECK:STDOUT: %ptr.loc5_28.2: type = ptr_type %T.ref.loc5_27 [template = %ptr.loc5_28.1 (constants.%ptr.e8f8f9.1)]
|
||||
// CHECK:STDOUT: %T.ref.loc5_27: type = name_ref T, %T.loc5_16.2 [template = %T.loc5_16.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %ptr.loc5_28.2: type = ptr_type %T.ref.loc5_27 [template = %ptr.loc5_28.1 (constants.%ptr.e8f)]
|
||||
// CHECK:STDOUT: %ptr.loc5_29.2: type = ptr_type %ptr.loc5_28.2 [template = %ptr.loc5_29.1 (constants.%ptr.125)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: @F.%ptr.loc5_29.1 (%ptr.125) = wrapper_binding x, %x.param
|
||||
// CHECK:STDOUT: %return.param: ref @F.%ptr.loc5_28.1 (%ptr.e8f8f9.1) = out_param call_param1
|
||||
// CHECK:STDOUT: %return: ref @F.%ptr.loc5_28.1 (%ptr.e8f8f9.1) = return_slot %return.param
|
||||
// CHECK:STDOUT: %return.param: ref @F.%ptr.loc5_28.1 (%ptr.e8f) = out_param call_param1
|
||||
// CHECK:STDOUT: %return: ref @F.%ptr.loc5_28.1 (%ptr.e8f) = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @F(%T.loc5_16.2: type) {
|
||||
// CHECK:STDOUT: %T.patt.loc5_16.2: %pattern_type.98f = symbolic_binding_pattern T, 0, template [template = %T.patt.loc5_16.2 (constants.%T.patt.d47011.1)]
|
||||
// CHECK:STDOUT: %T.loc5_16.1: type = symbolic_binding T, 0, template [template = %T.loc5_16.1 (constants.%T.67db0b.1)]
|
||||
// CHECK:STDOUT: %ptr.loc5_28.1: type = ptr_type %T.loc5_16.1 [template = %ptr.loc5_28.1 (constants.%ptr.e8f8f9.1)]
|
||||
// CHECK:STDOUT: %T.patt.loc5_16.2: %pattern_type.98f = symbolic_binding_pattern T, 0, template [template = %T.patt.loc5_16.2 (constants.%T.patt)]
|
||||
// CHECK:STDOUT: %T.loc5_16.1: type = symbolic_binding T, 0, template [template = %T.loc5_16.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %ptr.loc5_28.1: type = ptr_type %T.loc5_16.1 [template = %ptr.loc5_28.1 (constants.%ptr.e8f)]
|
||||
// CHECK:STDOUT: %ptr.loc5_29.1: type = ptr_type %ptr.loc5_28.1 [template = %ptr.loc5_29.1 (constants.%ptr.125)]
|
||||
// CHECK:STDOUT: %pattern_type.loc5_25: type = pattern_type %ptr.loc5_29.1 [template = %pattern_type.loc5_25 (constants.%pattern_type.8bb)]
|
||||
// CHECK:STDOUT: %x.param_patt.loc5_25.2: @F.%pattern_type.loc5_25 (%pattern_type.8bb) = value_param_pattern [template = %x.param_patt.loc5_25.2 (constants.%x.param_patt)]
|
||||
// CHECK:STDOUT: %x.patt.loc5_25.2: @F.%pattern_type.loc5_25 (%pattern_type.8bb) = wrapper_binding_pattern x, %x.param_patt.loc5_25.2 [template = %x.patt.loc5_25.2 (constants.%x.patt)]
|
||||
// CHECK:STDOUT: %.loc5_36.1: Core.Form = init_form %ptr.loc5_28.1 [template = %.loc5_36.1 (constants.%.cb6cb9.1)]
|
||||
// CHECK:STDOUT: %pattern_type.loc5_36: type = pattern_type %ptr.loc5_28.1 [template = %pattern_type.loc5_36 (constants.%pattern_type.4f4b84.1)]
|
||||
// CHECK:STDOUT: %return.param_patt.loc5_36.2: @F.%pattern_type.loc5_36 (%pattern_type.4f4b84.1) = out_param_pattern [template = %return.param_patt.loc5_36.2 (constants.%return.param_patt.27f587.1)]
|
||||
// CHECK:STDOUT: %return.patt.loc5_32.2: @F.%pattern_type.loc5_36 (%pattern_type.4f4b84.1) = return_slot_pattern %return.param_patt.loc5_36.2, %ptr.loc5_28.1 [template = %return.patt.loc5_32.2 (constants.%return.patt.d67)]
|
||||
// CHECK:STDOUT: %.loc5_36.1: Core.Form = init_form %ptr.loc5_28.1 [template = %.loc5_36.1 (constants.%.cb6)]
|
||||
// CHECK:STDOUT: %pattern_type.loc5_36: type = pattern_type %ptr.loc5_28.1 [template = %pattern_type.loc5_36 (constants.%pattern_type.4f4)]
|
||||
// CHECK:STDOUT: %return.param_patt.loc5_36.2: @F.%pattern_type.loc5_36 (%pattern_type.4f4) = out_param_pattern [template = %return.param_patt.loc5_36.2 (constants.%return.param_patt.27f)]
|
||||
// CHECK:STDOUT: %return.patt.loc5_32.2: @F.%pattern_type.loc5_36 (%pattern_type.4f4) = return_slot_pattern %return.param_patt.loc5_36.2, %ptr.loc5_28.1 [template = %return.patt.loc5_32.2 (constants.%return.patt.d67)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete.loc5_25: <witness> = require_complete_type %ptr.loc5_29.1 [template = %require_complete.loc5_25 (constants.%require_complete.fbe)]
|
||||
// CHECK:STDOUT: %require_complete.loc5_32: <witness> = require_complete_type %ptr.loc5_28.1 [template = %require_complete.loc5_32 (constants.%require_complete.ef162c.1)]
|
||||
// CHECK:STDOUT: %.loc6_10.5: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.loc5_16.1) [template = %.loc6_10.5 (constants.%.0e9)]
|
||||
// CHECK:STDOUT: %Copy.lookup_impl_witness: <witness> = lookup_impl_witness %ptr.loc5_28.1, @Copy [template = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.1da)]
|
||||
// CHECK:STDOUT: %Copy.facet.loc6_10.3: %Copy.type = facet_value %ptr.loc5_28.1, (%Copy.lookup_impl_witness) [template = %Copy.facet.loc6_10.3 (constants.%Copy.facet)]
|
||||
// CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet.loc6_10.3) [template = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.884)]
|
||||
// CHECK:STDOUT: %.loc6_10.6: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %Copy.facet.loc6_10.3 [template = %.loc6_10.6 (constants.%.be5)]
|
||||
// CHECK:STDOUT: %impl.elem0.loc6_10.2: @F.%.loc6_10.6 (%.be5) = impl_witness_access %Copy.lookup_impl_witness, element0 [template = %impl.elem0.loc6_10.2 (constants.%impl.elem0.484)]
|
||||
// CHECK:STDOUT: %specific_impl_fn.loc6_10.2: <specific function> = specific_impl_function %impl.elem0.loc6_10.2, @Copy.WithSelf.Op(%Copy.facet.loc6_10.3) [template = %specific_impl_fn.loc6_10.2 (constants.%specific_impl_fn.a76)]
|
||||
// CHECK:STDOUT: %require_complete.loc5_32: <witness> = require_complete_type %ptr.loc5_28.1 [template = %require_complete.loc5_32 (constants.%require_complete.ef1)]
|
||||
// CHECK:STDOUT: %.loc10_10.5: <instruction> = refine_type_action %.loc10_10.2, %ptr.loc5_28.1 [template]
|
||||
// CHECK:STDOUT: %.loc10_10.6: <instruction> = compound_member_access_action %.loc10_10.3, constants.%assoc0 [template]
|
||||
// CHECK:STDOUT: %.loc10_10.7: type = type_of_inst %.loc10_10.6 [template]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%x.param: @F.%ptr.loc5_29.1 (%ptr.125)) -> out %return.param: @F.%ptr.loc5_28.1 (%ptr.e8f8f9.1) {
|
||||
// CHECK:STDOUT: fn(%x.param: @F.%ptr.loc5_29.1 (%ptr.125)) -> out %return.param: @F.%ptr.loc5_28.1 (%ptr.e8f) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %x.ref: @F.%ptr.loc5_29.1 (%ptr.125) = name_ref x, %x
|
||||
// CHECK:STDOUT: %.loc6_10.1: ref @F.%ptr.loc5_28.1 (%ptr.e8f8f9.1) = deref %x.ref
|
||||
// CHECK:STDOUT: %.loc6_10.2: @F.%ptr.loc5_28.1 (%ptr.e8f8f9.1) = acquire_value %.loc6_10.1
|
||||
// CHECK:STDOUT: %impl.elem0.loc6_10.1: @F.%.loc6_10.6 (%.be5) = impl_witness_access constants.%Copy.lookup_impl_witness.1da, element0 [template = %impl.elem0.loc6_10.2 (constants.%impl.elem0.484)]
|
||||
// CHECK:STDOUT: %bound_method.loc6_10.1: <bound method> = bound_method %.loc6_10.2, %impl.elem0.loc6_10.1
|
||||
// CHECK:STDOUT: %Copy.facet.loc6_10.1: %Copy.type = facet_value constants.%ptr.e8f8f9.1, (constants.%Copy.lookup_impl_witness.1da) [template = %Copy.facet.loc6_10.3 (constants.%Copy.facet)]
|
||||
// CHECK:STDOUT: %.loc6_10.3: %Copy.type = converted constants.%ptr.e8f8f9.1, %Copy.facet.loc6_10.1 [template = %Copy.facet.loc6_10.3 (constants.%Copy.facet)]
|
||||
// CHECK:STDOUT: %Copy.facet.loc6_10.2: %Copy.type = facet_value constants.%ptr.e8f8f9.1, (constants.%Copy.lookup_impl_witness.1da) [template = %Copy.facet.loc6_10.3 (constants.%Copy.facet)]
|
||||
// CHECK:STDOUT: %.loc6_10.4: %Copy.type = converted constants.%ptr.e8f8f9.1, %Copy.facet.loc6_10.2 [template = %Copy.facet.loc6_10.3 (constants.%Copy.facet)]
|
||||
// CHECK:STDOUT: %specific_impl_fn.loc6_10.1: <specific function> = specific_impl_function %impl.elem0.loc6_10.1, @Copy.WithSelf.Op(constants.%Copy.facet) [template = %specific_impl_fn.loc6_10.2 (constants.%specific_impl_fn.a76)]
|
||||
// CHECK:STDOUT: %bound_method.loc6_10.2: <bound method> = bound_method %.loc6_10.2, %specific_impl_fn.loc6_10.1
|
||||
// CHECK:STDOUT: %Copy.WithSelf.Op.call: init @F.%ptr.loc5_28.1 (%ptr.e8f8f9.1) = call %bound_method.loc6_10.2(%.loc6_10.2)
|
||||
// CHECK:STDOUT: return %Copy.WithSelf.Op.call
|
||||
// CHECK:STDOUT: %.loc10_10.1: ref @F.%ptr.loc5_28.1 (%ptr.e8f) = deref %x.ref
|
||||
// CHECK:STDOUT: %.loc10_10.2: @F.%ptr.loc5_28.1 (%ptr.e8f) = acquire_value %.loc10_10.1
|
||||
// CHECK:STDOUT: %.loc10_10.3: @F.%ptr.loc5_28.1 (%ptr.e8f) = splice_inst %.loc10_10.5
|
||||
// CHECK:STDOUT: %.loc10_10.4: @F.%.loc10_10.7 (@F.%.loc10_10.7) = splice_inst %.loc10_10.6
|
||||
// CHECK:STDOUT: return <error>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @F(constants.%T.67db0b.1) {
|
||||
// CHECK:STDOUT: %T.patt.loc5_16.2 => constants.%T.patt.d47011.1
|
||||
// CHECK:STDOUT: %T.loc5_16.1 => constants.%T.67db0b.1
|
||||
// CHECK:STDOUT: %ptr.loc5_28.1 => constants.%ptr.e8f8f9.1
|
||||
// CHECK:STDOUT: specific @F(constants.%T) {
|
||||
// CHECK:STDOUT: %T.patt.loc5_16.2 => constants.%T.patt
|
||||
// CHECK:STDOUT: %T.loc5_16.1 => constants.%T
|
||||
// CHECK:STDOUT: %ptr.loc5_28.1 => constants.%ptr.e8f
|
||||
// CHECK:STDOUT: %ptr.loc5_29.1 => constants.%ptr.125
|
||||
// CHECK:STDOUT: %pattern_type.loc5_25 => constants.%pattern_type.8bb
|
||||
// CHECK:STDOUT: %x.param_patt.loc5_25.2 => constants.%x.param_patt
|
||||
// CHECK:STDOUT: %x.patt.loc5_25.2 => constants.%x.patt
|
||||
// CHECK:STDOUT: %.loc5_36.1 => constants.%.cb6cb9.1
|
||||
// CHECK:STDOUT: %pattern_type.loc5_36 => constants.%pattern_type.4f4b84.1
|
||||
// CHECK:STDOUT: %return.param_patt.loc5_36.2 => constants.%return.param_patt.27f587.1
|
||||
// CHECK:STDOUT: %.loc5_36.1 => constants.%.cb6
|
||||
// CHECK:STDOUT: %pattern_type.loc5_36 => constants.%pattern_type.4f4
|
||||
// CHECK:STDOUT: %return.param_patt.loc5_36.2 => constants.%return.param_patt.27f
|
||||
// CHECK:STDOUT: %return.patt.loc5_32.2 => constants.%return.patt.d67
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -52,6 +52,7 @@ CARBON_SEM_IR_INST_KIND(ClassElementAccess)
|
||||
CARBON_SEM_IR_INST_KIND(ClassInit)
|
||||
CARBON_SEM_IR_INST_KIND(ClassType)
|
||||
CARBON_SEM_IR_INST_KIND(CompleteTypeWitness)
|
||||
CARBON_SEM_IR_INST_KIND(CompoundMemberAccessAction)
|
||||
CARBON_SEM_IR_INST_KIND(ConstType)
|
||||
CARBON_SEM_IR_INST_KIND(ConvertToValueAction)
|
||||
CARBON_SEM_IR_INST_KIND(Converted)
|
||||
|
||||
@@ -530,6 +530,20 @@ struct CompleteTypeWitness {
|
||||
TypeInstId object_repr_type_inst_id;
|
||||
};
|
||||
|
||||
// An action that performs compound member access.
|
||||
struct CompoundMemberAccessAction {
|
||||
static constexpr auto Kind =
|
||||
InstKind::CompoundMemberAccessAction.Define<Parse::NodeId>(
|
||||
{.ir_name = "compound_member_access_action",
|
||||
.expr_category = ActionExprCategory(ExprCategory::Dependent),
|
||||
.constant_kind = InstConstantKind::InstAction,
|
||||
.is_lowered = false});
|
||||
|
||||
TypeId type_id;
|
||||
MetaInstId base_id;
|
||||
MetaInstId member_expr_id;
|
||||
};
|
||||
|
||||
// Indicates `const` on a type, such as `var x: const i32`.
|
||||
struct ConstType {
|
||||
static constexpr auto Kind =
|
||||
|
||||
Reference in New Issue
Block a user