Skip to content

Commit

Permalink
Make ImplDecls evaluate to themselves. (carbon-language#4352)
Browse files Browse the repository at this point in the history
Change ImplDecls so they evaluate to themselves in general, rather than
having a special case in import handling that pretends that they do.
  • Loading branch information
zygoloid authored Sep 27, 2024
1 parent 9d1d8d7 commit 5ab957d
Show file tree
Hide file tree
Showing 67 changed files with 138 additions and 146 deletions.
6 changes: 4 additions & 2 deletions toolchain/check/eval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1278,6 +1278,7 @@ static auto TryEvalInstInContext(EvalContext& eval_context,
.specific_id = SemIR::SpecificId::Invalid},
Phase::Template);
}

case CARBON_KIND(SemIR::InterfaceDecl interface_decl): {
// If the interface has generic parameters, we don't produce an interface
// type, but a callable whose return value is an interface type.
Expand Down Expand Up @@ -1311,10 +1312,12 @@ static auto TryEvalInstInContext(EvalContext& eval_context,
// These cases are treated as being the unique canonical definition of the
// corresponding constant value.
// TODO: This doesn't properly handle redeclarations. Consider adding a
// corresponding `Value` inst for each of these cases.
// corresponding `Value` inst for each of these cases, or returning the
// first declaration.
case SemIR::AssociatedConstantDecl::Kind:
case SemIR::BaseDecl::Kind:
case SemIR::FieldDecl::Kind:
case SemIR::ImplDecl::Kind:
case SemIR::Namespace::Kind:
return SemIR::ConstantId::ForTemplateConstant(inst_id);

Expand Down Expand Up @@ -1451,7 +1454,6 @@ static auto TryEvalInstInContext(EvalContext& eval_context,
case SemIR::Branch::Kind:
case SemIR::BranchIf::Kind:
case SemIR::BranchWithArg::Kind:
case SemIR::ImplDecl::Kind:
case SemIR::ImportDecl::Kind:
case SemIR::Param::Kind:
case SemIR::RequirementEquivalent::Kind:
Expand Down
20 changes: 1 addition & 19 deletions toolchain/check/import_ref.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1580,24 +1580,6 @@ class ImportRefResolver {
context_.types().GetConstantId(interface_val.type_id()));
}

// Forms a constant ID that represents the given instruction ID that denotes
// an impl declaration. Impl declarations don't have a constant value, but for
// the purposes of importing we pretend that they do.
//
// TODO: Consider alternative options here. We could make impl declarations
// actually evaluate to themselves to avoid this hack.
static auto ImplDeclIdAsConstantId(SemIR::InstId impl_decl_id)
-> SemIR::ConstantId {
return SemIR::ConstantId::ForTemplateConstant(impl_decl_id);
}

// Gets the instruction ID for an impl declaration represented by the
// specified constant ID.
auto ConstantIdAsImplDeclId(SemIR::ConstantId impl_const_id)
-> SemIR::InstId {
return context_.constant_values().GetInstId(impl_const_id);
}

// Make a declaration of an impl. This is done as a separate step from
// importing the impl definition in order to resolve cycles.
auto MakeImplDeclaration(const SemIR::Impl& import_impl)
Expand All @@ -1615,7 +1597,7 @@ class ImportRefResolver {

// Write the impl ID into the ImplDecl.
context_.ReplaceInstBeforeConstantUse(impl_decl_id, impl_decl);
return {impl_decl.impl_id, ImplDeclIdAsConstantId(impl_decl_id)};
return {impl_decl.impl_id, context_.constant_values().Get(impl_decl_id)};
}

// Imports the definition of an impl.
Expand Down
4 changes: 2 additions & 2 deletions toolchain/check/testdata/as/overloaded.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ let n: i32 = ((4 as i32) as X) as i32;
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} {}
// CHECK:STDOUT: impl_decl @impl.1 {} {
// CHECK:STDOUT: impl_decl @impl.1 [template] {} {
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc15_6.1: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc15_6.2: type = converted %int.make_type_32, %.loc15_6.1 [template = i32]
Expand All @@ -103,7 +103,7 @@ let n: i32 = ((4 as i32) as X) as i32;
// CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X]
// CHECK:STDOUT: %.loc15_20: type = interface_type @As, @As(constants.%X) [template = constants.%.8]
// CHECK:STDOUT: }
// CHECK:STDOUT: impl_decl @impl.2 {} {
// CHECK:STDOUT: impl_decl @impl.2 [template] {} {
// CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X]
// CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [template = imports.%Core]
// CHECK:STDOUT: %As.ref: %As.type = name_ref As, imports.%import_ref.2 [template = constants.%As]
Expand Down
2 changes: 1 addition & 1 deletion toolchain/check/testdata/function/builtin/method.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ var arr: [i32; 1.(I.F)(2)];
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} {}
// CHECK:STDOUT: impl_decl @impl {} {
// CHECK:STDOUT: impl_decl @impl [template] {} {
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc15_6.1: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc15_6.2: type = converted %int.make_type_32, %.loc15_6.1 [template = i32]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
// CHECK:STDOUT: .arr = %arr
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: impl_decl @impl {} {
// CHECK:STDOUT: impl_decl @impl [template] {} {
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc6_6.1: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc6_6.2: type = converted %int.make_type_32, %.loc6_6.1 [template = i32]
Expand Down
2 changes: 1 addition & 1 deletion toolchain/check/testdata/impl/compound.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ fn InstanceCallIndirect(p: i32*) {
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Simple.decl: type = interface_decl @Simple [template = constants.%.1] {} {}
// CHECK:STDOUT: impl_decl @impl {} {
// CHECK:STDOUT: impl_decl @impl [template] {} {
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc16_6.1: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc16_6.2: type = converted %int.make_type_32, %.loc16_6.1 [template = i32]
Expand Down
2 changes: 1 addition & 1 deletion toolchain/check/testdata/impl/declaration.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl i32 as I;
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} {}
// CHECK:STDOUT: impl_decl @impl {} {
// CHECK:STDOUT: impl_decl @impl [template] {} {
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc13_6.1: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc13_6.2: type = converted %int.make_type_32, %.loc13_6.1 [template = i32]
Expand Down
2 changes: 1 addition & 1 deletion toolchain/check/testdata/impl/empty.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl i32 as Empty {
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Empty.decl: type = interface_decl @Empty [template = constants.%.1] {} {}
// CHECK:STDOUT: impl_decl @impl {} {
// CHECK:STDOUT: impl_decl @impl [template] {} {
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc14_6.1: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc14_6.2: type = converted %int.make_type_32, %.loc14_6.1 [template = i32]
Expand Down
2 changes: 1 addition & 1 deletion toolchain/check/testdata/impl/extend_impl.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ fn G(c: C) {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @C {
// CHECK:STDOUT: impl_decl @impl {} {
// CHECK:STDOUT: impl_decl @impl [template] {} {
// CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [template = constants.%.1]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc19: <witness> = complete_type_witness %.6 [template = constants.%.7]
Expand Down
2 changes: 1 addition & 1 deletion toolchain/check/testdata/impl/fail_call_invalid.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fn InstanceCall(n: i32) {
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Simple.decl: type = interface_decl @Simple [template = constants.%.1] {} {}
// CHECK:STDOUT: impl_decl @impl {} {
// CHECK:STDOUT: impl_decl @impl [template] {} {
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc15_6.1: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc15_6.2: type = converted %int.make_type_32, %.loc15_6.1 [template = i32]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class C {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @C {
// CHECK:STDOUT: impl_decl @impl {
// CHECK:STDOUT: impl_decl @impl [template] {
// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0
// CHECK:STDOUT: } {
// CHECK:STDOUT: %T.param: type = param T, runtime_param<invalid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ extend impl i32 as I {}
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} {}
// CHECK:STDOUT: impl_decl @impl {} {
// CHECK:STDOUT: impl_decl @impl [template] {} {
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc16_13.1: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc16_13.2: type = converted %int.make_type_32, %.loc16_13.1 [template = i32]
Expand Down
6 changes: 3 additions & 3 deletions toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class E {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @C {
// CHECK:STDOUT: impl_decl @impl.1 {} {
// CHECK:STDOUT: impl_decl @impl.1 [template] {} {
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc18_15.1: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc18_15.2: type = converted %int.make_type_32, %.loc18_15.1 [template = i32]
Expand All @@ -124,7 +124,7 @@ class E {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @D {
// CHECK:STDOUT: impl_decl @impl.2 {} {
// CHECK:STDOUT: impl_decl @impl.2 [template] {} {
// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D]
// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1]
// CHECK:STDOUT: }
Expand All @@ -136,7 +136,7 @@ class E {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @E {
// CHECK:STDOUT: impl_decl @impl.3 {} {
// CHECK:STDOUT: impl_decl @impl.3 [template] {} {
// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%E [template = constants.%E]
// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1]
// CHECK:STDOUT: }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class C {
// CHECK:STDOUT: class @C {
// CHECK:STDOUT: %.loc15_18.1: type = value_of_initializer @impl.%int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc15_18.2: type = converted @impl.%int.make_type_32, %.loc15_18.1 [template = i32]
// CHECK:STDOUT: impl_decl @impl {} {
// CHECK:STDOUT: impl_decl @impl [template] {} {
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc16: <witness> = complete_type_witness %.2 [template = constants.%.3]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ interface I {
// CHECK:STDOUT: !definition:
// CHECK:STDOUT:
// CHECK:STDOUT: class {
// CHECK:STDOUT: impl_decl @impl {} {
// CHECK:STDOUT: impl_decl @impl [template] {} {
// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc20: <witness> = complete_type_witness %.2 [template = constants.%.3]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class C {
// CHECK:STDOUT: impl @impl: %C as %.1;
// CHECK:STDOUT:
// CHECK:STDOUT: class @C {
// CHECK:STDOUT: impl_decl @impl {} {
// CHECK:STDOUT: impl_decl @impl [template] {} {
// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc21: <witness> = complete_type_witness %.2 [template = constants.%.3]
Expand Down
2 changes: 1 addition & 1 deletion toolchain/check/testdata/impl/fail_impl_as_scope.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ impl as Simple {
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Simple.decl: type = interface_decl @Simple [template = constants.%.1] {} {}
// CHECK:STDOUT: impl_decl @impl {} {
// CHECK:STDOUT: impl_decl @impl [template] {} {
// CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%.1]
// CHECK:STDOUT: }
// CHECK:STDOUT: }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl bool as I {}
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} {}
// CHECK:STDOUT: impl_decl @impl {} {
// CHECK:STDOUT: impl_decl @impl [template] {} {
// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool]
// CHECK:STDOUT: %.loc16_6.1: type = value_of_initializer %bool.make_type [template = bool]
// CHECK:STDOUT: %.loc16_6.2: type = converted %bool.make_type, %.loc16_6.1 [template = bool]
Expand Down
30 changes: 15 additions & 15 deletions toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ class SelfNestedBadReturnType {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @NoF {
// CHECK:STDOUT: impl_decl @impl.1 {} {
// CHECK:STDOUT: impl_decl @impl.1 [template] {} {
// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc22: <witness> = complete_type_witness %.5 [template = constants.%.6]
Expand All @@ -744,7 +744,7 @@ class SelfNestedBadReturnType {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @FNotFunction {
// CHECK:STDOUT: impl_decl @impl.2 {} {
// CHECK:STDOUT: impl_decl @impl.2 [template] {} {
// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc35: <witness> = complete_type_witness %.5 [template = constants.%.6]
Expand All @@ -756,7 +756,7 @@ class SelfNestedBadReturnType {
// CHECK:STDOUT: class @F.16;
// CHECK:STDOUT:
// CHECK:STDOUT: class @FAlias {
// CHECK:STDOUT: impl_decl @impl.3 {} {
// CHECK:STDOUT: impl_decl @impl.3 [template] {} {
// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc51: <witness> = complete_type_witness %.5 [template = constants.%.6]
Expand All @@ -766,7 +766,7 @@ class SelfNestedBadReturnType {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @FExtraParam {
// CHECK:STDOUT: impl_decl @impl.4 {} {
// CHECK:STDOUT: impl_decl @impl.4 [template] {} {
// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc64: <witness> = complete_type_witness %.5 [template = constants.%.6]
Expand All @@ -776,7 +776,7 @@ class SelfNestedBadReturnType {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @FExtraImplicitParam {
// CHECK:STDOUT: impl_decl @impl.5 {} {
// CHECK:STDOUT: impl_decl @impl.5 [template] {} {
// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc77: <witness> = complete_type_witness %.5 [template = constants.%.6]
Expand All @@ -786,7 +786,7 @@ class SelfNestedBadReturnType {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @FExtraReturnType {
// CHECK:STDOUT: impl_decl @impl.6 {} {
// CHECK:STDOUT: impl_decl @impl.6 [template] {} {
// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc91: <witness> = complete_type_witness %.5 [template = constants.%.6]
Expand All @@ -796,7 +796,7 @@ class SelfNestedBadReturnType {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @FMissingParam {
// CHECK:STDOUT: impl_decl @impl.7 {} {
// CHECK:STDOUT: impl_decl @impl.7 [template] {} {
// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.7]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc106: <witness> = complete_type_witness %.5 [template = constants.%.6]
Expand All @@ -806,7 +806,7 @@ class SelfNestedBadReturnType {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @FMissingImplicitParam {
// CHECK:STDOUT: impl_decl @impl.8 {} {
// CHECK:STDOUT: impl_decl @impl.8 [template] {} {
// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.7]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc119: <witness> = complete_type_witness %.5 [template = constants.%.6]
Expand All @@ -816,7 +816,7 @@ class SelfNestedBadReturnType {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @FMissingReturnType {
// CHECK:STDOUT: impl_decl @impl.9 {} {
// CHECK:STDOUT: impl_decl @impl.9 [template] {} {
// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.7]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc132: <witness> = complete_type_witness %.5 [template = constants.%.6]
Expand All @@ -826,7 +826,7 @@ class SelfNestedBadReturnType {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @FDifferentParamType {
// CHECK:STDOUT: impl_decl @impl.10 {} {
// CHECK:STDOUT: impl_decl @impl.10 [template] {} {
// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.7]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc145: <witness> = complete_type_witness %.5 [template = constants.%.6]
Expand All @@ -836,7 +836,7 @@ class SelfNestedBadReturnType {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @FDifferentImplicitParamType {
// CHECK:STDOUT: impl_decl @impl.11 {} {
// CHECK:STDOUT: impl_decl @impl.11 [template] {} {
// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.7]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc158: <witness> = complete_type_witness %.5 [template = constants.%.6]
Expand All @@ -846,7 +846,7 @@ class SelfNestedBadReturnType {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @FDifferentReturnType {
// CHECK:STDOUT: impl_decl @impl.12 {} {
// CHECK:STDOUT: impl_decl @impl.12 [template] {} {
// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.7]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc171: <witness> = complete_type_witness %.5 [template = constants.%.6]
Expand All @@ -856,7 +856,7 @@ class SelfNestedBadReturnType {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @FDifferentParamName {
// CHECK:STDOUT: impl_decl @impl.13 {} {
// CHECK:STDOUT: impl_decl @impl.13 [template] {} {
// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.7]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc185: <witness> = complete_type_witness %.5 [template = constants.%.6]
Expand All @@ -866,7 +866,7 @@ class SelfNestedBadReturnType {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @SelfNestedBadParam {
// CHECK:STDOUT: impl_decl @impl.14 {} {
// CHECK:STDOUT: impl_decl @impl.14 [template] {} {
// CHECK:STDOUT: %SelfNested.ref: type = name_ref SelfNested, file.%SelfNested.decl [template = constants.%.10]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc202: <witness> = complete_type_witness %.5 [template = constants.%.6]
Expand All @@ -876,7 +876,7 @@ class SelfNestedBadReturnType {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @SelfNestedBadReturnType {
// CHECK:STDOUT: impl_decl @impl.15 {} {
// CHECK:STDOUT: impl_decl @impl.15 [template] {} {
// CHECK:STDOUT: %SelfNested.ref: type = name_ref SelfNested, file.%SelfNested.decl [template = constants.%.10]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc214: <witness> = complete_type_witness %.5 [template = constants.%.6]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ impl i32 as false {}
// CHECK:STDOUT: %.loc21_13.2: %.7 = specific_constant imports.%import_ref.4, @ImplicitAs(type) [template = constants.%.8]
// CHECK:STDOUT: %Convert.ref: %.7 = name_ref Convert, %.loc21_13.2 [template = constants.%.8]
// CHECK:STDOUT: %.loc21_13.3: type = converted @impl.%.loc21_13, <error> [template = <error>]
// CHECK:STDOUT: impl_decl @impl {} {
// CHECK:STDOUT: impl_decl @impl [template] {} {
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc21_6.1: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc21_6.2: type = converted %int.make_type_32, %.loc21_6.1 [template = i32]
Expand Down
Loading

0 comments on commit 5ab957d

Please sign in to comment.