Start every diagnostic with a single message attached to the code (#8102)

This is the final step in landing the _structural_ updates to diagnostic
rendering.

The key idea here is that we want the primary diagnostic to have a
message clearly explaining the problem and attached to the code that has
that problem. This should be the starting point for readers working to
address the issue, but is rendered attached to the code snippet in
question so errors are always "in context" of the code with the error.
Everything else in a diagnostic is an additional label attached to code
to explain or help the reader understand the problem in the primary
message.

Previously, `ContextScope` resulted in some confusion here, as
diagnostic consumers turned messages into labels and made the message in
the context scope the message. In essence, this isn't a scope with
context _for_ a diagnostic (with two exceptions that should probably
have been an `AnnotationScope`), but a context within `check` where we
have a preferred message for a diagnostic emitted by general purpose
code we call into. For example, "class was forward declared here" starts
as an error, and then consumers render it as a label to make the message
from the context scope the error. We also grew an `AnnotationScope` to
handle the contextual information we want to show for a diagnostic (what
I would have assumed `ContextScope` actually did).

Now we have a `Diagnoser`: code in `check` that can better explain the
problem than shared logic it is calling into passes a callback that
builds a caller-specific diagnostic. The callee then can attach relevant
labels and emit it. Diagnostics no longer store `contexts` and consumers
no longer need the logic to restructure things. We move all (but two) of
the old contexts to be normal messages emitted in this way, and we move
some diagnostics to become labels. Each of the new normal messages
corresponds to a new diagnostic kind as usual. Common code following
this pattern now _requires_ the `Diagnoser` to be passed (or emit
nothing), and this uncovered three places where an empty context was
used that made the rendered form miss key information. All three are
fixed with new diagnostics, one already covered by tests, and two with
TODOs to add test coverage.

We also completely remove the old `ContextScope` and
`CARBON_DIAGNOSTIC_CONTEXT` and rename `AnnotationScope` to
`ContextScope`. It is only used to attach information about when/where a
diagnostic occurred.

Labels also no longer have categories. What were `Primary` are now
`ExtraRange`s on the diagnostic rather than labels. Labels are now
always informational.

`DeclaredName` now narrows the range of a label when the range is a
declaration of a named entity to only be the range of that name. For
entities that don't have a declared name, the entire declaration remains
the range. The code building and emitting these diagnostics can skip
them if the declared location isn't distinct from the diagnostic
location.

Wording is largely unchanged here so we can just review the _structural_
change. #7991 iterates using this to improve locations and adds missing
labels. A subsequent PR will iterate on the wording to increasingly fit
within this structural model.

This is separated out as a way to review incrementally, and so that
subsequently we don't have to review wording improvements that only make
sense in a new structure that you cannot see yet. It seems easier to
look at the structure here even with awkward wording.

Assisted-by: Claude Code
This commit is contained in:
Chandler Carruth authored and GitHub committed 2026-11-22 05:19:35 +00:00
1 parent 4729b4473b
commit 0072b28129
378 files changed
+5795 -6998

No files matched your search

@@ -30,13 +30,11 @@ library "[[@TEST_NAME]]";
class C {}
class D {}
// CHECK:STDERR: ╭─┤ fail_type_mismatch.carbon:[[@LINE+9]]:13
// CHECK:STDERR: ╭─┤ fail_type_mismatch.carbon:[[@LINE+7]]:13
// CHECK:STDERR: -> │ fn K(x: C = {} as D);
// CHECK:STDERR: · ━┳━━━━━
// CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `D` to `C`
// CHECK:STDERR: · │ ┃ [ConversionFailure]
// CHECK:STDERR: · ╰────┤ type `D` does not implement interface `Core.ImplicitAs(C)`
// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext]
// CHECK:STDERR: · ┃ [ConversionFailure]
// CHECK:STDERR: ╰────
// CHECK:STDERR:
fn K(x: C = {} as D);
@@ -137,13 +135,11 @@ impl C as Core.As(D) {
fn Convert(unused self: C) -> D { return {} as D; }
}
// CHECK:STDERR: ╭─┤ fail_explicit_conversion_not_supported.carbon:[[@LINE+9]]:13
// CHECK:STDERR: ╭─┤ fail_explicit_conversion_not_supported.carbon:[[@LINE+7]]:13
// CHECK:STDERR: -> │ fn F(a: D = {} as C);
// CHECK:STDERR: · ━┳━━━━━
// CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `C` to `D`
// CHECK:STDERR: · │ ┃ [ConversionFailure]
// CHECK:STDERR: · ╰────┤ type `C` does not implement interface `Core.ImplicitAs(D)`
// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext]
// CHECK:STDERR: · ┃ [ConversionFailure]
// CHECK:STDERR: ╰────
// CHECK:STDERR:
fn F(a: D = {} as C);
@@ -31,8 +31,8 @@ library "[[@TEST_NAME]]";
extern fn F();
// CHECK:STDERR: ╭─┤ fail_redecl.carbon:[[@LINE+10]]:1
// CHECK:STDERR: │ extern fn F();
// CHECK:STDERR: · ───────┬──────
// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl]
// CHECK:STDERR: · ┬
// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl]
// CHECK:STDERR: ┆
// CHECK:STDERR: -> │ extern fn F();
// CHECK:STDERR: · ━━━━━━━┳━━━━━━
@@ -48,8 +48,8 @@ library "[[@TEST_NAME]]";
extern fn F();
// CHECK:STDERR: ╭─┤ fail_redecl_extern.carbon:[[@LINE+10]]:1
// CHECK:STDERR: │ extern fn F();
// CHECK:STDERR: · ───────┬──────
// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl]
// CHECK:STDERR: · ┬
// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl]
// CHECK:STDERR: ┆
// CHECK:STDERR: -> │ fn F();
// CHECK:STDERR: · ━━━┳━━━
@@ -95,8 +95,8 @@ import library "basic";
// CHECK:STDERR: ┆
// CHECK:STDERR: ├─┤ basic.carbon
// CHECK:STDERR: │ extern fn F();
// CHECK:STDERR: · ───────┬──────
// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl]
// CHECK:STDERR: · ┬
// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl]
// CHECK:STDERR: ╰────
// CHECK:STDERR:
extern library "basic" fn F();
@@ -54,7 +54,7 @@ library "[[@TEST_NAME]]";
import library "extern_library";
// CHECK:STDERR: ╭─┤ fail_extern_library_nonextern.carbon:[[@LINE+12]]:1
// CHECK:STDERR: ╭─┤ fail_extern_library_nonextern.carbon:[[@LINE+13]]:1
// CHECK:STDERR: -> │ fn F();
// CHECK:STDERR: · ━━━┳━━━
// CHECK:STDERR: · ┗━━┫ error: redeclarations of `fn F` must match use of `extern`
@@ -62,8 +62,9 @@ import library "extern_library";
// CHECK:STDERR: ┆
// CHECK:STDERR: ├─┤ extern_library.carbon
// CHECK:STDERR: │ extern library "extern_library_owner" fn F();
// CHECK:STDERR: · ──────────────────────┬──────────────────────
// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl]
// CHECK:STDERR: · ┬
// CHECK:STDERR: · ╰──┤ previously declared here
// CHECK:STDERR: · │ [RedeclPrevDecl]
// CHECK:STDERR: ╰────
// CHECK:STDERR:
fn F();
@@ -95,7 +96,7 @@ extern library "extern_library_owner" fn F();
library "[[@TEST_NAME]]";
// CHECK:STDERR: ╷ ╭── imported from: fail_extern_library_collision.carbon [InImport]
// CHECK:STDERR: ├─┤ extern_library_copy.carbon:[[@LINE+12]]:1
// CHECK:STDERR: ├─┤ extern_library_copy.carbon:[[@LINE+13]]:1
// CHECK:STDERR: -> │ extern library "extern_library_owner" fn F();
// CHECK:STDERR: · ━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━
// CHECK:STDERR: · ┗━━┫ error: duplicate name `F` being declared in the same scope
@@ -103,8 +104,9 @@ library "[[@TEST_NAME]]";
// CHECK:STDERR: ┆
// CHECK:STDERR: ├─┤ extern_library.carbon
// CHECK:STDERR: │ extern library "extern_library_owner" fn F();
// CHECK:STDERR: · ──────────────────────┬──────────────────────
// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious]
// CHECK:STDERR: · ┬
// CHECK:STDERR: · ╰──┤ name is previously declared here
// CHECK:STDERR: · │ [NameDeclPrevious]
// CHECK:STDERR: ╰────
// CHECK:STDERR:
extern library "extern_library_owner" fn F();
@@ -178,7 +180,7 @@ import library "extern_of_import";
// CHECK:STDERR: ┆
// CHECK:STDERR: ├─┤ extern_of_import.carbon
// CHECK:STDERR: │ fn F();
// CHECK:STDERR: · ───┬───
// CHECK:STDERR: · ┬
// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl]
// CHECK:STDERR: ╰────
// CHECK:STDERR:
@@ -27,8 +27,8 @@ fn ReturnDUsed() -> D;
fn Call() {
// CHECK:STDERR: ╭─┤ fail_incomplete_return.carbon:[[@LINE+15]]:3
// CHECK:STDERR: │ class C;
// CHECK:STDERR: · ────┬───
// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere]
// CHECK:STDERR: · ┬
// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere]
// CHECK:STDERR: ┆
// CHECK:STDERR: │ fn ReturnCUsed() -> C;
// CHECK:STDERR: · ──┬─
@@ -43,8 +43,8 @@ fn Call() {
ReturnCUsed();
// CHECK:STDERR: ╭─┤ fail_incomplete_return.carbon:[[@LINE+15]]:3
// CHECK:STDERR: │ class D;
// CHECK:STDERR: · ────┬───
// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere]
// CHECK:STDERR: · ┬
// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere]
// CHECK:STDERR: ┆
// CHECK:STDERR: │ fn ReturnDUsed() -> D;
// CHECK:STDERR: · ──┬─
@@ -68,17 +68,16 @@ library "[[@TEST_NAME]]";
import library "incomplete_return";
fn CallFAndGIncomplete() {
// CHECK:STDERR: ╭─┤ fail_use_imported.carbon:[[@LINE+17]]:3
// CHECK:STDERR: ╭─┤ fail_use_imported.carbon:[[@LINE+16]]:3
// CHECK:STDERR: -> │ ReturnCUnused();
// CHECK:STDERR: · ━━━━━━━┳━━━━━━━
// CHECK:STDERR: · ┗━━┫ error: function returns incomplete type `C`
// CHECK:STDERR: · ┃ [IncompleteTypeInFunctionReturnType]
// CHECK:STDERR: ┆
// CHECK:STDERR: │ ╭── imported from: fail_use_imported.carbon [InImport]
// CHECK:STDERR: ├─┤ fail_incomplete_return.carbon
// CHECK:STDERR: │ class C;
// CHECK:STDERR: · ────┬───
// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere]
// CHECK:STDERR: · ┬
// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere]
// CHECK:STDERR: ┆
// CHECK:STDERR: │ fn ReturnCUnused() -> C;
// CHECK:STDERR: · ──┬─
@@ -86,17 +85,16 @@ fn CallFAndGIncomplete() {
// CHECK:STDERR: ╰────
// CHECK:STDERR:
ReturnCUnused();
// CHECK:STDERR: ╭─┤ fail_use_imported.carbon:[[@LINE+17]]:3
// CHECK:STDERR: ╭─┤ fail_use_imported.carbon:[[@LINE+16]]:3
// CHECK:STDERR: -> │ ReturnCUsed();
// CHECK:STDERR: · ━━━━━━┳━━━━━━
// CHECK:STDERR: · ┗━━┫ error: function returns incomplete type `C`
// CHECK:STDERR: · ┃ [IncompleteTypeInFunctionReturnType]
// CHECK:STDERR: ┆
// CHECK:STDERR: │ ╭── imported from: fail_use_imported.carbon [InImport]
// CHECK:STDERR: ├─┤ fail_incomplete_return.carbon
// CHECK:STDERR: │ class C;
// CHECK:STDERR: · ────┬───
// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere]
// CHECK:STDERR: · ┬
// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere]
// CHECK:STDERR: ┆
// CHECK:STDERR: │ fn ReturnCUsed() -> C;
// CHECK:STDERR: · ──┬─
@@ -247,7 +245,7 @@ fn CallFAndGIncomplete() {
// CHECK:STDOUT: %T.09f: %SubobjectDestroy.type = symbolic_binding T, 0 [symbolic]
// CHECK:STDOUT: %T.as_type.as.DestroyImpl.impl.Op.type.dea: type = fn_type @T.as_type.as.DestroyImpl.impl.Op, @T.as_type.as.DestroyImpl.impl(%T.09f) [symbolic]
// CHECK:STDOUT: %T.as_type.as.DestroyImpl.impl.Op.6e5: %T.as_type.as.DestroyImpl.impl.Op.type.dea = struct_value () [symbolic]
// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.2: type = fn_type @SubobjectDestroy.WithSelf.Op.loc43_17.2 [concrete]
// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.2: type = fn_type @SubobjectDestroy.WithSelf.Op.loc41_17.2 [concrete]
// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.30f1ee.2: %SubobjectDestroy.WithSelf.Op.type.6870fd.2 = struct_value () [concrete]
// CHECK:STDOUT: %custom_witness.b80ef6.2: <witness> = custom_witness (%SubobjectDestroy.WithSelf.Op.30f1ee.2), @SubobjectDestroy [concrete]
// CHECK:STDOUT: %SubobjectDestroy.facet.f61: %SubobjectDestroy.type = facet_value %D, (%custom_witness.b80ef6.2) [concrete]
@@ -311,25 +309,25 @@ fn CallFAndGIncomplete() {
// CHECK:STDOUT: %ReturnCUsed.ref: %ReturnCUsed.type = name_ref ReturnCUsed, imports.%Main.ReturnCUsed [concrete = constants.%ReturnCUsed]
// CHECK:STDOUT: %ReturnCUsed.call: init <error> = call %ReturnCUsed.ref()
// CHECK:STDOUT: %ReturnDUnused.ref: %ReturnDUnused.type = name_ref ReturnDUnused, imports.%Main.ReturnDUnused [concrete = constants.%ReturnDUnused]
// CHECK:STDOUT: %.loc43_17.1: ref %D = temporary_storage
// CHECK:STDOUT: %ReturnDUnused.call: init %D to %.loc43_17.1 = call %ReturnDUnused.ref()
// CHECK:STDOUT: %.loc43_17.2: ref %D = temporary %.loc43_17.1, %ReturnDUnused.call
// CHECK:STDOUT: %Destroy.facet.loc43_17.1: %Destroy.type = facet_value constants.%D, (constants.%DestroyImpl.impl_witness.30f, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet]
// CHECK:STDOUT: %.loc43_17.3: %Destroy.type = converted constants.%D, %Destroy.facet.loc43_17.1 [concrete = constants.%Destroy.facet]
// CHECK:STDOUT: %Destroy.facet.loc43_17.2: %Destroy.type = facet_value constants.%D, (constants.%DestroyImpl.impl_witness.30f, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet]
// CHECK:STDOUT: %.loc43_17.4: %Destroy.type = converted constants.%D, %Destroy.facet.loc43_17.2 [concrete = constants.%Destroy.facet]
// CHECK:STDOUT: %.loc41_17.1: ref %D = temporary_storage
// CHECK:STDOUT: %ReturnDUnused.call: init %D to %.loc41_17.1 = call %ReturnDUnused.ref()
// CHECK:STDOUT: %.loc41_17.2: ref %D = temporary %.loc41_17.1, %ReturnDUnused.call
// CHECK:STDOUT: %Destroy.facet.loc41_17.1: %Destroy.type = facet_value constants.%D, (constants.%DestroyImpl.impl_witness.30f, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet]
// CHECK:STDOUT: %.loc41_17.3: %Destroy.type = converted constants.%D, %Destroy.facet.loc41_17.1 [concrete = constants.%Destroy.facet]
// CHECK:STDOUT: %Destroy.facet.loc41_17.2: %Destroy.type = facet_value constants.%D, (constants.%DestroyImpl.impl_witness.30f, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet]
// CHECK:STDOUT: %.loc41_17.4: %Destroy.type = converted constants.%D, %Destroy.facet.loc41_17.2 [concrete = constants.%Destroy.facet]
// CHECK:STDOUT: %SelfDestruct.specific_fn.1: <specific function> = specific_function constants.%SelfDestruct, @SelfDestruct(constants.%Destroy.facet) [concrete = constants.%SelfDestruct.specific_fn]
// CHECK:STDOUT: %SelfDestruct.call.loc43: init %empty_tuple.type = call %SelfDestruct.specific_fn.1(%.loc43_17.2)
// CHECK:STDOUT: %SelfDestruct.call.loc41: init %empty_tuple.type = call %SelfDestruct.specific_fn.1(%.loc41_17.2)
// CHECK:STDOUT: %ReturnDUsed.ref: %ReturnDUsed.type = name_ref ReturnDUsed, imports.%Main.ReturnDUsed [concrete = constants.%ReturnDUsed]
// CHECK:STDOUT: %.loc44_15.1: ref %D = temporary_storage
// CHECK:STDOUT: %ReturnDUsed.call: init %D to %.loc44_15.1 = call %ReturnDUsed.ref()
// CHECK:STDOUT: %.loc44_15.2: ref %D = temporary %.loc44_15.1, %ReturnDUsed.call
// CHECK:STDOUT: %Destroy.facet.loc44_15.1: %Destroy.type = facet_value constants.%D, (constants.%DestroyImpl.impl_witness.30f, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet]
// CHECK:STDOUT: %.loc44_15.3: %Destroy.type = converted constants.%D, %Destroy.facet.loc44_15.1 [concrete = constants.%Destroy.facet]
// CHECK:STDOUT: %Destroy.facet.loc44_15.2: %Destroy.type = facet_value constants.%D, (constants.%DestroyImpl.impl_witness.30f, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet]
// CHECK:STDOUT: %.loc44_15.4: %Destroy.type = converted constants.%D, %Destroy.facet.loc44_15.2 [concrete = constants.%Destroy.facet]
// CHECK:STDOUT: %.loc42_15.1: ref %D = temporary_storage
// CHECK:STDOUT: %ReturnDUsed.call: init %D to %.loc42_15.1 = call %ReturnDUsed.ref()
// CHECK:STDOUT: %.loc42_15.2: ref %D = temporary %.loc42_15.1, %ReturnDUsed.call
// CHECK:STDOUT: %Destroy.facet.loc42_15.1: %Destroy.type = facet_value constants.%D, (constants.%DestroyImpl.impl_witness.30f, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet]
// CHECK:STDOUT: %.loc42_15.3: %Destroy.type = converted constants.%D, %Destroy.facet.loc42_15.1 [concrete = constants.%Destroy.facet]
// CHECK:STDOUT: %Destroy.facet.loc42_15.2: %Destroy.type = facet_value constants.%D, (constants.%DestroyImpl.impl_witness.30f, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet]
// CHECK:STDOUT: %.loc42_15.4: %Destroy.type = converted constants.%D, %Destroy.facet.loc42_15.2 [concrete = constants.%Destroy.facet]
// CHECK:STDOUT: %SelfDestruct.specific_fn.2: <specific function> = specific_function constants.%SelfDestruct, @SelfDestruct(constants.%Destroy.facet) [concrete = constants.%SelfDestruct.specific_fn]
// CHECK:STDOUT: %SelfDestruct.call.loc44: init %empty_tuple.type = call %SelfDestruct.specific_fn.2(%.loc44_15.2)
// CHECK:STDOUT: %SelfDestruct.call.loc42: init %empty_tuple.type = call %SelfDestruct.specific_fn.2(%.loc42_15.2)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -339,9 +337,9 @@ fn CallFAndGIncomplete() {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @ReturnDUnused [from "fail_incomplete_return.carbon"];
// CHECK:STDOUT:
// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc43_17.1(%self.param: ref %empty_struct_type) = "no_op";
// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc41_17.1(%self.param: ref %empty_struct_type) = "no_op";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc43_17.2(%self.param: ref %D) = "no_op";
// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc41_17.2(%self.param: ref %D) = "no_op";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @ReturnDUsed [from "fail_incomplete_return.carbon"];
// CHECK:STDOUT:
@@ -14,10 +14,10 @@
// CHECK:STDERR: ╭─┤ fail_param_redecl.carbon:[[@LINE+8]]:14
// CHECK:STDERR: -> │ fn F(n: i32, n: i32);
// CHECK:STDERR: · ───┬── ┳
// CHECK:STDERR: · │ ┗━━┫ error: duplicate name `n` being declared in the same scope
// CHECK:STDERR: · │ ┃ [NameDeclDuplicate]
// CHECK:STDERR: · ╰─────────┤ name is previously declared here [NameDeclPrevious]
// CHECK:STDERR: · ┬ ┳
// CHECK:STDERR: · │ ┗━━┫ error: duplicate name `n` being declared in the same scope
// CHECK:STDERR: · │ ┃ [NameDeclDuplicate]
// CHECK:STDERR: · ╰────────────┤ name is previously declared here [NameDeclPrevious]
// CHECK:STDERR: ╰────
// CHECK:STDERR:
fn F(n: i32, n: i32);
@@ -15,7 +15,7 @@
fn A();
// CHECK:STDERR: ╭─┤ fail_redecl.carbon:[[@LINE+10]]:1
// CHECK:STDERR: │ fn A();
// CHECK:STDERR: · ───┬───
// CHECK:STDERR: · ┬
// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl]
// CHECK:STDERR: ┆
// CHECK:STDERR: -> │ fn A();
@@ -28,8 +28,8 @@ fn A();
fn B(x: ());
// CHECK:STDERR: ╭─┤ fail_redecl.carbon:[[@LINE+10]]:1
// CHECK:STDERR: │ fn B(x: ());
// CHECK:STDERR: · ──────┬─────
// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl]
// CHECK:STDERR: · ┬
// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl]
// CHECK:STDERR: ┆
// CHECK:STDERR: -> │ fn B(x: ());
// CHECK:STDERR: · ━━━━━━┳━━━━━
@@ -55,8 +55,8 @@ fn C(x: ());
fn D() {}
// CHECK:STDERR: ╭─┤ fail_redecl.carbon:[[@LINE+10]]:1
// CHECK:STDERR: │ fn D() {}
// CHECK:STDERR: · ────┬───
// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl]
// CHECK:STDERR: · ┬
// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl]
// CHECK:STDERR: ┆
// CHECK:STDERR: -> │ fn D();
// CHECK:STDERR: · ━━━┳━━━
@@ -68,8 +68,8 @@ fn D();
fn E() {}
// CHECK:STDERR: ╭─┤ fail_redecl.carbon:[[@LINE+10]]:1
// CHECK:STDERR: │ fn E() {}
// CHECK:STDERR: · ────┬───
// CHECK:STDERR: · ╰──┤ previously defined here [RedeclPrevDef]
// CHECK:STDERR: · ┬
// CHECK:STDERR: · ╰──┤ previously defined here [RedeclPrevDef]
// CHECK:STDERR: ┆
// CHECK:STDERR: -> │ fn E() {}
// CHECK:STDERR: · ━━━━┳━━━
@@ -42,8 +42,8 @@ impl library "[[@TEST_NAME]]";
// CHECK:STDERR: ┆
// CHECK:STDERR: ├─┤ extern_api.carbon
// CHECK:STDERR: │ extern fn A();
// CHECK:STDERR: · ───────┬──────
// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl]
// CHECK:STDERR: · ┬
// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl]
// CHECK:STDERR: ╰────
// CHECK:STDERR:
// CHECK:STDERR: ╭─┤ fail_extern_api.impl.carbon:[[@LINE+7]]:1
@@ -73,7 +73,7 @@ impl library "[[@TEST_NAME]]";
// CHECK:STDERR: ┆
// CHECK:STDERR: ├─┤ extern_impl.carbon
// CHECK:STDERR: │ fn A();
// CHECK:STDERR: · ───┬───
// CHECK:STDERR: · ┬
// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl]
// CHECK:STDERR: ╰────
// CHECK:STDERR:
+67 -64
View File
@@ -70,7 +70,7 @@ import library "api";
// CHECK:STDERR: ┆
// CHECK:STDERR: ├─┤ api.carbon
// CHECK:STDERR: │ fn A();
// CHECK:STDERR: · ───┬───
// CHECK:STDERR: · ┬
// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl]
// CHECK:STDERR: ╰────
// CHECK:STDERR:
@@ -83,8 +83,8 @@ extern fn A();
// CHECK:STDERR: ┆
// CHECK:STDERR: ├─┤ api.carbon
// CHECK:STDERR: │ fn B(b: i32) -> i32;
// CHECK:STDERR: · ──────────┬─────────
// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl]
// CHECK:STDERR: · ┬
// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl]
// CHECK:STDERR: ╰────
// CHECK:STDERR:
extern fn B(b: i32) -> i32;
@@ -96,8 +96,8 @@ extern fn B(b: i32) -> i32;
// CHECK:STDERR: ┆
// CHECK:STDERR: ├─┤ api.carbon
// CHECK:STDERR: │ fn C(c: (i32,)) -> {.c: i32};
// CHECK:STDERR: · ──────────────┬──────────────
// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl]
// CHECK:STDERR: · ┬
// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl]
// CHECK:STDERR: ╰────
// CHECK:STDERR:
extern fn C(c: (i32,)) -> {.c: i32};
@@ -108,12 +108,12 @@ extern fn C(c: (i32,)) -> {.c: i32};
// CHECK:STDERR: ┆
// CHECK:STDERR: ├─┤ api.carbon
// CHECK:STDERR: │ extern fn D();
// CHECK:STDERR: · ───────┬──────
// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl]
// CHECK:STDERR: · ┬
// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl]
// CHECK:STDERR: ╰────
// CHECK:STDERR:
extern fn D();
// CHECK:STDERR: ╭─┤ fail_redecl_api.carbon:[[@LINE+144]]:1
// CHECK:STDERR: ╭─┤ fail_redecl_api.carbon:[[@LINE+147]]:1
// CHECK:STDERR: -> │ extern fn NS.E();
// CHECK:STDERR: · ━━━━━━━━┳━━━━━━━━
// CHECK:STDERR: · ┗━━┫ error: redeclarations of `fn E` must match use of `extern`
@@ -121,8 +121,8 @@ extern fn D();
// CHECK:STDERR: ┆
// CHECK:STDERR: ├─┤ api.carbon
// CHECK:STDERR: │ fn NS.E();
// CHECK:STDERR: · ─────┬────
// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl]
// CHECK:STDERR: · ┬
// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl]
// CHECK:STDERR: ╰────
// CHECK:STDERR:
// CHECK:STDERR: ╷ ╭── imported from: fail_merge.carbon [InImport]
@@ -134,7 +134,7 @@ extern fn D();
// CHECK:STDERR: ┆
// CHECK:STDERR: ├─┤ api.carbon
// CHECK:STDERR: │ fn A();
// CHECK:STDERR: · ───┬───
// CHECK:STDERR: · ┬
// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious]
// CHECK:STDERR: ╰────
// CHECK:STDERR:
@@ -147,8 +147,8 @@ extern fn D();
// CHECK:STDERR: ┆
// CHECK:STDERR: ├─┤ api.carbon
// CHECK:STDERR: │ fn B(b: i32) -> i32;
// CHECK:STDERR: · ──────────┬─────────
// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious]
// CHECK:STDERR: · ┬
// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious]
// CHECK:STDERR: ╰────
// CHECK:STDERR:
// CHECK:STDERR: ╷ ╭── imported from: fail_merge.carbon [InImport]
@@ -160,8 +160,8 @@ extern fn D();
// CHECK:STDERR: ┆
// CHECK:STDERR: ├─┤ api.carbon
// CHECK:STDERR: │ fn C(c: (i32,)) -> {.c: i32};
// CHECK:STDERR: · ──────────────┬──────────────
// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious]
// CHECK:STDERR: · ┬
// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious]
// CHECK:STDERR: ╰────
// CHECK:STDERR:
// CHECK:STDERR: ╷ ╭── imported from: fail_merge.carbon [InImport]
@@ -173,8 +173,8 @@ extern fn D();
// CHECK:STDERR: ┆
// CHECK:STDERR: ├─┤ api.carbon
// CHECK:STDERR: │ extern fn D();
// CHECK:STDERR: · ───────┬──────
// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious]
// CHECK:STDERR: · ┬
// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious]
// CHECK:STDERR: ╰────
// CHECK:STDERR:
// CHECK:STDERR: ╷ ╭── imported from: fail_merge.carbon [InImport]
@@ -186,8 +186,8 @@ extern fn D();
// CHECK:STDERR: ┆
// CHECK:STDERR: ├─┤ api.carbon
// CHECK:STDERR: │ fn NS.E();
// CHECK:STDERR: · ─────┬────
// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious]
// CHECK:STDERR: · ┬
// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious]
// CHECK:STDERR: ╰────
// CHECK:STDERR:
// CHECK:STDERR: ╷ ╭── imported from: fail_merge_reverse.carbon [InImport]
@@ -199,8 +199,9 @@ extern fn D();
// CHECK:STDERR: ┆
// CHECK:STDERR: ├─┤ extern_api.carbon
// CHECK:STDERR: │ extern library "redecl_extern_api" fn A();
// CHECK:STDERR: · ─────────────────────┬────────────────────
// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious]
// CHECK:STDERR: · ┬
// CHECK:STDERR: · ╰──┤ name is previously declared here
// CHECK:STDERR: · │ [NameDeclPrevious]
// CHECK:STDERR: ╰────
// CHECK:STDERR:
// CHECK:STDERR: ╷ ╭── imported from: fail_merge_reverse.carbon [InImport]
@@ -212,9 +213,9 @@ extern fn D();
// CHECK:STDERR: ┆
// CHECK:STDERR: ├─┤ extern_api.carbon
// CHECK:STDERR: │ extern library "redecl_extern_api" fn B(b: i32) -> i32;
// CHECK:STDERR: · ───────────────────────────┬───────────────────────────
// CHECK:STDERR: · ╰──┤ name is previously declared here
// CHECK:STDERR: · │ [NameDeclPrevious]
// CHECK:STDERR: · ┬
// CHECK:STDERR: · ╰──┤ name is previously declared here
// CHECK:STDERR: · │ [NameDeclPrevious]
// CHECK:STDERR: ╰────
// CHECK:STDERR:
// CHECK:STDERR: ╷ ╭── imported from: fail_merge_reverse.carbon [InImport]
@@ -226,9 +227,9 @@ extern fn D();
// CHECK:STDERR: ┆
// CHECK:STDERR: ├─┤ extern_api.carbon
// CHECK:STDERR: │ extern library "redecl_extern_api" fn C(c: (i32,)) -> {.c: i32};
// CHECK:STDERR: · ────────────────────────────────┬───────────────────────────────
// CHECK:STDERR: · ╰──┤ name is previously declared here
// CHECK:STDERR: · │ [NameDeclPrevious]
// CHECK:STDERR: · ┬
// CHECK:STDERR: · ╰──┤ name is previously declared here
// CHECK:STDERR: · │ [NameDeclPrevious]
// CHECK:STDERR: ╰────
// CHECK:STDERR:
// CHECK:STDERR: ╷ ╭── imported from: fail_merge_reverse.carbon [InImport]
@@ -240,8 +241,9 @@ extern fn D();
// CHECK:STDERR: ┆
// CHECK:STDERR: ├─┤ extern_api.carbon
// CHECK:STDERR: │ extern library "redecl_extern_api" fn D();
// CHECK:STDERR: · ─────────────────────┬────────────────────
// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious]
// CHECK:STDERR: · ┬
// CHECK:STDERR: · ╰──┤ name is previously declared here
// CHECK:STDERR: · │ [NameDeclPrevious]
// CHECK:STDERR: ╰────
// CHECK:STDERR:
// CHECK:STDERR: ╷ ╭── imported from: fail_merge_reverse.carbon [InImport]
@@ -253,8 +255,9 @@ extern fn D();
// CHECK:STDERR: ┆
// CHECK:STDERR: ├─┤ extern_api.carbon
// CHECK:STDERR: │ extern library "redecl_extern_api" fn NS.E();
// CHECK:STDERR: · ──────────────────────┬──────────────────────
// CHECK:STDERR: · ╰──┤ name is previously declared here [NameDeclPrevious]
// CHECK:STDERR: · ┬
// CHECK:STDERR: · ╰──┤ name is previously declared here
// CHECK:STDERR: · │ [NameDeclPrevious]
// CHECK:STDERR: ╰────
// CHECK:STDERR:
extern fn NS.E();
@@ -850,9 +853,9 @@ import library "extern_api";
// CHECK:STDOUT: %D.decl: %D.type = fn_decl @D [concrete = constants.%D] {} {}
// CHECK:STDOUT: %E.decl: %E.type = fn_decl @E [concrete = constants.%E] {} {}
// CHECK:STDOUT: %a.var: ref %empty_tuple.type = var_storage %a.var_patt [concrete]
// CHECK:STDOUT: %.loc203_9.1: type = splice_block %.loc203_9.3 [concrete = constants.%empty_tuple.type] {
// CHECK:STDOUT: %.loc203_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %.loc203_9.3: type = converted %.loc203_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
// CHECK:STDOUT: %.loc206_9.1: type = splice_block %.loc206_9.3 [concrete = constants.%empty_tuple.type] {
// CHECK:STDOUT: %.loc206_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %.loc206_9.3: type = converted %.loc206_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
// CHECK:STDOUT: }
// CHECK:STDOUT: %a: ref %empty_tuple.type = wrapper_binding a, %a.var [concrete = %a.var]
// CHECK:STDOUT: name_binding_decl {
@@ -860,15 +863,15 @@ import library "extern_api";
// CHECK:STDOUT: %a.var_patt: %pattern_type.cb1 = var_pattern %a.patt [concrete = constants.%a.var_patt]
// CHECK:STDOUT: }
// CHECK:STDOUT: %b.var: ref %i32 = var_storage %b.var_patt [concrete]
// CHECK:STDOUT: %i32.loc204: type = type_literal constants.%i32 [concrete = constants.%i32]
// CHECK:STDOUT: %i32.loc207: type = type_literal constants.%i32 [concrete = constants.%i32]
// CHECK:STDOUT: %b: ref %i32 = wrapper_binding b, %b.var [concrete = %b.var]
// CHECK:STDOUT: name_binding_decl {
// CHECK:STDOUT: %b.patt: %pattern_type.d94 = ref_binding_pattern b [concrete = constants.%b.patt.920]
// CHECK:STDOUT: %b.var_patt: %pattern_type.d94 = var_pattern %b.patt [concrete = constants.%b.var_patt]
// CHECK:STDOUT: }
// CHECK:STDOUT: %c.var: ref %struct_type.c = var_storage %c.var_patt [concrete]
// CHECK:STDOUT: %.loc205: type = splice_block %struct_type.c [concrete = constants.%struct_type.c] {
// CHECK:STDOUT: %i32.loc205: type = type_literal constants.%i32 [concrete = constants.%i32]
// CHECK:STDOUT: %.loc208: type = splice_block %struct_type.c [concrete = constants.%struct_type.c] {
// CHECK:STDOUT: %i32.loc208: type = type_literal constants.%i32 [concrete = constants.%i32]
// CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [concrete = constants.%struct_type.c]
// CHECK:STDOUT: }
// CHECK:STDOUT: %c: ref %struct_type.c = wrapper_binding c, %c.var [concrete = %c.var]
@@ -877,9 +880,9 @@ import library "extern_api";
// CHECK:STDOUT: %c.var_patt: %pattern_type.51a = var_pattern %c.patt [concrete = constants.%c.var_patt]
// CHECK:STDOUT: }
// CHECK:STDOUT: %d.var: ref %empty_tuple.type = var_storage %d.var_patt [concrete]
// CHECK:STDOUT: %.loc206_9.1: type = splice_block %.loc206_9.3 [concrete = constants.%empty_tuple.type] {
// CHECK:STDOUT: %.loc206_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %.loc206_9.3: type = converted %.loc206_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
// CHECK:STDOUT: %.loc209_9.1: type = splice_block %.loc209_9.3 [concrete = constants.%empty_tuple.type] {
// CHECK:STDOUT: %.loc209_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %.loc209_9.3: type = converted %.loc209_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
// CHECK:STDOUT: }
// CHECK:STDOUT: %d: ref %empty_tuple.type = wrapper_binding d, %d.var [concrete = %d.var]
// CHECK:STDOUT: name_binding_decl {
@@ -887,9 +890,9 @@ import library "extern_api";
// CHECK:STDOUT: %d.var_patt: %pattern_type.cb1 = var_pattern %d.patt [concrete = constants.%d.var_patt]
// CHECK:STDOUT: }
// CHECK:STDOUT: %e.var: ref %empty_tuple.type = var_storage %e.var_patt [concrete]
// CHECK:STDOUT: %.loc207_9.1: type = splice_block %.loc207_9.3 [concrete = constants.%empty_tuple.type] {
// CHECK:STDOUT: %.loc207_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %.loc207_9.3: type = converted %.loc207_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
// CHECK:STDOUT: %.loc210_9.1: type = splice_block %.loc210_9.3 [concrete = constants.%empty_tuple.type] {
// CHECK:STDOUT: %.loc210_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %.loc210_9.3: type = converted %.loc210_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
// CHECK:STDOUT: }
// CHECK:STDOUT: %e: ref %empty_tuple.type = wrapper_binding e, %e.var [concrete = %e.var]
// CHECK:STDOUT: name_binding_decl {
@@ -914,29 +917,29 @@ import library "extern_api";
// CHECK:STDOUT: %A.call: init %empty_tuple.type = call %A.ref()
// CHECK:STDOUT: assign file.%a.var, %A.call
// CHECK:STDOUT: %B.ref: %B.type = name_ref B, file.%B.decl [concrete = constants.%B]
// CHECK:STDOUT: %int_1.loc204: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
// CHECK:STDOUT: %impl.elem0.loc204: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60]
// CHECK:STDOUT: %bound_method.loc204_16.1: <bound method> = bound_method %int_1.loc204, %impl.elem0.loc204 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
// CHECK:STDOUT: %specific_fn.loc204: <specific function> = specific_function %impl.elem0.loc204, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
// CHECK:STDOUT: %bound_method.loc204_16.2: <bound method> = bound_method %int_1.loc204, %specific_fn.loc204 [concrete = constants.%bound_method]
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc204: init %i32 = call %bound_method.loc204_16.2(%int_1.loc204) [concrete = constants.%int_1.68a]
// CHECK:STDOUT: %.loc204_16.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc204 [concrete = constants.%int_1.68a]
// CHECK:STDOUT: %.loc204_16.2: %i32 = converted %int_1.loc204, %.loc204_16.1 [concrete = constants.%int_1.68a]
// CHECK:STDOUT: %B.call: init %i32 = call %B.ref(%.loc204_16.2)
// CHECK:STDOUT: %int_1.loc207: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
// CHECK:STDOUT: %impl.elem0.loc207: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60]
// CHECK:STDOUT: %bound_method.loc207_16.1: <bound method> = bound_method %int_1.loc207, %impl.elem0.loc207 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
// CHECK:STDOUT: %specific_fn.loc207: <specific function> = specific_function %impl.elem0.loc207, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
// CHECK:STDOUT: %bound_method.loc207_16.2: <bound method> = bound_method %int_1.loc207, %specific_fn.loc207 [concrete = constants.%bound_method]
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc207: init %i32 = call %bound_method.loc207_16.2(%int_1.loc207) [concrete = constants.%int_1.68a]
// CHECK:STDOUT: %.loc207_16.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc207 [concrete = constants.%int_1.68a]
// CHECK:STDOUT: %.loc207_16.2: %i32 = converted %int_1.loc207, %.loc207_16.1 [concrete = constants.%int_1.68a]
// CHECK:STDOUT: %B.call: init %i32 = call %B.ref(%.loc207_16.2)
// CHECK:STDOUT: assign file.%b.var, %B.call
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C]
// CHECK:STDOUT: %int_1.loc205: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
// CHECK:STDOUT: %.loc205_25.1: %tuple.type.985 = tuple_literal (%int_1.loc205) [concrete = constants.%tuple.378]
// CHECK:STDOUT: %impl.elem0.loc205: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60]
// CHECK:STDOUT: %bound_method.loc205_25.1: <bound method> = bound_method %int_1.loc205, %impl.elem0.loc205 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
// CHECK:STDOUT: %specific_fn.loc205: <specific function> = specific_function %impl.elem0.loc205, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
// CHECK:STDOUT: %bound_method.loc205_25.2: <bound method> = bound_method %int_1.loc205, %specific_fn.loc205 [concrete = constants.%bound_method]
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc205: init %i32 = call %bound_method.loc205_25.2(%int_1.loc205) [concrete = constants.%int_1.68a]
// CHECK:STDOUT: %.loc205_25.2: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc205 [concrete = constants.%int_1.68a]
// CHECK:STDOUT: %.loc205_25.3: %i32 = converted %int_1.loc205, %.loc205_25.2 [concrete = constants.%int_1.68a]
// CHECK:STDOUT: %tuple: %tuple.type.294 = tuple_value (%.loc205_25.3) [concrete = constants.%tuple.f6b]
// CHECK:STDOUT: %.loc205_25.4: %tuple.type.294 = converted %.loc205_25.1, %tuple [concrete = constants.%tuple.f6b]
// CHECK:STDOUT: %C.call: init %struct_type.c = call %C.ref(%.loc205_25.4)
// CHECK:STDOUT: %int_1.loc208: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
// CHECK:STDOUT: %.loc208_25.1: %tuple.type.985 = tuple_literal (%int_1.loc208) [concrete = constants.%tuple.378]
// CHECK:STDOUT: %impl.elem0.loc208: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60]
// CHECK:STDOUT: %bound_method.loc208_25.1: <bound method> = bound_method %int_1.loc208, %impl.elem0.loc208 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
// CHECK:STDOUT: %specific_fn.loc208: <specific function> = specific_function %impl.elem0.loc208, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
// CHECK:STDOUT: %bound_method.loc208_25.2: <bound method> = bound_method %int_1.loc208, %specific_fn.loc208 [concrete = constants.%bound_method]
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc208: init %i32 = call %bound_method.loc208_25.2(%int_1.loc208) [concrete = constants.%int_1.68a]
// CHECK:STDOUT: %.loc208_25.2: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc208 [concrete = constants.%int_1.68a]
// CHECK:STDOUT: %.loc208_25.3: %i32 = converted %int_1.loc208, %.loc208_25.2 [concrete = constants.%int_1.68a]
// CHECK:STDOUT: %tuple: %tuple.type.294 = tuple_value (%.loc208_25.3) [concrete = constants.%tuple.f6b]
// CHECK:STDOUT: %.loc208_25.4: %tuple.type.294 = converted %.loc208_25.1, %tuple [concrete = constants.%tuple.f6b]
// CHECK:STDOUT: %C.call: init %struct_type.c = call %C.ref(%.loc208_25.4)
// CHECK:STDOUT: assign file.%c.var, %C.call
// CHECK:STDOUT: %D.ref: %D.type = name_ref D, file.%D.decl [concrete = constants.%D]
// CHECK:STDOUT: %D.call: init %empty_tuple.type = call %D.ref()
@@ -59,7 +59,7 @@ impl library "[[@TEST_NAME]]";
// CHECK:STDERR: ┆
// CHECK:STDERR: ├─┤ decl_in_api_decl_in_impl.carbon
// CHECK:STDERR: │ fn C();
// CHECK:STDERR: · ───┬───
// CHECK:STDERR: · ┬
// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl]
// CHECK:STDERR: ╰────
// CHECK:STDERR:
@@ -89,7 +89,7 @@ impl library "[[@TEST_NAME]]";
// CHECK:STDERR: ┆
// CHECK:STDERR: ├─┤ decl_in_api_decl_and_definition_in_impl.carbon
// CHECK:STDERR: │ fn D();
// CHECK:STDERR: · ───┬───
// CHECK:STDERR: · ┬
// CHECK:STDERR: · ╰──┤ previously declared here [RedeclPrevDecl]
// CHECK:STDERR: ╰────
// CHECK:STDERR: