Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move diagnostic kind name to the end of the diagnostic. #4437

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion toolchain/check/testdata/alias/fail_bool_value.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/alias/fail_bool_value.carbon

// CHECK:STDERR: fail_bool_value.carbon:[[@LINE+3]]:11: error(AliasRequiresNameRef): alias initializer must be a name reference
// CHECK:STDERR: fail_bool_value.carbon:[[@LINE+3]]:11: error: alias initializer must be a name reference [AliasRequiresNameRef]
// CHECK:STDERR: alias a = false;
// CHECK:STDERR: ^~~~~
alias a = false;
Expand Down
4 changes: 2 additions & 2 deletions toolchain/check/testdata/alias/fail_builtins.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/alias/fail_builtins.carbon

// CHECK:STDERR: fail_builtins.carbon:[[@LINE+4]]:11: error(AliasRequiresNameRef): alias initializer must be a name reference
// CHECK:STDERR: fail_builtins.carbon:[[@LINE+4]]:11: error: alias initializer must be a name reference [AliasRequiresNameRef]
// CHECK:STDERR: alias a = i32;
// CHECK:STDERR: ^~~
// CHECK:STDERR:
alias a = i32;

// CHECK:STDERR: fail_builtins.carbon:[[@LINE+3]]:11: error(AliasRequiresNameRef): alias initializer must be a name reference
// CHECK:STDERR: fail_builtins.carbon:[[@LINE+3]]:11: error: alias initializer must be a name reference [AliasRequiresNameRef]
// CHECK:STDERR: alias b = bool;
// CHECK:STDERR: ^~~~
alias b = bool;
Expand Down
6 changes: 3 additions & 3 deletions toolchain/check/testdata/alias/fail_control_flow.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/alias/fail_control_flow.carbon

// CHECK:STDERR: fail_control_flow.carbon:[[@LINE+11]]:11: error(SemanticsTodo): semantics TODO: `Control flow expressions are currently only supported inside functions.`
// CHECK:STDERR: fail_control_flow.carbon:[[@LINE+11]]:11: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo]
// CHECK:STDERR: alias a = true or false;
// CHECK:STDERR: ^~~~~~~
// CHECK:STDERR:
// CHECK:STDERR: fail_control_flow.carbon:[[@LINE+7]]:11: error(SemanticsTodo): semantics TODO: `Control flow expressions are currently only supported inside functions.`
// CHECK:STDERR: fail_control_flow.carbon:[[@LINE+7]]:11: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo]
// CHECK:STDERR: alias a = true or false;
// CHECK:STDERR: ^~~~~~~~~~~~~
// CHECK:STDERR:
// CHECK:STDERR: fail_control_flow.carbon:[[@LINE+3]]:11: error(AliasRequiresNameRef): alias initializer must be a name reference
// CHECK:STDERR: fail_control_flow.carbon:[[@LINE+3]]:11: error: alias initializer must be a name reference [AliasRequiresNameRef]
// CHECK:STDERR: alias a = true or false;
// CHECK:STDERR: ^~~~~~~~~~~~~
alias a = true or false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ library "[[@TEST_NAME]]";

import library "export";

// CHECK:STDERR: fail_orig_name_not_in_export.carbon:[[@LINE+3]]:8: error(NameNotFound): name `C` not found
// CHECK:STDERR: fail_orig_name_not_in_export.carbon:[[@LINE+3]]:8: error: name `C` not found [NameNotFound]
// CHECK:STDERR: var c: C = {};
// CHECK:STDERR: ^
var c: C = {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class D {}
alias c = C;
var d: D = {};

// CHECK:STDERR: fail_aliased_name_in_diag.carbon:[[@LINE+3]]:1: error(CoreNotFound): package `Core` implicitly referenced here, but not found
// CHECK:STDERR: fail_aliased_name_in_diag.carbon:[[@LINE+3]]:1: error: package `Core` implicitly referenced here, but not found [CoreNotFound]
// CHECK:STDERR: let c_var: c = d;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
let c_var: c = d;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
namespace NS;

fn F() -> {} {
// CHECK:STDERR: fail_local_in_namespace.carbon:[[@LINE+8]]:9: error(NameNotFound): name `NS` not found
// CHECK:STDERR: fail_local_in_namespace.carbon:[[@LINE+8]]:9: error: name `NS` not found [NameNotFound]
// CHECK:STDERR: alias NS.a = {};
// CHECK:STDERR: ^~
// CHECK:STDERR:
// CHECK:STDERR: fail_local_in_namespace.carbon:[[@LINE+4]]:16: error(AliasRequiresNameRef): alias initializer must be a name reference
// CHECK:STDERR: fail_local_in_namespace.carbon:[[@LINE+4]]:16: error: alias initializer must be a name reference [AliasRequiresNameRef]
// CHECK:STDERR: alias NS.a = {};
// CHECK:STDERR: ^~
// CHECK:STDERR:
alias NS.a = {};
// CHECK:STDERR: fail_local_in_namespace.carbon:[[@LINE+3]]:10: error(NameNotFound): name `a` not found
// CHECK:STDERR: fail_local_in_namespace.carbon:[[@LINE+3]]:10: error: name `a` not found [NameNotFound]
// CHECK:STDERR: return NS.a;
// CHECK:STDERR: ^~~~
return NS.a;
Expand Down
18 changes: 9 additions & 9 deletions toolchain/check/testdata/alias/no_prelude/fail_modifiers.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,40 @@

class Class {}

// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+25]]:1: error(ModifierNotAllowedOnDeclaration): `abstract` not allowed on `alias` declaration
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+25]]:1: error: `abstract` not allowed on `alias` declaration [ModifierNotAllowedOnDeclaration]
// CHECK:STDERR: abstract base default final alias A = Class;
// CHECK:STDERR: ^~~~~~~~
// CHECK:STDERR:
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+21]]:10: error(ModifierNotAllowedWith): `base` not allowed on declaration with `abstract`
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+21]]:10: error: `base` not allowed on declaration with `abstract` [ModifierNotAllowedWith]
// CHECK:STDERR: abstract base default final alias A = Class;
// CHECK:STDERR: ^~~~
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+18]]:1: note(ModifierPrevious): `abstract` previously appeared here
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+18]]:1: note: `abstract` previously appeared here [ModifierPrevious]
// CHECK:STDERR: abstract base default final alias A = Class;
// CHECK:STDERR: ^~~~~~~~
// CHECK:STDERR:
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+14]]:15: error(ModifierNotAllowedWith): `default` not allowed on declaration with `abstract`
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+14]]:15: error: `default` not allowed on declaration with `abstract` [ModifierNotAllowedWith]
// CHECK:STDERR: abstract base default final alias A = Class;
// CHECK:STDERR: ^~~~~~~
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: note(ModifierPrevious): `abstract` previously appeared here
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: note: `abstract` previously appeared here [ModifierPrevious]
// CHECK:STDERR: abstract base default final alias A = Class;
// CHECK:STDERR: ^~~~~~~~
// CHECK:STDERR:
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:23: error(ModifierNotAllowedWith): `final` not allowed on declaration with `abstract`
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:23: error: `final` not allowed on declaration with `abstract` [ModifierNotAllowedWith]
// CHECK:STDERR: abstract base default final alias A = Class;
// CHECK:STDERR: ^~~~~
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note(ModifierPrevious): `abstract` previously appeared here
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note: `abstract` previously appeared here [ModifierPrevious]
// CHECK:STDERR: abstract base default final alias A = Class;
// CHECK:STDERR: ^~~~~~~~
// CHECK:STDERR:
abstract base default final alias A = Class;

// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error(ModifierNotAllowedOnDeclaration): `impl` not allowed on `alias` declaration
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `impl` not allowed on `alias` declaration [ModifierNotAllowedOnDeclaration]
// CHECK:STDERR: impl alias B = Class;
// CHECK:STDERR: ^~~~
// CHECK:STDERR:
impl alias B = Class;

// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: error(ModifierNotAllowedOnDeclaration): `extern` not allowed on `alias` declaration
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: error: `extern` not allowed on `alias` declaration [ModifierNotAllowedOnDeclaration]
// CHECK:STDERR: extern alias C = Class;
// CHECK:STDERR: ^~~~~~
extern alias C = Class;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@
class C {}

alias a = C;
// CHECK:STDERR: fail_name_conflict.carbon:[[@LINE+7]]:5: error(NameDeclDuplicate): duplicate name being declared in the same scope
// CHECK:STDERR: fail_name_conflict.carbon:[[@LINE+7]]:5: error: duplicate name being declared in the same scope [NameDeclDuplicate]
// CHECK:STDERR: var a: C = {};
// CHECK:STDERR: ^
// CHECK:STDERR: fail_name_conflict.carbon:[[@LINE-4]]:7: note(NameDeclPrevious): name is previously declared here
// CHECK:STDERR: fail_name_conflict.carbon:[[@LINE-4]]:7: note: name is previously declared here [NameDeclPrevious]
// CHECK:STDERR: alias a = C;
// CHECK:STDERR: ^
// CHECK:STDERR:
var a: C = {};

var b: C = {};
// CHECK:STDERR: fail_name_conflict.carbon:[[@LINE+6]]:7: error(NameDeclDuplicate): duplicate name being declared in the same scope
// CHECK:STDERR: fail_name_conflict.carbon:[[@LINE+6]]:7: error: duplicate name being declared in the same scope [NameDeclDuplicate]
// CHECK:STDERR: alias b = C;
// CHECK:STDERR: ^
// CHECK:STDERR: fail_name_conflict.carbon:[[@LINE-4]]:5: note(NameDeclPrevious): name is previously declared here
// CHECK:STDERR: fail_name_conflict.carbon:[[@LINE-4]]:5: note: name is previously declared here [NameDeclPrevious]
// CHECK:STDERR: var b: C = {};
// CHECK:STDERR: ^
alias b = C;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
fn F() {
var a: () = ();
var b: ()* = &a;
// CHECK:STDERR: fail_not_constant.carbon:[[@LINE+3]]:13: error(AliasRequiresNameRef): alias initializer must be a name reference
// CHECK:STDERR: fail_not_constant.carbon:[[@LINE+3]]:13: error: alias initializer must be a name reference [AliasRequiresNameRef]
// CHECK:STDERR: alias c = *b;
// CHECK:STDERR: ^~
alias c = *b;
Expand Down
4 changes: 2 additions & 2 deletions toolchain/check/testdata/alias/no_prelude/fail_params.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/alias/no_prelude/fail_params.carbon

// CHECK:STDERR: fail_params.carbon:[[@LINE+7]]:8: error(UnexpectedDeclNameParams): `alias` declaration cannot have parameters
// CHECK:STDERR: fail_params.carbon:[[@LINE+7]]:8: error: `alias` declaration cannot have parameters [UnexpectedDeclNameParams]
// CHECK:STDERR: alias A(T:! type) = T*;
// CHECK:STDERR: ^~~~~~~~~~
// CHECK:STDERR:
// CHECK:STDERR: fail_params.carbon:[[@LINE+3]]:21: error(AliasRequiresNameRef): alias initializer must be a name reference
// CHECK:STDERR: fail_params.carbon:[[@LINE+3]]:21: error: alias initializer must be a name reference [AliasRequiresNameRef]
// CHECK:STDERR: alias A(T:! type) = T*;
// CHECK:STDERR: ^~
alias A(T:! type) = T*;
Expand Down
4 changes: 2 additions & 2 deletions toolchain/check/testdata/alias/no_prelude/import.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ var b: () = a_alias;

library "[[@TEST_NAME]]";

// CHECK:STDERR: fail_var3.carbon:[[@LINE+4]]:1(InImport): in import
// CHECK:STDERR: var2.carbon:8:5: error(SemanticsTodo): semantics TODO: `Non-constant ImportRefLoaded (comes up with var)`
// CHECK:STDERR: fail_var3.carbon:[[@LINE+4]]:1: in import [InImport]
// CHECK:STDERR: var2.carbon:8:5: error: semantics TODO: `Non-constant ImportRefLoaded (comes up with var)` [SemanticsTodo]
// CHECK:STDERR: var b: () = a_alias;
// CHECK:STDERR: ^
import library "var2";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ package Test library "[[@TEST_NAME]]";

import library "def";

// CHECK:STDERR: fail_local_def.carbon:[[@LINE+4]]:11: error(NameNotFound): name `A` not found
// CHECK:STDERR: fail_local_def.carbon:[[@LINE+4]]:11: error: name `A` not found [NameNotFound]
// CHECK:STDERR: var inst: A = {};
// CHECK:STDERR: ^
// CHECK:STDERR:
Expand All @@ -47,7 +47,7 @@ package Other library "[[@TEST_NAME]]";

import Test library "def";

// CHECK:STDERR: fail_other_def.carbon:[[@LINE+3]]:11: error(NameNotFound): name `A` not found
// CHECK:STDERR: fail_other_def.carbon:[[@LINE+3]]:11: error: name `A` not found [NameNotFound]
// CHECK:STDERR: var inst: Test.A = {};
// CHECK:STDERR: ^~~~~~
var inst: Test.A = {};
Expand Down
2 changes: 1 addition & 1 deletion toolchain/check/testdata/array/fail_bound_negative.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

fn Negate(n: i32) -> i32 = "int.snegate";

// CHECK:STDERR: fail_bound_negative.carbon:[[@LINE+3]]:14: error(ArrayBoundNegative): array bound of -1 is negative
// CHECK:STDERR: fail_bound_negative.carbon:[[@LINE+3]]:14: error: array bound of -1 is negative [ArrayBoundNegative]
// CHECK:STDERR: var a: [i32; Negate(1)];
// CHECK:STDERR: ^~~~~~~
var a: [i32; Negate(1)];
Expand Down
8 changes: 4 additions & 4 deletions toolchain/check/testdata/array/fail_bound_overflow.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@
// TODO: Once we preserve the full value of integer literals in SemIR, check
// that we reject the array bound being too large.

// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+4]]:14: error(IntLiteralTooLargeForI32): integer literal with value 39999999999999999993 does not fit in i32
// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+4]]:14: error: integer literal with value 39999999999999999993 does not fit in i32 [IntLiteralTooLargeForI32]
// CHECK:STDERR: var a: [i32; 39999999999999999993];
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
var a: [i32; 39999999999999999993];

// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+10]]:9: error(ImplicitAsConversionFailure): cannot implicitly convert from `i32` to `type`
// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+10]]:9: error: cannot implicitly convert from `i32` to `type` [ImplicitAsConversionFailure]
// CHECK:STDERR: var b: [1; 39999999999999999993];
// CHECK:STDERR: ^
// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+7]]:9: note(MissingImplInMemberAccessNote): type `i32` does not implement interface `ImplicitAs`
// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+7]]:9: note: type `i32` does not implement interface `ImplicitAs` [MissingImplInMemberAccessNote]
// CHECK:STDERR: var b: [1; 39999999999999999993];
// CHECK:STDERR: ^
// CHECK:STDERR:
// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+3]]:12: error(IntLiteralTooLargeForI32): integer literal with value 39999999999999999993 does not fit in i32
// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+3]]:12: error: integer literal with value 39999999999999999993 does not fit in i32 [IntLiteralTooLargeForI32]
// CHECK:STDERR: var b: [1; 39999999999999999993];
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
var b: [1; 39999999999999999993];
Expand Down
4 changes: 2 additions & 2 deletions toolchain/check/testdata/array/fail_incomplete_element.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@

class Incomplete;

// CHECK:STDERR: fail_incomplete_element.carbon:[[@LINE+6]]:8: error(IncompleteTypeInVarDecl): variable has incomplete type `[Incomplete; 1]`
// CHECK:STDERR: fail_incomplete_element.carbon:[[@LINE+6]]:8: error: variable has incomplete type `[Incomplete; 1]` [IncompleteTypeInVarDecl]
// CHECK:STDERR: var a: [Incomplete; 1];
// CHECK:STDERR: ^~~~~~~~~~~~~~~
// CHECK:STDERR: fail_incomplete_element.carbon:[[@LINE-5]]:1: note(ClassForwardDeclaredHere): class was forward declared here
// CHECK:STDERR: fail_incomplete_element.carbon:[[@LINE-5]]:1: note: class was forward declared here [ClassForwardDeclaredHere]
// CHECK:STDERR: class Incomplete;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
var a: [Incomplete; 1];
Expand Down
4 changes: 2 additions & 2 deletions toolchain/check/testdata/array/fail_invalid_type.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/array/fail_invalid_type.carbon

// CHECK:STDERR: fail_invalid_type.carbon:[[@LINE+6]]:9: error(ImplicitAsConversionFailure): cannot implicitly convert from `i32` to `type`
// CHECK:STDERR: fail_invalid_type.carbon:[[@LINE+6]]:9: error: cannot implicitly convert from `i32` to `type` [ImplicitAsConversionFailure]
// CHECK:STDERR: var a: [1; 1];
// CHECK:STDERR: ^
// CHECK:STDERR: fail_invalid_type.carbon:[[@LINE+3]]:9: note(MissingImplInMemberAccessNote): type `i32` does not implement interface `ImplicitAs`
// CHECK:STDERR: fail_invalid_type.carbon:[[@LINE+3]]:9: note: type `i32` does not implement interface `ImplicitAs` [MissingImplInMemberAccessNote]
// CHECK:STDERR: var a: [1; 1];
// CHECK:STDERR: ^
var a: [1; 1];
Expand Down
2 changes: 1 addition & 1 deletion toolchain/check/testdata/array/fail_out_of_bound.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/array/fail_out_of_bound.carbon

// CHECK:STDERR: fail_out_of_bound.carbon:[[@LINE+3]]:19: error(ArrayInitFromLiteralArgCountMismatch): cannot initialize array of 1 element from 3 initializers
// CHECK:STDERR: fail_out_of_bound.carbon:[[@LINE+3]]:19: error: cannot initialize array of 1 element from 3 initializers [ArrayInitFromLiteralArgCountMismatch]
// CHECK:STDERR: var a: [i32; 1] = (1, 2, 3);
// CHECK:STDERR: ^~~~~~~~~
var a: [i32; 1] = (1, 2, 3);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon

var a: [i32; 3] = (1, 2, 3);
// CHECK:STDERR: fail_out_of_bound_non_literal.carbon:[[@LINE+3]]:16: error(ArrayIndexOutOfBounds): array index `3` is past the end of type `[i32; 3]`
// CHECK:STDERR: fail_out_of_bound_non_literal.carbon:[[@LINE+3]]:16: error: array index `3` is past the end of type `[i32; 3]` [ArrayIndexOutOfBounds]
// CHECK:STDERR: var b: i32 = a[{.index = 3}.index];
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~
var b: i32 = a[{.index = 3}.index];
Expand Down
12 changes: 6 additions & 6 deletions toolchain/check/testdata/array/fail_type_mismatch.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,33 @@
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/array/fail_type_mismatch.carbon

// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+7]]:19: error(ImplicitAsConversionFailure): cannot implicitly convert from `String` to `i32`
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+7]]:19: error: cannot implicitly convert from `String` to `i32` [ImplicitAsConversionFailure]
// CHECK:STDERR: var a: [i32; 3] = (1, "Hello", "World");
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:19: note(MissingImplInMemberAccessNote): type `String` does not implement interface `ImplicitAs`
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:19: note: type `String` does not implement interface `ImplicitAs` [MissingImplInMemberAccessNote]
// CHECK:STDERR: var a: [i32; 3] = (1, "Hello", "World");
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
var a: [i32; 3] = (1, "Hello", "World");

var t1: (i32, String, String);
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+7]]:19: error(ImplicitAsConversionFailure): cannot implicitly convert from `String` to `i32`
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+7]]:19: error: cannot implicitly convert from `String` to `i32` [ImplicitAsConversionFailure]
// CHECK:STDERR: var b: [i32; 3] = t1;
// CHECK:STDERR: ^~
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:19: note(MissingImplInMemberAccessNote): type `String` does not implement interface `ImplicitAs`
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:19: note: type `String` does not implement interface `ImplicitAs` [MissingImplInMemberAccessNote]
// CHECK:STDERR: var b: [i32; 3] = t1;
// CHECK:STDERR: ^~
// CHECK:STDERR:
var b: [i32; 3] = t1;

// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:19: error(ArrayInitFromLiteralArgCountMismatch): cannot initialize array of 3 elements from 2 initializers
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:19: error: cannot initialize array of 3 elements from 2 initializers [ArrayInitFromLiteralArgCountMismatch]
// CHECK:STDERR: var c: [i32; 3] = (1, 2);
// CHECK:STDERR: ^~~~~~
// CHECK:STDERR:
var c: [i32; 3] = (1, 2);

var t2: (i32, i32);
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:19: error(ArrayInitFromExprArgCountMismatch): cannot initialize array of 3 elements from tuple with 2 elements
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:19: error: cannot initialize array of 3 elements from tuple with 2 elements [ArrayInitFromExprArgCountMismatch]
// CHECK:STDERR: var d: [i32; 3] = t2;
// CHECK:STDERR: ^~
var d: [i32; 3] = t2;
Expand Down
Loading
Loading