From 8d45530c5f16e2e10c07cf1c2622105d372e1b7b Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Mon, 23 Sep 2024 16:59:25 -0700 Subject: [PATCH] Add a `note: ` prefix to all notes. (#4330) Omit the `note: ` prefix and the snippet from the "in import" note that precedes a diagnostic. This makes our diagnostic output more closely match that of Clang and GCC. --- .../check/sem_ir_diagnostic_converter.cpp | 3 +- .../alias/no_prelude/fail_modifiers.carbon | 6 +- .../no_prelude/fail_name_conflict.carbon | 4 +- .../testdata/alias/no_prelude/import.carbon | 14 +- .../testdata/array/fail_bound_overflow.carbon | 2 +- .../array/fail_incomplete_element.carbon | 2 +- .../testdata/array/fail_invalid_type.carbon | 2 +- .../testdata/array/fail_type_mismatch.carbon | 4 +- .../testdata/as/adapter_conversion.carbon | 2 +- .../testdata/as/fail_no_conversion.carbon | 2 +- .../check/testdata/as/fail_not_type.carbon | 2 +- .../basics/fail_non_type_as_type.carbon | 2 +- .../testdata/builtins/float/negate.carbon | 6 +- .../check/testdata/builtins/int/sadd.carbon | 2 +- .../testdata/builtins/int/snegate.carbon | 8 +- .../check/testdata/builtins/int/uadd.carbon | 2 +- .../testdata/builtins/int/unegate.carbon | 8 +- .../testdata/class/access_modifers.carbon | 14 +- .../class/cross_package_import.carbon | 48 ++- .../check/testdata/class/extend_adapt.carbon | 6 +- .../testdata/class/fail_adapt_bad_decl.carbon | 8 +- .../testdata/class/fail_adapt_bad_type.carbon | 2 +- .../class/fail_adapt_modifiers.carbon | 4 +- .../class/fail_adapt_with_subobjects.carbon | 8 +- .../testdata/class/fail_addr_self.carbon | 8 +- .../testdata/class/fail_base_bad_type.carbon | 12 +- .../testdata/class/fail_base_modifiers.carbon | 4 +- .../testdata/class/fail_base_repeated.carbon | 4 +- .../class/fail_compound_type_mismatch.carbon | 2 +- .../class/fail_derived_to_base.carbon | 4 +- .../testdata/class/fail_extend_cycle.carbon | 2 +- .../testdata/class/fail_generic_method.carbon | 2 +- .../testdata/class/fail_import_misuses.carbon | 16 +- .../testdata/class/fail_incomplete.carbon | 28 +- .../class/fail_memaccess_category.carbon | 4 +- .../testdata/class/fail_member_of_let.carbon | 2 +- .../check/testdata/class/fail_method.carbon | 6 +- .../class/fail_method_modifiers.carbon | 6 +- .../class/fail_method_redefinition.carbon | 2 +- .../testdata/class/fail_modifiers.carbon | 12 +- .../fail_redeclaration_introducer.carbon | 12 +- .../testdata/class/fail_redefinition.carbon | 4 +- .../check/testdata/class/fail_self.carbon | 4 +- .../check/testdata/class/generic/call.carbon | 8 +- .../testdata/class/generic/import.carbon | 20 +- .../class/generic/member_access.carbon | 2 +- .../class/generic/member_out_of_line.carbon | 8 +- .../testdata/class/generic/redeclare.carbon | 10 +- .../testdata/class/inheritance_access.carbon | 12 +- .../check/testdata/class/init_adapt.carbon | 8 +- .../testdata/class/no_prelude/extern.carbon | 94 ++---- .../class/no_prelude/implicit_import.carbon | 22 +- .../class/no_prelude/syntactic_merge.carbon | 12 +- .../class/syntactic_merge_literal.carbon | 2 +- .../check/testdata/const/fail_collapse.carbon | 2 +- .../function/builtin/fail_redefined.carbon | 6 +- .../function/call/fail_param_count.carbon | 12 +- .../function/call/fail_param_type.carbon | 4 +- .../call/fail_return_type_mismatch.carbon | 2 +- .../declaration/fail_param_redecl.carbon | 2 +- .../function/declaration/import.carbon | 308 ++++++++---------- .../declaration/no_prelude/extern.carbon | 4 +- .../no_prelude/extern_library.carbon | 34 +- .../extern_library_for_default.carbon | 6 +- .../extern_library_from_default.carbon | 6 +- .../fail_import_incomplete_return.carbon | 46 ++- .../no_prelude/fail_modifiers.carbon | 14 +- .../declaration/no_prelude/fail_redecl.carbon | 10 +- .../no_prelude/implicit_import.carbon | 12 +- .../function/definition/import.carbon | 60 ++-- .../definition/no_prelude/extern.carbon | 10 +- .../no_prelude/extern_library.carbon | 6 +- .../fail_decl_param_mismatch.carbon | 10 +- .../definition/no_prelude/fail_redef.carbon | 2 +- .../no_prelude/implicit_import.carbon | 30 +- .../no_prelude/syntactic_merge.carbon | 10 +- .../testdata/function/generic/deduce.carbon | 10 +- .../function/generic/redeclare.carbon | 12 +- .../impl/fail_extend_impl_type_as.carbon | 4 +- ..._extend_partially_defined_interface.carbon | 2 +- .../fail_extend_undefined_interface.carbon | 2 +- .../impl/fail_impl_bad_assoc_fn.carbon | 30 +- .../impl/fail_impl_bad_interface.carbon | 2 +- .../testdata/impl/fail_redefinition.carbon | 2 +- .../index/fail_array_non_int_indexing.carbon | 2 +- .../fail_assoc_const_bad_default.carbon | 2 +- ..._todo_define_default_fn_out_of_line.carbon | 4 +- .../fail_definition_imported.carbon | 6 +- .../no_prelude/fail_duplicate.carbon | 8 +- .../fail_generic_redeclaration.carbon | 6 +- .../no_prelude/fail_lookup_undefined.carbon | 6 +- .../no_prelude/fail_redeclare_member.carbon | 2 +- .../fail_todo_generic_default_fn.carbon | 2 +- .../interface/no_prelude/generic.carbon | 2 +- .../no_prelude/syntactic_merge.carbon | 52 ++- .../testdata/let/fail_duplicate_decl.carbon | 2 +- .../check/testdata/let/fail_generic.carbon | 4 +- .../testdata/let/fail_generic_import.carbon | 2 +- .../check/testdata/let/fail_modifiers.carbon | 8 +- .../fail_conflict_after_merge.carbon | 20 +- ...l_conflict_imported_namespace_first.carbon | 6 +- ..._conflict_imported_namespace_nested.carbon | 8 +- ..._conflict_imported_namespace_second.carbon | 16 +- ...conflict_in_imports_namespace_first.carbon | 10 +- ...onflict_in_imports_namespace_second.carbon | 10 +- .../namespace/fail_decl_in_alias.carbon | 2 +- .../testdata/namespace/fail_duplicate.carbon | 2 +- .../testdata/namespace/fail_modifiers.carbon | 6 +- .../testdata/namespace/fail_params.carbon | 2 +- .../builtin/fail_type_mismatch.carbon | 2 +- .../fail_type_mismatch_assignment.carbon | 2 +- .../testdata/operators/overloaded/eq.carbon | 4 +- .../overloaded/fail_assign_non_ref.carbon | 4 +- .../overloaded/fail_no_impl_for_arg.carbon | 8 +- .../fail_conflict_no_namespaces.carbon | 10 +- .../testdata/packages/fail_extension.carbon | 4 +- .../packages/fail_import_repeat.carbon | 8 +- .../no_prelude/cross_package_export.carbon | 26 +- .../no_prelude/cross_package_import.carbon | 42 +-- .../packages/no_prelude/export_name.carbon | 16 +- .../no_prelude/fail_export_name_member.carbon | 6 +- .../implicit_imports_entities.carbon | 22 +- .../testdata/pointer/fail_deref_type.carbon | 2 +- .../pointer/fail_type_mismatch.carbon | 2 +- .../testdata/return/fail_let_in_type.carbon | 2 +- .../fail_return_with_returned_var.carbon | 4 +- .../fail_returned_var_no_return_type.carbon | 2 +- .../return/fail_returned_var_shadow.carbon | 4 +- .../return/fail_returned_var_type.carbon | 2 +- .../testdata/return/fail_type_mismatch.carbon | 2 +- .../return/fail_value_disallowed.carbon | 2 +- .../testdata/return/fail_value_missing.carbon | 2 +- .../struct/fail_duplicate_name.carbon | 10 +- .../testdata/struct/fail_type_assign.carbon | 2 +- .../testdata/struct/fail_value_as_type.carbon | 2 +- toolchain/check/testdata/struct/import.carbon | 18 +- .../no_prelude/fail_nested_incomplete.carbon | 2 +- .../tuple/access/fail_non_int_indexing.carbon | 2 +- .../tuple/fail_element_type_mismatch.carbon | 2 +- .../tuple/fail_nested_incomplete.carbon | 2 +- .../testdata/tuple/fail_type_assign.carbon | 2 +- .../testdata/tuple/fail_value_as_type.carbon | 2 +- toolchain/check/testdata/tuple/import.carbon | 20 +- .../var/fail_storage_is_literal.carbon | 2 +- .../var/no_prelude/export_name.carbon | 16 +- .../var/no_prelude/fail_duplicate_decl.carbon | 2 +- .../var/no_prelude/fail_modifiers.carbon | 4 +- .../no_prelude/fail_namespace_conflict.carbon | 4 +- .../testdata/while/fail_bad_condition.carbon | 2 +- toolchain/diagnostics/diagnostic.h | 8 +- toolchain/diagnostics/diagnostic_consumer.cpp | 10 +- toolchain/diagnostics/diagnostic_emitter.h | 5 +- toolchain/diagnostics/mocks.cpp | 3 + .../parse/testdata/packages/export.carbon | 2 +- .../testdata/packages/import/export.carbon | 2 +- .../packages/import/fail_after_decl.carbon | 2 +- .../import/fail_after_decl_repeated.carbon | 6 +- .../packages/library/fail_semi_before.carbon | 2 +- .../packages/library/fail_too_late.carbon | 2 +- .../packages/package/fail_after_decl.carbon | 2 +- .../packages/package/fail_after_import.carbon | 2 +- .../package/fail_after_package.carbon | 2 +- .../packages/package/fail_semi_before.carbon | 2 +- 163 files changed, 725 insertions(+), 940 deletions(-) diff --git a/toolchain/check/sem_ir_diagnostic_converter.cpp b/toolchain/check/sem_ir_diagnostic_converter.cpp index 131fd3829032..fc80b8d014c7 100644 --- a/toolchain/check/sem_ir_diagnostic_converter.cpp +++ b/toolchain/check/sem_ir_diagnostic_converter.cpp @@ -47,7 +47,8 @@ auto SemIRDiagnosticConverter::ConvertLoc(SemIRLoc loc, // TODO: Add an "In implicit import of prelude." note for the case where we // don't have a location. if (import_loc_id.is_valid()) { - CARBON_DIAGNOSTIC(InImport, Note, "in import"); + // TODO: Include the name of the imported library in the diagnostic. + CARBON_DIAGNOSTIC(InImport, LocationInfo, "in import"); context_fn(in_import_loc, InImport); } diff --git a/toolchain/check/testdata/alias/no_prelude/fail_modifiers.carbon b/toolchain/check/testdata/alias/no_prelude/fail_modifiers.carbon index 1311b72c89df..a7231950decd 100644 --- a/toolchain/check/testdata/alias/no_prelude/fail_modifiers.carbon +++ b/toolchain/check/testdata/alias/no_prelude/fail_modifiers.carbon @@ -17,21 +17,21 @@ class Class {} // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+21]]:10: error: `base` not allowed on declaration with `abstract` // CHECK:STDERR: abstract base default final alias A = Class; // CHECK:STDERR: ^~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+18]]:1: `abstract` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+18]]:1: note: `abstract` previously appeared here // CHECK:STDERR: abstract base default final alias A = Class; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+14]]:15: error: `default` not allowed on declaration with `abstract` // CHECK:STDERR: abstract base default final alias A = Class; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: `abstract` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: note: `abstract` previously appeared here // CHECK:STDERR: abstract base default final alias A = Class; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:23: error: `final` not allowed on declaration with `abstract` // CHECK:STDERR: abstract base default final alias A = Class; // CHECK:STDERR: ^~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `abstract` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note: `abstract` previously appeared here // CHECK:STDERR: abstract base default final alias A = Class; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: diff --git a/toolchain/check/testdata/alias/no_prelude/fail_name_conflict.carbon b/toolchain/check/testdata/alias/no_prelude/fail_name_conflict.carbon index 102ea3407174..1a6fd6b9b065 100644 --- a/toolchain/check/testdata/alias/no_prelude/fail_name_conflict.carbon +++ b/toolchain/check/testdata/alias/no_prelude/fail_name_conflict.carbon @@ -14,7 +14,7 @@ alias a = C; // CHECK:STDERR: fail_name_conflict.carbon:[[@LINE+7]]:5: error: duplicate name being declared in the same scope // CHECK:STDERR: var a: C = {}; // CHECK:STDERR: ^ -// CHECK:STDERR: fail_name_conflict.carbon:[[@LINE-4]]:7: name is previously declared here +// CHECK:STDERR: fail_name_conflict.carbon:[[@LINE-4]]:7: note: name is previously declared here // CHECK:STDERR: alias a = C; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -24,7 +24,7 @@ var b: C = {}; // CHECK:STDERR: fail_name_conflict.carbon:[[@LINE+6]]:7: error: duplicate name being declared in the same scope // CHECK:STDERR: alias b = C; // CHECK:STDERR: ^ -// CHECK:STDERR: fail_name_conflict.carbon:[[@LINE-4]]:5: name is previously declared here +// CHECK:STDERR: fail_name_conflict.carbon:[[@LINE-4]]:5: note: name is previously declared here // CHECK:STDERR: var b: C = {}; // CHECK:STDERR: ^ alias b = C; diff --git a/toolchain/check/testdata/alias/no_prelude/import.carbon b/toolchain/check/testdata/alias/no_prelude/import.carbon index c844973f2823..3d0a1281de85 100644 --- a/toolchain/check/testdata/alias/no_prelude/import.carbon +++ b/toolchain/check/testdata/alias/no_prelude/import.carbon @@ -58,9 +58,7 @@ var b: () = a_alias; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_var3.carbon:[[@LINE+6]]:1: in import -// CHECK:STDERR: import library "var2"; -// CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: fail_var3.carbon:[[@LINE+4]]:1: in import // CHECK:STDERR: var2.carbon:8:5: error: semantics TODO: `Non-constant ImportRefLoaded (comes up with var)` // CHECK:STDERR: var b: () = a_alias; // CHECK:STDERR: ^ @@ -255,8 +253,8 @@ var c: () = a_alias_alias; // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %.loc12_9.1: %.1 = tuple_literal () -// CHECK:STDOUT: %.loc12_9.2: type = converted %.loc12_9.1, constants.%.1 [template = constants.%.1] +// CHECK:STDOUT: %.loc10_9.1: %.1 = tuple_literal () +// CHECK:STDOUT: %.loc10_9.2: type = converted %.loc10_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %c.var: ref %.1 = var c // CHECK:STDOUT: %c: ref %.1 = bind_name c, %c.var // CHECK:STDOUT: } @@ -264,9 +262,9 @@ var c: () = a_alias_alias; // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a_alias_alias.ref: ref %.1 = name_ref a_alias_alias, imports.%import_ref.1 [template = ] -// CHECK:STDOUT: %.loc12_13: init %.1 = tuple_init () to file.%c.var [template = constants.%tuple] -// CHECK:STDOUT: %.loc12_26: init %.1 = converted %a_alias_alias.ref, %.loc12_13 [template = constants.%tuple] -// CHECK:STDOUT: assign file.%c.var, %.loc12_26 +// CHECK:STDOUT: %.loc10_13: init %.1 = tuple_init () to file.%c.var [template = constants.%tuple] +// CHECK:STDOUT: %.loc10_26: init %.1 = converted %a_alias_alias.ref, %.loc10_13 [template = constants.%tuple] +// CHECK:STDOUT: assign file.%c.var, %.loc10_26 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/fail_bound_overflow.carbon b/toolchain/check/testdata/array/fail_bound_overflow.carbon index ce45093a4c50..211a8b99262f 100644 --- a/toolchain/check/testdata/array/fail_bound_overflow.carbon +++ b/toolchain/check/testdata/array/fail_bound_overflow.carbon @@ -20,7 +20,7 @@ var a: [i32; 39999999999999999993]; // CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+10]]:9: error: cannot implicitly convert from `i32` to `type` // CHECK:STDERR: var b: [1; 39999999999999999993]; // CHECK:STDERR: ^ -// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+7]]:9: type `i32` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+7]]:9: note: type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: var b: [1; 39999999999999999993]; // CHECK:STDERR: ^ // CHECK:STDERR: diff --git a/toolchain/check/testdata/array/fail_incomplete_element.carbon b/toolchain/check/testdata/array/fail_incomplete_element.carbon index 07f63b3f4462..c6b4213bb3e6 100644 --- a/toolchain/check/testdata/array/fail_incomplete_element.carbon +++ b/toolchain/check/testdata/array/fail_incomplete_element.carbon @@ -13,7 +13,7 @@ class Incomplete; // CHECK:STDERR: fail_incomplete_element.carbon:[[@LINE+6]]:8: error: Variable has incomplete type `[Incomplete; 1]` // CHECK:STDERR: var a: [Incomplete; 1]; // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_incomplete_element.carbon:[[@LINE-5]]:1: class was forward declared here +// CHECK:STDERR: fail_incomplete_element.carbon:[[@LINE-5]]:1: note: class was forward declared here // CHECK:STDERR: class Incomplete; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ var a: [Incomplete; 1]; diff --git a/toolchain/check/testdata/array/fail_invalid_type.carbon b/toolchain/check/testdata/array/fail_invalid_type.carbon index 8fb92850b7e5..68aa24f3b40b 100644 --- a/toolchain/check/testdata/array/fail_invalid_type.carbon +++ b/toolchain/check/testdata/array/fail_invalid_type.carbon @@ -11,7 +11,7 @@ // CHECK:STDERR: fail_invalid_type.carbon:[[@LINE+6]]:9: error: cannot implicitly convert from `i32` to `type` // CHECK:STDERR: var a: [1; 1]; // CHECK:STDERR: ^ -// CHECK:STDERR: fail_invalid_type.carbon:[[@LINE+3]]:9: type `i32` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_invalid_type.carbon:[[@LINE+3]]:9: note: type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: var a: [1; 1]; // CHECK:STDERR: ^ var a: [1; 1]; diff --git a/toolchain/check/testdata/array/fail_type_mismatch.carbon b/toolchain/check/testdata/array/fail_type_mismatch.carbon index 61801716b913..b792d935e578 100644 --- a/toolchain/check/testdata/array/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/array/fail_type_mismatch.carbon @@ -11,7 +11,7 @@ // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+7]]:19: error: cannot implicitly convert from `String` to `i32` // CHECK:STDERR: var a: [i32; 3] = (1, "Hello", "World"); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:19: type `String` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:19: note: type `String` does not implement interface `ImplicitAs` // CHECK:STDERR: var a: [i32; 3] = (1, "Hello", "World"); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -21,7 +21,7 @@ var t1: (i32, String, String); // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+7]]:19: error: cannot implicitly convert from `String` to `i32` // CHECK:STDERR: var b: [i32; 3] = t1; // CHECK:STDERR: ^~ -// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:19: type `String` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:19: note: type `String` does not implement interface `ImplicitAs` // CHECK:STDERR: var b: [i32; 3] = t1; // CHECK:STDERR: ^~ // CHECK:STDERR: diff --git a/toolchain/check/testdata/as/adapter_conversion.carbon b/toolchain/check/testdata/as/adapter_conversion.carbon index 5330d9fa01d4..c1e329df6ac3 100644 --- a/toolchain/check/testdata/as/adapter_conversion.carbon +++ b/toolchain/check/testdata/as/adapter_conversion.carbon @@ -100,7 +100,7 @@ class B { // CHECK:STDERR: fail_adapt_init_from_struct.carbon:[[@LINE+6]]:12: error: cannot convert from `{.x: i32}` to `B` with `as` // CHECK:STDERR: var b: B = {.x = 1} as B; // CHECK:STDERR: ^~~~~~~~~~~~~ -// CHECK:STDERR: fail_adapt_init_from_struct.carbon:[[@LINE+3]]:12: type `{.x: i32}` does not implement interface `As` +// CHECK:STDERR: fail_adapt_init_from_struct.carbon:[[@LINE+3]]:12: note: type `{.x: i32}` does not implement interface `As` // CHECK:STDERR: var b: B = {.x = 1} as B; // CHECK:STDERR: ^~~~~~~~~~~~~ var b: B = {.x = 1} as B; diff --git a/toolchain/check/testdata/as/fail_no_conversion.carbon b/toolchain/check/testdata/as/fail_no_conversion.carbon index c255da428bd0..09a006b03d58 100644 --- a/toolchain/check/testdata/as/fail_no_conversion.carbon +++ b/toolchain/check/testdata/as/fail_no_conversion.carbon @@ -11,7 +11,7 @@ // CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+6]]:21: error: cannot convert from `i32` to `(i32, i32)` with `as` // CHECK:STDERR: let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+3]]:21: type `i32` does not implement interface `As` +// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+3]]:21: note: type `i32` does not implement interface `As` // CHECK:STDERR: let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDERR: ^~~~~~~~~~~~~~~ let n: (i32, i32) = 1 as (i32, i32); diff --git a/toolchain/check/testdata/as/fail_not_type.carbon b/toolchain/check/testdata/as/fail_not_type.carbon index 766b29af8c41..f5025410197d 100644 --- a/toolchain/check/testdata/as/fail_not_type.carbon +++ b/toolchain/check/testdata/as/fail_not_type.carbon @@ -11,7 +11,7 @@ // CHECK:STDERR: fail_not_type.carbon:[[@LINE+6]]:19: error: cannot implicitly convert from `i32` to `type` // CHECK:STDERR: let n: i32 = 1 as 2; // CHECK:STDERR: ^ -// CHECK:STDERR: fail_not_type.carbon:[[@LINE+3]]:19: type `i32` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_not_type.carbon:[[@LINE+3]]:19: note: type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: let n: i32 = 1 as 2; // CHECK:STDERR: ^ let n: i32 = 1 as 2; diff --git a/toolchain/check/testdata/basics/fail_non_type_as_type.carbon b/toolchain/check/testdata/basics/fail_non_type_as_type.carbon index 5b3b25f5e927..46048e71cd4d 100644 --- a/toolchain/check/testdata/basics/fail_non_type_as_type.carbon +++ b/toolchain/check/testdata/basics/fail_non_type_as_type.carbon @@ -11,7 +11,7 @@ // CHECK:STDERR: fail_non_type_as_type.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `i32` to `type` // CHECK:STDERR: var x: type = 42; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_non_type_as_type.carbon:[[@LINE+3]]:1: type `i32` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_non_type_as_type.carbon:[[@LINE+3]]:1: note: type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: var x: type = 42; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ var x: type = 42; diff --git a/toolchain/check/testdata/builtins/float/negate.carbon b/toolchain/check/testdata/builtins/float/negate.carbon index 29dcb5eb5c77..0d3941c20290 100644 --- a/toolchain/check/testdata/builtins/float/negate.carbon +++ b/toolchain/check/testdata/builtins/float/negate.carbon @@ -43,7 +43,7 @@ fn RuntimeCallTooFew(a: f64) -> f64 { // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: error: 1 argument(s) passed to function expecting 0 argument(s). // CHECK:STDERR: return TooFew(a); // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-17]]:1: calling function declared here + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-17]]:1: note: calling function declared here // CHECK:STDERR: fn TooFew() -> f64 = "float.negate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -54,7 +54,7 @@ fn RuntimeCallTooMany(a: f64, b: f64, c: f64) -> f64 { // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: error: 3 argument(s) passed to function expecting 2 argument(s). // CHECK:STDERR: return TooMany(a, b, c); // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-23]]:1: calling function declared here + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-23]]:1: note: calling function declared here // CHECK:STDERR: fn TooMany(a: f64, b: f64) -> f64 = "float.negate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -65,7 +65,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+6]]:10: error: 2 argument(s) passed to function expecting 1 argument(s). // CHECK:STDERR: return BadReturnType(a, b); // CHECK:STDERR: ^~~~~~~~~~~~~~ - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-29]]:1: calling function declared here + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-29]]:1: note: calling function declared here // CHECK:STDERR: fn BadReturnType(a: f64) -> bool = "float.negate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ return BadReturnType(a, b); diff --git a/toolchain/check/testdata/builtins/int/sadd.carbon b/toolchain/check/testdata/builtins/int/sadd.carbon index 319e98b307bd..9c85c57daa17 100644 --- a/toolchain/check/testdata/builtins/int/sadd.carbon +++ b/toolchain/check/testdata/builtins/int/sadd.carbon @@ -59,7 +59,7 @@ var bad_return_type: [i32; BadReturnType(1, 2)]; // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:21: error: 3 argument(s) passed to function expecting 2 argument(s). // CHECK:STDERR: var bad_call: [i32; JustRight(1, 2, 3)]; // CHECK:STDERR: ^~~~~~~~~~ -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-21]]:1: calling function declared here +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-21]]:1: note: calling function declared here // CHECK:STDERR: fn JustRight(a: i32, b: i32) -> i32 = "int.sadd"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: diff --git a/toolchain/check/testdata/builtins/int/snegate.carbon b/toolchain/check/testdata/builtins/int/snegate.carbon index 9b58a5843c9b..ee86b87b4d31 100644 --- a/toolchain/check/testdata/builtins/int/snegate.carbon +++ b/toolchain/check/testdata/builtins/int/snegate.carbon @@ -61,7 +61,7 @@ var bad_return_type: [i32; BadReturnType(1)]; // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:21: error: 2 argument(s) passed to function expecting 1 argument(s). // CHECK:STDERR: var bad_call: [i32; JustRight(1, 2)]; // CHECK:STDERR: ^~~~~~~~~~ -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-21]]:1: calling function declared here +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-21]]:1: note: calling function declared here // CHECK:STDERR: fn JustRight(a: i32) -> i32 = "int.snegate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -71,7 +71,7 @@ fn RuntimeCallTooFew(a: i32) -> i32 { // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: error: 1 argument(s) passed to function expecting 0 argument(s). // CHECK:STDERR: return TooFew(a); // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-42]]:1: calling function declared here + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-42]]:1: note: calling function declared here // CHECK:STDERR: fn TooFew() -> i32 = "int.snegate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -82,7 +82,7 @@ fn RuntimeCallTooMany(a: i32, b: i32, c: i32) -> i32 { // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: error: 3 argument(s) passed to function expecting 2 argument(s). // CHECK:STDERR: return TooMany(a, b, c); // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-48]]:1: calling function declared here + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-48]]:1: note: calling function declared here // CHECK:STDERR: fn TooMany(a: i32, b: i32) -> i32 = "int.snegate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -93,7 +93,7 @@ fn RuntimeCallBadReturnType(a: i32, b: i32) -> bool { // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: error: 2 argument(s) passed to function expecting 1 argument(s). // CHECK:STDERR: return BadReturnType(a, b); // CHECK:STDERR: ^~~~~~~~~~~~~~ - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-54]]:1: calling function declared here + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-54]]:1: note: calling function declared here // CHECK:STDERR: fn BadReturnType(a: i32) -> bool = "int.snegate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: diff --git a/toolchain/check/testdata/builtins/int/uadd.carbon b/toolchain/check/testdata/builtins/int/uadd.carbon index fd365e59d9e4..7cbc8330fbf1 100644 --- a/toolchain/check/testdata/builtins/int/uadd.carbon +++ b/toolchain/check/testdata/builtins/int/uadd.carbon @@ -59,7 +59,7 @@ var bad_return_type: [i32; BadReturnType(1, 2)]; // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+6]]:21: error: 3 argument(s) passed to function expecting 2 argument(s). // CHECK:STDERR: var bad_call: [i32; JustRight(1, 2, 3)]; // CHECK:STDERR: ^~~~~~~~~~ -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-21]]:1: calling function declared here +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-21]]:1: note: calling function declared here // CHECK:STDERR: fn JustRight(a: i32, b: i32) -> i32 = "int.uadd"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var bad_call: [i32; JustRight(1, 2, 3)]; diff --git a/toolchain/check/testdata/builtins/int/unegate.carbon b/toolchain/check/testdata/builtins/int/unegate.carbon index 290dde45c903..c4de1fd344ca 100644 --- a/toolchain/check/testdata/builtins/int/unegate.carbon +++ b/toolchain/check/testdata/builtins/int/unegate.carbon @@ -61,7 +61,7 @@ var bad_return_type: [i32; BadReturnType(1)]; // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:21: error: 2 argument(s) passed to function expecting 1 argument(s). // CHECK:STDERR: var bad_call: [i32; JustRight(1, 2)]; // CHECK:STDERR: ^~~~~~~~~~ -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-21]]:1: calling function declared here +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-21]]:1: note: calling function declared here // CHECK:STDERR: fn JustRight(a: i32) -> i32 = "int.unegate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -71,7 +71,7 @@ fn RuntimeCallTooFew(a: i32) -> i32 { // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: error: 1 argument(s) passed to function expecting 0 argument(s). // CHECK:STDERR: return TooFew(a); // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-42]]:1: calling function declared here + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-42]]:1: note: calling function declared here // CHECK:STDERR: fn TooFew() -> i32 = "int.unegate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -82,7 +82,7 @@ fn RuntimeCallTooMany(a: i32, b: i32, c: i32) -> i32 { // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: error: 3 argument(s) passed to function expecting 2 argument(s). // CHECK:STDERR: return TooMany(a, b, c); // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-48]]:1: calling function declared here + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-48]]:1: note: calling function declared here // CHECK:STDERR: fn TooMany(a: i32, b: i32) -> i32 = "int.unegate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -93,7 +93,7 @@ fn RuntimeCallBadReturnType(a: i32, b: i32) -> bool { // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+6]]:10: error: 2 argument(s) passed to function expecting 1 argument(s). // CHECK:STDERR: return BadReturnType(a, b); // CHECK:STDERR: ^~~~~~~~~~~~~~ - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-54]]:1: calling function declared here + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-54]]:1: note: calling function declared here // CHECK:STDERR: fn BadReturnType(a: i32) -> bool = "int.unegate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ return BadReturnType(a, b); diff --git a/toolchain/check/testdata/class/access_modifers.carbon b/toolchain/check/testdata/class/access_modifers.carbon index 8335269b67a0..23285ee6fb8d 100644 --- a/toolchain/check/testdata/class/access_modifers.carbon +++ b/toolchain/check/testdata/class/access_modifers.carbon @@ -30,7 +30,7 @@ fn Run() { // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE+7]]:21: error: cannot access private member `radius` of type `Circle` // CHECK:STDERR: let radius: i32 = circle.radius; // CHECK:STDERR: ^~~~~~~~~~~~~ - // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE-17]]:15: the private member `radius` is defined here + // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE-17]]:15: note: the private member `radius` is defined here // CHECK:STDERR: private var radius: i32; // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: @@ -38,7 +38,7 @@ fn Run() { // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE+7]]:3: error: cannot access private member `radius` of type `Circle` // CHECK:STDERR: circle.radius = 5; // CHECK:STDERR: ^~~~~~~~~~~~~ - // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE-25]]:15: the private member `radius` is defined here + // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE-25]]:15: note: the private member `radius` is defined here // CHECK:STDERR: private var radius: i32; // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: @@ -46,7 +46,7 @@ fn Run() { // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE+7]]:3: error: cannot access private member `SOME_INTERNAL_CONSTANT` of type `Circle` // CHECK:STDERR: circle.SOME_INTERNAL_CONSTANT; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE-32]]:15: the private member `SOME_INTERNAL_CONSTANT` is defined here + // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE-32]]:15: note: the private member `SOME_INTERNAL_CONSTANT` is defined here // CHECK:STDERR: private let SOME_INTERNAL_CONSTANT: i32 = 5; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -55,7 +55,7 @@ fn Run() { // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE+7]]:3: error: cannot access private member `SomeInternalFunction` of type `Circle` // CHECK:STDERR: circle.SomeInternalFunction(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE-39]]:3: the private member `SomeInternalFunction` is defined here + // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE-39]]:3: note: the private member `SomeInternalFunction` is defined here // CHECK:STDERR: private fn SomeInternalFunction() -> i32 { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -74,7 +74,7 @@ fn Run() { // CHECK:STDERR: fail_protected_field_access.carbon:[[@LINE+7]]:16: error: cannot access protected member `x` of type `A` // CHECK:STDERR: let x: i32 = A.x; // CHECK:STDERR: ^~~ - // CHECK:STDERR: fail_protected_field_access.carbon:[[@LINE-7]]:17: the protected member `x` is defined here + // CHECK:STDERR: fail_protected_field_access.carbon:[[@LINE-7]]:17: note: the protected member `x` is defined here // CHECK:STDERR: protected var x: i32; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -123,7 +123,7 @@ class A { // CHECK:STDERR: fail_global_access.carbon:[[@LINE+7]]:14: error: cannot access protected member `x` of type `A` // CHECK:STDERR: let x: i32 = A.x; // CHECK:STDERR: ^~~ -// CHECK:STDERR: fail_global_access.carbon:[[@LINE-7]]:17: the protected member `x` is defined here +// CHECK:STDERR: fail_global_access.carbon:[[@LINE-7]]:17: note: the protected member `x` is defined here // CHECK:STDERR: protected let x: i32 = 5; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -131,7 +131,7 @@ let x: i32 = A.x; // CHECK:STDERR: fail_global_access.carbon:[[@LINE+6]]:14: error: cannot access private member `y` of type `A` // CHECK:STDERR: let y: i32 = A.y; // CHECK:STDERR: ^~~ -// CHECK:STDERR: fail_global_access.carbon:[[@LINE-14]]:15: the private member `y` is defined here +// CHECK:STDERR: fail_global_access.carbon:[[@LINE-14]]:15: note: the private member `y` is defined here // CHECK:STDERR: private let y: i32 = 5; // CHECK:STDERR: ^ let y: i32 = A.y; diff --git a/toolchain/check/testdata/class/cross_package_import.carbon b/toolchain/check/testdata/class/cross_package_import.carbon index 7a3cdf4005a4..8e98d482135f 100644 --- a/toolchain/check/testdata/class/cross_package_import.carbon +++ b/toolchain/check/testdata/class/cross_package_import.carbon @@ -48,13 +48,11 @@ library "[[@TEST_NAME]]"; import Other library "other_extern"; -// CHECK:STDERR: fail_extern.carbon:[[@LINE+10]]:8: error: Variable has incomplete type `C` +// CHECK:STDERR: fail_extern.carbon:[[@LINE+8]]:8: error: Variable has incomplete type `C` // CHECK:STDERR: var c: Other.C = {}; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fail_extern.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: import Other library "other_extern"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: other_extern.carbon:4:1: class was forward declared here +// CHECK:STDERR: other_extern.carbon:4:1: note: class was forward declared here // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -64,22 +62,18 @@ var c: Other.C = {}; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_todo_merge_define_extern.carbon:[[@LINE+12]]:1: in import -// CHECK:STDERR: import Other library "other_define"; -// CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: fail_todo_merge_define_extern.carbon:[[@LINE+8]]:1: in import // CHECK:STDERR: other_extern.carbon:4:1: error: duplicate name being declared in the same scope // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_todo_merge_define_extern.carbon:[[@LINE+6]]:1: in import -// CHECK:STDERR: import Other library "other_define"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: other_define.carbon:4:1: name is previously declared here +// CHECK:STDERR: fail_todo_merge_define_extern.carbon:[[@LINE+4]]:1: in import +// CHECK:STDERR: other_define.carbon:4:1: note: name is previously declared here // CHECK:STDERR: class C {} // CHECK:STDERR: ^~~~~~~~~ import Other library "other_define"; import Other library "other_extern"; -// CHECK:STDERR: fail_todo_merge_define_extern.carbon:[[@LINE+4]]:8: in name lookup for `C` +// CHECK:STDERR: fail_todo_merge_define_extern.carbon:[[@LINE+4]]:8: note: in name lookup for `C` // CHECK:STDERR: var c: Other.C = {}; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -89,22 +83,18 @@ var c: Other.C = {}; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+12]]:1: in import -// CHECK:STDERR: import Other library "other_define"; -// CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+8]]:1: in import // CHECK:STDERR: other_conflict.carbon:4:1: error: duplicate name being declared in the same scope // CHECK:STDERR: fn C() {} // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+6]]:1: in import -// CHECK:STDERR: import Other library "other_define"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: other_define.carbon:4:1: name is previously declared here +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+4]]:1: in import +// CHECK:STDERR: other_define.carbon:4:1: note: name is previously declared here // CHECK:STDERR: class C {} // CHECK:STDERR: ^~~~~~~~~ import Other library "other_define"; import Other library "other_conflict"; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+3]]:8: in name lookup for `C` +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+3]]:8: note: in name lookup for `C` // CHECK:STDERR: var c: Other.C = {}; // CHECK:STDERR: ^~~~~~~ var c: Other.C = {}; @@ -312,7 +302,7 @@ var c: Other.C = {}; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc16: %.1 = struct_literal () +// CHECK:STDOUT: %.loc14: %.1 = struct_literal () // CHECK:STDOUT: assign file.%c.var, // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -370,10 +360,10 @@ var c: Other.C = {}; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc23_19.1: %.1 = struct_literal () -// CHECK:STDOUT: %.loc23_19.2: init %C = class_init (), file.%c.var [template = constants.%struct] -// CHECK:STDOUT: %.loc23_20: init %C = converted %.loc23_19.1, %.loc23_19.2 [template = constants.%struct] -// CHECK:STDOUT: assign file.%c.var, %.loc23_20 +// CHECK:STDOUT: %.loc19_19.1: %.1 = struct_literal () +// CHECK:STDOUT: %.loc19_19.2: init %C = class_init (), file.%c.var [template = constants.%struct] +// CHECK:STDOUT: %.loc19_20: init %C = converted %.loc19_19.1, %.loc19_19.2 [template = constants.%struct] +// CHECK:STDOUT: assign file.%c.var, %.loc19_20 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -430,10 +420,10 @@ var c: Other.C = {}; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc22_19.1: %.1 = struct_literal () -// CHECK:STDOUT: %.loc22_19.2: init %C = class_init (), file.%c.var [template = constants.%struct] -// CHECK:STDOUT: %.loc22_20: init %C = converted %.loc22_19.1, %.loc22_19.2 [template = constants.%struct] -// CHECK:STDOUT: assign file.%c.var, %.loc22_20 +// CHECK:STDOUT: %.loc18_19.1: %.1 = struct_literal () +// CHECK:STDOUT: %.loc18_19.2: init %C = class_init (), file.%c.var [template = constants.%struct] +// CHECK:STDOUT: %.loc18_20: init %C = converted %.loc18_19.1, %.loc18_19.2 [template = constants.%struct] +// CHECK:STDOUT: assign file.%c.var, %.loc18_20 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/extend_adapt.carbon b/toolchain/check/testdata/class/extend_adapt.carbon index 8e5542222825..c31cd0497136 100644 --- a/toolchain/check/testdata/class/extend_adapt.carbon +++ b/toolchain/check/testdata/class/extend_adapt.carbon @@ -51,10 +51,10 @@ fn F(a: SomeClassAdapter) { // CHECK:STDERR: fail_todo_method_access.carbon:[[@LINE+10]]:3: error: cannot implicitly convert from `SomeClassAdapter` to `SomeClass` // CHECK:STDERR: a.F(); // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_todo_method_access.carbon:[[@LINE+7]]:3: type `SomeClassAdapter` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_todo_method_access.carbon:[[@LINE+7]]:3: note: type `SomeClassAdapter` does not implement interface `ImplicitAs` // CHECK:STDERR: a.F(); // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_todo_method_access.carbon:[[@LINE-14]]:8: initializing `self` parameter of method declared here + // CHECK:STDERR: fail_todo_method_access.carbon:[[@LINE-14]]:8: note: initializing `self` parameter of method declared here // CHECK:STDERR: fn F[self: Self](); // CHECK:STDERR: ^~~~ // CHECK:STDERR: @@ -78,7 +78,7 @@ fn F(a: SomeClassAdapter) -> i32 { // CHECK:STDERR: fail_todo_field_access.carbon:[[@LINE+7]]:10: error: cannot implicitly convert from `SomeClassAdapter` to `SomeClass` // CHECK:STDERR: return a.b; // CHECK:STDERR: ^~~ - // CHECK:STDERR: fail_todo_field_access.carbon:[[@LINE+4]]:10: type `SomeClassAdapter` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_todo_field_access.carbon:[[@LINE+4]]:10: note: type `SomeClassAdapter` does not implement interface `ImplicitAs` // CHECK:STDERR: return a.b; // CHECK:STDERR: ^~~ // CHECK:STDERR: diff --git a/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon b/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon index 0f6a5da236d6..11b50b523ec9 100644 --- a/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon +++ b/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon @@ -16,7 +16,7 @@ class Bad { // CHECK:STDERR: fail_not_type.carbon:[[@LINE+7]]:3: error: cannot implicitly convert from `i32` to `type` // CHECK:STDERR: adapt 100; // CHECK:STDERR: ^~~~~~~~~~ - // CHECK:STDERR: fail_not_type.carbon:[[@LINE+4]]:3: type `i32` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_not_type.carbon:[[@LINE+4]]:3: note: type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: adapt 100; // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: @@ -37,7 +37,7 @@ class Bad { // CHECK:STDERR: fail_extend_not_type.carbon:[[@LINE+7]]:3: error: cannot implicitly convert from `i32` to `type` // CHECK:STDERR: extend adapt 100; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_extend_not_type.carbon:[[@LINE+4]]:3: type `i32` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_extend_not_type.carbon:[[@LINE+4]]:3: note: type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: extend adapt 100; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -56,7 +56,7 @@ class MultipleAdapts { // CHECK:STDERR: fail_repeated.carbon:[[@LINE+7]]:3: error: multiple `adapt` declarations in class // CHECK:STDERR: adapt {}; // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_repeated.carbon:[[@LINE-4]]:3: previous `adapt` declaration is here + // CHECK:STDERR: fail_repeated.carbon:[[@LINE-4]]:3: note: previous `adapt` declaration is here // CHECK:STDERR: adapt (); // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -68,7 +68,7 @@ class MultipleAdaptsSameType { // CHECK:STDERR: fail_repeated.carbon:[[@LINE+7]]:3: error: multiple `adapt` declarations in class // CHECK:STDERR: adapt (); // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_repeated.carbon:[[@LINE-4]]:3: previous `adapt` declaration is here + // CHECK:STDERR: fail_repeated.carbon:[[@LINE-4]]:3: note: previous `adapt` declaration is here // CHECK:STDERR: adapt (); // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: diff --git a/toolchain/check/testdata/class/fail_adapt_bad_type.carbon b/toolchain/check/testdata/class/fail_adapt_bad_type.carbon index 4dbde4defbf4..8cff588d39f1 100644 --- a/toolchain/check/testdata/class/fail_adapt_bad_type.carbon +++ b/toolchain/check/testdata/class/fail_adapt_bad_type.carbon @@ -18,7 +18,7 @@ class AdaptIncomplete { // CHECK:STDERR: fail_incomplete_type.carbon:[[@LINE+6]]:3: error: adapted type `Incomplete` is an incomplete type // CHECK:STDERR: adapt Incomplete; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_incomplete_type.carbon:[[@LINE-6]]:1: class was forward declared here + // CHECK:STDERR: fail_incomplete_type.carbon:[[@LINE-6]]:1: note: class was forward declared here // CHECK:STDERR: class Incomplete; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ adapt Incomplete; diff --git a/toolchain/check/testdata/class/fail_adapt_modifiers.carbon b/toolchain/check/testdata/class/fail_adapt_modifiers.carbon index 1082b8403267..f8387bce5f56 100644 --- a/toolchain/check/testdata/class/fail_adapt_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_adapt_modifiers.carbon @@ -38,7 +38,7 @@ class C4 { // CHECK:STDERR: fail_adapt_modifiers.carbon:[[@LINE+7]]:10: error: `extend` repeated on declaration // CHECK:STDERR: extend extend adapt B; // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_adapt_modifiers.carbon:[[@LINE+4]]:3: `extend` previously appeared here + // CHECK:STDERR: fail_adapt_modifiers.carbon:[[@LINE+4]]:3: note: `extend` previously appeared here // CHECK:STDERR: extend extend adapt B; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -49,7 +49,7 @@ class C5 { // CHECK:STDERR: fail_adapt_modifiers.carbon:[[@LINE+6]]:10: error: `base` not allowed on declaration with `extend` // CHECK:STDERR: extend base adapt B; // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_adapt_modifiers.carbon:[[@LINE+3]]:3: `extend` previously appeared here + // CHECK:STDERR: fail_adapt_modifiers.carbon:[[@LINE+3]]:3: note: `extend` previously appeared here // CHECK:STDERR: extend base adapt B; // CHECK:STDERR: ^~~~~~ extend base adapt B; diff --git a/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon b/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon index 61d748b6ca0b..0e1782add643 100644 --- a/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon +++ b/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon @@ -19,7 +19,7 @@ class AdaptWithBase { // CHECK:STDERR: adapt i32; // CHECK:STDERR: ^~~~~~~~~~ adapt i32; - // CHECK:STDERR: fail_adapt_with_base.carbon:[[@LINE+4]]:3: `base` declaration is here + // CHECK:STDERR: fail_adapt_with_base.carbon:[[@LINE+4]]:3: note: `base` declaration is here // CHECK:STDERR: extend base: Base; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -35,7 +35,7 @@ class AdaptWithField { // CHECK:STDERR: adapt i32; // CHECK:STDERR: ^~~~~~~~~~ adapt i32; - // CHECK:STDERR: fail_adapt_with_fields.carbon:[[@LINE+4]]:7: first field declaration is here + // CHECK:STDERR: fail_adapt_with_fields.carbon:[[@LINE+4]]:7: note: first field declaration is here // CHECK:STDERR: var n: i32; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -47,7 +47,7 @@ class AdaptWithFields { // CHECK:STDERR: adapt i32; // CHECK:STDERR: ^~~~~~~~~~ adapt i32; - // CHECK:STDERR: fail_adapt_with_fields.carbon:[[@LINE+4]]:7: first field declaration is here + // CHECK:STDERR: fail_adapt_with_fields.carbon:[[@LINE+4]]:7: note: first field declaration is here // CHECK:STDERR: var a: i32; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -68,7 +68,7 @@ class AdaptWithBaseAndFields { // CHECK:STDERR: fail_adapt_with_base_and_fields.carbon:[[@LINE+6]]:3: error: adapter with base class // CHECK:STDERR: adapt {}; // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_adapt_with_base_and_fields.carbon:[[@LINE-5]]:3: `base` declaration is here + // CHECK:STDERR: fail_adapt_with_base_and_fields.carbon:[[@LINE-5]]:3: note: `base` declaration is here // CHECK:STDERR: extend base: Base; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ adapt {}; diff --git a/toolchain/check/testdata/class/fail_addr_self.carbon b/toolchain/check/testdata/class/fail_addr_self.carbon index fcb0575c4f62..828038b1e1c7 100644 --- a/toolchain/check/testdata/class/fail_addr_self.carbon +++ b/toolchain/check/testdata/class/fail_addr_self.carbon @@ -17,7 +17,7 @@ fn F(c: Class, p: Class*) { // CHECK:STDERR: fail_addr_self.carbon:[[@LINE+7]]:6: error: `addr self` method cannot be invoked on a value // CHECK:STDERR: c.F(); // CHECK:STDERR: ^ - // CHECK:STDERR: fail_addr_self.carbon:[[@LINE-8]]:13: initializing `addr self` parameter of method declared here + // CHECK:STDERR: fail_addr_self.carbon:[[@LINE-8]]:13: note: initializing `addr self` parameter of method declared here // CHECK:STDERR: fn F[addr self: Class*](); // CHECK:STDERR: ^~~~ // CHECK:STDERR: @@ -26,7 +26,7 @@ fn F(c: Class, p: Class*) { // CHECK:STDERR: fail_addr_self.carbon:[[@LINE+7]]:6: error: `addr self` method cannot be invoked on a value // CHECK:STDERR: c.G(); // CHECK:STDERR: ^ - // CHECK:STDERR: fail_addr_self.carbon:[[@LINE-16]]:13: initializing `addr self` parameter of method declared here + // CHECK:STDERR: fail_addr_self.carbon:[[@LINE-16]]:13: note: initializing `addr self` parameter of method declared here // CHECK:STDERR: fn G[addr self: Class](); // CHECK:STDERR: ^~~~ // CHECK:STDERR: @@ -38,10 +38,10 @@ fn F(c: Class, p: Class*) { // CHECK:STDERR: fail_addr_self.carbon:[[@LINE+9]]:3: error: cannot implicitly convert from `Class*` to `Class` // CHECK:STDERR: (*p).G(); // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_addr_self.carbon:[[@LINE+6]]:3: type `Class*` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_addr_self.carbon:[[@LINE+6]]:3: note: type `Class*` does not implement interface `ImplicitAs` // CHECK:STDERR: (*p).G(); // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_addr_self.carbon:[[@LINE-31]]:13: initializing `addr self` parameter of method declared here + // CHECK:STDERR: fail_addr_self.carbon:[[@LINE-31]]:13: note: initializing `addr self` parameter of method declared here // CHECK:STDERR: fn G[addr self: Class](); // CHECK:STDERR: ^~~~ (*p).G(); diff --git a/toolchain/check/testdata/class/fail_base_bad_type.carbon b/toolchain/check/testdata/class/fail_base_bad_type.carbon index 902f337f5538..1a6515328c9e 100644 --- a/toolchain/check/testdata/class/fail_base_bad_type.carbon +++ b/toolchain/check/testdata/class/fail_base_bad_type.carbon @@ -28,7 +28,7 @@ class DeriveFromNonType { // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+7]]:16: error: cannot implicitly convert from `i32` to `type` // CHECK:STDERR: extend base: 32; // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+4]]:16: type `i32` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+4]]:16: note: type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: extend base: 32; // CHECK:STDERR: ^~ // CHECK:STDERR: @@ -50,7 +50,7 @@ class DeriveFromi32 { // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+7]]:53: error: cannot implicitly convert from `DeriveFromi32*` to `i32*` // CHECK:STDERR: fn ConvertToBadBasei32(p: DeriveFromi32*) -> i32* { return p; } // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+4]]:53: type `DeriveFromi32*` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+4]]:53: note: type `DeriveFromi32*` does not implement interface `ImplicitAs` // CHECK:STDERR: fn ConvertToBadBasei32(p: DeriveFromi32*) -> i32* { return p; } // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -69,7 +69,7 @@ class DeriveFromTuple { // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+7]]:61: error: cannot implicitly convert from `DeriveFromTuple*` to `(Base,)*` // CHECK:STDERR: fn ConvertToBadBaseTuple(p: DeriveFromTuple*) -> (Base,)* { return p; } // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+4]]:61: type `DeriveFromTuple*` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+4]]:61: note: type `DeriveFromTuple*` does not implement interface `ImplicitAs` // CHECK:STDERR: fn ConvertToBadBaseTuple(p: DeriveFromTuple*) -> (Base,)* { return p; } // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -90,7 +90,7 @@ class DeriveFromStruct { // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+7]]:74: error: cannot implicitly convert from `DeriveFromStruct*` to `{.a: i32, .b: i32}*` // CHECK:STDERR: fn ConvertToBadBaseStruct(p: DeriveFromStruct*) -> {.a: i32, .b: i32}* { return p; } // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+4]]:74: type `DeriveFromStruct*` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+4]]:74: note: type `DeriveFromStruct*` does not implement interface `ImplicitAs` // CHECK:STDERR: fn ConvertToBadBaseStruct(p: DeriveFromStruct*) -> {.a: i32, .b: i32}* { return p; } // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -105,7 +105,7 @@ class DeriveFromIncomplete { // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+7]]:16: error: base `Incomplete` is an incomplete type // CHECK:STDERR: extend base: Incomplete; // CHECK:STDERR: ^~~~~~~~~~ - // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE-6]]:1: class was forward declared here + // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE-6]]:1: note: class was forward declared here // CHECK:STDERR: base class Incomplete; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -115,7 +115,7 @@ class DeriveFromIncomplete { // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+7]]:74: error: cannot implicitly convert from `DeriveFromIncomplete*` to `Incomplete*` // CHECK:STDERR: fn ConvertToBadBaseIncomplete(p: DeriveFromIncomplete*) -> Incomplete* { return p; } // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+4]]:74: type `DeriveFromIncomplete*` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+4]]:74: note: type `DeriveFromIncomplete*` does not implement interface `ImplicitAs` // CHECK:STDERR: fn ConvertToBadBaseIncomplete(p: DeriveFromIncomplete*) -> Incomplete* { return p; } // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: diff --git a/toolchain/check/testdata/class/fail_base_modifiers.carbon b/toolchain/check/testdata/class/fail_base_modifiers.carbon index 1f11ea28495a..d08b219e6bc4 100644 --- a/toolchain/check/testdata/class/fail_base_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_base_modifiers.carbon @@ -34,7 +34,7 @@ class C3 { // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+7]]:10: error: `default` not allowed on declaration with `extend` // CHECK:STDERR: extend default base: B; // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+4]]:3: `extend` previously appeared here + // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+4]]:3: note: `extend` previously appeared here // CHECK:STDERR: extend default base: B; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -45,7 +45,7 @@ class C4 { // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+6]]:10: error: `extend` repeated on declaration // CHECK:STDERR: extend extend base: B; // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+3]]:3: `extend` previously appeared here + // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+3]]:3: note: `extend` previously appeared here // CHECK:STDERR: extend extend base: B; // CHECK:STDERR: ^~~~~~ extend extend base: B; diff --git a/toolchain/check/testdata/class/fail_base_repeated.carbon b/toolchain/check/testdata/class/fail_base_repeated.carbon index e446618bb3b4..9049cf9806cb 100644 --- a/toolchain/check/testdata/class/fail_base_repeated.carbon +++ b/toolchain/check/testdata/class/fail_base_repeated.carbon @@ -16,7 +16,7 @@ class C { // CHECK:STDERR: fail_base_repeated.carbon:[[@LINE+7]]:3: error: multiple `base` declarations in class; multiple inheritance is not permitted // CHECK:STDERR: extend base: B2; // CHECK:STDERR: ^~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_base_repeated.carbon:[[@LINE-4]]:3: previous `base` declaration is here + // CHECK:STDERR: fail_base_repeated.carbon:[[@LINE-4]]:3: note: previous `base` declaration is here // CHECK:STDERR: extend base: B1; // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -29,7 +29,7 @@ class D { // CHECK:STDERR: fail_base_repeated.carbon:[[@LINE+6]]:3: error: multiple `base` declarations in class; multiple inheritance is not permitted // CHECK:STDERR: extend base: B1; // CHECK:STDERR: ^~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_base_repeated.carbon:[[@LINE-4]]:3: previous `base` declaration is here + // CHECK:STDERR: fail_base_repeated.carbon:[[@LINE-4]]:3: note: previous `base` declaration is here // CHECK:STDERR: extend base: B1; // CHECK:STDERR: ^~~~~~~~~~~~~~~~ extend base: B1; diff --git a/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon b/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon index b9c3458e346d..ecde7410afe0 100644 --- a/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon +++ b/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon @@ -20,7 +20,7 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDERR: fail_compound_type_mismatch.carbon:[[@LINE+6]]:10: error: cannot implicitly convert from `A` to `B` // CHECK:STDERR: return a.(B.b); // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_compound_type_mismatch.carbon:[[@LINE+3]]:10: type `A` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_compound_type_mismatch.carbon:[[@LINE+3]]:10: note: type `A` does not implement interface `ImplicitAs` // CHECK:STDERR: return a.(B.b); // CHECK:STDERR: ^~~~~~~ return a.(B.b); diff --git a/toolchain/check/testdata/class/fail_derived_to_base.carbon b/toolchain/check/testdata/class/fail_derived_to_base.carbon index 67b042030b15..685e8ca85689 100644 --- a/toolchain/check/testdata/class/fail_derived_to_base.carbon +++ b/toolchain/check/testdata/class/fail_derived_to_base.carbon @@ -24,7 +24,7 @@ class B2 { // CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+7]]:38: error: cannot implicitly convert from `B2*` to `A1*` // CHECK:STDERR: fn ConvertUnrelated(p: B2*) -> A1* { return p; } // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+4]]:38: type `B2*` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+4]]:38: note: type `B2*` does not implement interface `ImplicitAs` // CHECK:STDERR: fn ConvertUnrelated(p: B2*) -> A1* { return p; } // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -35,7 +35,7 @@ class Incomplete; // CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+6]]:47: error: cannot implicitly convert from `Incomplete*` to `A2*` // CHECK:STDERR: fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+3]]:47: type `Incomplete*` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+3]]:47: note: type `Incomplete*` does not implement interface `ImplicitAs` // CHECK:STDERR: fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDERR: ^~~~~~~~~ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } diff --git a/toolchain/check/testdata/class/fail_extend_cycle.carbon b/toolchain/check/testdata/class/fail_extend_cycle.carbon index 0148685b1a9f..2d3ed4dbc269 100644 --- a/toolchain/check/testdata/class/fail_extend_cycle.carbon +++ b/toolchain/check/testdata/class/fail_extend_cycle.carbon @@ -19,7 +19,7 @@ base class B { // CHECK:STDERR: fail_extend_cycle.carbon:[[@LINE+7]]:1: error: redefinition of `class A` // CHECK:STDERR: base class A { // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_extend_cycle.carbon:[[@LINE-11]]:1: previously defined here +// CHECK:STDERR: fail_extend_cycle.carbon:[[@LINE-11]]:1: note: previously defined here // CHECK:STDERR: base class A { // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: diff --git a/toolchain/check/testdata/class/fail_generic_method.carbon b/toolchain/check/testdata/class/fail_generic_method.carbon index e812ab2d108e..05d43bbce09e 100644 --- a/toolchain/check/testdata/class/fail_generic_method.carbon +++ b/toolchain/check/testdata/class/fail_generic_method.carbon @@ -18,7 +18,7 @@ class Class(T:! type) { // CHECK:STDERR: fail_generic_method.carbon:[[@LINE+14]]:10: error: redeclaration differs at parameter 1 // CHECK:STDERR: fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_generic_method.carbon:[[@LINE-10]]:13: previous declaration's corresponding parameter here +// CHECK:STDERR: fail_generic_method.carbon:[[@LINE-10]]:13: note: previous declaration's corresponding parameter here // CHECK:STDERR: class Class(T:! type) { // CHECK:STDERR: ^ // CHECK:STDERR: diff --git a/toolchain/check/testdata/class/fail_import_misuses.carbon b/toolchain/check/testdata/class/fail_import_misuses.carbon index d3f94a20938b..df34b8229ffc 100644 --- a/toolchain/check/testdata/class/fail_import_misuses.carbon +++ b/toolchain/check/testdata/class/fail_import_misuses.carbon @@ -23,26 +23,22 @@ library "[[@TEST_NAME]]"; import library "a"; -// CHECK:STDERR: fail_b.carbon:[[@LINE+10]]:1: error: redeclaration of `class Empty` is redundant +// CHECK:STDERR: fail_b.carbon:[[@LINE+8]]:1: error: redeclaration of `class Empty` is redundant // CHECK:STDERR: class Empty { // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: fail_b.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: import library "a"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: a.carbon:4:1: previously declared here +// CHECK:STDERR: a.carbon:4:1: note: previously declared here // CHECK:STDERR: class Empty { // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: class Empty { } -// CHECK:STDERR: fail_b.carbon:[[@LINE+9]]:8: error: Variable has incomplete type `Incomplete` +// CHECK:STDERR: fail_b.carbon:[[@LINE+7]]:8: error: Variable has incomplete type `Incomplete` // CHECK:STDERR: var a: Incomplete; // CHECK:STDERR: ^~~~~~~~~~ -// CHECK:STDERR: fail_b.carbon:[[@LINE-18]]:1: in import -// CHECK:STDERR: import library "a"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: a.carbon:7:1: class was forward declared here +// CHECK:STDERR: fail_b.carbon:[[@LINE-16]]:1: in import +// CHECK:STDERR: a.carbon:7:1: note: class was forward declared here // CHECK:STDERR: class Incomplete; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ var a: Incomplete; @@ -136,7 +132,7 @@ var a: Incomplete; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @.1 { -// CHECK:STDOUT: %.loc17: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: %.loc15: = complete_type_witness %.1 [template = constants.%.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%.3 diff --git a/toolchain/check/testdata/class/fail_incomplete.carbon b/toolchain/check/testdata/class/fail_incomplete.carbon index 5c8700d0da77..27b40443804d 100644 --- a/toolchain/check/testdata/class/fail_incomplete.carbon +++ b/toolchain/check/testdata/class/fail_incomplete.carbon @@ -13,7 +13,7 @@ class Class; // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:4: error: cannot declare a member of incomplete class `Class` // CHECK:STDERR: fn Class.Function() {} // CHECK:STDERR: ^~~~~ -// CHECK:STDERR: fail_incomplete.carbon:[[@LINE-5]]:1: class was forward declared here +// CHECK:STDERR: fail_incomplete.carbon:[[@LINE-5]]:1: note: class was forward declared here // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: @@ -23,7 +23,7 @@ fn CallClassFunction() { // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:3: error: member access into incomplete class `Class` // CHECK:STDERR: Class.Function(); // CHECK:STDERR: ^~~~~~~~~~~~~~ - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-15]]:1: class was forward declared here + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-15]]:1: note: class was forward declared here // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: @@ -33,7 +33,7 @@ fn CallClassFunction() { // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:17: error: Variable has incomplete type `Class` // CHECK:STDERR: var global_var: Class; // CHECK:STDERR: ^~~~~ -// CHECK:STDERR: fail_incomplete.carbon:[[@LINE-25]]:1: class was forward declared here +// CHECK:STDERR: fail_incomplete.carbon:[[@LINE-25]]:1: note: class was forward declared here // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: @@ -42,7 +42,7 @@ var global_var: Class; // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:24: error: function returns incomplete type `Class` // CHECK:STDERR: fn ConvertFromStruct() -> Class { return {}; } // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_incomplete.carbon:[[@LINE-34]]:1: class was forward declared here +// CHECK:STDERR: fail_incomplete.carbon:[[@LINE-34]]:1: note: class was forward declared here // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: @@ -52,7 +52,7 @@ fn G(p: Class*) -> i32 { // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:10: error: member access into object of incomplete type `Class` // CHECK:STDERR: return p->n; // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-44]]:1: class was forward declared here + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-44]]:1: note: class was forward declared here // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: @@ -63,7 +63,7 @@ fn MemberAccess(p: Class*) -> i32 { // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:11: error: member access into object of incomplete type `Class` // CHECK:STDERR: return (*p).n; // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-55]]:1: class was forward declared here + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-55]]:1: note: class was forward declared here // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: @@ -73,7 +73,7 @@ fn MemberAccess(p: Class*) -> i32 { // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:20: error: function returns incomplete type `Class` // CHECK:STDERR: fn Copy(p: Class*) -> Class { // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_incomplete.carbon:[[@LINE-65]]:1: class was forward declared here +// CHECK:STDERR: fail_incomplete.carbon:[[@LINE-65]]:1: note: class was forward declared here // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: @@ -85,7 +85,7 @@ fn Let(p: Class*) { // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:10: error: `let` binding has incomplete type `Class` // CHECK:STDERR: let c: Class = *p; // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-77]]:1: class was forward declared here + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-77]]:1: note: class was forward declared here // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: @@ -100,10 +100,10 @@ fn CallTakeIncomplete(p: Class*) { // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+10]]:3: error: forming value of incomplete type `Class` // CHECK:STDERR: TakeIncomplete(*p); // CHECK:STDERR: ^~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-92]]:1: class was forward declared here + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-92]]:1: note: class was forward declared here // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-11]]:1: initializing parameter 1 of function declared here + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-11]]:1: note: initializing parameter 1 of function declared here // CHECK:STDERR: fn TakeIncomplete(c: Class); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -112,10 +112,10 @@ fn CallTakeIncomplete(p: Class*) { // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+10]]:3: error: forming value of incomplete type `Class` // CHECK:STDERR: TakeIncomplete({}); // CHECK:STDERR: ^~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-104]]:1: class was forward declared here + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-104]]:1: note: class was forward declared here // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-23]]:1: initializing parameter 1 of function declared here + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-23]]:1: note: initializing parameter 1 of function declared here // CHECK:STDERR: fn TakeIncomplete(c: Class); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -126,10 +126,10 @@ fn CallReturnIncomplete() { // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+9]]:3: error: function returns incomplete type `Class` // CHECK:STDERR: ReturnIncomplete(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-118]]:1: class was forward declared here + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-118]]:1: note: class was forward declared here // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-35]]:23: return type declared here + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-35]]:23: note: return type declared here // CHECK:STDERR: fn ReturnIncomplete() -> Class; // CHECK:STDERR: ^~~~~~~~ ReturnIncomplete(); diff --git a/toolchain/check/testdata/class/fail_memaccess_category.carbon b/toolchain/check/testdata/class/fail_memaccess_category.carbon index 0d695655fdba..e56369525006 100644 --- a/toolchain/check/testdata/class/fail_memaccess_category.carbon +++ b/toolchain/check/testdata/class/fail_memaccess_category.carbon @@ -21,7 +21,7 @@ fn F(s: {.a: A}, b: B) { // CHECK:STDERR: fail_memaccess_category.carbon:[[@LINE+7]]:8: error: `addr self` method cannot be invoked on a value // CHECK:STDERR: s.a.F(); // CHECK:STDERR: ^ - // CHECK:STDERR: fail_memaccess_category.carbon:[[@LINE-12]]:13: initializing `addr self` parameter of method declared here + // CHECK:STDERR: fail_memaccess_category.carbon:[[@LINE-12]]:13: note: initializing `addr self` parameter of method declared here // CHECK:STDERR: fn F[addr self: A*](); // CHECK:STDERR: ^~~~ // CHECK:STDERR: @@ -32,7 +32,7 @@ fn F(s: {.a: A}, b: B) { // CHECK:STDERR: fail_memaccess_category.carbon:[[@LINE+6]]:8: error: `addr self` method cannot be invoked on a value // CHECK:STDERR: b.a.F(); // CHECK:STDERR: ^ - // CHECK:STDERR: fail_memaccess_category.carbon:[[@LINE-23]]:13: initializing `addr self` parameter of method declared here + // CHECK:STDERR: fail_memaccess_category.carbon:[[@LINE-23]]:13: note: initializing `addr self` parameter of method declared here // CHECK:STDERR: fn F[addr self: A*](); // CHECK:STDERR: ^~~~ b.a.F(); diff --git a/toolchain/check/testdata/class/fail_member_of_let.carbon b/toolchain/check/testdata/class/fail_member_of_let.carbon index 319e1ec900c2..0ee890aadee6 100644 --- a/toolchain/check/testdata/class/fail_member_of_let.carbon +++ b/toolchain/check/testdata/class/fail_member_of_let.carbon @@ -20,7 +20,7 @@ let T: type = Class; // CHECK:STDERR: fail_member_of_let.carbon:[[@LINE+6]]:4: error: name qualifiers are only allowed for entities that provide a scope // CHECK:STDERR: fn T.F() {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_member_of_let.carbon:[[@LINE-7]]:5: referenced non-scope entity declared here +// CHECK:STDERR: fail_member_of_let.carbon:[[@LINE-7]]:5: note: referenced non-scope entity declared here // CHECK:STDERR: let T: type = Class; // CHECK:STDERR: ^ fn T.F() {} diff --git a/toolchain/check/testdata/class/fail_method.carbon b/toolchain/check/testdata/class/fail_method.carbon index decfa0855056..428d6c1fde78 100644 --- a/toolchain/check/testdata/class/fail_method.carbon +++ b/toolchain/check/testdata/class/fail_method.carbon @@ -23,7 +23,7 @@ fn F(c: Class) { // CHECK:STDERR: fail_method.carbon:[[@LINE+7]]:3: error: missing object argument in method call // CHECK:STDERR: Class.WithSelf(); // CHECK:STDERR: ^~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_method.carbon:[[@LINE-13]]:3: calling function declared here + // CHECK:STDERR: fail_method.carbon:[[@LINE-13]]:3: note: calling function declared here // CHECK:STDERR: fn WithSelf[self: Class](); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -31,7 +31,7 @@ fn F(c: Class) { // CHECK:STDERR: fail_method.carbon:[[@LINE+7]]:3: error: 1 argument(s) passed to function expecting 0 argument(s). // CHECK:STDERR: Class.WithSelf(c); // CHECK:STDERR: ^~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_method.carbon:[[@LINE-21]]:3: calling function declared here + // CHECK:STDERR: fail_method.carbon:[[@LINE-21]]:3: note: calling function declared here // CHECK:STDERR: fn WithSelf[self: Class](); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -40,7 +40,7 @@ fn F(c: Class) { // CHECK:STDERR: fail_method.carbon:[[@LINE+6]]:3: error: missing object argument in method call // CHECK:STDERR: A(); // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_method.carbon:[[@LINE-30]]:3: calling function declared here + // CHECK:STDERR: fail_method.carbon:[[@LINE-30]]:3: note: calling function declared here // CHECK:STDERR: fn WithSelf[self: Class](); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ A(); diff --git a/toolchain/check/testdata/class/fail_method_modifiers.carbon b/toolchain/check/testdata/class/fail_method_modifiers.carbon index 6960ac7414b9..7d213fbab901 100644 --- a/toolchain/check/testdata/class/fail_method_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_method_modifiers.carbon @@ -13,7 +13,7 @@ class FinalClass { // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE+7]]:3: error: `abstract` not allowed on `fn` declaration in a non-abstract `class` definition // CHECK:STDERR: abstract fn Abstract[self: Self](); // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE-5]]:1: containing definition here + // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE-5]]:1: note: containing definition here // CHECK:STDERR: class FinalClass { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -22,7 +22,7 @@ class FinalClass { // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE+7]]:3: error: `virtual` not allowed on `fn` declaration in a non-abstract non-base `class` definition // CHECK:STDERR: virtual fn Virtual[self: Self](); // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE-14]]:1: containing definition here + // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE-14]]:1: note: containing definition here // CHECK:STDERR: class FinalClass { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -49,7 +49,7 @@ base class BaseClass { // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE+6]]:3: error: `abstract` not allowed on `fn` declaration in a non-abstract `class` definition // CHECK:STDERR: abstract fn Abstract[self: Self](); // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE-5]]:1: containing definition here + // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE-5]]:1: note: containing definition here // CHECK:STDERR: base class BaseClass { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ abstract fn Abstract[self: Self](); diff --git a/toolchain/check/testdata/class/fail_method_redefinition.carbon b/toolchain/check/testdata/class/fail_method_redefinition.carbon index 12d4dfbece92..f157e7d32258 100644 --- a/toolchain/check/testdata/class/fail_method_redefinition.carbon +++ b/toolchain/check/testdata/class/fail_method_redefinition.carbon @@ -13,7 +13,7 @@ class Class { // CHECK:STDERR: fail_method_redefinition.carbon:[[@LINE+6]]:3: error: redefinition of `fn F` // CHECK:STDERR: fn F() {} // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_method_redefinition.carbon:[[@LINE-4]]:3: previously defined here + // CHECK:STDERR: fail_method_redefinition.carbon:[[@LINE-4]]:3: note: previously defined here // CHECK:STDERR: fn F() {} // CHECK:STDERR: ^~~~~~~~ fn F() {} diff --git a/toolchain/check/testdata/class/fail_modifiers.carbon b/toolchain/check/testdata/class/fail_modifiers.carbon index a3fb7b0cd6cf..8bd51404b5b1 100644 --- a/toolchain/check/testdata/class/fail_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_modifiers.carbon @@ -11,7 +11,7 @@ // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:18: error: `private` repeated on declaration // CHECK:STDERR: private abstract private class DuplicatePrivate; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `private` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note: `private` previously appeared here // CHECK:STDERR: private abstract private class DuplicatePrivate; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -20,7 +20,7 @@ private abstract private class DuplicatePrivate; // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:14: error: `protected` not allowed on declaration with `private` // CHECK:STDERR: private base protected class TwoAccess {} // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `private` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note: `private` previously appeared here // CHECK:STDERR: private base protected class TwoAccess {} // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -29,7 +29,7 @@ private base protected class TwoAccess {} // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:10: error: `abstract` repeated on declaration // CHECK:STDERR: abstract abstract class TwoAbstract; // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `abstract` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note: `abstract` previously appeared here // CHECK:STDERR: abstract abstract class TwoAbstract; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -46,7 +46,7 @@ abstract abstract class TwoAbstract; // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:19: error: `base` not allowed on declaration with `virtual` // CHECK:STDERR: protected virtual base class Virtual {} // CHECK:STDERR: ^~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:11: `virtual` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:11: note: `virtual` previously appeared here // CHECK:STDERR: protected virtual base class Virtual {} // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -55,7 +55,7 @@ protected virtual base class Virtual {} // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:10: error: `protected` must appear before `abstract` // CHECK:STDERR: abstract protected class WrongOrder; // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `abstract` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note: `abstract` previously appeared here // CHECK:STDERR: abstract protected class WrongOrder; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -64,7 +64,7 @@ abstract protected class WrongOrder; // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+6]]:10: error: `base` not allowed on declaration with `abstract` // CHECK:STDERR: abstract base class AbstractAndBase {} // CHECK:STDERR: ^~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: `abstract` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: note: `abstract` previously appeared here // CHECK:STDERR: abstract base class AbstractAndBase {} // CHECK:STDERR: ^~~~~~~~ abstract base class AbstractAndBase {} diff --git a/toolchain/check/testdata/class/fail_redeclaration_introducer.carbon b/toolchain/check/testdata/class/fail_redeclaration_introducer.carbon index 217e1574bb58..0f3811617fea 100644 --- a/toolchain/check/testdata/class/fail_redeclaration_introducer.carbon +++ b/toolchain/check/testdata/class/fail_redeclaration_introducer.carbon @@ -16,7 +16,7 @@ class A; // CHECK:STDERR: fail_add_base.carbon:[[@LINE+7]]:1: error: class redeclared with different inheritance kind // CHECK:STDERR: base class A {} // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_add_base.carbon:[[@LINE-4]]:1: previously declared here +// CHECK:STDERR: fail_add_base.carbon:[[@LINE-4]]:1: note: previously declared here // CHECK:STDERR: class A; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -30,7 +30,7 @@ class B; // CHECK:STDERR: fail_add_abstract.carbon:[[@LINE+7]]:1: error: class redeclared with different inheritance kind // CHECK:STDERR: abstract class B {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_add_abstract.carbon:[[@LINE-4]]:1: previously declared here +// CHECK:STDERR: fail_add_abstract.carbon:[[@LINE-4]]:1: note: previously declared here // CHECK:STDERR: class B; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -44,7 +44,7 @@ base class C; // CHECK:STDERR: fail_remove_base.carbon:[[@LINE+7]]:1: error: class redeclared with different inheritance kind // CHECK:STDERR: class C {} // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_remove_base.carbon:[[@LINE-4]]:1: previously declared here +// CHECK:STDERR: fail_remove_base.carbon:[[@LINE-4]]:1: note: previously declared here // CHECK:STDERR: base class C; // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: @@ -58,7 +58,7 @@ base class D; // CHECK:STDERR: fail_base_to_abstract.carbon:[[@LINE+7]]:1: error: class redeclared with different inheritance kind // CHECK:STDERR: abstract class D {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_base_to_abstract.carbon:[[@LINE-4]]:1: previously declared here +// CHECK:STDERR: fail_base_to_abstract.carbon:[[@LINE-4]]:1: note: previously declared here // CHECK:STDERR: base class D; // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: @@ -72,7 +72,7 @@ abstract class E; // CHECK:STDERR: fail_remove_abstract.carbon:[[@LINE+7]]:1: error: class redeclared with different inheritance kind // CHECK:STDERR: class E {} // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_remove_abstract.carbon:[[@LINE-4]]:1: previously declared here +// CHECK:STDERR: fail_remove_abstract.carbon:[[@LINE-4]]:1: note: previously declared here // CHECK:STDERR: abstract class E; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -86,7 +86,7 @@ abstract class F; // CHECK:STDERR: fail_abstract_to_base.carbon:[[@LINE+6]]:1: error: class redeclared with different inheritance kind // CHECK:STDERR: base class F {} // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_abstract_to_base.carbon:[[@LINE-4]]:1: previously declared here +// CHECK:STDERR: fail_abstract_to_base.carbon:[[@LINE-4]]:1: note: previously declared here // CHECK:STDERR: abstract class F; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ base class F {} diff --git a/toolchain/check/testdata/class/fail_redefinition.carbon b/toolchain/check/testdata/class/fail_redefinition.carbon index 3b0e57f0e58c..b1c5e502a864 100644 --- a/toolchain/check/testdata/class/fail_redefinition.carbon +++ b/toolchain/check/testdata/class/fail_redefinition.carbon @@ -17,7 +17,7 @@ class Class { // CHECK:STDERR: fail_redefinition.carbon:[[@LINE+7]]:1: error: redefinition of `class Class` // CHECK:STDERR: class Class { // CHECK:STDERR: ^~~~~~~~~~~~~ -// CHECK:STDERR: fail_redefinition.carbon:[[@LINE-9]]:1: previously defined here +// CHECK:STDERR: fail_redefinition.carbon:[[@LINE-9]]:1: note: previously defined here // CHECK:STDERR: class Class { // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: @@ -37,7 +37,7 @@ fn Class.H() {} // CHECK:STDERR: fail_redefinition.carbon:[[@LINE+6]]:1: error: redefinition of `fn I` // CHECK:STDERR: fn Class.I() {} // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_redefinition.carbon:[[@LINE-26]]:3: previously defined here +// CHECK:STDERR: fail_redefinition.carbon:[[@LINE-26]]:3: note: previously defined here // CHECK:STDERR: fn I() {} // CHECK:STDERR: ^~~~~~~~ fn Class.I() {} diff --git a/toolchain/check/testdata/class/fail_self.carbon b/toolchain/check/testdata/class/fail_self.carbon index 5c62d5bdd8d2..2fc297812be5 100644 --- a/toolchain/check/testdata/class/fail_self.carbon +++ b/toolchain/check/testdata/class/fail_self.carbon @@ -46,10 +46,10 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDERR: fail_self.carbon:[[@LINE+9]]:3: error: cannot implicitly convert from `WrongSelf` to `Class` // CHECK:STDERR: ws.F(); // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: fail_self.carbon:[[@LINE+6]]:3: type `WrongSelf` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_self.carbon:[[@LINE+6]]:3: note: type `WrongSelf` does not implement interface `ImplicitAs` // CHECK:STDERR: ws.F(); // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: fail_self.carbon:[[@LINE-10]]:8: initializing `self` parameter of method declared here + // CHECK:STDERR: fail_self.carbon:[[@LINE-10]]:8: note: initializing `self` parameter of method declared here // CHECK:STDERR: fn F[self: Class](); // CHECK:STDERR: ^~~~ ws.F(); diff --git a/toolchain/check/testdata/class/generic/call.carbon b/toolchain/check/testdata/class/generic/call.carbon index 3042d0a22a82..228f76d16371 100644 --- a/toolchain/check/testdata/class/generic/call.carbon +++ b/toolchain/check/testdata/class/generic/call.carbon @@ -28,7 +28,7 @@ class Class(T:! type, N:! i32) {} // CHECK:STDERR: fail_too_few.carbon:[[@LINE+7]]:8: error: 1 argument(s) passed to generic class expecting 2 argument(s). // CHECK:STDERR: var a: Class(i32*); // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_too_few.carbon:[[@LINE-5]]:1: calling generic class declared here +// CHECK:STDERR: fail_too_few.carbon:[[@LINE-5]]:1: note: calling generic class declared here // CHECK:STDERR: class Class(T:! type, N:! i32) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -43,7 +43,7 @@ class Class(T:! type, N:! i32) {} // CHECK:STDERR: fail_too_many.carbon:[[@LINE+7]]:8: error: 3 argument(s) passed to generic class expecting 2 argument(s). // CHECK:STDERR: var a: Class(i32*, 1, 2); // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_too_many.carbon:[[@LINE-5]]:1: calling generic class declared here +// CHECK:STDERR: fail_too_many.carbon:[[@LINE-5]]:1: note: calling generic class declared here // CHECK:STDERR: class Class(T:! type, N:! i32) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -58,10 +58,10 @@ class Class(T:! type, N:! i32) {} // CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+9]]:8: error: cannot implicitly convert from `i32` to `type` // CHECK:STDERR: var a: Class(5, i32*); // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+6]]:8: type `i32` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+6]]:8: note: type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: var a: Class(5, i32*); // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE-8]]:13: initializing generic parameter `T` declared here +// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE-8]]:13: note: initializing generic parameter `T` declared here // CHECK:STDERR: class Class(T:! type, N:! i32) {} // CHECK:STDERR: ^ var a: Class(5, i32*); diff --git a/toolchain/check/testdata/class/generic/import.carbon b/toolchain/check/testdata/class/generic/import.carbon index a1a721d23daa..749c4b9d0c8e 100644 --- a/toolchain/check/testdata/class/generic/import.carbon +++ b/toolchain/check/testdata/class/generic/import.carbon @@ -58,7 +58,7 @@ fn Use() { // CHECK:STDERR: fail_generic_arg_mismatch.carbon:[[@LINE+7]]:3: error: cannot implicitly convert from `CompleteClass` to `CompleteClass` // CHECK:STDERR: var v: CompleteClass(i32*) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_generic_arg_mismatch.carbon:[[@LINE+4]]:3: type `CompleteClass` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_generic_arg_mismatch.carbon:[[@LINE+4]]:3: note: type `CompleteClass` does not implement interface `ImplicitAs` // CHECK:STDERR: var v: CompleteClass(i32*) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -69,13 +69,11 @@ fn Use() { impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_foo.impl.carbon:[[@LINE+10]]:13: error: redeclaration differs at parameter 1 +// CHECK:STDERR: fail_foo.impl.carbon:[[@LINE+8]]:13: error: redeclaration differs at parameter 1 // CHECK:STDERR: class Class(U:! type) { // CHECK:STDERR: ^ // CHECK:STDERR: fail_foo.impl.carbon:[[@LINE-5]]:6: in import -// CHECK:STDERR: impl library "foo"; -// CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: foo.carbon:4:13: previous declaration's corresponding parameter here +// CHECK:STDERR: foo.carbon:4:13: note: previous declaration's corresponding parameter here // CHECK:STDERR: class Class(T:! type); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -833,8 +831,8 @@ class Class(U:! type) { // CHECK:STDOUT: %default.import.loc2_6.2 = import // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.2] { -// CHECK:STDOUT: %U.loc14_13.1: type = param U, runtime_param -// CHECK:STDOUT: %U.loc14_13.2: type = bind_symbolic_name U 0, %U.loc14_13.1 [symbolic = @.1.%U (constants.%U)] +// CHECK:STDOUT: %U.loc12_13.1: type = param U, runtime_param +// CHECK:STDOUT: %U.loc12_13.2: type = bind_symbolic_name U 0, %U.loc12_13.1 [symbolic = @.1.%U (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -844,19 +842,19 @@ class Class(U:! type) { // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @.1(file.%U.loc14_13.2: type) { +// CHECK:STDOUT: generic class @.1(file.%U.loc12_13.2: type) { // CHECK:STDOUT: %U: type = bind_symbolic_name U 0 [symbolic = %U (constants.%U)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %T.ref: = name_ref T, [template = ] -// CHECK:STDOUT: %.loc18: = field_decl x, element0 [template] -// CHECK:STDOUT: %.loc19: = complete_type_witness [template = ] +// CHECK:STDOUT: %.loc16: = field_decl x, element0 [template] +// CHECK:STDOUT: %.loc17: = complete_type_witness [template = ] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%.3 -// CHECK:STDOUT: .x = %.loc18 +// CHECK:STDOUT: .x = %.loc16 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/member_access.carbon b/toolchain/check/testdata/class/generic/member_access.carbon index 8055048f5b7e..d2cce2e15644 100644 --- a/toolchain/check/testdata/class/generic/member_access.carbon +++ b/toolchain/check/testdata/class/generic/member_access.carbon @@ -42,7 +42,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDERR: fail_todo_static_member_fn_call.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `Class` to `Class` // CHECK:STDERR: return Class(T).Make(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_todo_static_member_fn_call.carbon:[[@LINE+3]]:3: type `Class` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_todo_static_member_fn_call.carbon:[[@LINE+3]]:3: note: type `Class` does not implement interface `ImplicitAs` // CHECK:STDERR: return Class(T).Make(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ return Class(T).Make(); diff --git a/toolchain/check/testdata/class/generic/member_out_of_line.carbon b/toolchain/check/testdata/class/generic/member_out_of_line.carbon index 08a7306f34d0..a4ea4862ea9c 100644 --- a/toolchain/check/testdata/class/generic/member_out_of_line.carbon +++ b/toolchain/check/testdata/class/generic/member_out_of_line.carbon @@ -49,7 +49,7 @@ class NotGeneric { // CHECK:STDERR: fail_mismatched_not_generic_vs_generic.carbon:[[@LINE+7]]:4: error: redeclaration differs because of parameter list // CHECK:STDERR: fn NotGeneric(T:! type).F() {} // CHECK:STDERR: ^~~~~~~~~~ -// CHECK:STDERR: fail_mismatched_not_generic_vs_generic.carbon:[[@LINE-7]]:1: previously declared without parameter list +// CHECK:STDERR: fail_mismatched_not_generic_vs_generic.carbon:[[@LINE-7]]:1: note: previously declared without parameter list // CHECK:STDERR: class NotGeneric { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -66,7 +66,7 @@ class Generic(T:! type) { // CHECK:STDERR: fail_mismatched_too_few_args.carbon:[[@LINE+7]]:4: error: redeclaration differs because of parameter count of 0 // CHECK:STDERR: fn Generic().TooFew() {} // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_mismatched_too_few_args.carbon:[[@LINE-7]]:1: previously declared with parameter count of 1 +// CHECK:STDERR: fail_mismatched_too_few_args.carbon:[[@LINE-7]]:1: note: previously declared with parameter count of 1 // CHECK:STDERR: class Generic(T:! type) { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -83,7 +83,7 @@ class Generic(T:! type) { // CHECK:STDERR: fail_mismatched_too_many_args.carbon:[[@LINE+7]]:4: error: redeclaration differs because of parameter count of 2 // CHECK:STDERR: fn Generic(T:! type, U:! type).TooMany() {} // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_mismatched_too_many_args.carbon:[[@LINE-7]]:1: previously declared with parameter count of 1 +// CHECK:STDERR: fail_mismatched_too_many_args.carbon:[[@LINE-7]]:1: note: previously declared with parameter count of 1 // CHECK:STDERR: class Generic(T:! type) { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -100,7 +100,7 @@ class Generic(T:! type) { // CHECK:STDERR: fail_mismatched_wrong_arg_type.carbon:[[@LINE+6]]:12: error: redeclaration differs at parameter 1 // CHECK:STDERR: fn Generic(T:! ()).WrongType() {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_mismatched_wrong_arg_type.carbon:[[@LINE-7]]:15: previous declaration's corresponding parameter here +// CHECK:STDERR: fail_mismatched_wrong_arg_type.carbon:[[@LINE-7]]:15: note: previous declaration's corresponding parameter here // CHECK:STDERR: class Generic(T:! type) { // CHECK:STDERR: ^ fn Generic(T:! ()).WrongType() {} diff --git a/toolchain/check/testdata/class/generic/redeclare.carbon b/toolchain/check/testdata/class/generic/redeclare.carbon index d7c2631f1282..582d409145f8 100644 --- a/toolchain/check/testdata/class/generic/redeclare.carbon +++ b/toolchain/check/testdata/class/generic/redeclare.carbon @@ -25,7 +25,7 @@ class A; // CHECK:STDERR: fail_mismatch_param_list.carbon:[[@LINE+7]]:1: error: redeclaration differs because of parameter list // CHECK:STDERR: class A(T:! type) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_mismatch_param_list.carbon:[[@LINE-4]]:1: previously declared without parameter list +// CHECK:STDERR: fail_mismatch_param_list.carbon:[[@LINE-4]]:1: note: previously declared without parameter list // CHECK:STDERR: class A; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -39,7 +39,7 @@ class B(N:! i32); // CHECK:STDERR: fail_mismatch_implicit_param_list.carbon:[[@LINE+7]]:1: error: redeclaration differs because of implicit parameter list // CHECK:STDERR: class B[T:! type](N:! T) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_mismatch_implicit_param_list.carbon:[[@LINE-4]]:1: previously declared without implicit parameter list +// CHECK:STDERR: fail_mismatch_implicit_param_list.carbon:[[@LINE-4]]:1: note: previously declared without implicit parameter list // CHECK:STDERR: class B(N:! i32); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -53,7 +53,7 @@ class C(T:! type); // CHECK:STDERR: fail_mismatch_param_count.carbon:[[@LINE+7]]:1: error: redeclaration differs because of parameter count of 2 // CHECK:STDERR: class C(T:! type, U:! i32) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_mismatch_param_count.carbon:[[@LINE-4]]:1: previously declared with parameter count of 1 +// CHECK:STDERR: fail_mismatch_param_count.carbon:[[@LINE-4]]:1: note: previously declared with parameter count of 1 // CHECK:STDERR: class C(T:! type); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -67,7 +67,7 @@ class D(T:! type); // CHECK:STDERR: fail_mismatch_param_type.carbon:[[@LINE+7]]:9: error: redeclaration differs at parameter 1 // CHECK:STDERR: class D(T:! i32) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_mismatch_param_type.carbon:[[@LINE-4]]:9: previous declaration's corresponding parameter here +// CHECK:STDERR: fail_mismatch_param_type.carbon:[[@LINE-4]]:9: note: previous declaration's corresponding parameter here // CHECK:STDERR: class D(T:! type); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -81,7 +81,7 @@ class E(T:! type); // CHECK:STDERR: fail_mismatch_param_name.carbon:[[@LINE+6]]:9: error: redeclaration differs at parameter 1 // CHECK:STDERR: class E(U:! type) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_mismatch_param_name.carbon:[[@LINE-4]]:9: previous declaration's corresponding parameter here +// CHECK:STDERR: fail_mismatch_param_name.carbon:[[@LINE-4]]:9: note: previous declaration's corresponding parameter here // CHECK:STDERR: class E(T:! type); // CHECK:STDERR: ^ class E(U:! type) {} diff --git a/toolchain/check/testdata/class/inheritance_access.carbon b/toolchain/check/testdata/class/inheritance_access.carbon index b17d0080721a..5128d28f459b 100644 --- a/toolchain/check/testdata/class/inheritance_access.carbon +++ b/toolchain/check/testdata/class/inheritance_access.carbon @@ -82,7 +82,7 @@ class Square { // CHECK:STDERR: fail_inherited_private_field_access.carbon:[[@LINE+7]]:12: error: cannot access private member `y` of type `Shape` // CHECK:STDERR: return self.y; // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_inherited_private_field_access.carbon:[[@LINE-10]]:15: the private member `y` is defined here + // CHECK:STDERR: fail_inherited_private_field_access.carbon:[[@LINE-10]]:15: note: the private member `y` is defined here // CHECK:STDERR: private var y: i32; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -121,7 +121,7 @@ class C { // CHECK:STDERR: fail_noninstance_private_on_parent.carbon:[[@LINE+7]]:12: error: cannot access private member `F` of type `B` // CHECK:STDERR: fn G() { Self.F(); } // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_noninstance_private_on_parent.carbon:[[@LINE-8]]:3: the private member `F` is defined here + // CHECK:STDERR: fail_noninstance_private_on_parent.carbon:[[@LINE-8]]:3: note: the private member `F` is defined here // CHECK:STDERR: private fn F() {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -161,7 +161,7 @@ class B { // CHECK:STDERR: fail_non_inherited_access.carbon:[[@LINE+7]]:5: error: cannot access private member `SOME_PRIVATE_CONSTANT` of type `A` // CHECK:STDERR: A.SOME_PRIVATE_CONSTANT; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_non_inherited_access.carbon:[[@LINE-14]]:15: the private member `SOME_PRIVATE_CONSTANT` is defined here + // CHECK:STDERR: fail_non_inherited_access.carbon:[[@LINE-14]]:15: note: the private member `SOME_PRIVATE_CONSTANT` is defined here // CHECK:STDERR: private let SOME_PRIVATE_CONSTANT: i32 = 5; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -170,7 +170,7 @@ class B { // CHECK:STDERR: fail_non_inherited_access.carbon:[[@LINE+7]]:12: error: cannot access protected member `SOME_PROTECTED_CONSTANT` of type `A` // CHECK:STDERR: return A.SOME_PROTECTED_CONSTANT; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_non_inherited_access.carbon:[[@LINE-24]]:17: the protected member `SOME_PROTECTED_CONSTANT` is defined here + // CHECK:STDERR: fail_non_inherited_access.carbon:[[@LINE-24]]:17: note: the protected member `SOME_PROTECTED_CONSTANT` is defined here // CHECK:STDERR: protected let SOME_PROTECTED_CONSTANT: i32 = 5; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -181,7 +181,7 @@ class B { // CHECK:STDERR: fail_non_inherited_access.carbon:[[@LINE+7]]:12: error: cannot access protected member `INTERNAL_CONSTANT` of type `Internal` // CHECK:STDERR: return self.internal.INTERNAL_CONSTANT; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_non_inherited_access.carbon:[[@LINE-30]]:17: the protected member `INTERNAL_CONSTANT` is defined here + // CHECK:STDERR: fail_non_inherited_access.carbon:[[@LINE-30]]:17: note: the protected member `INTERNAL_CONSTANT` is defined here // CHECK:STDERR: protected let INTERNAL_CONSTANT: i32 = 5; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -203,7 +203,7 @@ class B { // CHECK:STDERR: fail_compound_member_access.carbon:[[@LINE+6]]:11: error: cannot access private member `x` of type `A` // CHECK:STDERR: self.(A.x); // CHECK:STDERR: ^~~ - // CHECK:STDERR: fail_compound_member_access.carbon:[[@LINE-9]]:15: the private member `x` is defined here + // CHECK:STDERR: fail_compound_member_access.carbon:[[@LINE-9]]:15: note: the private member `x` is defined here // CHECK:STDERR: private var x: i32; // CHECK:STDERR: ^~~~~~ self.(A.x); diff --git a/toolchain/check/testdata/class/init_adapt.carbon b/toolchain/check/testdata/class/init_adapt.carbon index ae9b187f43ac..b85e3d5806d5 100644 --- a/toolchain/check/testdata/class/init_adapt.carbon +++ b/toolchain/check/testdata/class/init_adapt.carbon @@ -55,7 +55,7 @@ let a: C = {.a = 1, .b = 2}; // CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+7]]:1: error: cannot implicitly convert from `C` to `AdaptC` // CHECK:STDERR: let b: AdaptC = a; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+4]]:1: type `C` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+4]]:1: note: type `C` does not implement interface `ImplicitAs` // CHECK:STDERR: let b: AdaptC = a; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -64,7 +64,7 @@ let b: AdaptC = a; // CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+7]]:1: error: cannot implicitly convert from `AdaptC` to `C` // CHECK:STDERR: let c: C = b; // CHECK:STDERR: ^~~~~~~~~~~~~ -// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+4]]:1: type `` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+4]]:1: note: type `` does not implement interface `ImplicitAs` // CHECK:STDERR: let c: C = b; // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: @@ -77,7 +77,7 @@ fn MakeAdaptC() -> AdaptC; // CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+7]]:1: error: cannot implicitly convert from `C` to `AdaptC` // CHECK:STDERR: var d: AdaptC = MakeC(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+4]]:1: type `C` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+4]]:1: note: type `C` does not implement interface `ImplicitAs` // CHECK:STDERR: var d: AdaptC = MakeC(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -86,7 +86,7 @@ var d: AdaptC = MakeC(); // CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `AdaptC` to `C` // CHECK:STDERR: var e: C = MakeAdaptC(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+3]]:1: type `AdaptC` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+3]]:1: note: type `AdaptC` does not implement interface `ImplicitAs` // CHECK:STDERR: var e: C = MakeAdaptC(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ var e: C = MakeAdaptC(); diff --git a/toolchain/check/testdata/class/no_prelude/extern.carbon b/toolchain/check/testdata/class/no_prelude/extern.carbon index 67f60d043405..4910092d8b1d 100644 --- a/toolchain/check/testdata/class/no_prelude/extern.carbon +++ b/toolchain/check/testdata/class/no_prelude/extern.carbon @@ -48,7 +48,7 @@ extern class C; // CHECK:STDERR: fail_decl_fn_in_extern.carbon:[[@LINE+7]]:4: error: cannot declare a member of incomplete class `C` // CHECK:STDERR: fn C.F(); // CHECK:STDERR: ^ -// CHECK:STDERR: fail_decl_fn_in_extern.carbon:[[@LINE-4]]:1: class was forward declared here +// CHECK:STDERR: fail_decl_fn_in_extern.carbon:[[@LINE-4]]:1: note: class was forward declared here // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -68,7 +68,7 @@ extern class C; // CHECK:STDERR: fail_extern_decl_after_extern_decl.carbon:[[@LINE+7]]:1: error: redeclaration of `class C` is redundant // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_extern_decl_after_extern_decl.carbon:[[@LINE-4]]:1: previously declared here +// CHECK:STDERR: fail_extern_decl_after_extern_decl.carbon:[[@LINE-4]]:1: note: previously declared here // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -82,7 +82,7 @@ extern class C; // CHECK:STDERR: fail_decl_after_extern_decl.carbon:[[@LINE+7]]:1: error: redeclaration of `class C` is redundant // CHECK:STDERR: class C; // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_decl_after_extern_decl.carbon:[[@LINE-4]]:1: previously declared here +// CHECK:STDERR: fail_decl_after_extern_decl.carbon:[[@LINE-4]]:1: note: previously declared here // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -108,7 +108,7 @@ extern class C; // CHECK:STDERR: fail_def_after_extern_decl.carbon:[[@LINE+7]]:1: error: redeclarations of `class C` must match use of `extern` // CHECK:STDERR: class C {} // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_def_after_extern_decl.carbon:[[@LINE-4]]:1: previously declared here +// CHECK:STDERR: fail_def_after_extern_decl.carbon:[[@LINE-4]]:1: note: previously declared here // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -122,7 +122,7 @@ class C; // CHECK:STDERR: fail_extern_decl_after_decl.carbon:[[@LINE+7]]:1: error: redeclaration of `class C` is redundant // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_extern_decl_after_decl.carbon:[[@LINE-4]]:1: previously declared here +// CHECK:STDERR: fail_extern_decl_after_decl.carbon:[[@LINE-4]]:1: note: previously declared here // CHECK:STDERR: class C; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -132,16 +132,12 @@ extern class C; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_import_extern_decl_then_decl.carbon:[[@LINE+13]]:1: in import -// CHECK:STDERR: import library "extern_decl"; -// CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: fail_import_extern_decl_then_decl.carbon:[[@LINE+9]]:1: in import // CHECK:STDERR: decl.carbon:4:1: error: duplicate name being declared in the same scope // CHECK:STDERR: class C; // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_import_extern_decl_then_decl.carbon:[[@LINE+7]]:1: in import -// CHECK:STDERR: import library "extern_decl"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_decl.carbon:4:1: name is previously declared here +// CHECK:STDERR: fail_import_extern_decl_then_decl.carbon:[[@LINE+5]]:1: in import +// CHECK:STDERR: extern_decl.carbon:4:1: note: name is previously declared here // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -152,16 +148,12 @@ import library "decl"; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_import_decl_then_extern_decl.carbon:[[@LINE+13]]:1: in import -// CHECK:STDERR: import library "decl"; -// CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: fail_import_decl_then_extern_decl.carbon:[[@LINE+9]]:1: in import // CHECK:STDERR: extern_decl.carbon:4:1: error: duplicate name being declared in the same scope // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_import_decl_then_extern_decl.carbon:[[@LINE+7]]:1: in import -// CHECK:STDERR: import library "decl"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: decl.carbon:4:1: name is previously declared here +// CHECK:STDERR: fail_import_decl_then_extern_decl.carbon:[[@LINE+5]]:1: in import +// CHECK:STDERR: decl.carbon:4:1: note: name is previously declared here // CHECK:STDERR: class C; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -172,16 +164,12 @@ import library "extern_decl"; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_import_extern_decl_then_def.carbon:[[@LINE+13]]:1: in import -// CHECK:STDERR: import library "extern_decl"; -// CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: fail_import_extern_decl_then_def.carbon:[[@LINE+9]]:1: in import // CHECK:STDERR: def.carbon:4:1: error: duplicate name being declared in the same scope // CHECK:STDERR: class C {} // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_import_extern_decl_then_def.carbon:[[@LINE+7]]:1: in import -// CHECK:STDERR: import library "extern_decl"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_decl.carbon:4:1: name is previously declared here +// CHECK:STDERR: fail_import_extern_decl_then_def.carbon:[[@LINE+5]]:1: in import +// CHECK:STDERR: extern_decl.carbon:4:1: note: name is previously declared here // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -192,29 +180,21 @@ import library "def"; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_import_ownership_conflict.carbon:[[@LINE+26]]:1: in import -// CHECK:STDERR: import library "extern_decl"; -// CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: fail_import_ownership_conflict.carbon:[[@LINE+18]]:1: in import // CHECK:STDERR: decl.carbon:4:1: error: duplicate name being declared in the same scope // CHECK:STDERR: class C; // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_import_ownership_conflict.carbon:[[@LINE+20]]:1: in import -// CHECK:STDERR: import library "extern_decl"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_decl.carbon:4:1: name is previously declared here +// CHECK:STDERR: fail_import_ownership_conflict.carbon:[[@LINE+14]]:1: in import +// CHECK:STDERR: extern_decl.carbon:4:1: note: name is previously declared here // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_import_ownership_conflict.carbon:[[@LINE+13]]:1: in import -// CHECK:STDERR: import library "extern_decl"; -// CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: fail_import_ownership_conflict.carbon:[[@LINE+9]]:1: in import // CHECK:STDERR: def.carbon:4:1: error: duplicate name being declared in the same scope // CHECK:STDERR: class C {} // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_import_ownership_conflict.carbon:[[@LINE+7]]:1: in import -// CHECK:STDERR: import library "extern_decl"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_decl.carbon:4:1: name is previously declared here +// CHECK:STDERR: fail_import_ownership_conflict.carbon:[[@LINE+5]]:1: in import +// CHECK:STDERR: extern_decl.carbon:4:1: note: name is previously declared here // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -226,16 +206,12 @@ import library "def"; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_todo_import_extern_decl_copy.carbon:[[@LINE+13]]:1: in import -// CHECK:STDERR: import library "extern_decl"; -// CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: fail_todo_import_extern_decl_copy.carbon:[[@LINE+9]]:1: in import // CHECK:STDERR: extern_decl_copy.carbon:4:1: error: duplicate name being declared in the same scope // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_todo_import_extern_decl_copy.carbon:[[@LINE+7]]:1: in import -// CHECK:STDERR: import library "extern_decl"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_decl.carbon:4:1: name is previously declared here +// CHECK:STDERR: fail_todo_import_extern_decl_copy.carbon:[[@LINE+5]]:1: in import +// CHECK:STDERR: extern_decl.carbon:4:1: note: name is previously declared here // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -248,13 +224,11 @@ library "[[@TEST_NAME]]"; import library "extern_decl"; -// CHECK:STDERR: fail_extern_decl_after_import_extern_decl.carbon:[[@LINE+10]]:1: error: redeclaration of `class C` is redundant +// CHECK:STDERR: fail_extern_decl_after_import_extern_decl.carbon:[[@LINE+8]]:1: error: redeclaration of `class C` is redundant // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: fail_extern_decl_after_import_extern_decl.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: import library "extern_decl"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_decl.carbon:4:1: previously declared here +// CHECK:STDERR: extern_decl.carbon:4:1: note: previously declared here // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -266,13 +240,11 @@ library "[[@TEST_NAME]]"; import library "decl"; -// CHECK:STDERR: fail_decl_after_import_extern_decl.carbon:[[@LINE+10]]:1: error: redeclarations of `class C` must match use of `extern` +// CHECK:STDERR: fail_decl_after_import_extern_decl.carbon:[[@LINE+8]]:1: error: redeclarations of `class C` must match use of `extern` // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: fail_decl_after_import_extern_decl.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: import library "decl"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: decl.carbon:4:1: previously declared here +// CHECK:STDERR: decl.carbon:4:1: note: previously declared here // CHECK:STDERR: class C; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -284,13 +256,11 @@ library "[[@TEST_NAME]]"; import library "def"; -// CHECK:STDERR: fail_def_after_import_extern_decl.carbon:[[@LINE+10]]:1: error: redeclarations of `class C` must match use of `extern` +// CHECK:STDERR: fail_def_after_import_extern_decl.carbon:[[@LINE+8]]:1: error: redeclarations of `class C` must match use of `extern` // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: fail_def_after_import_extern_decl.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: import library "def"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: def.carbon:4:1: previously declared here +// CHECK:STDERR: def.carbon:4:1: note: previously declared here // CHECK:STDERR: class C {} // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -302,13 +272,11 @@ library "[[@TEST_NAME]]"; import library "def"; -// CHECK:STDERR: fail_extern_decl_after_import_def.carbon:[[@LINE+9]]:1: error: redeclarations of `class C` must match use of `extern` +// CHECK:STDERR: fail_extern_decl_after_import_def.carbon:[[@LINE+7]]:1: error: redeclarations of `class C` must match use of `extern` // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: fail_extern_decl_after_import_def.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: import library "def"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: def.carbon:4:1: previously declared here +// CHECK:STDERR: def.carbon:4:1: note: previously declared here // CHECK:STDERR: class C {} // CHECK:STDERR: ^~~~~~~~~ extern class C; diff --git a/toolchain/check/testdata/class/no_prelude/implicit_import.carbon b/toolchain/check/testdata/class/no_prelude/implicit_import.carbon index 7ab046ef1e5e..1220949b2b78 100644 --- a/toolchain/check/testdata/class/no_prelude/implicit_import.carbon +++ b/toolchain/check/testdata/class/no_prelude/implicit_import.carbon @@ -30,13 +30,11 @@ class C {} impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_redecl_after_def.impl.carbon:[[@LINE+10]]:1: error: redeclaration of `class C` is redundant +// CHECK:STDERR: fail_redecl_after_def.impl.carbon:[[@LINE+8]]:1: error: redeclaration of `class C` is redundant // CHECK:STDERR: class C; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fail_redecl_after_def.impl.carbon:[[@LINE-5]]:6: in import -// CHECK:STDERR: impl library "redecl_after_def"; -// CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: redecl_after_def.carbon:4:1: previously declared here +// CHECK:STDERR: redecl_after_def.carbon:4:1: note: previously declared here // CHECK:STDERR: class C {} // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -52,13 +50,11 @@ class C {} impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_redef_after_def.impl.carbon:[[@LINE+10]]:1: error: redefinition of `class C` +// CHECK:STDERR: fail_redef_after_def.impl.carbon:[[@LINE+8]]:1: error: redefinition of `class C` // CHECK:STDERR: class C {} // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: fail_redef_after_def.impl.carbon:[[@LINE-5]]:6: in import -// CHECK:STDERR: impl library "redef_after_def"; -// CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: redef_after_def.carbon:4:1: previously defined here +// CHECK:STDERR: redef_after_def.carbon:4:1: note: previously defined here // CHECK:STDERR: class C {} // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -75,13 +71,11 @@ alias B = C; impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_def_alias.impl.carbon:[[@LINE+9]]:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_def_alias.impl.carbon:[[@LINE+7]]:1: error: duplicate name being declared in the same scope // CHECK:STDERR: class B {} // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: fail_def_alias.impl.carbon:[[@LINE-5]]:6: in import -// CHECK:STDERR: impl library "def_alias"; -// CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: def_alias.carbon:5:7: name is previously declared here +// CHECK:STDERR: def_alias.carbon:5:7: note: name is previously declared here // CHECK:STDERR: alias B = C; // CHECK:STDERR: ^ class B {} @@ -229,7 +223,7 @@ class B {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @.1 { -// CHECK:STDOUT: %.loc14: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: %.loc12: = complete_type_witness %.1 [template = constants.%.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%.3 @@ -280,7 +274,7 @@ class B {} // CHECK:STDOUT: class @C; // CHECK:STDOUT: // CHECK:STDOUT: class @.1 { -// CHECK:STDOUT: %.loc13: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc11: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%.1 diff --git a/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon b/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon index 9596d1c85146..3cef5e9f9b1d 100644 --- a/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon +++ b/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon @@ -40,7 +40,7 @@ class Foo(a:! C); // CHECK:STDERR: fail_parens.carbon:[[@LINE+7]]:15: error: redeclaration syntax differs here // CHECK:STDERR: class Foo(a:! (C)) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_parens.carbon:[[@LINE-4]]:15: comparing with previous declaration here +// CHECK:STDERR: fail_parens.carbon:[[@LINE-4]]:15: note: comparing with previous declaration here // CHECK:STDERR: class Foo(a:! C); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -83,7 +83,7 @@ class Foo(a:! C); // CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE+7]]:11: error: redeclaration differs at parameter 1 // CHECK:STDERR: class Foo(b:! D) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE-4]]:11: previous declaration's corresponding parameter here +// CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE-4]]:11: note: previous declaration's corresponding parameter here // CHECK:STDERR: class Foo(a:! C); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -100,7 +100,7 @@ class Foo(a:! C); // CHECK:STDERR: fail_alias.carbon:[[@LINE+7]]:15: error: redeclaration syntax differs here // CHECK:STDERR: class Foo(a:! D) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_alias.carbon:[[@LINE-4]]:15: comparing with previous declaration here +// CHECK:STDERR: fail_alias.carbon:[[@LINE-4]]:15: note: comparing with previous declaration here // CHECK:STDERR: class Foo(a:! C); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -117,7 +117,7 @@ class Foo[a:! C](); // CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE+7]]:15: error: redeclaration syntax differs here // CHECK:STDERR: class Foo[a:! D]() {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE-4]]:15: comparing with previous declaration here +// CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE-4]]:15: note: comparing with previous declaration here // CHECK:STDERR: class Foo[a:! C](); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -153,7 +153,7 @@ class Foo(a:! const C); // CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+7]]:21: error: redeclaration syntax differs here // CHECK:STDERR: class Foo(a:! const (const C)) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE-8]]:21: comparing with previous declaration here +// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE-8]]:21: note: comparing with previous declaration here // CHECK:STDERR: class Foo(a:! const C); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -172,7 +172,7 @@ base class Base { // CHECK:STDERR: fail_self_type.carbon:[[@LINE+6]]:22: error: redeclaration syntax differs here // CHECK:STDERR: fn Base.F[addr self: Base*]() { // CHECK:STDERR: ^~~~ -// CHECK:STDERR: fail_self_type.carbon:[[@LINE-6]]:19: comparing with previous declaration here +// CHECK:STDERR: fail_self_type.carbon:[[@LINE-6]]:19: note: comparing with previous declaration here // CHECK:STDERR: fn F[addr self: Self*](); // CHECK:STDERR: ^~~~ fn Base.F[addr self: Base*]() { diff --git a/toolchain/check/testdata/class/syntactic_merge_literal.carbon b/toolchain/check/testdata/class/syntactic_merge_literal.carbon index f59c440260a0..a55ce33fb613 100644 --- a/toolchain/check/testdata/class/syntactic_merge_literal.carbon +++ b/toolchain/check/testdata/class/syntactic_merge_literal.carbon @@ -23,7 +23,7 @@ class D(b:! C(1000)); // CHECK:STDERR: fail_int_mismatch.carbon:[[@LINE+6]]:15: error: redeclaration syntax differs here // CHECK:STDERR: class D(b:! C(1_000)) {} // CHECK:STDERR: ^~~~~ -// CHECK:STDERR: fail_int_mismatch.carbon:[[@LINE-4]]:15: comparing with previous declaration here +// CHECK:STDERR: fail_int_mismatch.carbon:[[@LINE-4]]:15: note: comparing with previous declaration here // CHECK:STDERR: class D(b:! C(1000)); // CHECK:STDERR: ^~~~ class D(b:! C(1_000)) {} diff --git a/toolchain/check/testdata/const/fail_collapse.carbon b/toolchain/check/testdata/const/fail_collapse.carbon index 773faa5f03c0..cfc02de0c6f2 100644 --- a/toolchain/check/testdata/const/fail_collapse.carbon +++ b/toolchain/check/testdata/const/fail_collapse.carbon @@ -16,7 +16,7 @@ fn G(p: const (const i32)**) -> i32** { // CHECK:STDERR: fail_collapse.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `const i32**` to `i32**` // CHECK:STDERR: return p; // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_collapse.carbon:[[@LINE+3]]:3: type `const i32**` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_collapse.carbon:[[@LINE+3]]:3: note: type `const i32**` does not implement interface `ImplicitAs` // CHECK:STDERR: return p; // CHECK:STDERR: ^~~~~~~~~ return p; diff --git a/toolchain/check/testdata/function/builtin/fail_redefined.carbon b/toolchain/check/testdata/function/builtin/fail_redefined.carbon index 7a743a57abfa..2192ac53a2c9 100644 --- a/toolchain/check/testdata/function/builtin/fail_redefined.carbon +++ b/toolchain/check/testdata/function/builtin/fail_redefined.carbon @@ -12,7 +12,7 @@ fn A(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDERR: fail_redefined.carbon:[[@LINE+7]]:1: error: redefinition of `fn A` // CHECK:STDERR: fn A(n: i32, m: i32) -> i32 { return n; } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_redefined.carbon:[[@LINE-4]]:1: previously defined here +// CHECK:STDERR: fail_redefined.carbon:[[@LINE-4]]:1: note: previously defined here // CHECK:STDERR: fn A(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -22,7 +22,7 @@ fn B(n: i32, m: i32) -> i32 { return n; } // CHECK:STDERR: fail_redefined.carbon:[[@LINE+7]]:1: error: redefinition of `fn B` // CHECK:STDERR: fn B(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_redefined.carbon:[[@LINE-4]]:1: previously defined here +// CHECK:STDERR: fail_redefined.carbon:[[@LINE-4]]:1: note: previously defined here // CHECK:STDERR: fn B(n: i32, m: i32) -> i32 { return n; } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -32,7 +32,7 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDERR: fail_redefined.carbon:[[@LINE+6]]:1: error: redefinition of `fn C` // CHECK:STDERR: fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_redefined.carbon:[[@LINE-4]]:1: previously defined here +// CHECK:STDERR: fail_redefined.carbon:[[@LINE-4]]:1: note: previously defined here // CHECK:STDERR: fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fn C(n: i32, m: i32) -> i32 = "int.sadd"; diff --git a/toolchain/check/testdata/function/call/fail_param_count.carbon b/toolchain/check/testdata/function/call/fail_param_count.carbon index 09758bbc3661..7803b1787959 100644 --- a/toolchain/check/testdata/function/call/fail_param_count.carbon +++ b/toolchain/check/testdata/function/call/fail_param_count.carbon @@ -16,7 +16,7 @@ fn Main() { // CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: error: 1 argument(s) passed to function expecting 0 argument(s). // CHECK:STDERR: Run0(1); // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: fail_param_count.carbon:[[@LINE-8]]:1: calling function declared here + // CHECK:STDERR: fail_param_count.carbon:[[@LINE-8]]:1: note: calling function declared here // CHECK:STDERR: fn Run0() {} // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: @@ -24,7 +24,7 @@ fn Main() { // CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: error: 2 argument(s) passed to function expecting 0 argument(s). // CHECK:STDERR: Run0(0, 1); // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: fail_param_count.carbon:[[@LINE-16]]:1: calling function declared here + // CHECK:STDERR: fail_param_count.carbon:[[@LINE-16]]:1: note: calling function declared here // CHECK:STDERR: fn Run0() {} // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: @@ -33,7 +33,7 @@ fn Main() { // CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: error: 0 argument(s) passed to function expecting 1 argument(s). // CHECK:STDERR: Run1(); // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: fail_param_count.carbon:[[@LINE-24]]:1: calling function declared here + // CHECK:STDERR: fail_param_count.carbon:[[@LINE-24]]:1: note: calling function declared here // CHECK:STDERR: fn Run1(a: i32) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -41,7 +41,7 @@ fn Main() { // CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: error: 2 argument(s) passed to function expecting 1 argument(s). // CHECK:STDERR: Run1(0, 1); // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: fail_param_count.carbon:[[@LINE-32]]:1: calling function declared here + // CHECK:STDERR: fail_param_count.carbon:[[@LINE-32]]:1: note: calling function declared here // CHECK:STDERR: fn Run1(a: i32) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -50,7 +50,7 @@ fn Main() { // CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: error: 0 argument(s) passed to function expecting 2 argument(s). // CHECK:STDERR: Run2(); // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: fail_param_count.carbon:[[@LINE-40]]:1: calling function declared here + // CHECK:STDERR: fail_param_count.carbon:[[@LINE-40]]:1: note: calling function declared here // CHECK:STDERR: fn Run2(a: i32, b: i32) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -58,7 +58,7 @@ fn Main() { // CHECK:STDERR: fail_param_count.carbon:[[@LINE+6]]:3: error: 1 argument(s) passed to function expecting 2 argument(s). // CHECK:STDERR: Run2(0); // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: fail_param_count.carbon:[[@LINE-48]]:1: calling function declared here + // CHECK:STDERR: fail_param_count.carbon:[[@LINE-48]]:1: note: calling function declared here // CHECK:STDERR: fn Run2(a: i32, b: i32) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ Run2(0); diff --git a/toolchain/check/testdata/function/call/fail_param_type.carbon b/toolchain/check/testdata/function/call/fail_param_type.carbon index d0e60142964e..43d8c054fbad 100644 --- a/toolchain/check/testdata/function/call/fail_param_type.carbon +++ b/toolchain/check/testdata/function/call/fail_param_type.carbon @@ -14,10 +14,10 @@ fn F() { // CHECK:STDERR: fail_param_type.carbon:[[@LINE+9]]:3: error: cannot implicitly convert from `f64` to `i32` // CHECK:STDERR: G(1.0); // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_param_type.carbon:[[@LINE+6]]:3: type `f64` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_param_type.carbon:[[@LINE+6]]:3: note: type `f64` does not implement interface `ImplicitAs` // CHECK:STDERR: G(1.0); // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_param_type.carbon:[[@LINE-9]]:1: initializing parameter 1 of function declared here + // CHECK:STDERR: fail_param_type.carbon:[[@LINE-9]]:1: note: initializing parameter 1 of function declared here // CHECK:STDERR: fn G(a: i32) {} // CHECK:STDERR: ^~~~~~~~~~~~~~ G(1.0); diff --git a/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon b/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon index 7c04ffb1d8ba..32a158996f5a 100644 --- a/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon +++ b/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon @@ -14,7 +14,7 @@ fn Run() { // CHECK:STDERR: fail_return_type_mismatch.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `f64` to `i32` // CHECK:STDERR: var x: i32 = Foo(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_return_type_mismatch.carbon:[[@LINE+3]]:3: type `f64` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_return_type_mismatch.carbon:[[@LINE+3]]:3: note: type `f64` does not implement interface `ImplicitAs` // CHECK:STDERR: var x: i32 = Foo(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ var x: i32 = Foo(); diff --git a/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon b/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon index 65f9192554f1..98dea5d443e2 100644 --- a/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon +++ b/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon @@ -11,7 +11,7 @@ // CHECK:STDERR: fail_param_redecl.carbon:[[@LINE+6]]:14: error: duplicate name being declared in the same scope // CHECK:STDERR: fn F(n: i32, n: i32); // CHECK:STDERR: ^ -// CHECK:STDERR: fail_param_redecl.carbon:[[@LINE+3]]:6: name is previously declared here +// CHECK:STDERR: fail_param_redecl.carbon:[[@LINE+3]]:6: note: name is previously declared here // CHECK:STDERR: fn F(n: i32, n: i32); // CHECK:STDERR: ^ fn F(n: i32, n: i32); diff --git a/toolchain/check/testdata/function/declaration/import.carbon b/toolchain/check/testdata/function/declaration/import.carbon index 2f3ff465b5e3..737f219f212b 100644 --- a/toolchain/check/testdata/function/declaration/import.carbon +++ b/toolchain/check/testdata/function/declaration/import.carbon @@ -58,57 +58,47 @@ library "[[@TEST_NAME]]"; import library "api"; -// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+10]]:1: error: redeclarations of `fn A` must match use of `extern` +// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+8]]:1: error: redeclarations of `fn A` must match use of `extern` // CHECK:STDERR: extern fn A(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: fail_redecl_api.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: import library "api"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: api.carbon:4:1: previously declared here +// CHECK:STDERR: api.carbon:4:1: note: previously declared here // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: extern fn A(); -// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+10]]:1: error: redeclarations of `fn B` must match use of `extern` +// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+8]]:1: error: redeclarations of `fn B` must match use of `extern` // CHECK:STDERR: extern fn B(b: i32) -> i32; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE-16]]:1: in import -// CHECK:STDERR: import library "api"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: api.carbon:5:1: previously declared here +// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE-14]]:1: in import +// CHECK:STDERR: api.carbon:5:1: note: previously declared here // CHECK:STDERR: fn B(b: i32) -> i32; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: extern fn B(b: i32) -> i32; -// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+10]]:1: error: redeclarations of `fn C` must match use of `extern` +// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+8]]:1: error: redeclarations of `fn C` must match use of `extern` // CHECK:STDERR: extern fn C(c: (i32,)) -> {.c: i32}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE-27]]:1: in import -// CHECK:STDERR: import library "api"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: api.carbon:6:1: previously declared here +// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE-23]]:1: in import +// CHECK:STDERR: api.carbon:6:1: note: previously declared here // CHECK:STDERR: fn C(c: (i32,)) -> {.c: i32}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: extern fn C(c: (i32,)) -> {.c: i32}; -// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+10]]:1: error: redeclaration of `fn D` is redundant +// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+8]]:1: error: redeclaration of `fn D` is redundant // CHECK:STDERR: extern fn D(); // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE-38]]:1: in import -// CHECK:STDERR: import library "api"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: api.carbon:7:1: previously declared here +// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE-32]]:1: in import +// CHECK:STDERR: api.carbon:7:1: note: previously declared here // CHECK:STDERR: extern fn D(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: extern fn D(); -// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+10]]:1: error: redeclarations of `fn E` must match use of `extern` +// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+8]]:1: error: redeclarations of `fn E` must match use of `extern` // CHECK:STDERR: extern fn NS.E(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE-49]]:1: in import -// CHECK:STDERR: import library "api"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: api.carbon:10:1: previously declared here +// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE-41]]:1: in import +// CHECK:STDERR: api.carbon:10:1: note: previously declared here // CHECK:STDERR: fn NS.E(); // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: @@ -142,68 +132,48 @@ var e: () = NS.E(); library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_merge.carbon:[[@LINE+65]]:1: in import -// CHECK:STDERR: import library "api"; -// CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: fail_merge.carbon:[[@LINE+45]]:1: in import // CHECK:STDERR: extern_api.carbon:4:1: error: duplicate name being declared in the same scope // CHECK:STDERR: extern library "redecl_extern_api" fn A(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_merge.carbon:[[@LINE+59]]:1: in import -// CHECK:STDERR: import library "api"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: api.carbon:4:1: name is previously declared here +// CHECK:STDERR: fail_merge.carbon:[[@LINE+41]]:1: in import +// CHECK:STDERR: api.carbon:4:1: note: name is previously declared here // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_merge.carbon:[[@LINE+52]]:1: in import -// CHECK:STDERR: import library "api"; -// CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: fail_merge.carbon:[[@LINE+36]]:1: in import // CHECK:STDERR: extern_api.carbon:5:1: error: duplicate name being declared in the same scope // CHECK:STDERR: extern library "redecl_extern_api" fn B(b: i32) -> i32; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_merge.carbon:[[@LINE+46]]:1: in import -// CHECK:STDERR: import library "api"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: api.carbon:5:1: name is previously declared here +// CHECK:STDERR: fail_merge.carbon:[[@LINE+32]]:1: in import +// CHECK:STDERR: api.carbon:5:1: note: name is previously declared here // CHECK:STDERR: fn B(b: i32) -> i32; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_merge.carbon:[[@LINE+39]]:1: in import -// CHECK:STDERR: import library "api"; -// CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: fail_merge.carbon:[[@LINE+27]]:1: in import // CHECK:STDERR: extern_api.carbon:6:1: error: duplicate name being declared in the same scope // CHECK:STDERR: extern library "redecl_extern_api" fn C(c: (i32,)) -> {.c: i32}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_merge.carbon:[[@LINE+33]]:1: in import -// CHECK:STDERR: import library "api"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: api.carbon:6:1: name is previously declared here +// CHECK:STDERR: fail_merge.carbon:[[@LINE+23]]:1: in import +// CHECK:STDERR: api.carbon:6:1: note: name is previously declared here // CHECK:STDERR: fn C(c: (i32,)) -> {.c: i32}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_merge.carbon:[[@LINE+26]]:1: in import -// CHECK:STDERR: import library "api"; -// CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: fail_merge.carbon:[[@LINE+18]]:1: in import // CHECK:STDERR: extern_api.carbon:7:1: error: duplicate name being declared in the same scope // CHECK:STDERR: extern library "redecl_extern_api" fn D(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_merge.carbon:[[@LINE+20]]:1: in import -// CHECK:STDERR: import library "api"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: api.carbon:7:1: name is previously declared here +// CHECK:STDERR: fail_merge.carbon:[[@LINE+14]]:1: in import +// CHECK:STDERR: api.carbon:7:1: note: name is previously declared here // CHECK:STDERR: extern fn D(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_merge.carbon:[[@LINE+13]]:1: in import -// CHECK:STDERR: import library "api"; -// CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: fail_merge.carbon:[[@LINE+9]]:1: in import // CHECK:STDERR: extern_api.carbon:10:1: error: duplicate name being declared in the same scope // CHECK:STDERR: extern library "redecl_extern_api" fn NS.E(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_merge.carbon:[[@LINE+7]]:1: in import -// CHECK:STDERR: import library "api"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: api.carbon:10:1: name is previously declared here +// CHECK:STDERR: fail_merge.carbon:[[@LINE+5]]:1: in import +// CHECK:STDERR: api.carbon:10:1: note: name is previously declared here // CHECK:STDERR: fn NS.E(); // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: @@ -220,68 +190,48 @@ var e: () = NS.E(); library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+64]]:1: in import -// CHECK:STDERR: import library "extern_api"; -// CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+44]]:1: in import // CHECK:STDERR: api.carbon:4:1: error: duplicate name being declared in the same scope // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+58]]:1: in import -// CHECK:STDERR: import library "extern_api"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_api.carbon:4:1: name is previously declared here +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+40]]:1: in import +// CHECK:STDERR: extern_api.carbon:4:1: note: name is previously declared here // CHECK:STDERR: extern library "redecl_extern_api" fn A(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+51]]:1: in import -// CHECK:STDERR: import library "extern_api"; -// CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+35]]:1: in import // CHECK:STDERR: api.carbon:5:1: error: duplicate name being declared in the same scope // CHECK:STDERR: fn B(b: i32) -> i32; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+45]]:1: in import -// CHECK:STDERR: import library "extern_api"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_api.carbon:5:1: name is previously declared here +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+31]]:1: in import +// CHECK:STDERR: extern_api.carbon:5:1: note: name is previously declared here // CHECK:STDERR: extern library "redecl_extern_api" fn B(b: i32) -> i32; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+38]]:1: in import -// CHECK:STDERR: import library "extern_api"; -// CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+26]]:1: in import // CHECK:STDERR: api.carbon:6:1: error: duplicate name being declared in the same scope // CHECK:STDERR: fn C(c: (i32,)) -> {.c: i32}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+32]]:1: in import -// CHECK:STDERR: import library "extern_api"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_api.carbon:6:1: name is previously declared here +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+22]]:1: in import +// CHECK:STDERR: extern_api.carbon:6:1: note: name is previously declared here // CHECK:STDERR: extern library "redecl_extern_api" fn C(c: (i32,)) -> {.c: i32}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+25]]:1: in import -// CHECK:STDERR: import library "extern_api"; -// CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+17]]:1: in import // CHECK:STDERR: api.carbon:7:1: error: duplicate name being declared in the same scope // CHECK:STDERR: extern fn D(); // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+19]]:1: in import -// CHECK:STDERR: import library "extern_api"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_api.carbon:7:1: name is previously declared here +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+13]]:1: in import +// CHECK:STDERR: extern_api.carbon:7:1: note: name is previously declared here // CHECK:STDERR: extern library "redecl_extern_api" fn D(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+12]]:1: in import -// CHECK:STDERR: import library "extern_api"; -// CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+8]]:1: in import // CHECK:STDERR: api.carbon:10:1: error: duplicate name being declared in the same scope // CHECK:STDERR: fn NS.E(); // CHECK:STDERR: ^~~~~~~~~~ -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+6]]:1: in import -// CHECK:STDERR: import library "extern_api"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_api.carbon:10:1: name is previously declared here +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+4]]:1: in import +// CHECK:STDERR: extern_api.carbon:10:1: note: name is previously declared here // CHECK:STDERR: extern library "redecl_extern_api" fn NS.E(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ import library "extern_api"; @@ -668,8 +618,8 @@ import library "extern_api"; // CHECK:STDOUT: .NS = imports.%NS // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .b = %b.loc63 -// CHECK:STDOUT: .c = %c.loc64 +// CHECK:STDOUT: .b = %b.loc53 +// CHECK:STDOUT: .c = %c.loc54 // CHECK:STDOUT: .d = %d // CHECK:STDOUT: .e = %e // CHECK:STDOUT: } @@ -677,53 +627,53 @@ import library "extern_api"; // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] { -// CHECK:STDOUT: %int.make_type_32.loc27_16: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc27_16.1: type = value_of_initializer %int.make_type_32.loc27_16 [template = i32] -// CHECK:STDOUT: %.loc27_16.2: type = converted %int.make_type_32.loc27_16, %.loc27_16.1 [template = i32] -// CHECK:STDOUT: %b.loc27_13.1: i32 = param b, runtime_param0 -// CHECK:STDOUT: %b.loc27_13.2: i32 = bind_name b, %b.loc27_13.1 -// CHECK:STDOUT: %int.make_type_32.loc27_24: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc27_24.1: type = value_of_initializer %int.make_type_32.loc27_24 [template = i32] -// CHECK:STDOUT: %.loc27_24.2: type = converted %int.make_type_32.loc27_24, %.loc27_24.1 [template = i32] -// CHECK:STDOUT: %return.var.loc27: ref i32 = var +// CHECK:STDOUT: %int.make_type_32.loc23_16: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc23_16.1: type = value_of_initializer %int.make_type_32.loc23_16 [template = i32] +// CHECK:STDOUT: %.loc23_16.2: type = converted %int.make_type_32.loc23_16, %.loc23_16.1 [template = i32] +// CHECK:STDOUT: %b.loc23_13.1: i32 = param b, runtime_param0 +// CHECK:STDOUT: %b.loc23_13.2: i32 = bind_name b, %b.loc23_13.1 +// CHECK:STDOUT: %int.make_type_32.loc23_24: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc23_24.1: type = value_of_initializer %int.make_type_32.loc23_24 [template = i32] +// CHECK:STDOUT: %.loc23_24.2: type = converted %int.make_type_32.loc23_24, %.loc23_24.1 [template = i32] +// CHECK:STDOUT: %return.var.loc23: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] { -// CHECK:STDOUT: %int.make_type_32.loc38_17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc38_21.1: %.2 = tuple_literal (%int.make_type_32.loc38_17) -// CHECK:STDOUT: %.loc38_21.2: type = value_of_initializer %int.make_type_32.loc38_17 [template = i32] -// CHECK:STDOUT: %.loc38_21.3: type = converted %int.make_type_32.loc38_17, %.loc38_21.2 [template = i32] -// CHECK:STDOUT: %.loc38_21.4: type = converted %.loc38_21.1, constants.%.3 [template = constants.%.3] -// CHECK:STDOUT: %c.loc38_13.1: %.3 = param c, runtime_param0 -// CHECK:STDOUT: %c.loc38_13.2: %.3 = bind_name c, %c.loc38_13.1 -// CHECK:STDOUT: %int.make_type_32.loc38_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc38_32.1: type = value_of_initializer %int.make_type_32.loc38_32 [template = i32] -// CHECK:STDOUT: %.loc38_32.2: type = converted %int.make_type_32.loc38_32, %.loc38_32.1 [template = i32] -// CHECK:STDOUT: %.loc38_35: type = struct_type {.c: i32} [template = constants.%.4] -// CHECK:STDOUT: %return.var.loc38: ref %.4 = var +// CHECK:STDOUT: %int.make_type_32.loc32_17: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc32_21.1: %.2 = tuple_literal (%int.make_type_32.loc32_17) +// CHECK:STDOUT: %.loc32_21.2: type = value_of_initializer %int.make_type_32.loc32_17 [template = i32] +// CHECK:STDOUT: %.loc32_21.3: type = converted %int.make_type_32.loc32_17, %.loc32_21.2 [template = i32] +// CHECK:STDOUT: %.loc32_21.4: type = converted %.loc32_21.1, constants.%.3 [template = constants.%.3] +// CHECK:STDOUT: %c.loc32_13.1: %.3 = param c, runtime_param0 +// CHECK:STDOUT: %c.loc32_13.2: %.3 = bind_name c, %c.loc32_13.1 +// CHECK:STDOUT: %int.make_type_32.loc32_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc32_32.1: type = value_of_initializer %int.make_type_32.loc32_32 [template = i32] +// CHECK:STDOUT: %.loc32_32.2: type = converted %int.make_type_32.loc32_32, %.loc32_32.1 [template = i32] +// CHECK:STDOUT: %.loc32_35: type = struct_type {.c: i32} [template = constants.%.4] +// CHECK:STDOUT: %return.var.loc32: ref %.4 = var // CHECK:STDOUT: } // CHECK:STDOUT: %D.decl: %D.type = fn_decl @D [template = constants.%D] {} // CHECK:STDOUT: %E.decl: %E.type = fn_decl @E [template = constants.%E] {} -// CHECK:STDOUT: %.loc62_9.1: %.1 = tuple_literal () -// CHECK:STDOUT: %.loc62_9.2: type = converted %.loc62_9.1, constants.%.1 [template = constants.%.1] +// CHECK:STDOUT: %.loc52_9.1: %.1 = tuple_literal () +// CHECK:STDOUT: %.loc52_9.2: type = converted %.loc52_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %a.var: ref %.1 = var a // CHECK:STDOUT: %a: ref %.1 = bind_name a, %a.var -// CHECK:STDOUT: %int.make_type_32.loc63: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc63_8.1: type = value_of_initializer %int.make_type_32.loc63 [template = i32] -// CHECK:STDOUT: %.loc63_8.2: type = converted %int.make_type_32.loc63, %.loc63_8.1 [template = i32] +// CHECK:STDOUT: %int.make_type_32.loc53: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc53_8.1: type = value_of_initializer %int.make_type_32.loc53 [template = i32] +// CHECK:STDOUT: %.loc53_8.2: type = converted %int.make_type_32.loc53, %.loc53_8.1 [template = i32] // CHECK:STDOUT: %b.var: ref i32 = var b -// CHECK:STDOUT: %b.loc63: ref i32 = bind_name b, %b.var -// CHECK:STDOUT: %int.make_type_32.loc64: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc64_13.1: type = value_of_initializer %int.make_type_32.loc64 [template = i32] -// CHECK:STDOUT: %.loc64_13.2: type = converted %int.make_type_32.loc64, %.loc64_13.1 [template = i32] -// CHECK:STDOUT: %.loc64_16: type = struct_type {.c: i32} [template = constants.%.4] +// CHECK:STDOUT: %b.loc53: ref i32 = bind_name b, %b.var +// CHECK:STDOUT: %int.make_type_32.loc54: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc54_13.1: type = value_of_initializer %int.make_type_32.loc54 [template = i32] +// CHECK:STDOUT: %.loc54_13.2: type = converted %int.make_type_32.loc54, %.loc54_13.1 [template = i32] +// CHECK:STDOUT: %.loc54_16: type = struct_type {.c: i32} [template = constants.%.4] // CHECK:STDOUT: %c.var: ref %.4 = var c -// CHECK:STDOUT: %c.loc64: ref %.4 = bind_name c, %c.var -// CHECK:STDOUT: %.loc65_9.1: %.1 = tuple_literal () -// CHECK:STDOUT: %.loc65_9.2: type = converted %.loc65_9.1, constants.%.1 [template = constants.%.1] +// CHECK:STDOUT: %c.loc54: ref %.4 = bind_name c, %c.var +// CHECK:STDOUT: %.loc55_9.1: %.1 = tuple_literal () +// CHECK:STDOUT: %.loc55_9.2: type = converted %.loc55_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %d.var: ref %.1 = var d // CHECK:STDOUT: %d: ref %.1 = bind_name d, %d.var -// CHECK:STDOUT: %.loc66_9.1: %.1 = tuple_literal () -// CHECK:STDOUT: %.loc66_9.2: type = converted %.loc66_9.1, constants.%.1 [template = constants.%.1] +// CHECK:STDOUT: %.loc56_9.1: %.1 = tuple_literal () +// CHECK:STDOUT: %.loc56_9.2: type = converted %.loc56_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %e.var: ref %.1 = var e // CHECK:STDOUT: %e: ref %.1 = bind_name e, %e.var // CHECK:STDOUT: } @@ -746,15 +696,15 @@ import library "extern_api"; // CHECK:STDOUT: %A.call: init %.1 = call %A.ref() // CHECK:STDOUT: assign file.%a.var, %A.call // CHECK:STDOUT: %B.ref: %B.type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc63: i32 = int_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %B.call: init i32 = call %B.ref(%.loc63) +// CHECK:STDOUT: %.loc53: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %B.call: init i32 = call %B.ref(%.loc53) // CHECK:STDOUT: assign file.%b.var, %B.call // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc64_23: i32 = int_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %.loc64_25: %.3 = tuple_literal (%.loc64_23) -// CHECK:STDOUT: %tuple: %.3 = tuple_value (%.loc64_23) [template = constants.%tuple] -// CHECK:STDOUT: %.loc64_21: %.3 = converted %.loc64_25, %tuple [template = constants.%tuple] -// CHECK:STDOUT: %C.call: init %.4 = call %C.ref(%.loc64_21) +// CHECK:STDOUT: %.loc54_23: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc54_25: %.3 = tuple_literal (%.loc54_23) +// CHECK:STDOUT: %tuple: %.3 = tuple_value (%.loc54_23) [template = constants.%tuple] +// CHECK:STDOUT: %.loc54_21: %.3 = converted %.loc54_25, %tuple [template = constants.%tuple] +// CHECK:STDOUT: %C.call: init %.4 = call %C.ref(%.loc54_21) // CHECK:STDOUT: assign file.%c.var, %C.call // CHECK:STDOUT: %D.ref: %D.type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %D.call: init %.1 = call %D.ref() @@ -987,27 +937,27 @@ import library "extern_api"; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %.loc72_9.1: %.1 = tuple_literal () -// CHECK:STDOUT: %.loc72_9.2: type = converted %.loc72_9.1, constants.%.1 [template = constants.%.1] +// CHECK:STDOUT: %.loc52_9.1: %.1 = tuple_literal () +// CHECK:STDOUT: %.loc52_9.2: type = converted %.loc52_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %a.var: ref %.1 = var a // CHECK:STDOUT: %a: ref %.1 = bind_name a, %a.var -// CHECK:STDOUT: %int.make_type_32.loc73: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc73_8.1: type = value_of_initializer %int.make_type_32.loc73 [template = i32] -// CHECK:STDOUT: %.loc73_8.2: type = converted %int.make_type_32.loc73, %.loc73_8.1 [template = i32] +// CHECK:STDOUT: %int.make_type_32.loc53: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc53_8.1: type = value_of_initializer %int.make_type_32.loc53 [template = i32] +// CHECK:STDOUT: %.loc53_8.2: type = converted %int.make_type_32.loc53, %.loc53_8.1 [template = i32] // CHECK:STDOUT: %b.var: ref i32 = var b // CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var -// CHECK:STDOUT: %int.make_type_32.loc74: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc74_13.1: type = value_of_initializer %int.make_type_32.loc74 [template = i32] -// CHECK:STDOUT: %.loc74_13.2: type = converted %int.make_type_32.loc74, %.loc74_13.1 [template = i32] -// CHECK:STDOUT: %.loc74_16: type = struct_type {.c: i32} [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_32.loc54: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc54_13.1: type = value_of_initializer %int.make_type_32.loc54 [template = i32] +// CHECK:STDOUT: %.loc54_13.2: type = converted %int.make_type_32.loc54, %.loc54_13.1 [template = i32] +// CHECK:STDOUT: %.loc54_16: type = struct_type {.c: i32} [template = constants.%.3] // CHECK:STDOUT: %c.var: ref %.3 = var c // CHECK:STDOUT: %c: ref %.3 = bind_name c, %c.var -// CHECK:STDOUT: %.loc75_9.1: %.1 = tuple_literal () -// CHECK:STDOUT: %.loc75_9.2: type = converted %.loc75_9.1, constants.%.1 [template = constants.%.1] +// CHECK:STDOUT: %.loc55_9.1: %.1 = tuple_literal () +// CHECK:STDOUT: %.loc55_9.2: type = converted %.loc55_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %d.var: ref %.1 = var d // CHECK:STDOUT: %d: ref %.1 = bind_name d, %d.var -// CHECK:STDOUT: %.loc76_9.1: %.1 = tuple_literal () -// CHECK:STDOUT: %.loc76_9.2: type = converted %.loc76_9.1, constants.%.1 [template = constants.%.1] +// CHECK:STDOUT: %.loc56_9.1: %.1 = tuple_literal () +// CHECK:STDOUT: %.loc56_9.2: type = converted %.loc56_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %e.var: ref %.1 = var e // CHECK:STDOUT: %e: ref %.1 = bind_name e, %e.var // CHECK:STDOUT: } @@ -1030,15 +980,15 @@ import library "extern_api"; // CHECK:STDOUT: %A.call: init %.1 = call %A.ref() // CHECK:STDOUT: assign file.%a.var, %A.call // CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%import_ref.2 [template = constants.%B] -// CHECK:STDOUT: %.loc73: i32 = int_literal 1 [template = constants.%.2] -// CHECK:STDOUT: %B.call: init i32 = call %B.ref(%.loc73) +// CHECK:STDOUT: %.loc53: i32 = int_literal 1 [template = constants.%.2] +// CHECK:STDOUT: %B.call: init i32 = call %B.ref(%.loc53) // CHECK:STDOUT: assign file.%b.var, %B.call // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C] -// CHECK:STDOUT: %.loc74_23: i32 = int_literal 1 [template = constants.%.2] -// CHECK:STDOUT: %.loc74_25: %.4 = tuple_literal (%.loc74_23) -// CHECK:STDOUT: %tuple: %.4 = tuple_value (%.loc74_23) [template = constants.%tuple] -// CHECK:STDOUT: %.loc74_21: %.4 = converted %.loc74_25, %tuple [template = constants.%tuple] -// CHECK:STDOUT: %C.call: init %.3 = call %C.ref(%.loc74_21) +// CHECK:STDOUT: %.loc54_23: i32 = int_literal 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc54_25: %.4 = tuple_literal (%.loc54_23) +// CHECK:STDOUT: %tuple: %.4 = tuple_value (%.loc54_23) [template = constants.%tuple] +// CHECK:STDOUT: %.loc54_21: %.4 = converted %.loc54_25, %tuple [template = constants.%tuple] +// CHECK:STDOUT: %C.call: init %.3 = call %C.ref(%.loc54_21) // CHECK:STDOUT: assign file.%c.var, %C.call // CHECK:STDOUT: %D.ref: %D.type = name_ref D, imports.%import_ref.4 [template = constants.%D] // CHECK:STDOUT: %D.call: init %.1 = call %D.ref() @@ -1117,27 +1067,27 @@ import library "extern_api"; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %.loc71_9.1: %.1 = tuple_literal () -// CHECK:STDOUT: %.loc71_9.2: type = converted %.loc71_9.1, constants.%.1 [template = constants.%.1] +// CHECK:STDOUT: %.loc51_9.1: %.1 = tuple_literal () +// CHECK:STDOUT: %.loc51_9.2: type = converted %.loc51_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %a.var: ref %.1 = var a // CHECK:STDOUT: %a: ref %.1 = bind_name a, %a.var -// CHECK:STDOUT: %int.make_type_32.loc72: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc72_8.1: type = value_of_initializer %int.make_type_32.loc72 [template = i32] -// CHECK:STDOUT: %.loc72_8.2: type = converted %int.make_type_32.loc72, %.loc72_8.1 [template = i32] +// CHECK:STDOUT: %int.make_type_32.loc52: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc52_8.1: type = value_of_initializer %int.make_type_32.loc52 [template = i32] +// CHECK:STDOUT: %.loc52_8.2: type = converted %int.make_type_32.loc52, %.loc52_8.1 [template = i32] // CHECK:STDOUT: %b.var: ref i32 = var b // CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var -// CHECK:STDOUT: %int.make_type_32.loc73: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc73_13.1: type = value_of_initializer %int.make_type_32.loc73 [template = i32] -// CHECK:STDOUT: %.loc73_13.2: type = converted %int.make_type_32.loc73, %.loc73_13.1 [template = i32] -// CHECK:STDOUT: %.loc73_16: type = struct_type {.c: i32} [template = constants.%.3] +// CHECK:STDOUT: %int.make_type_32.loc53: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc53_13.1: type = value_of_initializer %int.make_type_32.loc53 [template = i32] +// CHECK:STDOUT: %.loc53_13.2: type = converted %int.make_type_32.loc53, %.loc53_13.1 [template = i32] +// CHECK:STDOUT: %.loc53_16: type = struct_type {.c: i32} [template = constants.%.3] // CHECK:STDOUT: %c.var: ref %.3 = var c // CHECK:STDOUT: %c: ref %.3 = bind_name c, %c.var -// CHECK:STDOUT: %.loc74_9.1: %.1 = tuple_literal () -// CHECK:STDOUT: %.loc74_9.2: type = converted %.loc74_9.1, constants.%.1 [template = constants.%.1] +// CHECK:STDOUT: %.loc54_9.1: %.1 = tuple_literal () +// CHECK:STDOUT: %.loc54_9.2: type = converted %.loc54_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %d.var: ref %.1 = var d // CHECK:STDOUT: %d: ref %.1 = bind_name d, %d.var -// CHECK:STDOUT: %.loc75_9.1: %.1 = tuple_literal () -// CHECK:STDOUT: %.loc75_9.2: type = converted %.loc75_9.1, constants.%.1 [template = constants.%.1] +// CHECK:STDOUT: %.loc55_9.1: %.1 = tuple_literal () +// CHECK:STDOUT: %.loc55_9.2: type = converted %.loc55_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %e.var: ref %.1 = var e // CHECK:STDOUT: %e: ref %.1 = bind_name e, %e.var // CHECK:STDOUT: } @@ -1160,15 +1110,15 @@ import library "extern_api"; // CHECK:STDOUT: %A.call: init %.1 = call %A.ref() // CHECK:STDOUT: assign file.%a.var, %A.call // CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%import_ref.2 [template = constants.%B] -// CHECK:STDOUT: %.loc72: i32 = int_literal 1 [template = constants.%.2] -// CHECK:STDOUT: %B.call: init i32 = call %B.ref(%.loc72) +// CHECK:STDOUT: %.loc52: i32 = int_literal 1 [template = constants.%.2] +// CHECK:STDOUT: %B.call: init i32 = call %B.ref(%.loc52) // CHECK:STDOUT: assign file.%b.var, %B.call // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C] -// CHECK:STDOUT: %.loc73_23: i32 = int_literal 1 [template = constants.%.2] -// CHECK:STDOUT: %.loc73_25: %.4 = tuple_literal (%.loc73_23) -// CHECK:STDOUT: %tuple: %.4 = tuple_value (%.loc73_23) [template = constants.%tuple] -// CHECK:STDOUT: %.loc73_21: %.4 = converted %.loc73_25, %tuple [template = constants.%tuple] -// CHECK:STDOUT: %C.call: init %.3 = call %C.ref(%.loc73_21) +// CHECK:STDOUT: %.loc53_23: i32 = int_literal 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc53_25: %.4 = tuple_literal (%.loc53_23) +// CHECK:STDOUT: %tuple: %.4 = tuple_value (%.loc53_23) [template = constants.%tuple] +// CHECK:STDOUT: %.loc53_21: %.4 = converted %.loc53_25, %tuple [template = constants.%tuple] +// CHECK:STDOUT: %C.call: init %.3 = call %C.ref(%.loc53_21) // CHECK:STDOUT: assign file.%c.var, %C.call // CHECK:STDOUT: %D.ref: %D.type = name_ref D, imports.%import_ref.4 [template = constants.%D] // CHECK:STDOUT: %D.call: init %.1 = call %D.ref() diff --git a/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon b/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon index 5a1de8f67ea7..9127d3a9f329 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon @@ -28,7 +28,7 @@ extern fn F(); // CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: error: redeclaration of `fn F` is redundant // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: previously declared here +// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: note: previously declared here // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: @@ -42,7 +42,7 @@ extern fn F(); // CHECK:STDERR: fail_redecl_extern.carbon:[[@LINE+7]]:1: error: redeclaration of `fn F` is redundant // CHECK:STDERR: fn F(); // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_redecl_extern.carbon:[[@LINE-4]]:1: previously declared here +// CHECK:STDERR: fail_redecl_extern.carbon:[[@LINE-4]]:1: note: previously declared here // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: diff --git a/toolchain/check/testdata/function/declaration/no_prelude/extern_library.carbon b/toolchain/check/testdata/function/declaration/no_prelude/extern_library.carbon index ac5734db2eef..57a8a8f7b892 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/extern_library.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/extern_library.carbon @@ -28,13 +28,11 @@ library "[[@TEST_NAME]]"; import library "extern_library"; -// CHECK:STDERR: fail_extern_library_nonowner.carbon:[[@LINE+10]]:1: error: declaration in library "extern_library_nonowner" doesn't match `extern library` declaration +// CHECK:STDERR: fail_extern_library_nonowner.carbon:[[@LINE+8]]:1: error: declaration in library "extern_library_nonowner" doesn't match `extern library` declaration // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: fail_extern_library_nonowner.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: import library "extern_library"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_library.carbon:4:1: previously declared with `extern library` here +// CHECK:STDERR: extern_library.carbon:4:1: note: previously declared with `extern library` here // CHECK:STDERR: extern library "extern_library_owner" fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -46,13 +44,11 @@ library "[[@TEST_NAME]]"; import library "extern_library"; -// CHECK:STDERR: fail_extern_library_nonextern.carbon:[[@LINE+10]]:1: error: redeclarations of `fn F` must match use of `extern` +// CHECK:STDERR: fail_extern_library_nonextern.carbon:[[@LINE+8]]:1: error: redeclarations of `fn F` must match use of `extern` // CHECK:STDERR: fn F(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fail_extern_library_nonextern.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: import library "extern_library"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_library.carbon:4:1: previously declared here +// CHECK:STDERR: extern_library.carbon:4:1: note: previously declared here // CHECK:STDERR: extern library "extern_library_owner" fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -64,13 +60,11 @@ library "[[@TEST_NAME]]"; import library "extern_library"; -// CHECK:STDERR: fail_extern_library_redecl.carbon:[[@LINE+10]]:1: error: declaration in library "extern_library_redecl" doesn't match `extern library` declaration +// CHECK:STDERR: fail_extern_library_redecl.carbon:[[@LINE+8]]:1: error: declaration in library "extern_library_redecl" doesn't match `extern library` declaration // CHECK:STDERR: extern library "extern_library_owner" fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_extern_library_redecl.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: import library "extern_library"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_library.carbon:4:1: previously declared with `extern library` here +// CHECK:STDERR: extern_library.carbon:4:1: note: previously declared with `extern library` here // CHECK:STDERR: extern library "extern_library_owner" fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -86,16 +80,12 @@ extern library "extern_library_owner" fn F(); library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_extern_library_collision.carbon:[[@LINE+13]]:1: in import -// CHECK:STDERR: import library "extern_library"; -// CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: fail_extern_library_collision.carbon:[[@LINE+9]]:1: in import // CHECK:STDERR: extern_library_copy.carbon:4:1: error: duplicate name being declared in the same scope // CHECK:STDERR: extern library "extern_library_owner" fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_extern_library_collision.carbon:[[@LINE+7]]:1: in import -// CHECK:STDERR: import library "extern_library"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_library.carbon:4:1: name is previously declared here +// CHECK:STDERR: fail_extern_library_collision.carbon:[[@LINE+5]]:1: in import +// CHECK:STDERR: extern_library.carbon:4:1: note: name is previously declared here // CHECK:STDERR: extern library "extern_library_owner" fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -142,13 +132,11 @@ library "[[@TEST_NAME]]"; import library "extern_of_import"; -// CHECK:STDERR: fail_extern_of_import_redecl.carbon:[[@LINE+9]]:1: error: redeclarations of `fn F` must match use of `extern` +// CHECK:STDERR: fail_extern_of_import_redecl.carbon:[[@LINE+7]]:1: error: redeclarations of `fn F` must match use of `extern` // CHECK:STDERR: extern library "extern_of_import" fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_extern_of_import_redecl.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: import library "extern_of_import"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_of_import.carbon:4:1: previously declared here +// CHECK:STDERR: extern_of_import.carbon:4:1: note: previously declared here // CHECK:STDERR: fn F(); // CHECK:STDERR: ^~~~~~~ extern library "extern_of_import" fn F(); diff --git a/toolchain/check/testdata/function/declaration/no_prelude/extern_library_for_default.carbon b/toolchain/check/testdata/function/declaration/no_prelude/extern_library_for_default.carbon index de24722aa35b..391914e7f298 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/extern_library_for_default.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/extern_library_for_default.carbon @@ -28,13 +28,11 @@ package Foo library "[[@TEST_NAME]]"; import library default; -// CHECK:STDERR: fail_wrong_library.carbon:[[@LINE+9]]:1: error: declaration in library "wrong_library" doesn't match `extern library` declaration +// CHECK:STDERR: fail_wrong_library.carbon:[[@LINE+7]]:1: error: declaration in library "wrong_library" doesn't match `extern library` declaration // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: fail_wrong_library.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: import library default; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: default.carbon:4:1: previously declared with `extern library` here +// CHECK:STDERR: default.carbon:4:1: note: previously declared with `extern library` here // CHECK:STDERR: extern library "expected" fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ extern fn F(); diff --git a/toolchain/check/testdata/function/declaration/no_prelude/extern_library_from_default.carbon b/toolchain/check/testdata/function/declaration/no_prelude/extern_library_from_default.carbon index e2686711f83a..f2b013954b1b 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/extern_library_from_default.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/extern_library_from_default.carbon @@ -26,13 +26,11 @@ library "[[@TEST_NAME]]"; import library "extern_library"; -// CHECK:STDERR: fail_wrong_library.carbon:[[@LINE+9]]:1: error: declaration in library "wrong_library" doesn't match `extern library` declaration +// CHECK:STDERR: fail_wrong_library.carbon:[[@LINE+7]]:1: error: declaration in library "wrong_library" doesn't match `extern library` declaration // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: fail_wrong_library.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: import library "extern_library"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_library.carbon:4:1: previously declared with `extern library` here +// CHECK:STDERR: extern_library.carbon:4:1: note: previously declared with `extern library` here // CHECK:STDERR: extern library default fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ extern fn F(); diff --git a/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon b/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon index b450b77ba10f..b4fa3ac0bb60 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon @@ -24,10 +24,10 @@ fn Call() { // CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE+10]]:3: error: function returns incomplete type `C` // CHECK:STDERR: ReturnCUsed(); // CHECK:STDERR: ^~~~~~~~~~~ - // CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-12]]:1: class was forward declared here + // CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-12]]:1: note: class was forward declared here // CHECK:STDERR: class C; // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-11]]:18: return type declared here + // CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-11]]:18: note: return type declared here // CHECK:STDERR: fn ReturnCUsed() -> C; // CHECK:STDERR: ^~~~ // CHECK:STDERR: @@ -35,10 +35,10 @@ fn Call() { // CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE+10]]:3: error: function returns incomplete type `D` // CHECK:STDERR: ReturnDUsed(); // CHECK:STDERR: ^~~~~~~~~~~ - // CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-22]]:1: class was forward declared here + // CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-22]]:1: note: class was forward declared here // CHECK:STDERR: class D; // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-20]]:18: return type declared here + // CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-20]]:18: note: return type declared here // CHECK:STDERR: fn ReturnDUsed() -> D; // CHECK:STDERR: ^~~~ // CHECK:STDERR: @@ -54,36 +54,28 @@ library "[[@TEST_NAME]]"; import library "incomplete_return"; fn CallFAndGIncomplete() { - // CHECK:STDERR: fail_use_imported.carbon:[[@LINE+16]]:3: error: function returns incomplete type `C` + // CHECK:STDERR: fail_use_imported.carbon:[[@LINE+12]]:3: error: function returns incomplete type `C` // CHECK:STDERR: ReturnCUnused(); // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: fail_use_imported.carbon:[[@LINE-6]]:1: in import - // CHECK:STDERR: import library "incomplete_return"; - // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_incomplete_return.carbon:4:1: class was forward declared here + // CHECK:STDERR: fail_incomplete_return.carbon:4:1: note: class was forward declared here // CHECK:STDERR: class C; // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_use_imported.carbon:[[@LINE-12]]:1: in import - // CHECK:STDERR: import library "incomplete_return"; - // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_incomplete_return.carbon:7:20: return type declared here + // CHECK:STDERR: fail_use_imported.carbon:[[@LINE-10]]:1: in import + // CHECK:STDERR: fail_incomplete_return.carbon:7:20: note: return type declared here // CHECK:STDERR: fn ReturnCUnused() -> C; // CHECK:STDERR: ^~~~ // CHECK:STDERR: ReturnCUnused(); - // CHECK:STDERR: fail_use_imported.carbon:[[@LINE+15]]:3: error: function returns incomplete type `C` + // CHECK:STDERR: fail_use_imported.carbon:[[@LINE+11]]:3: error: function returns incomplete type `C` // CHECK:STDERR: ReturnCUsed(); // CHECK:STDERR: ^~~~~~~~~~~ - // CHECK:STDERR: fail_use_imported.carbon:[[@LINE-23]]:1: in import - // CHECK:STDERR: import library "incomplete_return"; - // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_incomplete_return.carbon:4:1: class was forward declared here + // CHECK:STDERR: fail_use_imported.carbon:[[@LINE-19]]:1: in import + // CHECK:STDERR: fail_incomplete_return.carbon:4:1: note: class was forward declared here // CHECK:STDERR: class C; // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_use_imported.carbon:[[@LINE-29]]:1: in import - // CHECK:STDERR: import library "incomplete_return"; - // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_incomplete_return.carbon:8:18: return type declared here + // CHECK:STDERR: fail_use_imported.carbon:[[@LINE-23]]:1: in import + // CHECK:STDERR: fail_incomplete_return.carbon:8:18: note: return type declared here // CHECK:STDERR: fn ReturnCUsed() -> C; // CHECK:STDERR: ^~~~ ReturnCUsed(); @@ -230,13 +222,13 @@ fn CallFAndGIncomplete() { // CHECK:STDOUT: %ReturnCUsed.ref: %ReturnCUsed.type = name_ref ReturnCUsed, imports.%import_ref.4 [template = constants.%ReturnCUsed] // CHECK:STDOUT: %ReturnCUsed.call: init = call %ReturnCUsed.ref() // CHECK:STDOUT: %ReturnDUnused.ref: %ReturnDUnused.type = name_ref ReturnDUnused, imports.%import_ref.5 [template = constants.%ReturnDUnused] -// CHECK:STDOUT: %.loc40_16.1: ref %D = temporary_storage -// CHECK:STDOUT: %ReturnDUnused.call: init %D = call %ReturnDUnused.ref() to %.loc40_16.1 -// CHECK:STDOUT: %.loc40_16.2: ref %D = temporary %.loc40_16.1, %ReturnDUnused.call +// CHECK:STDOUT: %.loc32_16.1: ref %D = temporary_storage +// CHECK:STDOUT: %ReturnDUnused.call: init %D = call %ReturnDUnused.ref() to %.loc32_16.1 +// CHECK:STDOUT: %.loc32_16.2: ref %D = temporary %.loc32_16.1, %ReturnDUnused.call // CHECK:STDOUT: %ReturnDUsed.ref: %ReturnDUsed.type = name_ref ReturnDUsed, imports.%import_ref.6 [template = constants.%ReturnDUsed] -// CHECK:STDOUT: %.loc41_14.1: ref %D = temporary_storage -// CHECK:STDOUT: %ReturnDUsed.call: init %D = call %ReturnDUsed.ref() to %.loc41_14.1 -// CHECK:STDOUT: %.loc41_14.2: ref %D = temporary %.loc41_14.1, %ReturnDUsed.call +// CHECK:STDOUT: %.loc33_14.1: ref %D = temporary_storage +// CHECK:STDOUT: %ReturnDUsed.call: init %D = call %ReturnDUsed.ref() to %.loc33_14.1 +// CHECK:STDOUT: %.loc33_14.2: ref %D = temporary %.loc33_14.1, %ReturnDUsed.call // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/declaration/no_prelude/fail_modifiers.carbon b/toolchain/check/testdata/function/declaration/no_prelude/fail_modifiers.carbon index 9709b3dbd881..2fefc1ee2180 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/fail_modifiers.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/fail_modifiers.carbon @@ -15,7 +15,7 @@ // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:9: error: `protected` must appear before `default` // CHECK:STDERR: default protected fn WrongOrder(); // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `default` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note: `default` previously appeared here // CHECK:STDERR: default protected fn WrongOrder(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -28,7 +28,7 @@ default protected fn WrongOrder(); // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:9: error: `virtual` repeated on declaration // CHECK:STDERR: virtual virtual fn DuplicateVirtual() {} // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `virtual` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note: `virtual` previously appeared here // CHECK:STDERR: virtual virtual fn DuplicateVirtual() {} // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -37,7 +37,7 @@ virtual virtual fn DuplicateVirtual() {} // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:9: error: `protected` not allowed on declaration with `private` // CHECK:STDERR: private protected fn TwoAccess(); // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `private` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note: `private` previously appeared here // CHECK:STDERR: private protected fn TwoAccess(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -50,7 +50,7 @@ private protected fn TwoAccess(); // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:10: error: `virtual` not allowed on declaration with `abstract` // CHECK:STDERR: abstract virtual fn ModifiersConflict() {} // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `abstract` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note: `abstract` previously appeared here // CHECK:STDERR: abstract virtual fn ModifiersConflict() {} // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -69,14 +69,14 @@ base fn InvalidModifier(); // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+14]]:9: error: `final` not allowed on declaration with `default` // CHECK:STDERR: default final virtual fn ModifiersConflict2() {} // CHECK:STDERR: ^~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: `default` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: note: `default` previously appeared here // CHECK:STDERR: default final virtual fn ModifiersConflict2() {} // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:15: error: `virtual` not allowed on declaration with `default` // CHECK:STDERR: default final virtual fn ModifiersConflict2() {} // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `default` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note: `default` previously appeared here // CHECK:STDERR: default final virtual fn ModifiersConflict2() {} // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -85,7 +85,7 @@ default final virtual fn ModifiersConflict2() {} // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+6]]:8: error: `private` must appear before `extern` // CHECK:STDERR: extern private fn ExternOrderAndConflict() {} // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: `extern` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: note: `extern` previously appeared here // CHECK:STDERR: extern private fn ExternOrderAndConflict() {} // CHECK:STDERR: ^~~~~~ extern private fn ExternOrderAndConflict() {} diff --git a/toolchain/check/testdata/function/declaration/no_prelude/fail_redecl.carbon b/toolchain/check/testdata/function/declaration/no_prelude/fail_redecl.carbon index 4c7cc0f62c0b..3442c278f47b 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/fail_redecl.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/fail_redecl.carbon @@ -12,7 +12,7 @@ fn A(); // CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: error: redeclaration of `fn A` is redundant // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: previously declared here +// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: note: previously declared here // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -22,7 +22,7 @@ fn B(x: ()); // CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: error: redeclaration of `fn B` is redundant // CHECK:STDERR: fn B(x: ()); // CHECK:STDERR: ^~~~~~~~~~~~ -// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: previously declared here +// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: note: previously declared here // CHECK:STDERR: fn B(x: ()); // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: @@ -32,7 +32,7 @@ fn C(); // CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: error: redeclaration differs because of parameter count of 1 // CHECK:STDERR: fn C(x: ()); // CHECK:STDERR: ^~~~~~~~~~~~ -// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: previously declared with parameter count of 0 +// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: note: previously declared with parameter count of 0 // CHECK:STDERR: fn C(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -42,7 +42,7 @@ fn D() {} // CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: error: redeclaration of `fn D` is redundant // CHECK:STDERR: fn D(); // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: previously declared here +// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: note: previously declared here // CHECK:STDERR: fn D() {} // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -52,7 +52,7 @@ fn E() {} // CHECK:STDERR: fail_redecl.carbon:[[@LINE+6]]:1: error: redefinition of `fn E` // CHECK:STDERR: fn E() {} // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: previously defined here +// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: note: previously defined here // CHECK:STDERR: fn E() {} // CHECK:STDERR: ^~~~~~~~ fn E() {} diff --git a/toolchain/check/testdata/function/declaration/no_prelude/implicit_import.carbon b/toolchain/check/testdata/function/declaration/no_prelude/implicit_import.carbon index 0d55a85b5504..9d412b427cad 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/implicit_import.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/implicit_import.carbon @@ -30,13 +30,11 @@ extern fn A(); impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE+14]]:1: error: redeclarations of `fn A` must match use of `extern` +// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE+12]]:1: error: redeclarations of `fn A` must match use of `extern` // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE-5]]:6: in import -// CHECK:STDERR: impl library "extern_api"; -// CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: extern_api.carbon:4:1: previously declared here +// CHECK:STDERR: extern_api.carbon:4:1: note: previously declared here // CHECK:STDERR: extern fn A(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: @@ -56,13 +54,11 @@ fn A(); impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_extern_impl.impl.carbon:[[@LINE+9]]:1: error: redeclarations of `fn A` must match use of `extern` +// CHECK:STDERR: fail_extern_impl.impl.carbon:[[@LINE+7]]:1: error: redeclarations of `fn A` must match use of `extern` // CHECK:STDERR: extern fn A(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: fail_extern_impl.impl.carbon:[[@LINE-5]]:6: in import -// CHECK:STDERR: impl library "extern_impl"; -// CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: extern_impl.carbon:4:1: previously declared here +// CHECK:STDERR: extern_impl.carbon:4:1: note: previously declared here // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~~~~~~ extern fn A(); diff --git a/toolchain/check/testdata/function/definition/import.carbon b/toolchain/check/testdata/function/definition/import.carbon index d82ad2da7ca9..cfbec6fd98a0 100644 --- a/toolchain/check/testdata/function/definition/import.carbon +++ b/toolchain/check/testdata/function/definition/import.carbon @@ -47,24 +47,20 @@ library "[[@TEST_NAME]]"; import library "fns"; -// CHECK:STDERR: fail_def_ownership.carbon:[[@LINE+10]]:1: error: redeclaration of `fn A` is redundant +// CHECK:STDERR: fail_def_ownership.carbon:[[@LINE+8]]:1: error: redeclaration of `fn A` is redundant // CHECK:STDERR: fn A() {}; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fail_def_ownership.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: import library "fns"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fns.carbon:4:1: previously declared here +// CHECK:STDERR: fns.carbon:4:1: note: previously declared here // CHECK:STDERR: fn A() {} // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fn A() {}; -// CHECK:STDERR: fail_def_ownership.carbon:[[@LINE+10]]:1: error: redeclaration of `fn B` is redundant +// CHECK:STDERR: fail_def_ownership.carbon:[[@LINE+8]]:1: error: redeclaration of `fn B` is redundant // CHECK:STDERR: fn B(b: i32) -> i32; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_def_ownership.carbon:[[@LINE-16]]:1: in import -// CHECK:STDERR: import library "fns"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fns.carbon:5:1: previously declared here +// CHECK:STDERR: fail_def_ownership.carbon:[[@LINE-14]]:1: in import +// CHECK:STDERR: fns.carbon:5:1: note: previously declared here // CHECK:STDERR: fn B(b: i32) -> i32 { return b; } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -76,25 +72,21 @@ library "[[@TEST_NAME]]"; import library "extern"; -// CHECK:STDERR: fail_redecl_then_def.carbon:[[@LINE+10]]:1: error: redeclarations of `fn A` must match use of `extern` +// CHECK:STDERR: fail_redecl_then_def.carbon:[[@LINE+8]]:1: error: redeclarations of `fn A` must match use of `extern` // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fail_redecl_then_def.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: import library "extern"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern.carbon:4:1: previously declared here +// CHECK:STDERR: extern.carbon:4:1: note: previously declared here // CHECK:STDERR: extern fn A(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: fn A(); -// CHECK:STDERR: fail_redecl_then_def.carbon:[[@LINE+10]]:1: error: redeclarations of `fn A` must match use of `extern` +// CHECK:STDERR: fail_redecl_then_def.carbon:[[@LINE+8]]:1: error: redeclarations of `fn A` must match use of `extern` // CHECK:STDERR: fn A() {} // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_redecl_then_def.carbon:[[@LINE-17]]:1: in import -// CHECK:STDERR: import library "extern"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern.carbon:4:1: previously declared here +// CHECK:STDERR: fail_redecl_then_def.carbon:[[@LINE-15]]:1: in import +// CHECK:STDERR: extern.carbon:4:1: note: previously declared here // CHECK:STDERR: extern fn A(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: @@ -106,13 +98,11 @@ library "[[@TEST_NAME]]"; import library "fns"; -// CHECK:STDERR: fail_mix_extern_decl.carbon:[[@LINE+9]]:1: error: redeclarations of `fn D` must match use of `extern` +// CHECK:STDERR: fail_mix_extern_decl.carbon:[[@LINE+7]]:1: error: redeclarations of `fn D` must match use of `extern` // CHECK:STDERR: extern fn D(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: fail_mix_extern_decl.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: import library "fns"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fns.carbon:7:1: previously declared here +// CHECK:STDERR: fns.carbon:7:1: note: previously declared here // CHECK:STDERR: fn D(); // CHECK:STDERR: ^~~~~~~ extern fn D(); @@ -387,14 +377,14 @@ fn D() {} // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] { -// CHECK:STDOUT: %int.make_type_32.loc27_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc27_9.1: type = value_of_initializer %int.make_type_32.loc27_9 [template = i32] -// CHECK:STDOUT: %.loc27_9.2: type = converted %int.make_type_32.loc27_9, %.loc27_9.1 [template = i32] -// CHECK:STDOUT: %b.loc27_6.1: i32 = param b, runtime_param0 -// CHECK:STDOUT: %b.loc27_6.2: i32 = bind_name b, %b.loc27_6.1 -// CHECK:STDOUT: %int.make_type_32.loc27_17: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc27_17.1: type = value_of_initializer %int.make_type_32.loc27_17 [template = i32] -// CHECK:STDOUT: %.loc27_17.2: type = converted %int.make_type_32.loc27_17, %.loc27_17.1 [template = i32] +// CHECK:STDOUT: %int.make_type_32.loc23_9: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc23_9.1: type = value_of_initializer %int.make_type_32.loc23_9 [template = i32] +// CHECK:STDOUT: %.loc23_9.2: type = converted %int.make_type_32.loc23_9, %.loc23_9.1 [template = i32] +// CHECK:STDOUT: %b.loc23_6.1: i32 = param b, runtime_param0 +// CHECK:STDOUT: %b.loc23_6.2: i32 = bind_name b, %b.loc23_6.1 +// CHECK:STDOUT: %int.make_type_32.loc23_17: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc23_17.1: type = value_of_initializer %int.make_type_32.loc23_17 [template = i32] +// CHECK:STDOUT: %.loc23_17.2: type = converted %int.make_type_32.loc23_17, %.loc23_17.1 [template = i32] // CHECK:STDOUT: %return.var: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -432,13 +422,13 @@ fn D() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .A = %A.decl.loc16 +// CHECK:STDOUT: .A = %A.decl.loc14 // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %A.decl.loc16: %A.type = fn_decl @A [template = constants.%A] {} -// CHECK:STDOUT: %A.decl.loc28: %A.type = fn_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl.loc14: %A.type = fn_decl @A [template = constants.%A] {} +// CHECK:STDOUT: %A.decl.loc24: %A.type = fn_decl @A [template = constants.%A] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @A() { @@ -476,13 +466,13 @@ fn D() {} // CHECK:STDOUT: .A = imports.%import_ref.1 // CHECK:STDOUT: .B = imports.%import_ref.2 // CHECK:STDOUT: .C = imports.%import_ref.3 -// CHECK:STDOUT: .D = %D.decl.loc15 +// CHECK:STDOUT: .D = %D.decl.loc13 // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %D.decl.loc13: %D.type = fn_decl @D [template = constants.%D] {} // CHECK:STDOUT: %D.decl.loc15: %D.type = fn_decl @D [template = constants.%D] {} -// CHECK:STDOUT: %D.decl.loc17: %D.type = fn_decl @D [template = constants.%D] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @D() { diff --git a/toolchain/check/testdata/function/definition/no_prelude/extern.carbon b/toolchain/check/testdata/function/definition/no_prelude/extern.carbon index 6c55f238cbb1..1735da099dda 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/extern.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/extern.carbon @@ -41,7 +41,7 @@ extern fn F(); // CHECK:STDERR: fail_def_extern_mismatch.carbon:[[@LINE+7]]:1: error: redeclarations of `fn F` must match use of `extern` // CHECK:STDERR: fn F() {} // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_def_extern_mismatch.carbon:[[@LINE-4]]:1: previously declared here +// CHECK:STDERR: fail_def_extern_mismatch.carbon:[[@LINE-4]]:1: note: previously declared here // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: @@ -55,7 +55,7 @@ fn F(); // CHECK:STDERR: fail_def_extern_mismatch_reverse.carbon:[[@LINE+7]]:1: error: redeclarations of `fn F` must match use of `extern` // CHECK:STDERR: extern fn F() {} // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_def_extern_mismatch_reverse.carbon:[[@LINE-4]]:1: previously declared here +// CHECK:STDERR: fail_def_extern_mismatch_reverse.carbon:[[@LINE-4]]:1: note: previously declared here // CHECK:STDERR: fn F(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -69,7 +69,7 @@ extern fn F(); // CHECK:STDERR: fail_extern_diag_suppressed.carbon:[[@LINE+7]]:1: error: redeclaration of `fn F` is redundant // CHECK:STDERR: fn F(); // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_extern_diag_suppressed.carbon:[[@LINE-4]]:1: previously declared here +// CHECK:STDERR: fail_extern_diag_suppressed.carbon:[[@LINE-4]]:1: note: previously declared here // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: @@ -77,7 +77,7 @@ fn F(); // CHECK:STDERR: fail_extern_diag_suppressed.carbon:[[@LINE+7]]:1: error: redeclarations of `fn F` must match use of `extern` // CHECK:STDERR: fn F() {} // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_extern_diag_suppressed.carbon:[[@LINE-12]]:1: previously declared here +// CHECK:STDERR: fail_extern_diag_suppressed.carbon:[[@LINE-12]]:1: note: previously declared here // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: @@ -91,7 +91,7 @@ fn F() {} // CHECK:STDERR: fail_extern_decl_after_def.carbon:[[@LINE+7]]:1: error: redeclaration of `fn F` is redundant // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_extern_decl_after_def.carbon:[[@LINE-4]]:1: previously declared here +// CHECK:STDERR: fail_extern_decl_after_def.carbon:[[@LINE-4]]:1: note: previously declared here // CHECK:STDERR: fn F() {} // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: diff --git a/toolchain/check/testdata/function/definition/no_prelude/extern_library.carbon b/toolchain/check/testdata/function/definition/no_prelude/extern_library.carbon index 87ab3f27d3f1..b269a1727ea9 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/extern_library.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/extern_library.carbon @@ -54,13 +54,11 @@ extern fn F(); impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_two_file_impl_mismatch.impl.carbon:[[@LINE+10]]:1: error: redeclarations of `fn F` must match use of `extern` +// CHECK:STDERR: fail_two_file_impl_mismatch.impl.carbon:[[@LINE+8]]:1: error: redeclarations of `fn F` must match use of `extern` // CHECK:STDERR: fn F() {} // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fail_two_file_impl_mismatch.impl.carbon:[[@LINE-5]]:6: in import -// CHECK:STDERR: impl library "two_file_impl_mismatch"; -// CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: two_file_impl_mismatch.carbon:4:1: previously declared here +// CHECK:STDERR: two_file_impl_mismatch.carbon:4:1: note: previously declared here // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: diff --git a/toolchain/check/testdata/function/definition/no_prelude/fail_decl_param_mismatch.carbon b/toolchain/check/testdata/function/definition/no_prelude/fail_decl_param_mismatch.carbon index 5e08fb658d5e..94c5927477fc 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/fail_decl_param_mismatch.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/fail_decl_param_mismatch.carbon @@ -12,7 +12,7 @@ fn F(); // CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:1: error: redeclaration differs because of parameter count of 1 // CHECK:STDERR: fn F(x: ()) {} // CHECK:STDERR: ^~~~~~~~~~~~~ -// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: previously declared with parameter count of 0 +// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: note: previously declared with parameter count of 0 // CHECK:STDERR: fn F(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -22,7 +22,7 @@ fn G(x: ()); // CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:1: error: redeclaration differs because of parameter count of 0 // CHECK:STDERR: fn G() {} // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: previously declared with parameter count of 1 +// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: note: previously declared with parameter count of 1 // CHECK:STDERR: fn G(x: ()); // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: @@ -39,7 +39,7 @@ fn I(); // CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:1: error: function redeclaration differs because return type is `()` // CHECK:STDERR: fn I() -> () { return (); } // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: previously declared with no return type +// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: note: previously declared with no return type // CHECK:STDERR: fn I(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -49,7 +49,7 @@ fn J() -> (); // CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:1: error: function redeclaration differs because no return type is provided // CHECK:STDERR: fn J() {} // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: previously declared with return type `()` +// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: note: previously declared with return type `()` // CHECK:STDERR: fn J() -> (); // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: @@ -59,7 +59,7 @@ fn K() -> (); // CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+6]]:1: error: function redeclaration differs because return type is `{}` // CHECK:STDERR: fn K() -> {} { return {}; } // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: previously declared with return type `()` +// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: note: previously declared with return type `()` // CHECK:STDERR: fn K() -> (); // CHECK:STDERR: ^~~~~~~~~~~~~ fn K() -> {} { return {}; } diff --git a/toolchain/check/testdata/function/definition/no_prelude/fail_redef.carbon b/toolchain/check/testdata/function/definition/no_prelude/fail_redef.carbon index faab2709109e..339dec854d2c 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/fail_redef.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/fail_redef.carbon @@ -12,7 +12,7 @@ fn F() {} // CHECK:STDERR: fail_redef.carbon:[[@LINE+6]]:1: error: redefinition of `fn F` // CHECK:STDERR: fn F() {} // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_redef.carbon:[[@LINE-4]]:1: previously defined here +// CHECK:STDERR: fail_redef.carbon:[[@LINE-4]]:1: note: previously defined here // CHECK:STDERR: fn F() {} // CHECK:STDERR: ^~~~~~~~ fn F() {} diff --git a/toolchain/check/testdata/function/definition/no_prelude/implicit_import.carbon b/toolchain/check/testdata/function/definition/no_prelude/implicit_import.carbon index 00397ca24832..4d68ac39194b 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/implicit_import.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/implicit_import.carbon @@ -30,13 +30,11 @@ extern fn A(); impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE+10]]:1: error: redeclarations of `fn A` must match use of `extern` +// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE+8]]:1: error: redeclarations of `fn A` must match use of `extern` // CHECK:STDERR: fn A() {} // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE-5]]:6: in import -// CHECK:STDERR: impl library "extern_api"; -// CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: extern_api.carbon:4:1: previously declared here +// CHECK:STDERR: extern_api.carbon:4:1: note: previously declared here // CHECK:STDERR: extern fn A(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: @@ -52,13 +50,11 @@ fn A(); impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_extern_impl.impl.carbon:[[@LINE+10]]:1: error: redeclarations of `fn A` must match use of `extern` +// CHECK:STDERR: fail_extern_impl.impl.carbon:[[@LINE+8]]:1: error: redeclarations of `fn A` must match use of `extern` // CHECK:STDERR: extern fn A() {} // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: fail_extern_impl.impl.carbon:[[@LINE-5]]:6: in import -// CHECK:STDERR: impl library "extern_impl"; -// CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: extern_impl.carbon:4:1: previously declared here +// CHECK:STDERR: extern_impl.carbon:4:1: note: previously declared here // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -74,13 +70,11 @@ fn A() {} impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_redecl_after_def.impl.carbon:[[@LINE+10]]:1: error: redeclaration of `fn A` is redundant +// CHECK:STDERR: fail_redecl_after_def.impl.carbon:[[@LINE+8]]:1: error: redeclaration of `fn A` is redundant // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fail_redecl_after_def.impl.carbon:[[@LINE-5]]:6: in import -// CHECK:STDERR: impl library "redecl_after_def"; -// CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: redecl_after_def.carbon:4:1: previously declared here +// CHECK:STDERR: redecl_after_def.carbon:4:1: note: previously declared here // CHECK:STDERR: fn A() {} // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -96,13 +90,11 @@ fn A() {} impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_redef_after_def.impl.carbon:[[@LINE+10]]:1: error: redefinition of `fn A` +// CHECK:STDERR: fail_redef_after_def.impl.carbon:[[@LINE+8]]:1: error: redefinition of `fn A` // CHECK:STDERR: fn A() {} // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fail_redef_after_def.impl.carbon:[[@LINE-5]]:6: in import -// CHECK:STDERR: impl library "redef_after_def"; -// CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: redef_after_def.carbon:4:1: previously defined here +// CHECK:STDERR: redef_after_def.carbon:4:1: note: previously defined here // CHECK:STDERR: fn A() {} // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -119,13 +111,11 @@ alias B = A; impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_def_alias.impl.carbon:[[@LINE+9]]:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_def_alias.impl.carbon:[[@LINE+7]]:1: error: duplicate name being declared in the same scope // CHECK:STDERR: fn B() {} // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fail_def_alias.impl.carbon:[[@LINE-5]]:6: in import -// CHECK:STDERR: impl library "def_alias"; -// CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: def_alias.carbon:5:7: name is previously declared here +// CHECK:STDERR: def_alias.carbon:5:7: note: name is previously declared here // CHECK:STDERR: alias B = A; // CHECK:STDERR: ^ fn B() {} diff --git a/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon b/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon index 80512c7fff48..3361512a883b 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon @@ -40,7 +40,7 @@ fn Foo(a: C); // CHECK:STDERR: fail_parens.carbon:[[@LINE+7]]:11: error: redeclaration syntax differs here // CHECK:STDERR: fn Foo(a: (C)) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_parens.carbon:[[@LINE-4]]:11: comparing with previous declaration here +// CHECK:STDERR: fail_parens.carbon:[[@LINE-4]]:11: note: comparing with previous declaration here // CHECK:STDERR: fn Foo(a: C); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -83,7 +83,7 @@ fn Foo(a: C); // CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE+7]]:8: error: redeclaration differs at parameter 1 // CHECK:STDERR: fn Foo(b: D) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE-4]]:8: previous declaration's corresponding parameter here +// CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE-4]]:8: note: previous declaration's corresponding parameter here // CHECK:STDERR: fn Foo(a: C); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -100,7 +100,7 @@ fn Foo(a: C); // CHECK:STDERR: fail_alias.carbon:[[@LINE+7]]:11: error: redeclaration syntax differs here // CHECK:STDERR: fn Foo(a: D) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_alias.carbon:[[@LINE-4]]:11: comparing with previous declaration here +// CHECK:STDERR: fail_alias.carbon:[[@LINE-4]]:11: note: comparing with previous declaration here // CHECK:STDERR: fn Foo(a: C); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -117,7 +117,7 @@ fn Foo[a: C](); // CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE+7]]:11: error: redeclaration syntax differs here // CHECK:STDERR: fn Foo[a: D]() {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE-4]]:11: comparing with previous declaration here +// CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE-4]]:11: note: comparing with previous declaration here // CHECK:STDERR: fn Foo[a: C](); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -163,7 +163,7 @@ fn Foo(a: const C); // CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+6]]:17: error: redeclaration syntax differs here // CHECK:STDERR: fn Foo(a: const (const C)) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE-8]]:17: comparing with previous declaration here +// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE-8]]:17: note: comparing with previous declaration here // CHECK:STDERR: fn Foo(a: const C); // CHECK:STDERR: ^ fn Foo(a: const (const C)) {} diff --git a/toolchain/check/testdata/function/generic/deduce.carbon b/toolchain/check/testdata/function/generic/deduce.carbon index 17fcc66c6381..35ba7d73ee59 100644 --- a/toolchain/check/testdata/function/generic/deduce.carbon +++ b/toolchain/check/testdata/function/generic/deduce.carbon @@ -35,7 +35,7 @@ fn CallExplicitAndAlsoDeduced(n: i32) -> i32* { // CHECK:STDERR: fail_todo_explicit_vs_deduced.carbon:[[@LINE+7]]:10: error: inconsistent deductions for value of generic parameter `T` // CHECK:STDERR: return ExplicitAndAlsoDeduced(A, {}); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_todo_explicit_vs_deduced.carbon:[[@LINE-7]]:1: while deducing parameters of generic declared here + // CHECK:STDERR: fail_todo_explicit_vs_deduced.carbon:[[@LINE-7]]:1: note: while deducing parameters of generic declared here // CHECK:STDERR: fn ExplicitAndAlsoDeduced(T:! type, x: T) -> T*; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -62,7 +62,7 @@ fn CallTupleParam() { // CHECK:STDERR: fail_todo_deduce_nested.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `T` // CHECK:STDERR: TupleParam((1, 2)); // CHECK:STDERR: ^~~~~~~~~~~ - // CHECK:STDERR: fail_todo_deduce_nested.carbon:[[@LINE-6]]:1: while deducing parameters of generic declared here + // CHECK:STDERR: fail_todo_deduce_nested.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here // CHECK:STDERR: fn TupleParam[T:! type](x: (T, i32)); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -75,7 +75,7 @@ fn CallStructParam() { // CHECK:STDERR: fail_todo_deduce_nested.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `T` // CHECK:STDERR: StructParam({.a = 1, .b = 2}); // CHECK:STDERR: ^~~~~~~~~~~~ - // CHECK:STDERR: fail_todo_deduce_nested.carbon:[[@LINE-6]]:1: while deducing parameters of generic declared here + // CHECK:STDERR: fail_todo_deduce_nested.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here // CHECK:STDERR: fn StructParam[T:! type](x: {.a: T, .b: i32}); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -94,7 +94,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDERR: fail_deduce_incomplete.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `U` // CHECK:STDERR: ImplicitNotDeducible(42); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_deduce_incomplete.carbon:[[@LINE-6]]:1: while deducing parameters of generic declared here + // CHECK:STDERR: fail_deduce_incomplete.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here // CHECK:STDERR: fn ImplicitNotDeducible[T:! type, U:! type](x: T) -> U; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -111,7 +111,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDERR: fail_deduce_inconsistent.carbon:[[@LINE+6]]:3: error: inconsistent deductions for value of generic parameter `T` // CHECK:STDERR: ImplicitNotDeducible(42, {.x = 12}); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_deduce_inconsistent.carbon:[[@LINE-6]]:1: while deducing parameters of generic declared here + // CHECK:STDERR: fail_deduce_inconsistent.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here // CHECK:STDERR: fn ImplicitNotDeducible[T:! type](x: T, y: T) -> T; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ImplicitNotDeducible(42, {.x = 12}); diff --git a/toolchain/check/testdata/function/generic/redeclare.carbon b/toolchain/check/testdata/function/generic/redeclare.carbon index e324b0d10917..a59811e1b877 100644 --- a/toolchain/check/testdata/function/generic/redeclare.carbon +++ b/toolchain/check/testdata/function/generic/redeclare.carbon @@ -27,7 +27,7 @@ fn F(T:! type, U:! type) -> T*; // CHECK:STDERR: fail_different_return_type.carbon:[[@LINE+7]]:1: error: function redeclaration differs because return type is `U*` // CHECK:STDERR: fn F(T:! type, U:! type) -> U* { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_different_return_type.carbon:[[@LINE-5]]:1: previously declared with return type `T*` +// CHECK:STDERR: fail_different_return_type.carbon:[[@LINE-5]]:1: note: previously declared with return type `T*` // CHECK:STDERR: fn F(T:! type, U:! type) -> T*; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -35,7 +35,7 @@ fn F(T:! type, U:! type) -> U* { // CHECK:STDERR: fail_different_return_type.carbon:[[@LINE+7]]:10: error: 1 argument(s) passed to function expecting 2 argument(s). // CHECK:STDERR: return F(T); // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_different_return_type.carbon:[[@LINE-13]]:1: calling function declared here + // CHECK:STDERR: fail_different_return_type.carbon:[[@LINE-13]]:1: note: calling function declared here // CHECK:STDERR: fn F(T:! type, U:! type) -> T*; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -51,7 +51,7 @@ fn F(T:! type, U:! type) -> T*; // CHECK:STDERR: fail_reorder.carbon:[[@LINE+7]]:6: error: redeclaration differs at parameter 1 // CHECK:STDERR: fn F(U:! type, T:! type) -> T* { // CHECK:STDERR: ^ -// CHECK:STDERR: fail_reorder.carbon:[[@LINE-5]]:6: previous declaration's corresponding parameter here +// CHECK:STDERR: fail_reorder.carbon:[[@LINE-5]]:6: note: previous declaration's corresponding parameter here // CHECK:STDERR: fn F(T:! type, U:! type) -> T*; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -59,7 +59,7 @@ fn F(U:! type, T:! type) -> T* { // CHECK:STDERR: fail_reorder.carbon:[[@LINE+7]]:10: error: 1 argument(s) passed to function expecting 2 argument(s). // CHECK:STDERR: return F(T); // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_reorder.carbon:[[@LINE-13]]:1: calling function declared here + // CHECK:STDERR: fail_reorder.carbon:[[@LINE-13]]:1: note: calling function declared here // CHECK:STDERR: fn F(T:! type, U:! type) -> T*; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -75,7 +75,7 @@ fn F(T:! type, U:! type) -> T*; // CHECK:STDERR: fail_rename.carbon:[[@LINE+7]]:6: error: redeclaration differs at parameter 1 // CHECK:STDERR: fn F(U:! type, T:! type) -> U* { // CHECK:STDERR: ^ -// CHECK:STDERR: fail_rename.carbon:[[@LINE-5]]:6: previous declaration's corresponding parameter here +// CHECK:STDERR: fail_rename.carbon:[[@LINE-5]]:6: note: previous declaration's corresponding parameter here // CHECK:STDERR: fn F(T:! type, U:! type) -> T*; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -83,7 +83,7 @@ fn F(U:! type, T:! type) -> U* { // CHECK:STDERR: fail_rename.carbon:[[@LINE+6]]:10: error: 1 argument(s) passed to function expecting 2 argument(s). // CHECK:STDERR: return F(T); // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_rename.carbon:[[@LINE-13]]:1: calling function declared here + // CHECK:STDERR: fail_rename.carbon:[[@LINE-13]]:1: note: calling function declared here // CHECK:STDERR: fn F(T:! type, U:! type) -> T*; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ return F(T); diff --git a/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon b/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon index cc40e986ede0..0d0b36259471 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon @@ -22,7 +22,7 @@ class D { // CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+7]]:3: error: cannot `extend` an `impl` with an explicit self type // CHECK:STDERR: extend impl D as I; // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+4]]:15: remove the explicit `Self` type here + // CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+4]]:15: note: remove the explicit `Self` type here // CHECK:STDERR: extend impl D as I; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -33,7 +33,7 @@ class E { // CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+6]]:3: error: cannot `extend` an `impl` with an explicit self type // CHECK:STDERR: extend impl Self as I {} // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+3]]:15: remove the explicit `Self` type here + // CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+3]]:15: note: remove the explicit `Self` type here // CHECK:STDERR: extend impl Self as I {} // CHECK:STDERR: ^~~~ extend impl Self as I {} diff --git a/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon b/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon index 872a40ac2b73..04dfbceac483 100644 --- a/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon +++ b/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon @@ -13,7 +13,7 @@ interface I { // CHECK:STDERR: fail_extend_partially_defined_interface.carbon:[[@LINE+6]]:5: error: `extend impl` requires a definition for interface `I` // CHECK:STDERR: extend impl as I; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_extend_partially_defined_interface.carbon:[[@LINE-5]]:1: interface is currently being defined + // CHECK:STDERR: fail_extend_partially_defined_interface.carbon:[[@LINE-5]]:1: note: interface is currently being defined // CHECK:STDERR: interface I { // CHECK:STDERR: ^~~~~~~~~~~~~ extend impl as I; diff --git a/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon b/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon index adfddcff3971..843fcafbb282 100644 --- a/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon +++ b/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon @@ -14,7 +14,7 @@ class C { // CHECK:STDERR: fail_extend_undefined_interface.carbon:[[@LINE+6]]:3: error: `extend impl` requires a definition for interface `I` // CHECK:STDERR: extend impl as I; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_extend_undefined_interface.carbon:[[@LINE-6]]:1: interface was forward declared here + // CHECK:STDERR: fail_extend_undefined_interface.carbon:[[@LINE-6]]:1: note: interface was forward declared here // CHECK:STDERR: interface I; // CHECK:STDERR: ^~~~~~~~~~~~ extend impl as I; diff --git a/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon b/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon index 38ab1bc35c9a..97cfbd647e5a 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon @@ -14,7 +14,7 @@ class NoF { // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:3: error: missing implementation of F in impl of interface I // CHECK:STDERR: impl as I {} // CHECK:STDERR: ^~~~~~~~~~~ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-6]]:15: associated function F declared here + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-6]]:15: note: associated function F declared here // CHECK:STDERR: interface I { fn F(); } // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -26,7 +26,7 @@ class FNotFunction { // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: associated function F implemented by non-function // CHECK:STDERR: class F; // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-18]]:15: associated function F declared here + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-18]]:15: note: associated function F declared here // CHECK:STDERR: interface I { fn F(); } // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -42,7 +42,7 @@ class FAlias { // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:11: error: associated function F implemented by non-function // CHECK:STDERR: alias F = PossiblyF; // CHECK:STDERR: ^ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-34]]:15: associated function F declared here + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-34]]:15: note: associated function F declared here // CHECK:STDERR: interface I { fn F(); } // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -55,7 +55,7 @@ class FExtraParam { // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: redeclaration differs because of parameter count of 1 // CHECK:STDERR: fn F(b: bool); // CHECK:STDERR: ^~~~~~~~~~~~~~ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-47]]:15: previously declared with parameter count of 0 + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-47]]:15: note: previously declared with parameter count of 0 // CHECK:STDERR: interface I { fn F(); } // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -68,7 +68,7 @@ class FExtraImplicitParam { // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: redeclaration differs because of implicit parameter list // CHECK:STDERR: fn F[self: Self](); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-60]]:15: previously declared without implicit parameter list + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-60]]:15: note: previously declared without implicit parameter list // CHECK:STDERR: interface I { fn F(); } // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -82,7 +82,7 @@ class FExtraReturnType { // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: function redeclaration differs because return type is `bool` // CHECK:STDERR: fn F() -> bool; // CHECK:STDERR: ^~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-74]]:15: previously declared with no return type + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-74]]:15: note: previously declared with no return type // CHECK:STDERR: interface I { fn F(); } // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -97,7 +97,7 @@ class FMissingParam { // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: redeclaration differs because of parameter count of 0 // CHECK:STDERR: fn F[self: bool]() -> bool; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-7]]:15: previously declared with parameter count of 1 + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-7]]:15: note: previously declared with parameter count of 1 // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -110,7 +110,7 @@ class FMissingImplicitParam { // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: redeclaration differs because of missing implicit parameter list // CHECK:STDERR: fn F(b: bool) -> bool; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-20]]:15: previously declared with implicit parameter list + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-20]]:15: note: previously declared with implicit parameter list // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -123,7 +123,7 @@ class FMissingReturnType { // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: function redeclaration differs because no return type is provided // CHECK:STDERR: fn F[self: bool](b: bool); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-33]]:15: previously declared with return type `bool` + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-33]]:15: note: previously declared with return type `bool` // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -136,7 +136,7 @@ class FDifferentParamType { // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:22: error: redeclaration differs at parameter 1 // CHECK:STDERR: fn F[self: bool](b: Self) -> bool; // CHECK:STDERR: ^ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-46]]:32: previous declaration's corresponding parameter here + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-46]]:32: note: previous declaration's corresponding parameter here // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; } // CHECK:STDERR: ^ // CHECK:STDERR: @@ -149,7 +149,7 @@ class FDifferentImplicitParamType { // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:10: error: redeclaration differs at implicit parameter 1 // CHECK:STDERR: fn F[self: Self](b: bool) -> bool; // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-59]]:20: previous declaration's corresponding implicit parameter here + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-59]]:20: note: previous declaration's corresponding implicit parameter here // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; } // CHECK:STDERR: ^~~~ // CHECK:STDERR: @@ -162,7 +162,7 @@ class FDifferentReturnType { // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: function redeclaration differs because return type is `FDifferentReturnType` // CHECK:STDERR: fn F[self: bool](b: bool) -> Self; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-72]]:15: previously declared with return type `bool` + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-72]]:15: note: previously declared with return type `bool` // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -176,7 +176,7 @@ class FDifferentParamName { // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:22: error: redeclaration differs at parameter 1 // CHECK:STDERR: fn F[self: bool](not_b: bool) -> bool; // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-86]]:32: previous declaration's corresponding parameter here + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-86]]:32: note: previous declaration's corresponding parameter here // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; } // CHECK:STDERR: ^ // CHECK:STDERR: @@ -193,7 +193,7 @@ class SelfNestedBadParam { // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:10: error: redeclaration differs at parameter 1 // CHECK:STDERR: fn F(x: (SelfNestedBadParam*, {.x: i32, .y: i32})) -> [SelfNestedBadParam; 4]; // CHECK:STDERR: ^ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-8]]:8: previous declaration's corresponding parameter here + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-8]]:8: note: previous declaration's corresponding parameter here // CHECK:STDERR: fn F(x: (Self*, {.x: Self, .y: i32})) -> [Self; 4]; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -206,7 +206,7 @@ class SelfNestedBadReturnType { // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+6]]:5: error: function redeclaration differs because return type is `[SelfNestedBadParam; 4]` // CHECK:STDERR: fn F(x: (SelfNestedBadReturnType*, {.x: SelfNestedBadReturnType, .y: i32})) -> [SelfNestedBadParam; 4]; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-21]]:3: previously declared with return type `[SelfNestedBadReturnType; 4]` + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-21]]:3: note: previously declared with return type `[SelfNestedBadReturnType; 4]` // CHECK:STDERR: fn F(x: (Self*, {.x: Self, .y: i32})) -> [Self; 4]; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fn F(x: (SelfNestedBadReturnType*, {.x: SelfNestedBadReturnType, .y: i32})) -> [SelfNestedBadParam; 4]; diff --git a/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon b/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon index 2f63ad428f22..acee91911f2d 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon @@ -15,7 +15,7 @@ // CHECK:STDERR: fail_impl_bad_interface.carbon:[[@LINE+6]]:13: error: cannot implicitly convert from `bool` to `type` // CHECK:STDERR: impl i32 as false {} // CHECK:STDERR: ^~~~~ -// CHECK:STDERR: fail_impl_bad_interface.carbon:[[@LINE+3]]:13: type `bool` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_impl_bad_interface.carbon:[[@LINE+3]]:13: note: type `bool` does not implement interface `ImplicitAs` // CHECK:STDERR: impl i32 as false {} // CHECK:STDERR: ^~~~~ impl i32 as false {} diff --git a/toolchain/check/testdata/impl/fail_redefinition.carbon b/toolchain/check/testdata/impl/fail_redefinition.carbon index 0f2964464db7..8af9f3d04fe5 100644 --- a/toolchain/check/testdata/impl/fail_redefinition.carbon +++ b/toolchain/check/testdata/impl/fail_redefinition.carbon @@ -15,7 +15,7 @@ impl i32 as I {} // CHECK:STDERR: fail_redefinition.carbon:[[@LINE+6]]:1: error: redefinition of `impl i32 as I` // CHECK:STDERR: impl i32 as I {} // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_redefinition.carbon:[[@LINE-5]]:1: previous definition was here +// CHECK:STDERR: fail_redefinition.carbon:[[@LINE-5]]:1: note: previous definition was here // CHECK:STDERR: impl i32 as I {} // CHECK:STDERR: ^~~~~~~~~~~~~~~ impl i32 as I {} diff --git a/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon b/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon index e8e045c7c83e..b8d3268543e8 100644 --- a/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon +++ b/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon @@ -12,7 +12,7 @@ var a: [i32; 1] = (12,); // CHECK:STDERR: fail_array_non_int_indexing.carbon:[[@LINE+6]]:16: error: cannot implicitly convert from `f64` to `i32` // CHECK:STDERR: var b: i32 = a[2.6]; // CHECK:STDERR: ^~~ -// CHECK:STDERR: fail_array_non_int_indexing.carbon:[[@LINE+3]]:16: type `f64` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_array_non_int_indexing.carbon:[[@LINE+3]]:16: note: type `f64` does not implement interface `ImplicitAs` // CHECK:STDERR: var b: i32 = a[2.6]; // CHECK:STDERR: ^~~ var b: i32 = a[2.6]; diff --git a/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon b/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon index fc31dec40b68..356bc32bf4b7 100644 --- a/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon +++ b/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon @@ -12,7 +12,7 @@ interface I { // CHECK:STDERR: fail_assoc_const_bad_default.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `i32` to `type` // CHECK:STDERR: let T:! type = 42; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_assoc_const_bad_default.carbon:[[@LINE+3]]:3: type `i32` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_assoc_const_bad_default.carbon:[[@LINE+3]]:3: note: type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: let T:! type = 42; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ let T:! type = 42; diff --git a/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon b/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon index 65e1d70be078..eb4720d99d28 100644 --- a/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon +++ b/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon @@ -27,7 +27,7 @@ interface Interface { // CHECK:STDERR: fail_todo_define_default_fn_out_of_line.carbon:[[@LINE+7]]:1: error: duplicate name being declared in the same scope // CHECK:STDERR: fn Interface.F() {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_todo_define_default_fn_out_of_line.carbon:[[@LINE-12]]:3: name is previously declared here +// CHECK:STDERR: fail_todo_define_default_fn_out_of_line.carbon:[[@LINE-12]]:3: note: name is previously declared here // CHECK:STDERR: default fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -36,7 +36,7 @@ fn Interface.F() {} // CHECK:STDERR: fail_todo_define_default_fn_out_of_line.carbon:[[@LINE+6]]:1: error: duplicate name being declared in the same scope // CHECK:STDERR: fn Interface.G(a: i32, b: i32) -> i32 = "int.sadd"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_todo_define_default_fn_out_of_line.carbon:[[@LINE-15]]:3: name is previously declared here +// CHECK:STDERR: fail_todo_define_default_fn_out_of_line.carbon:[[@LINE-15]]:3: note: name is previously declared here // CHECK:STDERR: default fn G(a: i32, b: i32) -> i32; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fn Interface.G(a: i32, b: i32) -> i32 = "int.sadd"; diff --git a/toolchain/check/testdata/interface/no_prelude/fail_definition_imported.carbon b/toolchain/check/testdata/interface/no_prelude/fail_definition_imported.carbon index 7d7e9ee1e470..decde9cd4ed4 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_definition_imported.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_definition_imported.carbon @@ -19,13 +19,11 @@ interface I; library "[[@TEST_NAME]]"; import library "a"; -// CHECK:STDERR: fail_b.carbon:[[@LINE+9]]:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_b.carbon:[[@LINE+7]]:1: error: duplicate name being declared in the same scope // CHECK:STDERR: interface I {} // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: fail_b.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: import library "a"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: a.carbon:4:1: name is previously declared here +// CHECK:STDERR: a.carbon:4:1: note: name is previously declared here // CHECK:STDERR: interface I; // CHECK:STDERR: ^~~~~~~~~~~~ interface I {} diff --git a/toolchain/check/testdata/interface/no_prelude/fail_duplicate.carbon b/toolchain/check/testdata/interface/no_prelude/fail_duplicate.carbon index 0956acf41a6b..b3fabc8642cc 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_duplicate.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_duplicate.carbon @@ -17,7 +17,7 @@ interface Interface { } // CHECK:STDERR: fail_redefine_without_dependents.carbon:[[@LINE+7]]:1: error: redefinition of `interface Interface` // CHECK:STDERR: interface Interface { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_redefine_without_dependents.carbon:[[@LINE-5]]:1: previously defined here +// CHECK:STDERR: fail_redefine_without_dependents.carbon:[[@LINE-5]]:1: note: previously defined here // CHECK:STDERR: interface Interface { } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -34,7 +34,7 @@ interface Interface {} // CHECK:STDERR: fail_redefine_with_dependents.carbon:[[@LINE+7]]:1: error: redefinition of `interface Interface` // CHECK:STDERR: interface Interface { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_redefine_with_dependents.carbon:[[@LINE-5]]:1: previously defined here +// CHECK:STDERR: fail_redefine_with_dependents.carbon:[[@LINE-5]]:1: note: previously defined here // CHECK:STDERR: interface Interface {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -51,7 +51,7 @@ fn Function(); // CHECK:STDERR: fail_name_conflict_with_fn.carbon:[[@LINE+7]]:1: error: duplicate name being declared in the same scope // CHECK:STDERR: interface Function; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_name_conflict_with_fn.carbon:[[@LINE-5]]:1: name is previously declared here +// CHECK:STDERR: fail_name_conflict_with_fn.carbon:[[@LINE-5]]:1: note: name is previously declared here // CHECK:STDERR: fn Function(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: @@ -64,7 +64,7 @@ class Class; // CHECK:STDERR: fail_name_conflict_with_class.carbon:[[@LINE+6]]:1: error: duplicate name being declared in the same scope // CHECK:STDERR: interface Class { } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_name_conflict_with_class.carbon:[[@LINE-5]]:1: name is previously declared here +// CHECK:STDERR: fail_name_conflict_with_class.carbon:[[@LINE-5]]:1: note: name is previously declared here // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ interface Class { } diff --git a/toolchain/check/testdata/interface/no_prelude/fail_generic_redeclaration.carbon b/toolchain/check/testdata/interface/no_prelude/fail_generic_redeclaration.carbon index ef813502237d..72ae61fee771 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_generic_redeclaration.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_generic_redeclaration.carbon @@ -12,7 +12,7 @@ interface NotGeneric; // CHECK:STDERR: fail_generic_redeclaration.carbon:[[@LINE+7]]:1: error: redeclaration differs because of parameter list // CHECK:STDERR: interface NotGeneric(T:! type) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_generic_redeclaration.carbon:[[@LINE-4]]:1: previously declared without parameter list +// CHECK:STDERR: fail_generic_redeclaration.carbon:[[@LINE-4]]:1: note: previously declared without parameter list // CHECK:STDERR: interface NotGeneric; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -22,7 +22,7 @@ interface Generic(T:! type); // CHECK:STDERR: fail_generic_redeclaration.carbon:[[@LINE+7]]:1: error: redeclaration differs because of missing parameter list // CHECK:STDERR: interface Generic {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_generic_redeclaration.carbon:[[@LINE-4]]:1: previously declared with parameter list +// CHECK:STDERR: fail_generic_redeclaration.carbon:[[@LINE-4]]:1: note: previously declared with parameter list // CHECK:STDERR: interface Generic(T:! type); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -32,7 +32,7 @@ interface DifferentParams(T:! type); // CHECK:STDERR: fail_generic_redeclaration.carbon:[[@LINE+6]]:27: error: redeclaration differs at parameter 1 // CHECK:STDERR: interface DifferentParams(T:! ()) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_generic_redeclaration.carbon:[[@LINE-4]]:27: previous declaration's corresponding parameter here +// CHECK:STDERR: fail_generic_redeclaration.carbon:[[@LINE-4]]:27: note: previous declaration's corresponding parameter here // CHECK:STDERR: interface DifferentParams(T:! type); // CHECK:STDERR: ^ interface DifferentParams(T:! ()) {} diff --git a/toolchain/check/testdata/interface/no_prelude/fail_lookup_undefined.carbon b/toolchain/check/testdata/interface/no_prelude/fail_lookup_undefined.carbon index 403dfcd1e5a6..1258c05f635c 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_lookup_undefined.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_lookup_undefined.carbon @@ -13,7 +13,7 @@ interface Undefined; // CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE+7]]:4: error: cannot declare a member of undefined interface `Undefined` // CHECK:STDERR: fn Undefined.F(); // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE-5]]:1: interface was forward declared here +// CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE-5]]:1: note: interface was forward declared here // CHECK:STDERR: interface Undefined; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -23,7 +23,7 @@ fn Test() { // CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE+7]]:3: error: member access into undefined interface `Undefined` // CHECK:STDERR: Undefined.G(); // CHECK:STDERR: ^~~~~~~~~~~ - // CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE-15]]:1: interface was forward declared here + // CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE-15]]:1: note: interface was forward declared here // CHECK:STDERR: interface Undefined; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -34,7 +34,7 @@ interface BeingDefined { // CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE+11]]:13: error: member access into undefined interface `BeingDefined` // CHECK:STDERR: fn H() -> BeingDefined.T; // CHECK:STDERR: ^~~~~~~~~~~~~~ - // CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE-4]]:1: interface is currently being defined + // CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE-4]]:1: note: interface is currently being defined // CHECK:STDERR: interface BeingDefined { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: diff --git a/toolchain/check/testdata/interface/no_prelude/fail_redeclare_member.carbon b/toolchain/check/testdata/interface/no_prelude/fail_redeclare_member.carbon index f89ed760424b..862c543c7d66 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_redeclare_member.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_redeclare_member.carbon @@ -13,7 +13,7 @@ interface Interface { // CHECK:STDERR: fail_redeclare_member.carbon:[[@LINE+6]]:3: error: duplicate name being declared in the same scope // CHECK:STDERR: fn F(); // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_redeclare_member.carbon:[[@LINE-4]]:3: name is previously declared here + // CHECK:STDERR: fail_redeclare_member.carbon:[[@LINE-4]]:3: note: name is previously declared here // CHECK:STDERR: fn F(); // CHECK:STDERR: ^~~~~~~ fn F(); diff --git a/toolchain/check/testdata/interface/no_prelude/fail_todo_generic_default_fn.carbon b/toolchain/check/testdata/interface/no_prelude/fail_todo_generic_default_fn.carbon index a5081732ef23..2ccd9a1c9f45 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_todo_generic_default_fn.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_todo_generic_default_fn.carbon @@ -16,7 +16,7 @@ interface I(T:! type) { // CHECK:STDERR: fail_todo_generic_default_fn.carbon:[[@LINE+6]]:1: error: duplicate name being declared in the same scope // CHECK:STDERR: fn I(T:! type).F[self: Self]() -> Self { return self; } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_todo_generic_default_fn.carbon:[[@LINE-6]]:3: name is previously declared here +// CHECK:STDERR: fail_todo_generic_default_fn.carbon:[[@LINE-6]]:3: note: name is previously declared here // CHECK:STDERR: fn F[self: Self]() -> Self; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ fn I(T:! type).F[self: Self]() -> Self { return self; } diff --git a/toolchain/check/testdata/interface/no_prelude/generic.carbon b/toolchain/check/testdata/interface/no_prelude/generic.carbon index a953106a79c9..f7174dae9202 100644 --- a/toolchain/check/testdata/interface/no_prelude/generic.carbon +++ b/toolchain/check/testdata/interface/no_prelude/generic.carbon @@ -52,7 +52,7 @@ fn G(T:! Generic(B)) { // CHECK:STDERR: fail_mismatched_args.carbon:[[@LINE+6]]:3: error: package `Core` implicitly referenced here, but not found // CHECK:STDERR: F(T); // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_mismatched_args.carbon:[[@LINE-6]]:6: initializing generic parameter `T` declared here + // CHECK:STDERR: fail_mismatched_args.carbon:[[@LINE-6]]:6: note: initializing generic parameter `T` declared here // CHECK:STDERR: fn F(T:! Generic(A)); // CHECK:STDERR: ^ F(T); diff --git a/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon b/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon index 83a8fe2b5e1f..cecb238105e0 100644 --- a/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon +++ b/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon @@ -40,7 +40,7 @@ interface Foo(a:! C); // CHECK:STDERR: fail_parens.carbon:[[@LINE+7]]:19: error: redeclaration syntax differs here // CHECK:STDERR: interface Foo(a:! (C)) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_parens.carbon:[[@LINE-4]]:19: comparing with previous declaration here +// CHECK:STDERR: fail_parens.carbon:[[@LINE-4]]:19: note: comparing with previous declaration here // CHECK:STDERR: interface Foo(a:! C); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -69,24 +69,20 @@ interface Bar(a:! D); impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_todo_two_file.impl.carbon:[[@LINE+10]]:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_todo_two_file.impl.carbon:[[@LINE+8]]:1: error: duplicate name being declared in the same scope // CHECK:STDERR: interface Foo(a:! C) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_todo_two_file.impl.carbon:[[@LINE-5]]:6: in import -// CHECK:STDERR: impl library "two_file"; -// CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: two_file.carbon:7:1: name is previously declared here +// CHECK:STDERR: two_file.carbon:7:1: note: name is previously declared here // CHECK:STDERR: interface Foo(a:! C); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: interface Foo(a:! C) {} -// CHECK:STDERR: fail_todo_two_file.impl.carbon:[[@LINE+10]]:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_todo_two_file.impl.carbon:[[@LINE+8]]:1: error: duplicate name being declared in the same scope // CHECK:STDERR: interface Bar(a:! D) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_todo_two_file.impl.carbon:[[@LINE-16]]:6: in import -// CHECK:STDERR: impl library "two_file"; -// CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: two_file.carbon:8:1: name is previously declared here +// CHECK:STDERR: fail_todo_two_file.impl.carbon:[[@LINE-14]]:6: in import +// CHECK:STDERR: two_file.carbon:8:1: note: name is previously declared here // CHECK:STDERR: interface Bar(a:! D); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -103,7 +99,7 @@ interface Foo(a:! C); // CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE+7]]:15: error: redeclaration differs at parameter 1 // CHECK:STDERR: interface Foo(b:! D) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE-4]]:15: previous declaration's corresponding parameter here +// CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE-4]]:15: note: previous declaration's corresponding parameter here // CHECK:STDERR: interface Foo(a:! C); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -120,7 +116,7 @@ interface Foo(a:! C); // CHECK:STDERR: fail_alias.carbon:[[@LINE+7]]:19: error: redeclaration syntax differs here // CHECK:STDERR: interface Foo(a:! D) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_alias.carbon:[[@LINE-4]]:19: comparing with previous declaration here +// CHECK:STDERR: fail_alias.carbon:[[@LINE-4]]:19: note: comparing with previous declaration here // CHECK:STDERR: interface Foo(a:! C); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -137,7 +133,7 @@ interface Foo[a:! C](); // CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE+7]]:19: error: redeclaration syntax differs here // CHECK:STDERR: interface Foo[a:! D]() {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE-4]]:19: comparing with previous declaration here +// CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE-4]]:19: note: comparing with previous declaration here // CHECK:STDERR: interface Foo[a:! C](); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -160,13 +156,11 @@ alias D = C; // TODO: This fails because importing interfaces doesn't work well. It should // fail due to `C` versus `D`, but may succeed if importing interfaces is fixed // before syntax matching on imports is supported. -// CHECK:STDERR: fail_alias_two_file.impl.carbon:[[@LINE+10]]:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_alias_two_file.impl.carbon:[[@LINE+8]]:1: error: duplicate name being declared in the same scope // CHECK:STDERR: interface Foo(a:! D) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_alias_two_file.impl.carbon:[[@LINE-10]]:6: in import -// CHECK:STDERR: impl library "alias_two_file"; -// CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: alias_two_file.carbon:6:1: name is previously declared here +// CHECK:STDERR: alias_two_file.carbon:6:1: note: name is previously declared here // CHECK:STDERR: interface Foo(a:! C); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -186,7 +180,7 @@ interface Foo(a:! const C); // CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+6]]:25: error: redeclaration syntax differs here // CHECK:STDERR: interface Foo(a:! const (const C)) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE-8]]:25: comparing with previous declaration here +// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE-8]]:25: note: comparing with previous declaration here // CHECK:STDERR: interface Foo(a:! const C); // CHECK:STDERR: ^ interface Foo(a:! const (const C)) {} @@ -599,15 +593,15 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %.decl.loc14: %.type.1 = interface_decl @.1 [template = constants.%.4] { +// CHECK:STDOUT: %.decl.loc12: %.type.1 = interface_decl @.1 [template = constants.%.4] { // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] -// CHECK:STDOUT: %a.loc14_15.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc14_15.2: %C = bind_symbolic_name a 0, %a.loc14_15.1 [symbolic = @.1.%a (constants.%a)] +// CHECK:STDOUT: %a.loc12_15.1: %C = param a, runtime_param +// CHECK:STDOUT: %a.loc12_15.2: %C = bind_symbolic_name a 0, %a.loc12_15.1 [symbolic = @.1.%a (constants.%a)] // CHECK:STDOUT: } -// CHECK:STDOUT: %.decl.loc25: %.type.2 = interface_decl @.2 [template = constants.%.6] { +// CHECK:STDOUT: %.decl.loc21: %.type.2 = interface_decl @.2 [template = constants.%.6] { // CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.2 [template = constants.%C] -// CHECK:STDOUT: %a.loc25_15.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc25_15.2: %C = bind_symbolic_name a 0, %a.loc25_15.1 [symbolic = @.2.%a (constants.%a)] +// CHECK:STDOUT: %a.loc21_15.1: %C = param a, runtime_param +// CHECK:STDOUT: %a.loc21_15.2: %C = bind_symbolic_name a 0, %a.loc21_15.1 [symbolic = @.2.%a (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -617,7 +611,7 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: interface; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @.1(file.%a.loc14_15.2: %C) { +// CHECK:STDOUT: generic interface @.1(file.%a.loc12_15.2: %C) { // CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -639,7 +633,7 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: interface; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @.2(file.%a.loc25_15.2: %C) { +// CHECK:STDOUT: generic interface @.2(file.%a.loc21_15.2: %C) { // CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -995,8 +989,8 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %D: type = bind_alias D, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %.decl: %.type = interface_decl @.1 [template = constants.%.4] { // CHECK:STDOUT: %D.ref: type = name_ref D, %D [template = constants.%C] -// CHECK:STDOUT: %a.loc19_15.1: %C = param a, runtime_param -// CHECK:STDOUT: %a.loc19_15.2: %C = bind_symbolic_name a 0, %a.loc19_15.1 [symbolic = @.1.%a (constants.%a)] +// CHECK:STDOUT: %a.loc17_15.1: %C = param a, runtime_param +// CHECK:STDOUT: %a.loc17_15.2: %C = bind_symbolic_name a 0, %a.loc17_15.1 [symbolic = @.1.%a (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1006,7 +1000,7 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: interface; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @.1(file.%a.loc19_15.2: %C) { +// CHECK:STDOUT: generic interface @.1(file.%a.loc17_15.2: %C) { // CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: diff --git a/toolchain/check/testdata/let/fail_duplicate_decl.carbon b/toolchain/check/testdata/let/fail_duplicate_decl.carbon index 1d40b74dbbb6..fc18add9d374 100644 --- a/toolchain/check/testdata/let/fail_duplicate_decl.carbon +++ b/toolchain/check/testdata/let/fail_duplicate_decl.carbon @@ -13,7 +13,7 @@ fn F() { // CHECK:STDERR: fail_duplicate_decl.carbon:[[@LINE+6]]:7: error: duplicate name being declared in the same scope // CHECK:STDERR: let a: i32 = 2; // CHECK:STDERR: ^ - // CHECK:STDERR: fail_duplicate_decl.carbon:[[@LINE-4]]:7: name is previously declared here + // CHECK:STDERR: fail_duplicate_decl.carbon:[[@LINE-4]]:7: note: name is previously declared here // CHECK:STDERR: let a: i32 = 1; // CHECK:STDERR: ^ let a: i32 = 2; diff --git a/toolchain/check/testdata/let/fail_generic.carbon b/toolchain/check/testdata/let/fail_generic.carbon index f644f40e9144..293c2cd6ce14 100644 --- a/toolchain/check/testdata/let/fail_generic.carbon +++ b/toolchain/check/testdata/let/fail_generic.carbon @@ -14,7 +14,7 @@ fn F(a: i32) -> i32 { // CHECK:STDERR: fail_generic.carbon:[[@LINE+7]]:3: error: cannot implicitly convert from `i32` to `T` // CHECK:STDERR: let x: T = 5; // CHECK:STDERR: ^~~~~~~~~~~~~ - // CHECK:STDERR: fail_generic.carbon:[[@LINE+4]]:3: type `i32` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_generic.carbon:[[@LINE+4]]:3: note: type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: let x: T = 5; // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: @@ -22,7 +22,7 @@ fn F(a: i32) -> i32 { // CHECK:STDERR: fail_generic.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `T` to `i32` // CHECK:STDERR: return x; // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_generic.carbon:[[@LINE+3]]:3: type `` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_generic.carbon:[[@LINE+3]]:3: note: type `` does not implement interface `ImplicitAs` // CHECK:STDERR: return x; // CHECK:STDERR: ^~~~~~~~~ return x; diff --git a/toolchain/check/testdata/let/fail_generic_import.carbon b/toolchain/check/testdata/let/fail_generic_import.carbon index 757d9194f737..b5316eb769d7 100644 --- a/toolchain/check/testdata/let/fail_generic_import.carbon +++ b/toolchain/check/testdata/let/fail_generic_import.carbon @@ -22,7 +22,7 @@ impl package Implicit; // CHECK:STDERR: fail_implicit.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `i32` to `T` // CHECK:STDERR: let a: T = 0; // CHECK:STDERR: ^~~~~~~~~~~~~ -// CHECK:STDERR: fail_implicit.impl.carbon:[[@LINE+3]]:1: type `i32` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_implicit.impl.carbon:[[@LINE+3]]:1: note: type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: let a: T = 0; // CHECK:STDERR: ^~~~~~~~~~~~~ let a: T = 0; diff --git a/toolchain/check/testdata/let/fail_modifiers.carbon b/toolchain/check/testdata/let/fail_modifiers.carbon index 59df1ef75aa8..47e544b0bdb3 100644 --- a/toolchain/check/testdata/let/fail_modifiers.carbon +++ b/toolchain/check/testdata/let/fail_modifiers.carbon @@ -39,7 +39,7 @@ virtual let e: i32 = 1; // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:9: error: `final` not allowed on declaration with `default` // CHECK:STDERR: default final let f: i32 = 1; // CHECK:STDERR: ^~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `default` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note: `default` previously appeared here // CHECK:STDERR: default final let f: i32 = 1; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -52,7 +52,7 @@ default final let f: i32 = 1; // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:9: error: `default` repeated on declaration // CHECK:STDERR: default default let g: i32 = 1; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `default` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note: `default` previously appeared here // CHECK:STDERR: default default let g: i32 = 1; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -65,7 +65,7 @@ default default let g: i32 = 1; // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:11: error: `private` not allowed on declaration with `protected` // CHECK:STDERR: protected private let h: i32 = 1; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `protected` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note: `protected` previously appeared here // CHECK:STDERR: protected private let h: i32 = 1; // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -78,7 +78,7 @@ protected private let h: i32 = 1; // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+6]]:11: error: `protected` repeated on declaration // CHECK:STDERR: protected protected let i: i32 = 1; // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: `protected` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: note: `protected` previously appeared here // CHECK:STDERR: protected protected let i: i32 = 1; // CHECK:STDERR: ^~~~~~~~~ protected protected let i: i32 = 1; diff --git a/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon b/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon index c671aa1897da..ab243d8102a6 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon @@ -24,13 +24,11 @@ import library "namespace"; // imported declaration. namespace NS; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+10]]:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+8]]:1: error: duplicate name being declared in the same scope // CHECK:STDERR: fn NS(); // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fail_conflict.carbon:[[@LINE-9]]:1: in import -// CHECK:STDERR: import library "namespace"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: namespace.carbon:4:1: name is previously declared here +// CHECK:STDERR: namespace.carbon:4:1: note: name is previously declared here // CHECK:STDERR: namespace NS; // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: @@ -40,13 +38,11 @@ fn NS(); // we don't move it. namespace NS; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+9]]:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+7]]:1: error: duplicate name being declared in the same scope // CHECK:STDERR: fn NS(); // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_conflict.carbon:[[@LINE-25]]:1: in import -// CHECK:STDERR: import library "namespace"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: namespace.carbon:4:1: name is previously declared here +// CHECK:STDERR: fail_conflict.carbon:[[@LINE-23]]:1: in import +// CHECK:STDERR: namespace.carbon:4:1: note: name is previously declared here // CHECK:STDERR: namespace NS; // CHECK:STDERR: ^~~~~~~~~~~~~ fn NS(); @@ -108,9 +104,9 @@ fn NS(); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %NS.loc8: = namespace [template] {} -// CHECK:STDOUT: %.decl.loc20: %.type.1 = fn_decl @.1 [template = constants.%.2] {} -// CHECK:STDOUT: %NS.loc24: = namespace [template] {} -// CHECK:STDOUT: %.decl.loc35: %.type.2 = fn_decl @.2 [template = constants.%.3] {} +// CHECK:STDOUT: %.decl.loc18: %.type.1 = fn_decl @.1 [template = constants.%.2] {} +// CHECK:STDOUT: %NS.loc22: = namespace [template] {} +// CHECK:STDOUT: %.decl.loc31: %.type.2 = fn_decl @.2 [template = constants.%.3] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @.1(); diff --git a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_first.carbon b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_first.carbon index 774c09594755..b9d0a31ecab7 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_first.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_first.carbon @@ -20,13 +20,11 @@ package Example; import library "namespace"; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+9]]:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+7]]:1: error: duplicate name being declared in the same scope // CHECK:STDERR: fn NS(); // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fail_conflict.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: import library "namespace"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: namespace.carbon:4:1: name is previously declared here +// CHECK:STDERR: namespace.carbon:4:1: note: name is previously declared here // CHECK:STDERR: namespace NS; // CHECK:STDERR: ^~~~~~~~~~~~~ fn NS(); diff --git a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_nested.carbon b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_nested.carbon index e4c20dbd745a..23925d45825d 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_nested.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_nested.carbon @@ -19,18 +19,16 @@ import Other; // CHECK:STDERR: fail_conflict.carbon:[[@LINE+7]]:1: error: duplicate name being declared in the same scope // CHECK:STDERR: namespace Other; // CHECK:STDERR: ^~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_conflict.carbon:[[@LINE-4]]:1: name is previously declared here +// CHECK:STDERR: fail_conflict.carbon:[[@LINE-4]]:1: note: name is previously declared here // CHECK:STDERR: import Other; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: namespace Other; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+9]]:10: error: imported packages cannot be used for declarations +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+7]]:10: error: imported packages cannot be used for declarations // CHECK:STDERR: fn Other.Nested.F(); // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: fail_conflict.carbon:[[@LINE-12]]:1: in import -// CHECK:STDERR: import Other; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fn.carbon:3:1: package imported here +// CHECK:STDERR: fn.carbon:3:1: note: package imported here // CHECK:STDERR: namespace Nested; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ fn Other.Nested.F(); diff --git a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon index 91496bf841cc..5adec5296b2e 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon @@ -20,25 +20,21 @@ package Example; import library "fn"; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+10]]:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+8]]:1: error: duplicate name being declared in the same scope // CHECK:STDERR: namespace NS; // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: fail_conflict.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: import library "fn"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fn.carbon:4:1: name is previously declared here +// CHECK:STDERR: fn.carbon:4:1: note: name is previously declared here // CHECK:STDERR: fn NS(); // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: namespace NS; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+9]]:4: error: name qualifiers are only allowed for entities that provide a scope +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+7]]:4: error: name qualifiers are only allowed for entities that provide a scope // CHECK:STDERR: fn NS.Foo(); // CHECK:STDERR: ^~ -// CHECK:STDERR: fail_conflict.carbon:[[@LINE-17]]:1: in import -// CHECK:STDERR: import library "fn"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fn.carbon:4:1: referenced non-scope entity declared here +// CHECK:STDERR: fail_conflict.carbon:[[@LINE-15]]:1: in import +// CHECK:STDERR: fn.carbon:4:1: note: referenced non-scope entity declared here // CHECK:STDERR: fn NS(); // CHECK:STDERR: ^~~~~~~~ fn NS.Foo(); @@ -106,7 +102,7 @@ fn NS.Foo(); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %.loc16: = namespace [template] {} +// CHECK:STDOUT: %.loc14: = namespace [template] {} // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.2] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_first.carbon b/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_first.carbon index 571146f4afc0..dc30f52243bb 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_first.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_first.carbon @@ -25,16 +25,12 @@ fn NS() {} package Example library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+12]]:1: in import -// CHECK:STDERR: import library "namespace"; -// CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+8]]:1: in import // CHECK:STDERR: fn.carbon:4:1: error: duplicate name being declared in the same scope // CHECK:STDERR: fn NS() {} // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+6]]:1: in import -// CHECK:STDERR: import library "namespace"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: namespace.carbon:4:1: name is previously declared here +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+4]]:1: in import +// CHECK:STDERR: namespace.carbon:4:1: note: name is previously declared here // CHECK:STDERR: namespace NS; // CHECK:STDERR: ^~~~~~~~~~~~~ import library "namespace"; diff --git a/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_second.carbon b/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_second.carbon index eeb3a57fd8d1..c1d40aa7c58f 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_second.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_second.carbon @@ -25,16 +25,12 @@ fn NS.Foo() {} package Example library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+12]]:1: in import -// CHECK:STDERR: import library "fn"; -// CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+8]]:1: in import // CHECK:STDERR: namespace.carbon:4:1: error: duplicate name being declared in the same scope // CHECK:STDERR: namespace NS; // CHECK:STDERR: ^~~~~~~~~~~~~ -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+6]]:1: in import -// CHECK:STDERR: import library "fn"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fn.carbon:4:1: name is previously declared here +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+4]]:1: in import +// CHECK:STDERR: fn.carbon:4:1: note: name is previously declared here // CHECK:STDERR: fn NS() {} // CHECK:STDERR: ^~~~~~~~~ import library "fn"; diff --git a/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon b/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon index 51c9989142e1..308898decd08 100644 --- a/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon +++ b/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon @@ -16,7 +16,7 @@ alias ns = NS; // CHECK:STDERR: fail_decl_in_alias.carbon:[[@LINE+6]]:4: error: name qualifiers are only allowed for entities that provide a scope // CHECK:STDERR: fn ns.A() -> i32 { return 0; } // CHECK:STDERR: ^~ -// CHECK:STDERR: fail_decl_in_alias.carbon:[[@LINE-6]]:7: referenced non-scope entity declared here +// CHECK:STDERR: fail_decl_in_alias.carbon:[[@LINE-6]]:7: note: referenced non-scope entity declared here // CHECK:STDERR: alias ns = NS; // CHECK:STDERR: ^~ fn ns.A() -> i32 { return 0; } diff --git a/toolchain/check/testdata/namespace/fail_duplicate.carbon b/toolchain/check/testdata/namespace/fail_duplicate.carbon index f43401601a49..4cfa4f861256 100644 --- a/toolchain/check/testdata/namespace/fail_duplicate.carbon +++ b/toolchain/check/testdata/namespace/fail_duplicate.carbon @@ -16,7 +16,7 @@ fn Foo.Baz() { // CHECK:STDERR: fail_duplicate.carbon:[[@LINE+6]]:1: error: redefinition of `fn Baz` // CHECK:STDERR: fn Foo.Baz() { // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_duplicate.carbon:[[@LINE-6]]:1: previously defined here +// CHECK:STDERR: fail_duplicate.carbon:[[@LINE-6]]:1: note: previously defined here // CHECK:STDERR: fn Foo.Baz() { // CHECK:STDERR: ^~~~~~~~~~~~~~ fn Foo.Baz() { diff --git a/toolchain/check/testdata/namespace/fail_modifiers.carbon b/toolchain/check/testdata/namespace/fail_modifiers.carbon index 06299919e854..5981ec09d1a1 100644 --- a/toolchain/check/testdata/namespace/fail_modifiers.carbon +++ b/toolchain/check/testdata/namespace/fail_modifiers.carbon @@ -23,21 +23,21 @@ // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+21]]:25: error: `base` not allowed on declaration with `abstract` // CHECK:STDERR: private extern abstract base default final namespace A; // CHECK:STDERR: ^~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+18]]:16: `abstract` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+18]]:16: note: `abstract` previously appeared here // CHECK:STDERR: private extern abstract base default final namespace A; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+14]]:30: error: `default` not allowed on declaration with `abstract` // CHECK:STDERR: private extern abstract base default final namespace A; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:16: `abstract` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:16: note: `abstract` previously appeared here // CHECK:STDERR: private extern abstract base default final namespace A; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:38: error: `final` not allowed on declaration with `abstract` // CHECK:STDERR: private extern abstract base default final namespace A; // CHECK:STDERR: ^~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:16: `abstract` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:16: note: `abstract` previously appeared here // CHECK:STDERR: private extern abstract base default final namespace A; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: diff --git a/toolchain/check/testdata/namespace/fail_params.carbon b/toolchain/check/testdata/namespace/fail_params.carbon index f47078e3a16e..ff5faa26f643 100644 --- a/toolchain/check/testdata/namespace/fail_params.carbon +++ b/toolchain/check/testdata/namespace/fail_params.carbon @@ -33,7 +33,7 @@ namespace D; // CHECK:STDERR: fail_params.carbon:[[@LINE+6]]:4: error: redeclaration differs because of parameter list // CHECK:STDERR: fn D(T:! type).F() {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_params.carbon:[[@LINE-4]]:1: previously declared without parameter list +// CHECK:STDERR: fail_params.carbon:[[@LINE-4]]:1: note: previously declared without parameter list // CHECK:STDERR: namespace D; // CHECK:STDERR: ^~~~~~~~~~~~ fn D(T:! type).F() {} diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon index 9764e11174bb..8ee194f02e9d 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon @@ -12,7 +12,7 @@ fn Main() { // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+6]]:17: error: cannot implicitly convert from `i32` to `bool` // CHECK:STDERR: var x: bool = not 12; // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:17: type `i32` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:17: note: type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: var x: bool = not 12; // CHECK:STDERR: ^~~~~~ var x: bool = not 12; diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon index e78631b1e6d3..9faab8cb42bf 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon @@ -13,7 +13,7 @@ fn Main() { // CHECK:STDERR: fail_type_mismatch_assignment.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `f64` to `i32` // CHECK:STDERR: a = 5.6; // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_type_mismatch_assignment.carbon:[[@LINE+3]]:3: type `f64` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_type_mismatch_assignment.carbon:[[@LINE+3]]:3: note: type `f64` does not implement interface `ImplicitAs` // CHECK:STDERR: a = 5.6; // CHECK:STDERR: ^~~~~~~ a = 5.6; diff --git a/toolchain/check/testdata/operators/overloaded/eq.carbon b/toolchain/check/testdata/operators/overloaded/eq.carbon index 68213563f1d2..15efa6f3678a 100644 --- a/toolchain/check/testdata/operators/overloaded/eq.carbon +++ b/toolchain/check/testdata/operators/overloaded/eq.carbon @@ -65,10 +65,10 @@ fn TestRhsBad(a: C, b: D) -> bool { // CHECK:STDERR: fail_no_impl_for_args.carbon:[[@LINE+10]]:10: error: cannot implicitly convert from `D` to `C` // CHECK:STDERR: return a == b; // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_no_impl_for_args.carbon:[[@LINE+7]]:10: type `D` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_no_impl_for_args.carbon:[[@LINE+7]]:10: note: type `D` does not implement interface `ImplicitAs` // CHECK:STDERR: return a == b; // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_no_impl_for_args.carbon:[[@LINE-11]]:3: initializing parameter 1 of function declared here + // CHECK:STDERR: fail_no_impl_for_args.carbon:[[@LINE-11]]:3: note: initializing parameter 1 of function declared here // CHECK:STDERR: fn Equal[self: C](other: C) -> bool; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: diff --git a/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon b/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon index a7c65de7b7b1..57ab5cbe195e 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon @@ -23,7 +23,7 @@ fn TestIncNonRef(a: C) { // CHECK:STDERR: fail_assign_non_ref.carbon:[[@LINE+7]]:3: error: `addr self` method cannot be invoked on a value // CHECK:STDERR: ++a; // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_assign_non_ref.carbon:[[@LINE-10]]:14: initializing `addr self` parameter of method declared here + // CHECK:STDERR: fail_assign_non_ref.carbon:[[@LINE-10]]:14: note: initializing `addr self` parameter of method declared here // CHECK:STDERR: fn Op[addr self: C*](); // CHECK:STDERR: ^~~~ // CHECK:STDERR: @@ -34,7 +34,7 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDERR: fail_assign_non_ref.carbon:[[@LINE+6]]:5: error: `addr self` method cannot be invoked on a value // CHECK:STDERR: a += b; // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_assign_non_ref.carbon:[[@LINE-18]]:14: initializing `addr self` parameter of method declared here + // CHECK:STDERR: fail_assign_non_ref.carbon:[[@LINE-18]]:14: note: initializing `addr self` parameter of method declared here // CHECK:STDERR: fn Op[addr self: C*](other: C); // CHECK:STDERR: ^~~~ a += b; diff --git a/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon b/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon index 2cedd2b2506e..348bf6c3a33e 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon @@ -24,10 +24,10 @@ fn Test(a: C, b: D) -> C { // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+10]]:10: error: cannot implicitly convert from `D` to `C` // CHECK:STDERR: return a + b; // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+7]]:10: type `D` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+7]]:10: note: type `D` does not implement interface `ImplicitAs` // CHECK:STDERR: return a + b; // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE-13]]:3: initializing parameter 1 of function declared here + // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE-13]]:3: note: initializing parameter 1 of function declared here // CHECK:STDERR: fn Op[self: C](other: C) -> C; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -39,10 +39,10 @@ fn TestAssign(b: D) { // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+9]]:3: error: cannot implicitly convert from `D` to `C` // CHECK:STDERR: a += b; // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+6]]:3: type `D` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+6]]:3: note: type `D` does not implement interface `ImplicitAs` // CHECK:STDERR: a += b; // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE-25]]:3: initializing parameter 1 of function declared here + // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE-25]]:3: note: initializing parameter 1 of function declared here // CHECK:STDERR: fn Op[addr self: C*](other: C); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a += b; diff --git a/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon b/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon index 868628b1036d..037c9a913138 100644 --- a/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon +++ b/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon @@ -24,16 +24,12 @@ var Foo: i32; package Example library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+12]]:1: in import -// CHECK:STDERR: import library "fn"; -// CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+8]]:1: in import // CHECK:STDERR: var.carbon:4:5: error: duplicate name being declared in the same scope // CHECK:STDERR: var Foo: i32; // CHECK:STDERR: ^~~ -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+6]]:1: in import -// CHECK:STDERR: import library "fn"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fn.carbon:4:1: name is previously declared here +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+4]]:1: in import +// CHECK:STDERR: fn.carbon:4:1: note: name is previously declared here // CHECK:STDERR: fn Foo(); // CHECK:STDERR: ^~~~~~~~~ import library "fn"; diff --git a/toolchain/check/testdata/packages/fail_extension.carbon b/toolchain/check/testdata/packages/fail_extension.carbon index da7f2ee72111..a43ad91146fa 100644 --- a/toolchain/check/testdata/packages/fail_extension.carbon +++ b/toolchain/check/testdata/packages/fail_extension.carbon @@ -12,7 +12,7 @@ // CHECK:STDERR: fail_main_redundant_with_swapped_ext.impl.carbon: error: `Main//default` previously provided by `fail_main.incorrect` // CHECK:STDERR: // CHECK:STDERR: fail_main_redundant_with_swapped_ext.impl.carbon: error: file extension of `.carbon` required for `api` -// CHECK:STDERR: fail_main_redundant_with_swapped_ext.impl.carbon: file extension of `.impl.carbon` only allowed for `impl` +// CHECK:STDERR: fail_main_redundant_with_swapped_ext.impl.carbon: note: file extension of `.impl.carbon` only allowed for `impl` // CHECK:STDERR: // --- fail_main.incorrect @@ -72,7 +72,7 @@ impl package Package library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_swapped_ext.impl.carbon:[[@LINE+5]]:1: error: file extension of `.carbon` required for `api` // CHECK:STDERR: package SwappedExt; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_swapped_ext.impl.carbon: file extension of `.impl.carbon` only allowed for `impl` +// CHECK:STDERR: fail_swapped_ext.impl.carbon: note: file extension of `.impl.carbon` only allowed for `impl` // CHECK:STDERR: package SwappedExt; diff --git a/toolchain/check/testdata/packages/fail_import_repeat.carbon b/toolchain/check/testdata/packages/fail_import_repeat.carbon index 4bf397dbade9..f38ef2cc7bd3 100644 --- a/toolchain/check/testdata/packages/fail_import_repeat.carbon +++ b/toolchain/check/testdata/packages/fail_import_repeat.carbon @@ -26,7 +26,7 @@ import Api; // CHECK:STDERR: fail_import.carbon:[[@LINE+7]]:1: error: library imported more than once // CHECK:STDERR: import Api; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_import.carbon:[[@LINE-4]]:1: first import here +// CHECK:STDERR: fail_import.carbon:[[@LINE-4]]:1: note: first import here // CHECK:STDERR: import Api; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -36,7 +36,7 @@ import Api library "api_lib"; // CHECK:STDERR: fail_import.carbon:[[@LINE+7]]:1: error: library imported more than once // CHECK:STDERR: import Api library "api_lib"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_import.carbon:[[@LINE-4]]:1: first import here +// CHECK:STDERR: fail_import.carbon:[[@LINE-4]]:1: note: first import here // CHECK:STDERR: import Api library "api_lib"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -46,7 +46,7 @@ import library "main_lib"; // CHECK:STDERR: fail_import.carbon:[[@LINE+7]]:1: error: library imported more than once // CHECK:STDERR: import library "main_lib"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_import.carbon:[[@LINE-4]]:1: first import here +// CHECK:STDERR: fail_import.carbon:[[@LINE-4]]:1: note: first import here // CHECK:STDERR: import library "main_lib"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -60,7 +60,7 @@ import library default; // CHECK:STDERR: fail_default_import.carbon:[[@LINE+6]]:1: error: library imported more than once // CHECK:STDERR: import library default; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_default_import.carbon:[[@LINE-4]]:1: first import here +// CHECK:STDERR: fail_default_import.carbon:[[@LINE-4]]:1: note: first import here // CHECK:STDERR: import library default; // CHECK:STDERR: ^~~~~~ import library default; diff --git a/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon b/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon index 99a9a22671eb..9592da9c7180 100644 --- a/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon +++ b/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon @@ -153,22 +153,18 @@ import Other library "conflict"; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_conflict_on_export_import.carbon:[[@LINE+12]]:1: in import -// CHECK:STDERR: import Other library "export_import"; -// CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: fail_conflict_on_export_import.carbon:[[@LINE+8]]:1: in import // CHECK:STDERR: base.carbon:4:1: error: duplicate name being declared in the same scope // CHECK:STDERR: class C { // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_conflict_on_export_import.carbon:[[@LINE+6]]:1: in import -// CHECK:STDERR: import Other library "export_import"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: conflict.carbon:4:1: name is previously declared here +// CHECK:STDERR: fail_conflict_on_export_import.carbon:[[@LINE+4]]:1: in import +// CHECK:STDERR: conflict.carbon:4:1: note: name is previously declared here // CHECK:STDERR: fn C() {} // CHECK:STDERR: ^~~~~~~~ import Other library "export_import"; import Other library "conflict"; -// CHECK:STDERR: fail_conflict_on_export_import.carbon:[[@LINE+4]]:11: in name lookup for `C` +// CHECK:STDERR: fail_conflict_on_export_import.carbon:[[@LINE+4]]:11: note: in name lookup for `C` // CHECK:STDERR: alias C = Other.C; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -178,25 +174,19 @@ alias C = Other.C; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_conflict_on_export_name.carbon:[[@LINE+15]]:1: in import -// CHECK:STDERR: import Other library "export_name"; -// CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: fail_conflict_on_export_name.carbon:[[@LINE+9]]:1: in import // CHECK:STDERR: conflict.carbon:4:1: error: duplicate name being declared in the same scope // CHECK:STDERR: fn C() {} // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_conflict_on_export_name.carbon:[[@LINE+9]]:1: in import -// CHECK:STDERR: import Other library "export_name"; -// CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: fail_conflict_on_export_name.carbon:[[@LINE+5]]:1: in import // CHECK:STDERR: export_name.carbon:4:1: in import -// CHECK:STDERR: import library "base"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: base.carbon:4:1: name is previously declared here +// CHECK:STDERR: base.carbon:4:1: note: name is previously declared here // CHECK:STDERR: class C { // CHECK:STDERR: ^~~~~~~~~ import Other library "export_name"; import Other library "conflict"; -// CHECK:STDERR: fail_conflict_on_export_name.carbon:[[@LINE+3]]:11: in name lookup for `C` +// CHECK:STDERR: fail_conflict_on_export_name.carbon:[[@LINE+3]]:11: note: in name lookup for `C` // CHECK:STDERR: alias C = Other.C; // CHECK:STDERR: ^~~~~~~ alias C = Other.C; diff --git a/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon b/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon index 754168d567dd..fca2aea898cc 100644 --- a/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon +++ b/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon @@ -70,23 +70,19 @@ fn Run() { library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_todo_main_use_other_extern.carbon:[[@LINE+12]]:1: in import -// CHECK:STDERR: import Other library "other_fn"; -// CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: fail_todo_main_use_other_extern.carbon:[[@LINE+8]]:1: in import // CHECK:STDERR: other_fn_extern.carbon:4:1: error: duplicate name being declared in the same scope // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_todo_main_use_other_extern.carbon:[[@LINE+6]]:1: in import -// CHECK:STDERR: import Other library "other_fn"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: other_fn.carbon:4:1: name is previously declared here +// CHECK:STDERR: fail_todo_main_use_other_extern.carbon:[[@LINE+4]]:1: in import +// CHECK:STDERR: other_fn.carbon:4:1: note: name is previously declared here // CHECK:STDERR: fn F() {} // CHECK:STDERR: ^~~~~~~~ import Other library "other_fn"; import Other library "other_fn_extern"; fn Run() { - // CHECK:STDERR: fail_todo_main_use_other_extern.carbon:[[@LINE+4]]:3: in name lookup for `F` + // CHECK:STDERR: fail_todo_main_use_other_extern.carbon:[[@LINE+4]]:3: note: in name lookup for `F` // CHECK:STDERR: Other.F(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -104,23 +100,19 @@ import Other library "other_fn_conflict"; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_main_use_other_ambiguous.carbon:[[@LINE+12]]:1: in import -// CHECK:STDERR: import Other library "other_fn"; -// CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: fail_main_use_other_ambiguous.carbon:[[@LINE+8]]:1: in import // CHECK:STDERR: other_fn_conflict.carbon:4:1: error: duplicate name being declared in the same scope // CHECK:STDERR: fn F(x: ()) {} // CHECK:STDERR: ^~~~~~~~~~~~~ -// CHECK:STDERR: fail_main_use_other_ambiguous.carbon:[[@LINE+6]]:1: in import -// CHECK:STDERR: import Other library "other_fn"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: other_fn.carbon:4:1: name is previously declared here +// CHECK:STDERR: fail_main_use_other_ambiguous.carbon:[[@LINE+4]]:1: in import +// CHECK:STDERR: other_fn.carbon:4:1: note: name is previously declared here // CHECK:STDERR: fn F() {} // CHECK:STDERR: ^~~~~~~~ import Other library "other_fn"; import Other library "other_fn_conflict"; fn Run() { - // CHECK:STDERR: fail_main_use_other_ambiguous.carbon:[[@LINE+4]]:3: in name lookup for `F` + // CHECK:STDERR: fail_main_use_other_ambiguous.carbon:[[@LINE+4]]:3: note: in name lookup for `F` // CHECK:STDERR: Other.F(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -132,25 +124,21 @@ fn Run() { library "[[@TEST_NAME]]"; import library "main_other_ns"; -// CHECK:STDERR: fail_main_namespace_conflict.carbon:[[@LINE+10]]:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_main_namespace_conflict.carbon:[[@LINE+8]]:1: error: duplicate name being declared in the same scope // CHECK:STDERR: import Other library "other_fn"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: fail_main_namespace_conflict.carbon:[[@LINE-4]]:1: in import -// CHECK:STDERR: import library "main_other_ns"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: main_other_ns.carbon:4:1: name is previously declared here +// CHECK:STDERR: main_other_ns.carbon:4:1: note: name is previously declared here // CHECK:STDERR: namespace Other; // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: import Other library "other_fn"; -// CHECK:STDERR: fail_main_namespace_conflict.carbon:[[@LINE+10]]:1: error: redeclaration of `fn F` is redundant +// CHECK:STDERR: fail_main_namespace_conflict.carbon:[[@LINE+8]]:1: error: redeclaration of `fn F` is redundant // CHECK:STDERR: fn Other.F() {} // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: fail_main_namespace_conflict.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: import Other library "other_fn"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: other_fn.carbon:4:1: previously declared here +// CHECK:STDERR: other_fn.carbon:4:1: note: previously declared here // CHECK:STDERR: fn F() {} // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -165,7 +153,7 @@ import Other library "other_fn"; // CHECK:STDERR: fail_main_reopen_other.carbon:[[@LINE+7]]:1: error: duplicate name being declared in the same scope // CHECK:STDERR: namespace Other; // CHECK:STDERR: ^~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_main_reopen_other.carbon:[[@LINE-5]]:1: name is previously declared here +// CHECK:STDERR: fail_main_reopen_other.carbon:[[@LINE-5]]:1: note: name is previously declared here // CHECK:STDERR: import Other library "other_fn"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -183,7 +171,7 @@ import Other library "other_fn"; // CHECK:STDERR: fail_main_reopen_other_nested.carbon:[[@LINE+7]]:11: error: imported packages cannot be used for declarations // CHECK:STDERR: namespace Other.Nested; // CHECK:STDERR: ^~~~~ -// CHECK:STDERR: fail_main_reopen_other_nested.carbon:[[@LINE-5]]:1: package imported here +// CHECK:STDERR: fail_main_reopen_other_nested.carbon:[[@LINE-5]]:1: note: package imported here // CHECK:STDERR: import Other library "other_fn"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -201,7 +189,7 @@ import Other library "other_fn"; // CHECK:STDERR: fail_main_add_to_other.carbon:[[@LINE+7]]:4: error: imported packages cannot be used for declarations // CHECK:STDERR: fn Other.G() {} // CHECK:STDERR: ^~~~~ -// CHECK:STDERR: fail_main_add_to_other.carbon:[[@LINE-5]]:1: package imported here +// CHECK:STDERR: fail_main_add_to_other.carbon:[[@LINE-5]]:1: note: package imported here // CHECK:STDERR: import Other library "other_fn"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: diff --git a/toolchain/check/testdata/packages/no_prelude/export_name.carbon b/toolchain/check/testdata/packages/no_prelude/export_name.carbon index d9c7a7062866..2a09eafe7f2a 100644 --- a/toolchain/check/testdata/packages/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/packages/no_prelude/export_name.carbon @@ -87,13 +87,11 @@ library "[[@TEST_NAME]]"; import library "base"; -// CHECK:STDERR: fail_export_ns.carbon:[[@LINE+10]]:1: error: only imported entities are valid for `export` +// CHECK:STDERR: fail_export_ns.carbon:[[@LINE+8]]:1: error: only imported entities are valid for `export` // CHECK:STDERR: export NS; // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: fail_export_ns.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: import library "base"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: base.carbon:8:1: name is declared here +// CHECK:STDERR: base.carbon:8:1: note: name is declared here // CHECK:STDERR: namespace NS; // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: @@ -108,7 +106,7 @@ class Local {} // CHECK:STDERR: fail_export_decl.carbon:[[@LINE+7]]:1: error: only imported entities are valid for `export` // CHECK:STDERR: export Local; // CHECK:STDERR: ^~~~~~~~~~~~~ -// CHECK:STDERR: fail_export_decl.carbon:[[@LINE-5]]:1: name is declared here +// CHECK:STDERR: fail_export_decl.carbon:[[@LINE-5]]:1: note: name is declared here // CHECK:STDERR: class Local {} // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: @@ -120,13 +118,11 @@ library "[[@TEST_NAME]]"; import library "base"; -// CHECK:STDERR: fail_export_member.carbon:[[@LINE+10]]:8: error: name qualifiers are only allowed for entities that provide a scope +// CHECK:STDERR: fail_export_member.carbon:[[@LINE+8]]:8: error: name qualifiers are only allowed for entities that provide a scope // CHECK:STDERR: export C.x; // CHECK:STDERR: ^ // CHECK:STDERR: fail_export_member.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: import library "base"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: base.carbon:4:1: referenced non-scope entity declared here +// CHECK:STDERR: base.carbon:4:1: note: referenced non-scope entity declared here // CHECK:STDERR: class C { // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -179,7 +175,7 @@ export C; // CHECK:STDERR: repeat_export.carbon:[[@LINE+7]]:1: warning: `export` matches previous `export` // CHECK:STDERR: export C; // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: repeat_export.carbon:[[@LINE-4]]:1: previous `export` here +// CHECK:STDERR: repeat_export.carbon:[[@LINE-4]]:1: note: previous `export` here // CHECK:STDERR: export C; // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: diff --git a/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon b/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon index b39963b38e3e..5193b7a5b1ab 100644 --- a/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon +++ b/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon @@ -24,13 +24,11 @@ import library "a"; // TODO: This diagnostic doesn't clearly explain the problem. We should instead // say something like: Only namespace-scope names can be exported. -// CHECK:STDERR: fail_b.carbon:[[@LINE+9]]:8: error: name qualifiers are only allowed for entities that provide a scope +// CHECK:STDERR: fail_b.carbon:[[@LINE+7]]:8: error: name qualifiers are only allowed for entities that provide a scope // CHECK:STDERR: export C.n; // CHECK:STDERR: ^ // CHECK:STDERR: fail_b.carbon:[[@LINE-7]]:1: in import -// CHECK:STDERR: import library "a"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: a.carbon:4:1: referenced non-scope entity declared here +// CHECK:STDERR: a.carbon:4:1: note: referenced non-scope entity declared here // CHECK:STDERR: class C { // CHECK:STDERR: ^~~~~~~~~ export C.n; diff --git a/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon b/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon index c6a4c9eaa945..17e9f65863a3 100644 --- a/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon +++ b/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon @@ -131,16 +131,12 @@ import Other library "o1"; // --- fail_import_conflict.impl.carbon -// CHECK:STDERR: fail_import_conflict.impl.carbon:[[@LINE+13]]:6: in import -// CHECK:STDERR: impl library "import_conflict"; -// CHECK:STDERR: ^~~~~~~ +// CHECK:STDERR: fail_import_conflict.impl.carbon:[[@LINE+9]]:6: in import // CHECK:STDERR: import_conflict.carbon:4:1: error: duplicate name being declared in the same scope // CHECK:STDERR: import Other library "o1"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_import_conflict.impl.carbon:[[@LINE+7]]:6: in import -// CHECK:STDERR: impl library "import_conflict"; -// CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: local_other.carbon:4:1: name is previously declared here +// CHECK:STDERR: fail_import_conflict.impl.carbon:[[@LINE+5]]:6: in import +// CHECK:STDERR: local_other.carbon:4:1: note: name is previously declared here // CHECK:STDERR: class Other {} // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: @@ -158,16 +154,12 @@ import library "local_other"; impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_import_conflict_reverse.impl.carbon:[[@LINE+12]]:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_import_conflict_reverse.impl.carbon:[[@LINE+8]]:1: error: duplicate name being declared in the same scope // CHECK:STDERR: import Other library "o1"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: fail_import_conflict_reverse.impl.carbon:[[@LINE-5]]:6: in import -// CHECK:STDERR: impl library "import_conflict_reverse"; -// CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: import_conflict_reverse.carbon:4:1: in import -// CHECK:STDERR: import library "local_other"; -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: local_other.carbon:4:1: name is previously declared here +// CHECK:STDERR: local_other.carbon:4:1: note: name is previously declared here // CHECK:STDERR: class Other {} // CHECK:STDERR: ^~~~~~~~~~~~~ import Other library "o1"; @@ -673,8 +665,8 @@ import Other library "o1"; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Other = imports.%Other // CHECK:STDOUT: } -// CHECK:STDOUT: %default.import.loc15_6.1 = import -// CHECK:STDOUT: %default.import.loc15_6.2 = import +// CHECK:STDOUT: %default.import.loc11_6.1 = import +// CHECK:STDOUT: %default.import.loc11_6.2 = import // CHECK:STDOUT: %Other.import = import Other // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/pointer/fail_deref_type.carbon b/toolchain/check/testdata/pointer/fail_deref_type.carbon index 855b5208911c..446435e42429 100644 --- a/toolchain/check/testdata/pointer/fail_deref_type.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_type.carbon @@ -11,7 +11,7 @@ // CHECK:STDERR: fail_deref_type.carbon:[[@LINE+7]]:8: error: cannot dereference operand of non-pointer type `type` // CHECK:STDERR: var p: *i32; // CHECK:STDERR: ^ -// CHECK:STDERR: fail_deref_type.carbon:[[@LINE+4]]:8: to form a pointer type, write the `*` after the pointee type +// CHECK:STDERR: fail_deref_type.carbon:[[@LINE+4]]:8: note: to form a pointer type, write the `*` after the pointee type // CHECK:STDERR: var p: *i32; // CHECK:STDERR: ^ // CHECK:STDERR: diff --git a/toolchain/check/testdata/pointer/fail_type_mismatch.carbon b/toolchain/check/testdata/pointer/fail_type_mismatch.carbon index b407dd1ba424..958166e8218f 100644 --- a/toolchain/check/testdata/pointer/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/pointer/fail_type_mismatch.carbon @@ -12,7 +12,7 @@ fn ConstMismatch(p: const {}*) -> const ({}*) { // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `const {}*` to `const ({}*)` // CHECK:STDERR: return p; // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:3: type `const {}*` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:3: note: type `const {}*` does not implement interface `ImplicitAs` // CHECK:STDERR: return p; // CHECK:STDERR: ^~~~~~~~~ return p; diff --git a/toolchain/check/testdata/return/fail_let_in_type.carbon b/toolchain/check/testdata/return/fail_let_in_type.carbon index b8d5d59efc65..7c516ef63dc9 100644 --- a/toolchain/check/testdata/return/fail_let_in_type.carbon +++ b/toolchain/check/testdata/return/fail_let_in_type.carbon @@ -20,7 +20,7 @@ let y:! type = i32; // CHECK:STDERR: fail_let_in_type.carbon:[[@LINE+7]]:23: error: cannot implicitly convert from `i32` to `y` // CHECK:STDERR: fn HalfDozen() -> y { return 6; } // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_let_in_type.carbon:[[@LINE+4]]:23: type `i32` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_let_in_type.carbon:[[@LINE+4]]:23: note: type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: fn HalfDozen() -> y { return 6; } // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: diff --git a/toolchain/check/testdata/return/fail_return_with_returned_var.carbon b/toolchain/check/testdata/return/fail_return_with_returned_var.carbon index 38c6e57ab747..e2682b53389b 100644 --- a/toolchain/check/testdata/return/fail_return_with_returned_var.carbon +++ b/toolchain/check/testdata/return/fail_return_with_returned_var.carbon @@ -13,7 +13,7 @@ fn F() -> i32 { // CHECK:STDERR: fail_return_with_returned_var.carbon:[[@LINE+7]]:3: error: can only `return var;` in the scope of a `returned var` // CHECK:STDERR: return 1; // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_return_with_returned_var.carbon:[[@LINE-4]]:16: `returned var` was declared here + // CHECK:STDERR: fail_return_with_returned_var.carbon:[[@LINE-4]]:16: note: `returned var` was declared here // CHECK:STDERR: returned var v: i32 = 0; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -26,7 +26,7 @@ fn G() -> C { // CHECK:STDERR: fail_return_with_returned_var.carbon:[[@LINE+6]]:3: error: can only `return var;` in the scope of a `returned var` // CHECK:STDERR: return c; // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_return_with_returned_var.carbon:[[@LINE-4]]:16: `returned var` was declared here + // CHECK:STDERR: fail_return_with_returned_var.carbon:[[@LINE-4]]:16: note: `returned var` was declared here // CHECK:STDERR: returned var c: C = {.a = 1, .b = 2}; // CHECK:STDERR: ^ return c; diff --git a/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon b/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon index 66d4f0eb86f8..143494d5becd 100644 --- a/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon @@ -12,7 +12,7 @@ fn Procedure() { // CHECK:STDERR: fail_returned_var_no_return_type.carbon:[[@LINE+6]]:3: error: cannot declare a `returned var` in this function // CHECK:STDERR: returned var v: () = (); // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_returned_var_no_return_type.carbon:[[@LINE-4]]:1: there was no return type provided + // CHECK:STDERR: fail_returned_var_no_return_type.carbon:[[@LINE-4]]:1: note: there was no return type provided // CHECK:STDERR: fn Procedure() { // CHECK:STDERR: ^~~~~~~~~~~~~~~~ returned var v: () = (); diff --git a/toolchain/check/testdata/return/fail_returned_var_shadow.carbon b/toolchain/check/testdata/return/fail_returned_var_shadow.carbon index cbc6e62529a8..7ae7efca35e6 100644 --- a/toolchain/check/testdata/return/fail_returned_var_shadow.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_shadow.carbon @@ -14,7 +14,7 @@ fn SameScope() -> i32 { // CHECK:STDERR: fail_returned_var_shadow.carbon:[[@LINE+7]]:18: error: cannot declare a `returned var` in the scope of another `returned var` // CHECK:STDERR: returned var w: i32 = 1; // CHECK:STDERR: ^ - // CHECK:STDERR: fail_returned_var_shadow.carbon:[[@LINE-4]]:18: `returned var` was declared here + // CHECK:STDERR: fail_returned_var_shadow.carbon:[[@LINE-4]]:18: note: `returned var` was declared here // CHECK:STDERR: returned var v: i32 = 0; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -30,7 +30,7 @@ fn DifferentScopes() -> i32 { // CHECK:STDERR: fail_returned_var_shadow.carbon:[[@LINE+6]]:20: error: cannot declare a `returned var` in the scope of another `returned var` // CHECK:STDERR: returned var w: i32 = 1; // CHECK:STDERR: ^ - // CHECK:STDERR: fail_returned_var_shadow.carbon:[[@LINE-5]]:18: `returned var` was declared here + // CHECK:STDERR: fail_returned_var_shadow.carbon:[[@LINE-5]]:18: note: `returned var` was declared here // CHECK:STDERR: returned var v: i32 = 0; // CHECK:STDERR: ^ returned var w: i32 = 1; diff --git a/toolchain/check/testdata/return/fail_returned_var_type.carbon b/toolchain/check/testdata/return/fail_returned_var_type.carbon index 42b3fdbd52ca..a60014671b7e 100644 --- a/toolchain/check/testdata/return/fail_returned_var_type.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_type.carbon @@ -12,7 +12,7 @@ fn Mismatch() -> i32 { // CHECK:STDERR: fail_returned_var_type.carbon:[[@LINE+6]]:19: error: type `f64` of `returned var` does not match return type of enclosing function // CHECK:STDERR: returned var v: f64 = 0.0; // CHECK:STDERR: ^~~ - // CHECK:STDERR: fail_returned_var_type.carbon:[[@LINE-4]]:15: return type of function is `i32` + // CHECK:STDERR: fail_returned_var_type.carbon:[[@LINE-4]]:15: note: return type of function is `i32` // CHECK:STDERR: fn Mismatch() -> i32 { // CHECK:STDERR: ^~~~~~ returned var v: f64 = 0.0; diff --git a/toolchain/check/testdata/return/fail_type_mismatch.carbon b/toolchain/check/testdata/return/fail_type_mismatch.carbon index daa62a933578..06e663adb6c2 100644 --- a/toolchain/check/testdata/return/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/return/fail_type_mismatch.carbon @@ -12,7 +12,7 @@ fn Main() -> i32 { // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `f64` to `i32` // CHECK:STDERR: return 1.0; // CHECK:STDERR: ^~~~~~~~~~~ - // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:3: type `f64` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:3: note: type `f64` does not implement interface `ImplicitAs` // CHECK:STDERR: return 1.0; // CHECK:STDERR: ^~~~~~~~~~~ return 1.0; diff --git a/toolchain/check/testdata/return/fail_value_disallowed.carbon b/toolchain/check/testdata/return/fail_value_disallowed.carbon index b126930a30f8..b4c7f6ead00a 100644 --- a/toolchain/check/testdata/return/fail_value_disallowed.carbon +++ b/toolchain/check/testdata/return/fail_value_disallowed.carbon @@ -12,7 +12,7 @@ fn Main() { // CHECK:STDERR: fail_value_disallowed.carbon:[[@LINE+6]]:3: error: no return expression should be provided in this context // CHECK:STDERR: return 0; // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_value_disallowed.carbon:[[@LINE-4]]:1: there was no return type provided + // CHECK:STDERR: fail_value_disallowed.carbon:[[@LINE-4]]:1: note: there was no return type provided // CHECK:STDERR: fn Main() { // CHECK:STDERR: ^~~~~~~~~~~ return 0; diff --git a/toolchain/check/testdata/return/fail_value_missing.carbon b/toolchain/check/testdata/return/fail_value_missing.carbon index 8844490218c3..b2f6757928bf 100644 --- a/toolchain/check/testdata/return/fail_value_missing.carbon +++ b/toolchain/check/testdata/return/fail_value_missing.carbon @@ -12,7 +12,7 @@ fn Main() -> i32 { // CHECK:STDERR: fail_value_missing.carbon:[[@LINE+6]]:3: error: missing return value // CHECK:STDERR: return; // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_value_missing.carbon:[[@LINE-4]]:11: return type of function is `i32` + // CHECK:STDERR: fail_value_missing.carbon:[[@LINE-4]]:11: note: return type of function is `i32` // CHECK:STDERR: fn Main() -> i32 { // CHECK:STDERR: ^~~~~~ return; diff --git a/toolchain/check/testdata/struct/fail_duplicate_name.carbon b/toolchain/check/testdata/struct/fail_duplicate_name.carbon index 9fbb3d3a1947..5e452732684e 100644 --- a/toolchain/check/testdata/struct/fail_duplicate_name.carbon +++ b/toolchain/check/testdata/struct/fail_duplicate_name.carbon @@ -11,7 +11,7 @@ // CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+7]]:42: error: duplicated field name `abc` in struct type literal // CHECK:STDERR: fn F() -> {.d: i32, .abc: i32, .e: i32, .abc: i32, .f: i32}; // CHECK:STDERR: ^~~ -// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+4]]:22: field with the same name here +// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+4]]:22: note: field with the same name here // CHECK:STDERR: fn F() -> {.d: i32, .abc: i32, .e: i32, .abc: i32, .f: i32}; // CHECK:STDERR: ^~~ // CHECK:STDERR: @@ -20,7 +20,7 @@ fn F() -> {.d: i32, .abc: i32, .e: i32, .abc: i32, .f: i32}; // CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+7]]:19: error: duplicated field name `a` in struct type literal // CHECK:STDERR: let v: {.a: i32, .a: i32} = {.a = 1}; // CHECK:STDERR: ^ -// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+4]]:10: field with the same name here +// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+4]]:10: note: field with the same name here // CHECK:STDERR: let v: {.a: i32, .a: i32} = {.a = 1}; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -29,7 +29,7 @@ let v: {.a: i32, .a: i32} = {.a = 1}; // CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+7]]:26: error: duplicated field name `def` in struct literal // CHECK:STDERR: let w: i32 = {.def = 1, .def = 2}.def; // CHECK:STDERR: ^~~ -// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+4]]:16: field with the same name here +// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+4]]:16: note: field with the same name here // CHECK:STDERR: let w: i32 = {.def = 1, .def = 2}.def; // CHECK:STDERR: ^~~ // CHECK:STDERR: @@ -38,7 +38,7 @@ let w: i32 = {.def = 1, .def = 2}.def; // CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+7]]:30: error: duplicated field name `a` in struct literal // CHECK:STDERR: var x: {.a: i32} = {.a = 1, .a = 2}; // CHECK:STDERR: ^ -// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+4]]:22: field with the same name here +// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+4]]:22: note: field with the same name here // CHECK:STDERR: var x: {.a: i32} = {.a = 1, .a = 2}; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -47,7 +47,7 @@ var x: {.a: i32} = {.a = 1, .a = 2}; // CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+6]]:39: error: duplicated field name `b` in struct literal // CHECK:STDERR: var y: {.b: i32, .c: i32} = {.b = 3, .b = 4}; // CHECK:STDERR: ^ -// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+3]]:31: field with the same name here +// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+3]]:31: note: field with the same name here // CHECK:STDERR: var y: {.b: i32, .c: i32} = {.b = 3, .b = 4}; // CHECK:STDERR: ^ var y: {.b: i32, .c: i32} = {.b = 3, .b = 4}; diff --git a/toolchain/check/testdata/struct/fail_type_assign.carbon b/toolchain/check/testdata/struct/fail_type_assign.carbon index 350bcaa15a54..b7901b2298ec 100644 --- a/toolchain/check/testdata/struct/fail_type_assign.carbon +++ b/toolchain/check/testdata/struct/fail_type_assign.carbon @@ -11,7 +11,7 @@ // CHECK:STDERR: fail_type_assign.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `type` to `{.a: i32}` // CHECK:STDERR: var x: {.a: i32} = {.a: i32}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+3]]:1: type `type` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+3]]:1: note: type `type` does not implement interface `ImplicitAs` // CHECK:STDERR: var x: {.a: i32} = {.a: i32}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var x: {.a: i32} = {.a: i32}; diff --git a/toolchain/check/testdata/struct/fail_value_as_type.carbon b/toolchain/check/testdata/struct/fail_value_as_type.carbon index c1e885943caf..05658e10ef94 100644 --- a/toolchain/check/testdata/struct/fail_value_as_type.carbon +++ b/toolchain/check/testdata/struct/fail_value_as_type.carbon @@ -11,7 +11,7 @@ // CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+6]]:8: error: cannot implicitly convert from `{.a: i32}` to `type` // CHECK:STDERR: var x: {.a = 1}; // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+3]]:8: type `{.a: i32}` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+3]]:8: note: type `{.a: i32}` does not implement interface `ImplicitAs` // CHECK:STDERR: var x: {.a = 1}; // CHECK:STDERR: ^~~~~~~~ var x: {.a = 1}; diff --git a/toolchain/check/testdata/struct/import.carbon b/toolchain/check/testdata/struct/import.carbon index 7534e2a68e0a..66c04410d654 100644 --- a/toolchain/check/testdata/struct/import.carbon +++ b/toolchain/check/testdata/struct/import.carbon @@ -30,13 +30,11 @@ var c: C({.a = 1, .b = 2}) = F(); // --- fail_bad_type.impl.carbon impl package Implicit; -// CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE+10]]:14: error: missing value for field `a` in struct initialization +// CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE+8]]:14: error: missing value for field `a` in struct initialization // CHECK:STDERR: var c_bad: C({.c = 1, .d = 2}) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE-4]]:6: in import -// CHECK:STDERR: impl package Implicit; -// CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: implicit.carbon:8:9: initializing generic parameter `S` declared here +// CHECK:STDERR: implicit.carbon:8:9: note: initializing generic parameter `S` declared here // CHECK:STDERR: class C(S:! {.a: i32, .b: i32}) {} // CHECK:STDERR: ^ // CHECK:STDERR: @@ -48,7 +46,7 @@ impl package Implicit; // CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C` to `C` // CHECK:STDERR: var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: type `C` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note: type `C` does not implement interface `ImplicitAs` // CHECK:STDERR: var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var c_bad: C({.a = 3, .b = 4}) = F(); @@ -424,9 +422,9 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C.1] -// CHECK:STDOUT: %.loc13_20: i32 = int_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %.loc13_28: i32 = int_literal 2 [template = constants.%.6] -// CHECK:STDOUT: %.loc13_29: %.7 = struct_literal (%.loc13_20, %.loc13_28) +// CHECK:STDOUT: %.loc11_20: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc11_28: i32 = int_literal 2 [template = constants.%.6] +// CHECK:STDOUT: %.loc11_29: %.7 = struct_literal (%.loc11_20, %.loc11_28) // CHECK:STDOUT: %c_bad.var: ref = var c_bad // CHECK:STDOUT: %c_bad: ref = bind_name c_bad, %c_bad.var // CHECK:STDOUT: } @@ -447,8 +445,8 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.4 [template = constants.%F] -// CHECK:STDOUT: %.loc13: ref %C.3 = temporary_storage -// CHECK:STDOUT: %F.call: init %C.3 = call %F.ref() to %.loc13 +// CHECK:STDOUT: %.loc11: ref %C.3 = temporary_storage +// CHECK:STDOUT: %F.call: init %C.3 = call %F.ref() to %.loc11 // CHECK:STDOUT: assign file.%c_bad.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/no_prelude/fail_nested_incomplete.carbon b/toolchain/check/testdata/struct/no_prelude/fail_nested_incomplete.carbon index fd178e5a9a9a..f29be33b989f 100644 --- a/toolchain/check/testdata/struct/no_prelude/fail_nested_incomplete.carbon +++ b/toolchain/check/testdata/struct/no_prelude/fail_nested_incomplete.carbon @@ -13,7 +13,7 @@ class Incomplete; // CHECK:STDERR: fail_nested_incomplete.carbon:[[@LINE+6]]:8: error: Variable has incomplete type `{.a: Incomplete}` // CHECK:STDERR: var s: {.a: Incomplete}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_nested_incomplete.carbon:[[@LINE-5]]:1: class was forward declared here +// CHECK:STDERR: fail_nested_incomplete.carbon:[[@LINE-5]]:1: note: class was forward declared here // CHECK:STDERR: class Incomplete; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ var s: {.a: Incomplete}; diff --git a/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon b/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon index bb84b8861b1d..aba988586d8a 100644 --- a/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon +++ b/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon @@ -12,7 +12,7 @@ var a: (i32, i32) = (12, 6); // CHECK:STDERR: fail_non_int_indexing.carbon:[[@LINE+6]]:17: error: cannot implicitly convert from `f64` to `i32` // CHECK:STDERR: var b: i32 = a.(2.6); // CHECK:STDERR: ^~~ -// CHECK:STDERR: fail_non_int_indexing.carbon:[[@LINE+3]]:17: type `f64` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_non_int_indexing.carbon:[[@LINE+3]]:17: note: type `f64` does not implement interface `ImplicitAs` // CHECK:STDERR: var b: i32 = a.(2.6); // CHECK:STDERR: ^~~ var b: i32 = a.(2.6); diff --git a/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon b/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon index 31babc84b66b..d6aca4eaef00 100644 --- a/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon +++ b/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon @@ -11,7 +11,7 @@ // CHECK:STDERR: fail_element_type_mismatch.carbon:[[@LINE+6]]:21: error: cannot implicitly convert from `f64` to `i32` // CHECK:STDERR: var x: (i32, i32) = (2, 65.89); // CHECK:STDERR: ^~~~~~~~~~ -// CHECK:STDERR: fail_element_type_mismatch.carbon:[[@LINE+3]]:21: type `f64` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_element_type_mismatch.carbon:[[@LINE+3]]:21: note: type `f64` does not implement interface `ImplicitAs` // CHECK:STDERR: var x: (i32, i32) = (2, 65.89); // CHECK:STDERR: ^~~~~~~~~~ var x: (i32, i32) = (2, 65.89); diff --git a/toolchain/check/testdata/tuple/fail_nested_incomplete.carbon b/toolchain/check/testdata/tuple/fail_nested_incomplete.carbon index 0d435f341ab8..fb2654b2b09a 100644 --- a/toolchain/check/testdata/tuple/fail_nested_incomplete.carbon +++ b/toolchain/check/testdata/tuple/fail_nested_incomplete.carbon @@ -13,7 +13,7 @@ class Incomplete; // CHECK:STDERR: fail_nested_incomplete.carbon:[[@LINE+6]]:8: error: Variable has incomplete type `(i32, Incomplete)` // CHECK:STDERR: var t: (i32, Incomplete); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_nested_incomplete.carbon:[[@LINE-5]]:1: class was forward declared here +// CHECK:STDERR: fail_nested_incomplete.carbon:[[@LINE-5]]:1: note: class was forward declared here // CHECK:STDERR: class Incomplete; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ var t: (i32, Incomplete); diff --git a/toolchain/check/testdata/tuple/fail_type_assign.carbon b/toolchain/check/testdata/tuple/fail_type_assign.carbon index 01512b890557..acb283d19ea5 100644 --- a/toolchain/check/testdata/tuple/fail_type_assign.carbon +++ b/toolchain/check/testdata/tuple/fail_type_assign.carbon @@ -11,7 +11,7 @@ // CHECK:STDERR: fail_type_assign.carbon:[[@LINE+6]]:18: error: cannot implicitly convert from `type` to `i32` // CHECK:STDERR: var x: (i32, ) = (i32, ); // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+3]]:18: type `type` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+3]]:18: note: type `type` does not implement interface `ImplicitAs` // CHECK:STDERR: var x: (i32, ) = (i32, ); // CHECK:STDERR: ^~~~~~~ var x: (i32, ) = (i32, ); diff --git a/toolchain/check/testdata/tuple/fail_value_as_type.carbon b/toolchain/check/testdata/tuple/fail_value_as_type.carbon index e74f6b2c8064..166b0cf677f8 100644 --- a/toolchain/check/testdata/tuple/fail_value_as_type.carbon +++ b/toolchain/check/testdata/tuple/fail_value_as_type.carbon @@ -11,7 +11,7 @@ // CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+6]]:8: error: cannot implicitly convert from `i32` to `type` // CHECK:STDERR: var x: (1, ); // CHECK:STDERR: ^~~~~ -// CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+3]]:8: type `i32` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+3]]:8: note: type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: var x: (1, ); // CHECK:STDERR: ^~~~~ var x: (1, ); diff --git a/toolchain/check/testdata/tuple/import.carbon b/toolchain/check/testdata/tuple/import.carbon index f66f29844bde..51f1872f3f26 100644 --- a/toolchain/check/testdata/tuple/import.carbon +++ b/toolchain/check/testdata/tuple/import.carbon @@ -31,13 +31,11 @@ var c: C((1, 2)) = F(); impl package Implicit; -// CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE+10]]:14: error: cannot initialize tuple of 2 element(s) from tuple with 3 element(s). +// CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE+8]]:14: error: cannot initialize tuple of 2 element(s) from tuple with 3 element(s). // CHECK:STDERR: var c_bad: C((1, 2, 3)) = F(); // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE-5]]:6: in import -// CHECK:STDERR: impl package Implicit; -// CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: implicit.carbon:7:9: initializing generic parameter `X` declared here +// CHECK:STDERR: implicit.carbon:7:9: note: initializing generic parameter `X` declared here // CHECK:STDERR: class C(X:! (i32, i32)) {} // CHECK:STDERR: ^ // CHECK:STDERR: @@ -50,7 +48,7 @@ impl package Implicit; // CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C` to `C` // CHECK:STDERR: var c_bad: C((3, 4)) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: type `C` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note: type `C` does not implement interface `ImplicitAs` // CHECK:STDERR: var c_bad: C((3, 4)) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ var c_bad: C((3, 4)) = F(); @@ -464,10 +462,10 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C.1] -// CHECK:STDOUT: %.loc14_15: i32 = int_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %.loc14_18: i32 = int_literal 2 [template = constants.%.6] -// CHECK:STDOUT: %.loc14_21: i32 = int_literal 3 [template = constants.%.7] -// CHECK:STDOUT: %.loc14_22: %.8 = tuple_literal (%.loc14_15, %.loc14_18, %.loc14_21) +// CHECK:STDOUT: %.loc12_15: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc12_18: i32 = int_literal 2 [template = constants.%.6] +// CHECK:STDOUT: %.loc12_21: i32 = int_literal 3 [template = constants.%.7] +// CHECK:STDOUT: %.loc12_22: %.8 = tuple_literal (%.loc12_15, %.loc12_18, %.loc12_21) // CHECK:STDOUT: %c_bad.var: ref = var c_bad // CHECK:STDOUT: %c_bad: ref = bind_name c_bad, %c_bad.var // CHECK:STDOUT: } @@ -488,8 +486,8 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.4 [template = constants.%F] -// CHECK:STDOUT: %.loc14: ref %C.3 = temporary_storage -// CHECK:STDOUT: %F.call: init %C.3 = call %F.ref() to %.loc14 +// CHECK:STDOUT: %.loc12: ref %C.3 = temporary_storage +// CHECK:STDOUT: %F.call: init %C.3 = call %F.ref() to %.loc12 // CHECK:STDOUT: assign file.%c_bad.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/var/fail_storage_is_literal.carbon b/toolchain/check/testdata/var/fail_storage_is_literal.carbon index c1383c25b4fd..acedc18e4c9f 100644 --- a/toolchain/check/testdata/var/fail_storage_is_literal.carbon +++ b/toolchain/check/testdata/var/fail_storage_is_literal.carbon @@ -12,7 +12,7 @@ fn Main() { // CHECK:STDERR: fail_storage_is_literal.carbon:[[@LINE+6]]:10: error: cannot implicitly convert from `i32` to `type` // CHECK:STDERR: var x: 1 = 1; // CHECK:STDERR: ^ - // CHECK:STDERR: fail_storage_is_literal.carbon:[[@LINE+3]]:10: type `i32` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_storage_is_literal.carbon:[[@LINE+3]]:10: note: type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: var x: 1 = 1; // CHECK:STDERR: ^ var x: 1 = 1; diff --git a/toolchain/check/testdata/var/no_prelude/export_name.carbon b/toolchain/check/testdata/var/no_prelude/export_name.carbon index 0c44b135e8ea..aae308180f4d 100644 --- a/toolchain/check/testdata/var/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/var/no_prelude/export_name.carbon @@ -34,12 +34,8 @@ export v; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_todo_use_export.carbon:[[@LINE+9]]:1: in import -// CHECK:STDERR: import library "export"; -// CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: fail_todo_use_export.carbon:[[@LINE+5]]:1: in import // CHECK:STDERR: export.carbon:4:1: in import -// CHECK:STDERR: import library "base"; -// CHECK:STDERR: ^~~~~~ // CHECK:STDERR: base.carbon:4:5: error: semantics TODO: `Non-constant ImportRefLoaded (comes up with var)` // CHECK:STDERR: var v: (); // CHECK:STDERR: ^ @@ -98,8 +94,8 @@ var w: () = v; // CHECK:STDOUT: .w = %w // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %.loc15_9.1: %.1 = tuple_literal () -// CHECK:STDOUT: %.loc15_9.2: type = converted %.loc15_9.1, constants.%.1 [template = constants.%.1] +// CHECK:STDOUT: %.loc11_9.1: %.1 = tuple_literal () +// CHECK:STDOUT: %.loc11_9.2: type = converted %.loc11_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %w.var: ref %.1 = var w // CHECK:STDOUT: %w: ref %.1 = bind_name w, %w.var // CHECK:STDOUT: } @@ -107,9 +103,9 @@ var w: () = v; // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %v.ref: ref %.1 = name_ref v, imports.%import_ref [template = ] -// CHECK:STDOUT: %.loc15_13: init %.1 = tuple_init () to file.%w.var [template = constants.%tuple] -// CHECK:STDOUT: %.loc15_14: init %.1 = converted %v.ref, %.loc15_13 [template = constants.%tuple] -// CHECK:STDOUT: assign file.%w.var, %.loc15_14 +// CHECK:STDOUT: %.loc11_13: init %.1 = tuple_init () to file.%w.var [template = constants.%tuple] +// CHECK:STDOUT: %.loc11_14: init %.1 = converted %v.ref, %.loc11_13 [template = constants.%tuple] +// CHECK:STDOUT: assign file.%w.var, %.loc11_14 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/var/no_prelude/fail_duplicate_decl.carbon b/toolchain/check/testdata/var/no_prelude/fail_duplicate_decl.carbon index 85873746ebc6..8545ccddb0a9 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_duplicate_decl.carbon +++ b/toolchain/check/testdata/var/no_prelude/fail_duplicate_decl.carbon @@ -14,7 +14,7 @@ fn Main() { // CHECK:STDERR: fail_duplicate_decl.carbon:[[@LINE+6]]:7: error: duplicate name being declared in the same scope // CHECK:STDERR: var x: () = (); // CHECK:STDERR: ^ - // CHECK:STDERR: fail_duplicate_decl.carbon:[[@LINE-4]]:7: name is previously declared here + // CHECK:STDERR: fail_duplicate_decl.carbon:[[@LINE-4]]:7: note: name is previously declared here // CHECK:STDERR: var x: () = (); // CHECK:STDERR: ^ var x: () = (); diff --git a/toolchain/check/testdata/var/no_prelude/fail_modifiers.carbon b/toolchain/check/testdata/var/no_prelude/fail_modifiers.carbon index abc6de74947c..a301dd805639 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_modifiers.carbon +++ b/toolchain/check/testdata/var/no_prelude/fail_modifiers.carbon @@ -17,7 +17,7 @@ protected var b: (); // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:9: error: `protected` not allowed on declaration with `private` // CHECK:STDERR: private protected var c: (); // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `private` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note: `private` previously appeared here // CHECK:STDERR: private protected var c: (); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -30,7 +30,7 @@ private protected var c: (); // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:11: error: `protected` repeated on declaration // CHECK:STDERR: protected protected var d: (); // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `protected` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note: `protected` previously appeared here // CHECK:STDERR: protected protected var d: (); // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: diff --git a/toolchain/check/testdata/var/no_prelude/fail_namespace_conflict.carbon b/toolchain/check/testdata/var/no_prelude/fail_namespace_conflict.carbon index 26c46b63a011..adae75dc1aa8 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_namespace_conflict.carbon +++ b/toolchain/check/testdata/var/no_prelude/fail_namespace_conflict.carbon @@ -13,7 +13,7 @@ namespace A; // CHECK:STDERR: fail_namespace_conflict.carbon:[[@LINE+7]]:5: error: duplicate name being declared in the same scope // CHECK:STDERR: var A: (); // CHECK:STDERR: ^ -// CHECK:STDERR: fail_namespace_conflict.carbon:[[@LINE-5]]:1: name is previously declared here +// CHECK:STDERR: fail_namespace_conflict.carbon:[[@LINE-5]]:1: note: name is previously declared here // CHECK:STDERR: namespace A; // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: @@ -22,7 +22,7 @@ var A: (); // CHECK:STDERR: fail_namespace_conflict.carbon:[[@LINE+6]]:5: error: duplicate name being declared in the same scope // CHECK:STDERR: var A: () = (); // CHECK:STDERR: ^ -// CHECK:STDERR: fail_namespace_conflict.carbon:[[@LINE-14]]:1: name is previously declared here +// CHECK:STDERR: fail_namespace_conflict.carbon:[[@LINE-14]]:1: note: name is previously declared here // CHECK:STDERR: namespace A; // CHECK:STDERR: ^~~~~~~~~~~~ var A: () = (); diff --git a/toolchain/check/testdata/while/fail_bad_condition.carbon b/toolchain/check/testdata/while/fail_bad_condition.carbon index ba997323172e..b3bd6119f7ec 100644 --- a/toolchain/check/testdata/while/fail_bad_condition.carbon +++ b/toolchain/check/testdata/while/fail_bad_condition.carbon @@ -12,7 +12,7 @@ fn While() { // CHECK:STDERR: fail_bad_condition.carbon:[[@LINE+6]]:9: error: cannot implicitly convert from `String` to `bool` // CHECK:STDERR: while ("Hello") {} // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_bad_condition.carbon:[[@LINE+3]]:9: type `String` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_bad_condition.carbon:[[@LINE+3]]:9: note: type `String` does not implement interface `ImplicitAs` // CHECK:STDERR: while ("Hello") {} // CHECK:STDERR: ^~~~~~~~~ while ("Hello") {} diff --git a/toolchain/diagnostics/diagnostic.h b/toolchain/diagnostics/diagnostic.h index 98b2426f28e8..2d312c10351f 100644 --- a/toolchain/diagnostics/diagnostic.h +++ b/toolchain/diagnostics/diagnostic.h @@ -18,8 +18,12 @@ namespace Carbon { enum class DiagnosticLevel : int8_t { - // A note, not indicating an error on its own, but possibly providing context - // for an error. + // Information about the location of another diagnostic, showing how we + // reached that location. This is currently only used for the "in import" + // message. + LocationInfo, + // A note, not indicating an error on its own, but possibly providing + // additional information for an error or warning. Note, // A warning diagnostic, indicating a likely problem with the program. Warning, diff --git a/toolchain/diagnostics/diagnostic_consumer.cpp b/toolchain/diagnostics/diagnostic_consumer.cpp index b4bf3a353c9a..92871aabecb8 100644 --- a/toolchain/diagnostics/diagnostic_consumer.cpp +++ b/toolchain/diagnostics/diagnostic_consumer.cpp @@ -27,10 +27,18 @@ auto StreamDiagnosticConsumer::HandleDiagnostic(Diagnostic diagnostic) -> void { *stream_ << "warning: "; break; case DiagnosticLevel::Note: + *stream_ << "note: "; + break; + case DiagnosticLevel::LocationInfo: break; } *stream_ << message.format_fn(message) << "\n"; - message.loc.FormatSnippet(*stream_); + // Don't include a snippet for location information to keep this diagnostic + // more visually associated with the following diagnostic that it describes + // and to better match C++ compilers. + if (message.level != DiagnosticLevel::LocationInfo) { + message.loc.FormatSnippet(*stream_); + } } } diff --git a/toolchain/diagnostics/diagnostic_emitter.h b/toolchain/diagnostics/diagnostic_emitter.h index 8222678dcefd..05e0dc9ed1f2 100644 --- a/toolchain/diagnostics/diagnostic_emitter.h +++ b/toolchain/diagnostics/diagnostic_emitter.h @@ -63,8 +63,9 @@ class DiagnosticEmitter { auto Note(LocT loc, const Internal::DiagnosticBase& diagnostic_base, Internal::NoTypeDeduction... args) -> DiagnosticBuilder& { - CARBON_CHECK(diagnostic_base.Level == DiagnosticLevel::Note, "{0}", - static_cast(diagnostic_base.Level)); + CARBON_CHECK(diagnostic_base.Level == DiagnosticLevel::Note || + diagnostic_base.Level == DiagnosticLevel::LocationInfo, + "{0}", static_cast(diagnostic_base.Level)); AddMessage(loc, diagnostic_base, {emitter_->MakeAny(args)...}); return *this; } diff --git a/toolchain/diagnostics/mocks.cpp b/toolchain/diagnostics/mocks.cpp index 9383c831d3e7..3be80e6bd234 100644 --- a/toolchain/diagnostics/mocks.cpp +++ b/toolchain/diagnostics/mocks.cpp @@ -19,6 +19,9 @@ void PrintTo(const Diagnostic& diagnostic, std::ostream* os) { void PrintTo(DiagnosticLevel level, std::ostream* os) { switch (level) { + case DiagnosticLevel::LocationInfo: + *os << "LocationInfo"; + break; case DiagnosticLevel::Note: *os << "Note"; break; diff --git a/toolchain/parse/testdata/packages/export.carbon b/toolchain/parse/testdata/packages/export.carbon index c79383fa5c51..6931cffc154b 100644 --- a/toolchain/parse/testdata/packages/export.carbon +++ b/toolchain/parse/testdata/packages/export.carbon @@ -111,7 +111,7 @@ export Foo; // CHECK:STDERR: fail_before_import.carbon:[[@LINE+7]]:1: error: `import` declarations must come after the `package` declaration (if present) and before any other entities in the file // CHECK:STDERR: import library "lib"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_before_import.carbon:[[@LINE-5]]:1: first declaration is here +// CHECK:STDERR: fail_before_import.carbon:[[@LINE-5]]:1: note: first declaration is here // CHECK:STDERR: export Foo; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: diff --git a/toolchain/parse/testdata/packages/import/export.carbon b/toolchain/parse/testdata/packages/import/export.carbon index e378e94b25da..b79a586936fb 100644 --- a/toolchain/parse/testdata/packages/import/export.carbon +++ b/toolchain/parse/testdata/packages/import/export.carbon @@ -41,7 +41,7 @@ class C; // CHECK:STDERR: fail_order.carbon:[[@LINE+7]]:1: error: `import` declarations must come after the `package` declaration (if present) and before any other entities in the file // CHECK:STDERR: export import library "b"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_order.carbon:[[@LINE-5]]:1: first declaration is here +// CHECK:STDERR: fail_order.carbon:[[@LINE-5]]:1: note: first declaration is here // CHECK:STDERR: class C; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: diff --git a/toolchain/parse/testdata/packages/import/fail_after_decl.carbon b/toolchain/parse/testdata/packages/import/fail_after_decl.carbon index ce1d3aaa28dc..16b79b8e28ee 100644 --- a/toolchain/parse/testdata/packages/import/fail_after_decl.carbon +++ b/toolchain/parse/testdata/packages/import/fail_after_decl.carbon @@ -13,7 +13,7 @@ fn A(); // CHECK:STDERR: fail_after_decl.carbon:[[@LINE+6]]:1: error: `import` declarations must come after the `package` declaration (if present) and before any other entities in the file // CHECK:STDERR: import B; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_after_decl.carbon:[[@LINE-5]]:1: first declaration is here +// CHECK:STDERR: fail_after_decl.carbon:[[@LINE-5]]:1: note: first declaration is here // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~ import B; diff --git a/toolchain/parse/testdata/packages/import/fail_after_decl_repeated.carbon b/toolchain/parse/testdata/packages/import/fail_after_decl_repeated.carbon index d192436c4be9..bd4b3418ce4b 100644 --- a/toolchain/parse/testdata/packages/import/fail_after_decl_repeated.carbon +++ b/toolchain/parse/testdata/packages/import/fail_after_decl_repeated.carbon @@ -13,7 +13,7 @@ fn A(); // CHECK:STDERR: fail_after_decl_repeated.carbon:[[@LINE+7]]:1: error: `import` declarations must come after the `package` declaration (if present) and before any other entities in the file // CHECK:STDERR: import B; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_after_decl_repeated.carbon:[[@LINE-5]]:1: first declaration is here +// CHECK:STDERR: fail_after_decl_repeated.carbon:[[@LINE-5]]:1: note: first declaration is here // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~ // CHECK:STDERR: @@ -24,7 +24,7 @@ import C; // CHECK:STDERR: fail_after_decl_repeated.carbon:[[@LINE+7]]:1: error: the `package` declaration must be the first non-comment line // CHECK:STDERR: package D; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_after_decl_repeated.carbon:[[@LINE-16]]:1: first non-comment line is here +// CHECK:STDERR: fail_after_decl_repeated.carbon:[[@LINE-16]]:1: note: first non-comment line is here // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~ // CHECK:STDERR: @@ -35,7 +35,7 @@ fn E(); // CHECK:STDERR: fail_after_decl_repeated.carbon:[[@LINE+6]]:1: error: `import` declarations must come after the `package` declaration (if present) and before any other entities in the file // CHECK:STDERR: import F; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_after_decl_repeated.carbon:[[@LINE-27]]:1: first declaration is here +// CHECK:STDERR: fail_after_decl_repeated.carbon:[[@LINE-27]]:1: note: first declaration is here // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~ import F; diff --git a/toolchain/parse/testdata/packages/library/fail_semi_before.carbon b/toolchain/parse/testdata/packages/library/fail_semi_before.carbon index 753dbbd08f8f..b7f070f681eb 100644 --- a/toolchain/parse/testdata/packages/library/fail_semi_before.carbon +++ b/toolchain/parse/testdata/packages/library/fail_semi_before.carbon @@ -13,7 +13,7 @@ // CHECK:STDERR: fail_semi_before.carbon:[[@LINE+6]]:1: error: the `library` declaration must be the first non-comment line // CHECK:STDERR: library "semi_before"; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_semi_before.carbon:[[@LINE-5]]:1: first non-comment line is here +// CHECK:STDERR: fail_semi_before.carbon:[[@LINE-5]]:1: note: first non-comment line is here // CHECK:STDERR: ; // CHECK:STDERR: ^ library "[[@TEST_NAME]]"; diff --git a/toolchain/parse/testdata/packages/library/fail_too_late.carbon b/toolchain/parse/testdata/packages/library/fail_too_late.carbon index 094f221a90b9..69b12c5c640a 100644 --- a/toolchain/parse/testdata/packages/library/fail_too_late.carbon +++ b/toolchain/parse/testdata/packages/library/fail_too_late.carbon @@ -13,7 +13,7 @@ import Geometry; // CHECK:STDERR: fail_too_late.carbon:[[@LINE+6]]:1: error: the `library` declaration must be the first non-comment line // CHECK:STDERR: library "too_late"; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_too_late.carbon:[[@LINE-5]]:1: first non-comment line is here +// CHECK:STDERR: fail_too_late.carbon:[[@LINE-5]]:1: note: first non-comment line is here // CHECK:STDERR: import Geometry; // CHECK:STDERR: ^~~~~~ library "[[@TEST_NAME]]"; diff --git a/toolchain/parse/testdata/packages/package/fail_after_decl.carbon b/toolchain/parse/testdata/packages/package/fail_after_decl.carbon index 68343815297c..6e4236cebe61 100644 --- a/toolchain/parse/testdata/packages/package/fail_after_decl.carbon +++ b/toolchain/parse/testdata/packages/package/fail_after_decl.carbon @@ -13,7 +13,7 @@ fn A(); // CHECK:STDERR: fail_after_decl.carbon:[[@LINE+6]]:1: error: the `package` declaration must be the first non-comment line // CHECK:STDERR: package B; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_after_decl.carbon:[[@LINE-5]]:1: first non-comment line is here +// CHECK:STDERR: fail_after_decl.carbon:[[@LINE-5]]:1: note: first non-comment line is here // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~ package B; diff --git a/toolchain/parse/testdata/packages/package/fail_after_import.carbon b/toolchain/parse/testdata/packages/package/fail_after_import.carbon index 3b4ad86497ab..13e0b9c7cba8 100644 --- a/toolchain/parse/testdata/packages/package/fail_after_import.carbon +++ b/toolchain/parse/testdata/packages/package/fail_after_import.carbon @@ -13,7 +13,7 @@ import A; // CHECK:STDERR: fail_after_import.carbon:[[@LINE+6]]:1: error: the `package` declaration must be the first non-comment line // CHECK:STDERR: package B; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_after_import.carbon:[[@LINE-5]]:1: first non-comment line is here +// CHECK:STDERR: fail_after_import.carbon:[[@LINE-5]]:1: note: first non-comment line is here // CHECK:STDERR: import A; // CHECK:STDERR: ^~~~~~ package B; diff --git a/toolchain/parse/testdata/packages/package/fail_after_package.carbon b/toolchain/parse/testdata/packages/package/fail_after_package.carbon index fa01df6048ab..12d82f718a0d 100644 --- a/toolchain/parse/testdata/packages/package/fail_after_package.carbon +++ b/toolchain/parse/testdata/packages/package/fail_after_package.carbon @@ -12,7 +12,7 @@ package A; // CHECK:STDERR: fail_after_package.carbon:[[@LINE+6]]:1: error: the `package` declaration must be the first non-comment line // CHECK:STDERR: package B; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_after_package.carbon:[[@LINE-4]]:1: first non-comment line is here +// CHECK:STDERR: fail_after_package.carbon:[[@LINE-4]]:1: note: first non-comment line is here // CHECK:STDERR: package A; // CHECK:STDERR: ^~~~~~~ package B; diff --git a/toolchain/parse/testdata/packages/package/fail_semi_before.carbon b/toolchain/parse/testdata/packages/package/fail_semi_before.carbon index b9a32e2036c7..38232a2d5cfd 100644 --- a/toolchain/parse/testdata/packages/package/fail_semi_before.carbon +++ b/toolchain/parse/testdata/packages/package/fail_semi_before.carbon @@ -13,7 +13,7 @@ // CHECK:STDERR: fail_semi_before.carbon:[[@LINE+6]]:1: error: the `package` declaration must be the first non-comment line // CHECK:STDERR: package Geometry; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_semi_before.carbon:[[@LINE-5]]:1: first non-comment line is here +// CHECK:STDERR: fail_semi_before.carbon:[[@LINE-5]]:1: note: first non-comment line is here // CHECK:STDERR: ; // CHECK:STDERR: ^ package Geometry;