mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-16 08:08:10 +00:00
Diagnostic rendering was part of the data model: `Loc::FormatLocation` and `Loc::FormatSnippet` wrote plain text to a stream, so no capability, color, or terminal width could reach them. A diagnostic is now one message with labels, contexts, and location information attached, and `Diagnostics::Renderer` draws it into a `Terminal::Buffer`. The design is in `toolchain/docs/diagnostics_rendering.md` (#7668), authoring in `toolchain/docs/diagnostics.md`. Before: ``` example.carbon:6:3: error: 1 argument passed to function expecting 0 arguments Run0(1); ^~~~~~~ example.carbon:3:1: note: calling function declared here fn Run0() {} ^~~~~~~~~~~ ``` After: ``` error: 1 argument passed to function expecting 0 arguments ╭─┤ example.carbon:6:3 ┆ 3 │ fn Run0() {} · ─────┬───── · ╰──┤ calling function declared here ┆ -> 6 │ Run0(1); · ─────── ╰──────────── ``` `--no-diagnostic-snippets` gives a compact form, `example.carbon:6:3-9`. File tests use it; the rendering tests under `toolchain/diagnostics/testdata` ask for snippets. C++ interop diagnostics are data now rather than text Clang drew: `SemIR::ClangSourceLocId` names a `clang::SourceRange`, and a Clang location is marked as the point it names. `StreamConsumer` moves to a `:renderer` target that `:emitter` does not depend on, keeping `common/terminal` out of `consumer.h`. Capabilities come from the file behind the error stream, so tests get plain ASCII. `renderer_fuzzer` draws diagnostics built from fuzzer bytes with every capability combination, since a shape the renderer doesn't expect must never be why the compiler dies while reporting a problem. TODOs mark the follow-ups: line weights and crossing lines, wrapping that keeps a quoted type whole, and ordering diagnostics that share a byte offset. Also: `IncorrectExtension`'s hint moves into its message, since its note had no location of its own, and `strip_noise` in `check_diagnostics.py` blanks multi-line `#define`s instead of deleting them. Assisted-by: Claude Code
309 lines
16 KiB
Plaintext
309 lines
16 KiB
Plaintext
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
// Exceptions. See /LICENSE for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/none.carbon
|
|
//
|
|
// AUTOUPDATE
|
|
// TIP: To test this file alone, run:
|
|
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/error_recovery.carbon
|
|
// TIP: To dump output, run:
|
|
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/error_recovery.carbon
|
|
|
|
// --- fail_runtime_generic_param.carbon
|
|
library "[[@TEST_NAME]]";
|
|
|
|
class C {}
|
|
interface I {}
|
|
|
|
//@dump-sem-ir-begin
|
|
// CHECK:STDERR: fail_runtime_generic_param.carbon:[[@LINE+2]]:14-28: error: parameters of generic types must be constant [GenericParamMustBeConstant]
|
|
// CHECK:STDERR:
|
|
impl forall [runtime T: type] C as I {}
|
|
//@dump-sem-ir-end
|
|
|
|
// --- fail_nonfinal_lookup_impl_witness_error_in_import.carbon
|
|
library "[[@TEST_NAME]]";
|
|
|
|
interface Z {}
|
|
// CHECK:STDERR: fail_nonfinal_lookup_impl_witness_error_in_import.carbon:[[@LINE+2]]:1-29: error: impl declared but not defined [ImplMissingDefinition]
|
|
// CHECK:STDERR:
|
|
impl forall [T: type] T as Z;
|
|
|
|
fn F(unused generic U: Z) {}
|
|
|
|
//@dump-sem-ir-begin
|
|
fn G(generic T: type) {
|
|
// This makes a LookupImplWitness instruction, but future lookups (evaluation
|
|
// of this instruction with a specific) will result in an error since the impl
|
|
// is never defined and is left with an error as its witness at the end of the
|
|
// file. The lookups should not fail entirely, just result in an error
|
|
// witness.
|
|
F(T);
|
|
}
|
|
//@dump-sem-ir-end
|
|
|
|
// --- nonfinal_lookup_impl_witness_error_in_import.impl.carbon
|
|
impl library "[[@TEST_NAME]]";
|
|
|
|
fn H() {
|
|
// The specific here contains errors, but does not fail entirely and crash
|
|
// when resolving the LookupImplWitness.
|
|
G(());
|
|
}
|
|
|
|
// --- fail_nonfinal_lookup_impl_witness_error.carbon
|
|
library "[[@TEST_NAME]]";
|
|
|
|
interface Z {}
|
|
// CHECK:STDERR: fail_nonfinal_lookup_impl_witness_error.carbon:[[@LINE+2]]:1-29: error: impl declared but not defined [ImplMissingDefinition]
|
|
// CHECK:STDERR:
|
|
impl forall [T: type] T as Z;
|
|
|
|
fn F(unused generic U: Z) {}
|
|
|
|
//@dump-sem-ir-begin
|
|
fn G(generic T: type) {
|
|
// This makes a LookupImplWitness instruction, but future lookups (evaluation
|
|
// of this instruction with a specific) will fail with an error since the impl
|
|
// is never defined and is left with an error as its witness at the end of the
|
|
// file. The lookups should not fail entirely, just result in an error
|
|
// witness.
|
|
F(T);
|
|
}
|
|
//@dump-sem-ir-end
|
|
|
|
fn H() {
|
|
// The specific here contains errors, but does not fail entirely and crash
|
|
// when resolving the LookupImplWitness.
|
|
G(());
|
|
}
|
|
|
|
// --- fail_final_lookup_impl_witness_error.carbon
|
|
library "[[@TEST_NAME]]";
|
|
|
|
interface Z {}
|
|
// CHECK:STDERR: fail_final_lookup_impl_witness_error.carbon:[[@LINE+2]]:1-29: error: impl declared but not defined [ImplMissingDefinition]
|
|
// CHECK:STDERR:
|
|
impl forall [T: type] T as Z;
|
|
|
|
fn F(unused generic U: Z) {}
|
|
|
|
fn G() {
|
|
// This impl lookup resolves to a final witness, which poisons any future
|
|
// queries. At the end of the file, the poisoned queries are replayed to make
|
|
// sure they don't change. However, here it is changed by the impl being
|
|
// diagnosed with an error. The poisoning check should handle that gracefully.
|
|
//@dump-sem-ir-begin
|
|
F(());
|
|
//@dump-sem-ir-end
|
|
}
|
|
|
|
// --- fail_invalid_fn_syntax_in_impl.carbon
|
|
library "[[@TEST_NAME]]";
|
|
|
|
interface I {
|
|
fn Op(self);
|
|
}
|
|
|
|
class C {};
|
|
//@dump-sem-ir-begin
|
|
impl C as I {
|
|
// This leaves the impl with a placeholder instruction in the witness table.
|
|
// CHECK:STDERR: fail_invalid_fn_syntax_in_impl.carbon:[[@LINE+6]]:9: error: name `x` not found [NameNotFound]
|
|
// CHECK:STDERR:
|
|
// CHECK:STDERR: fail_invalid_fn_syntax_in_impl.carbon:[[@LINE+4]]:11-14: error: expected `,` or `]` [UnexpectedTokenAfterListElement]
|
|
// CHECK:STDERR:
|
|
// CHECK:STDERR: fail_invalid_fn_syntax_in_impl.carbon:[[@LINE+2]]:8-18: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
|
// CHECK:STDERR:
|
|
fn Op[x self: C]() {}
|
|
}
|
|
//@dump-sem-ir-end
|
|
|
|
// CHECK:STDOUT: --- fail_runtime_generic_param.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
|
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
|
// CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
|
|
// CHECK:STDOUT: %.b7f: <witness> = impl_self_witness %C, @I [concrete]
|
|
// CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness @C.as.I.impl.%I.impl_witness_table [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: impl_decl @C.as.I.impl [concrete] {} {
|
|
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
|
// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %.loc9: <witness> = impl_self_witness @C.as.I.impl.%C.ref, @I [concrete = constants.%.b7f]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: impl @C.as.I.impl: %C.ref as %I.ref {
|
|
// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @C.as.I.impl [concrete]
|
|
// CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: extend %I.ref
|
|
// CHECK:STDOUT: witness = %I.impl_witness
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- fail_nonfinal_lookup_impl_witness_error_in_import.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
|
// CHECK:STDOUT: %Z.type: type = facet_type <@Z> [concrete]
|
|
// CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self]
|
|
// CHECK:STDOUT: %pattern_type.9a5: type = pattern_type type [concrete]
|
|
// CHECK:STDOUT: %T.patt: %pattern_type.9a5 = symbolic_binding_pattern T, 0 [symbolic]
|
|
// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
|
|
// 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: %G.type: type = fn_type @G [concrete]
|
|
// CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: %Z.lookup_impl_witness: <witness> = lookup_impl_witness %T, @Z [symbolic]
|
|
// CHECK:STDOUT: %.2f2: require_specific_def_type = require_specific_def @T.as.Z.impl(%T) [symbolic]
|
|
// CHECK:STDOUT: %Z.facet: %Z.type = facet_value %T, (%Z.lookup_impl_witness) [symbolic]
|
|
// CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F, @F(%Z.facet) [symbolic]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
|
|
// CHECK:STDOUT: %T.patt.loc11_15.1: %pattern_type.9a5 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_15.2 (constants.%T.patt)]
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %.loc11_17.1: type = splice_block %.loc11_17.2 [concrete = type] {
|
|
// CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
|
|
// CHECK:STDOUT: %.loc11_17.2: type = type_literal type [concrete = type]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %T.loc11_15.2: type = symbolic_binding T, 0 [symbolic = %T.loc11_15.1 (constants.%T)]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: generic fn @G(%T.loc11_15.2: type) {
|
|
// CHECK:STDOUT: %T.patt.loc11_15.2: %pattern_type.9a5 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_15.2 (constants.%T.patt)]
|
|
// CHECK:STDOUT: %T.loc11_15.1: type = symbolic_binding T, 0 [symbolic = %T.loc11_15.1 (constants.%T)]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !definition:
|
|
// CHECK:STDOUT: %.loc17_6.2: require_specific_def_type = require_specific_def @T.as.Z.impl(%T.loc11_15.1) [symbolic = %.loc17_6.2 (constants.%.2f2)]
|
|
// CHECK:STDOUT: %Z.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc11_15.1, @Z [symbolic = %Z.lookup_impl_witness (constants.%Z.lookup_impl_witness)]
|
|
// CHECK:STDOUT: %Z.facet.loc17_6.2: %Z.type = facet_value %T.loc11_15.1, (%Z.lookup_impl_witness) [symbolic = %Z.facet.loc17_6.2 (constants.%Z.facet)]
|
|
// CHECK:STDOUT: %F.specific_fn.loc17_3.2: <specific function> = specific_function constants.%F, @F(%Z.facet.loc17_6.2) [symbolic = %F.specific_fn.loc17_3.2 (constants.%F.specific_fn)]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn() {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
|
|
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc11_15.2 [symbolic = %T.loc11_15.1 (constants.%T)]
|
|
// CHECK:STDOUT: %Z.facet.loc17_6.1: %Z.type = facet_value %T.ref, (constants.%Z.lookup_impl_witness) [symbolic = %Z.facet.loc17_6.2 (constants.%Z.facet)]
|
|
// CHECK:STDOUT: %.loc17_6.1: %Z.type = converted %T.ref, %Z.facet.loc17_6.1 [symbolic = %Z.facet.loc17_6.2 (constants.%Z.facet)]
|
|
// CHECK:STDOUT: %F.specific_fn.loc17_3.1: <specific function> = specific_function %F.ref, @F(constants.%Z.facet) [symbolic = %F.specific_fn.loc17_3.2 (constants.%F.specific_fn)]
|
|
// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn.loc17_3.1()
|
|
// CHECK:STDOUT: return
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @G(constants.%T) {
|
|
// CHECK:STDOUT: %T.patt.loc11_15.2 => constants.%T.patt
|
|
// CHECK:STDOUT: %T.loc11_15.1 => constants.%T
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- fail_nonfinal_lookup_impl_witness_error.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
|
// CHECK:STDOUT: %Z.type: type = facet_type <@Z> [concrete]
|
|
// CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self]
|
|
// CHECK:STDOUT: %pattern_type.9a5: type = pattern_type type [concrete]
|
|
// CHECK:STDOUT: %T.patt: %pattern_type.9a5 = symbolic_binding_pattern T, 0 [symbolic]
|
|
// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
|
|
// 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: %G.type: type = fn_type @G [concrete]
|
|
// CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: %Z.lookup_impl_witness: <witness> = lookup_impl_witness %T, @Z [symbolic]
|
|
// CHECK:STDOUT: %.2f2: require_specific_def_type = require_specific_def @T.as.Z.impl(%T) [symbolic]
|
|
// CHECK:STDOUT: %Z.facet: %Z.type = facet_value %T, (%Z.lookup_impl_witness) [symbolic]
|
|
// CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F, @F(%Z.facet) [symbolic]
|
|
// CHECK:STDOUT: %.ba2: require_specific_def_type = require_specific_def @T.as.Z.impl(%empty_tuple.type) [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
|
|
// CHECK:STDOUT: %T.patt.loc11_15.1: %pattern_type.9a5 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_15.2 (constants.%T.patt)]
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %.loc11_17.1: type = splice_block %.loc11_17.2 [concrete = type] {
|
|
// CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
|
|
// CHECK:STDOUT: %.loc11_17.2: type = type_literal type [concrete = type]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %T.loc11_15.2: type = symbolic_binding T, 0 [symbolic = %T.loc11_15.1 (constants.%T)]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: generic fn @G(%T.loc11_15.2: type) {
|
|
// CHECK:STDOUT: %T.patt.loc11_15.2: %pattern_type.9a5 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_15.2 (constants.%T.patt)]
|
|
// CHECK:STDOUT: %T.loc11_15.1: type = symbolic_binding T, 0 [symbolic = %T.loc11_15.1 (constants.%T)]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !definition:
|
|
// CHECK:STDOUT: %.loc17_6.2: require_specific_def_type = require_specific_def @T.as.Z.impl(%T.loc11_15.1) [symbolic = %.loc17_6.2 (constants.%.2f2)]
|
|
// CHECK:STDOUT: %Z.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc11_15.1, @Z [symbolic = %Z.lookup_impl_witness (constants.%Z.lookup_impl_witness)]
|
|
// CHECK:STDOUT: %Z.facet.loc17_6.2: %Z.type = facet_value %T.loc11_15.1, (%Z.lookup_impl_witness) [symbolic = %Z.facet.loc17_6.2 (constants.%Z.facet)]
|
|
// CHECK:STDOUT: %F.specific_fn.loc17_3.2: <specific function> = specific_function constants.%F, @F(%Z.facet.loc17_6.2) [symbolic = %F.specific_fn.loc17_3.2 (constants.%F.specific_fn)]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn() {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
|
|
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc11_15.2 [symbolic = %T.loc11_15.1 (constants.%T)]
|
|
// CHECK:STDOUT: %Z.facet.loc17_6.1: %Z.type = facet_value %T.ref, (constants.%Z.lookup_impl_witness) [symbolic = %Z.facet.loc17_6.2 (constants.%Z.facet)]
|
|
// CHECK:STDOUT: %.loc17_6.1: %Z.type = converted %T.ref, %Z.facet.loc17_6.1 [symbolic = %Z.facet.loc17_6.2 (constants.%Z.facet)]
|
|
// CHECK:STDOUT: %F.specific_fn.loc17_3.1: <specific function> = specific_function %F.ref, @F(constants.%Z.facet) [symbolic = %F.specific_fn.loc17_3.2 (constants.%F.specific_fn)]
|
|
// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn.loc17_3.1()
|
|
// CHECK:STDOUT: return
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @G(constants.%T) {
|
|
// CHECK:STDOUT: %T.patt.loc11_15.2 => constants.%T.patt
|
|
// CHECK:STDOUT: %T.loc11_15.1 => constants.%T
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @G(constants.%empty_tuple.type) {
|
|
// CHECK:STDOUT: %T.patt.loc11_15.2 => constants.%T.patt
|
|
// CHECK:STDOUT: %T.loc11_15.1 => constants.%empty_tuple.type
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !definition:
|
|
// CHECK:STDOUT: %.loc17_6.2 => constants.%.ba2
|
|
// CHECK:STDOUT: %Z.lookup_impl_witness => <error>
|
|
// CHECK:STDOUT: %Z.facet.loc17_6.2 => <error>
|
|
// CHECK:STDOUT: %F.specific_fn.loc17_3.2 => <error>
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- fail_final_lookup_impl_witness_error.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
|
// CHECK:STDOUT: %Z.type: type = facet_type <@Z> [concrete]
|
|
// 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: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
|
|
// CHECK:STDOUT: %Z.impl_witness.47a: <witness> = impl_witness @T.as.Z.impl.%Z.impl_witness_table, @T.as.Z.impl(%empty_tuple.type) [concrete]
|
|
// CHECK:STDOUT: %Z.facet: %Z.type = facet_value %empty_tuple.type, (%Z.impl_witness.47a) [concrete]
|
|
// CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F, @F(%Z.facet) [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @G() {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
|
|
// CHECK:STDOUT: %.loc16_6: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: %Z.facet: %Z.type = facet_value constants.%empty_tuple.type, (constants.%Z.impl_witness.47a) [concrete = constants.%Z.facet]
|
|
// CHECK:STDOUT: %.loc16_7: %Z.type = converted %.loc16_6, %Z.facet [concrete = constants.%Z.facet]
|
|
// CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.ref, @F(constants.%Z.facet) [concrete = constants.%F.specific_fn]
|
|
// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn()
|
|
// CHECK:STDOUT: <elided>
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- fail_invalid_fn_syntax_in_impl.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: impl @<null name>: <unexpected>.inst{{[0-9A-F]+}}.loc9_6 as <unexpected>.inst{{[0-9A-F]+}}.loc9_11;
|
|
// CHECK:STDOUT:
|