Skip to content

Commit

Permalink
Support printing the diagnostic kind for verification. (#4425)
Browse files Browse the repository at this point in the history
This is to help identify which diagnostics we're actually using.

Note that driver/testdata still has tests which don't pass this flag,
and so continue to test the kind-less (default) behavior.
  • Loading branch information
jonmeow authored Oct 18, 2024
1 parent e395029 commit 62c36ec
Show file tree
Hide file tree
Showing 530 changed files with 1,951 additions and 1,931 deletions.
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: alias initializer must be a name reference
// CHECK:STDERR: fail_bool_value.carbon:[[@LINE+3]]:11: error(AliasRequiresNameRef): alias initializer must be a name reference
// 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: alias initializer must be a name reference
// CHECK:STDERR: fail_builtins.carbon:[[@LINE+4]]:11: error(AliasRequiresNameRef): alias initializer must be a name reference
// CHECK:STDERR: alias a = i32;
// CHECK:STDERR: ^~~
// CHECK:STDERR:
alias a = i32;

// CHECK:STDERR: fail_builtins.carbon:[[@LINE+3]]:11: error: alias initializer must be a name reference
// CHECK:STDERR: fail_builtins.carbon:[[@LINE+3]]:11: error(AliasRequiresNameRef): alias initializer must be a name reference
// 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: semantics TODO: `Control flow expressions are currently only supported inside functions.`
// CHECK:STDERR: fail_control_flow.carbon:[[@LINE+11]]:11: error(SemanticsTodo): semantics TODO: `Control flow expressions are currently only supported inside functions.`
// CHECK:STDERR: alias a = true or false;
// CHECK:STDERR: ^~~~~~~
// CHECK:STDERR:
// CHECK:STDERR: fail_control_flow.carbon:[[@LINE+7]]:11: error: semantics TODO: `Control flow expressions are currently only supported inside functions.`
// CHECK:STDERR: fail_control_flow.carbon:[[@LINE+7]]:11: error(SemanticsTodo): semantics TODO: `Control flow expressions are currently only supported inside functions.`
// CHECK:STDERR: alias a = true or false;
// CHECK:STDERR: ^~~~~~~~~~~~~
// CHECK:STDERR:
// CHECK:STDERR: fail_control_flow.carbon:[[@LINE+3]]:11: error: alias initializer must be a name reference
// CHECK:STDERR: fail_control_flow.carbon:[[@LINE+3]]:11: error(AliasRequiresNameRef): alias initializer must be a name reference
// 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: name `C` not found
// CHECK:STDERR: fail_orig_name_not_in_export.carbon:[[@LINE+3]]:8: error(NameNotFound): name `C` not found
// 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: package `Core` implicitly referenced here, but not found
// CHECK:STDERR: fail_aliased_name_in_diag.carbon:[[@LINE+3]]:1: error(CoreNotFound): package `Core` implicitly referenced here, but not found
// 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: name `NS` not found
// CHECK:STDERR: fail_local_in_namespace.carbon:[[@LINE+8]]:9: error(NameNotFound): name `NS` not found
// CHECK:STDERR: alias NS.a = {};
// CHECK:STDERR: ^~
// CHECK:STDERR:
// CHECK:STDERR: fail_local_in_namespace.carbon:[[@LINE+4]]:16: error: alias initializer must be a name reference
// CHECK:STDERR: fail_local_in_namespace.carbon:[[@LINE+4]]:16: error(AliasRequiresNameRef): alias initializer must be a name reference
// CHECK:STDERR: alias NS.a = {};
// CHECK:STDERR: ^~
// CHECK:STDERR:
alias NS.a = {};
// CHECK:STDERR: fail_local_in_namespace.carbon:[[@LINE+3]]:10: error: name `a` not found
// CHECK:STDERR: fail_local_in_namespace.carbon:[[@LINE+3]]:10: error(NameNotFound): name `a` not found
// 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: `abstract` not allowed on `alias` declaration
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+25]]:1: error(ModifierNotAllowedOnDeclaration): `abstract` not allowed on `alias` declaration
// CHECK:STDERR: abstract base default final alias A = Class;
// CHECK:STDERR: ^~~~~~~~
// CHECK:STDERR:
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+21]]:10: error: `base` not allowed on declaration with `abstract`
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+21]]:10: error(ModifierNotAllowedWith): `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: note: `abstract` previously appeared here
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+18]]:1: note(ModifierPrevious): `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: fail_modifiers.carbon:[[@LINE+14]]:15: error(ModifierNotAllowedWith): `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: note: `abstract` previously appeared here
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: note(ModifierPrevious): `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: fail_modifiers.carbon:[[@LINE+7]]:23: error(ModifierNotAllowedWith): `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: note: `abstract` previously appeared here
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note(ModifierPrevious): `abstract` previously appeared here
// 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: `impl` not allowed on `alias` declaration
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error(ModifierNotAllowedOnDeclaration): `impl` not allowed on `alias` declaration
// CHECK:STDERR: impl alias B = Class;
// CHECK:STDERR: ^~~~
// CHECK:STDERR:
impl alias B = Class;

// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: error: `extern` not allowed on `alias` declaration
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: error(ModifierNotAllowedOnDeclaration): `extern` not allowed on `alias` declaration
// 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: duplicate name being declared in the same scope
// CHECK:STDERR: fail_name_conflict.carbon:[[@LINE+7]]:5: error(NameDeclDuplicate): duplicate name being declared in the same scope
// CHECK:STDERR: var a: C = {};
// CHECK:STDERR: ^
// CHECK:STDERR: fail_name_conflict.carbon:[[@LINE-4]]:7: note: name is previously declared here
// CHECK:STDERR: fail_name_conflict.carbon:[[@LINE-4]]:7: note(NameDeclPrevious): name is previously declared here
// 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: duplicate name being declared in the same scope
// CHECK:STDERR: fail_name_conflict.carbon:[[@LINE+6]]:7: error(NameDeclDuplicate): duplicate name being declared in the same scope
// CHECK:STDERR: alias b = C;
// CHECK:STDERR: ^
// CHECK:STDERR: fail_name_conflict.carbon:[[@LINE-4]]:5: note: name is previously declared here
// CHECK:STDERR: fail_name_conflict.carbon:[[@LINE-4]]:5: note(NameDeclPrevious): name is previously declared here
// 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: alias initializer must be a name reference
// CHECK:STDERR: fail_not_constant.carbon:[[@LINE+3]]:13: error(AliasRequiresNameRef): alias initializer must be a name reference
// 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: `alias` declaration cannot have parameters
// CHECK:STDERR: fail_params.carbon:[[@LINE+7]]:8: error(UnexpectedDeclNameParams): `alias` declaration cannot have parameters
// CHECK:STDERR: alias A(T:! type) = T*;
// CHECK:STDERR: ^~~~~~~~~~
// CHECK:STDERR:
// CHECK:STDERR: fail_params.carbon:[[@LINE+3]]:21: error: alias initializer must be a name reference
// CHECK:STDERR: fail_params.carbon:[[@LINE+3]]:21: error(AliasRequiresNameRef): alias initializer must be a name reference
// 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: in import
// CHECK:STDERR: var2.carbon:8:5: error: semantics TODO: `Non-constant ImportRefLoaded (comes up with var)`
// 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: 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: name `A` not found
// CHECK:STDERR: fail_local_def.carbon:[[@LINE+4]]:11: error(NameNotFound): name `A` not found
// 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: name `A` not found
// CHECK:STDERR: fail_other_def.carbon:[[@LINE+3]]:11: error(NameNotFound): name `A` not found
// 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: array bound of -1 is negative
// CHECK:STDERR: fail_bound_negative.carbon:[[@LINE+3]]:14: error(ArrayBoundNegative): array bound of -1 is negative
// 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: integer literal with value 39999999999999999993 does not fit in i32
// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+4]]:14: error(IntLiteralTooLargeForI32): integer literal with value 39999999999999999993 does not fit in i32
// CHECK:STDERR: var a: [i32; 39999999999999999993];
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
var a: [i32; 39999999999999999993];

// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+10]]:9: error: cannot implicitly convert from `i32` to `type`
// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+10]]:9: error(ImplicitAsConversionFailure): cannot implicitly convert from `i32` to `type`
// CHECK:STDERR: var b: [1; 39999999999999999993];
// CHECK:STDERR: ^
// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+7]]:9: note: type `i32` does not implement interface `ImplicitAs`
// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+7]]:9: note(MissingImplInMemberAccessNote): type `i32` does not implement interface `ImplicitAs`
// CHECK:STDERR: var b: [1; 39999999999999999993];
// CHECK:STDERR: ^
// CHECK:STDERR:
// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+3]]:12: error: integer literal with value 39999999999999999993 does not fit in i32
// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+3]]:12: error(IntLiteralTooLargeForI32): integer literal with value 39999999999999999993 does not fit in i32
// 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: variable has incomplete type `[Incomplete; 1]`
// CHECK:STDERR: fail_incomplete_element.carbon:[[@LINE+6]]:8: error(IncompleteTypeInVarDecl): variable has incomplete type `[Incomplete; 1]`
// CHECK:STDERR: var a: [Incomplete; 1];
// CHECK:STDERR: ^~~~~~~~~~~~~~~
// CHECK:STDERR: fail_incomplete_element.carbon:[[@LINE-5]]:1: note: class was forward declared here
// CHECK:STDERR: fail_incomplete_element.carbon:[[@LINE-5]]:1: note(ClassForwardDeclaredHere): class was forward declared here
// 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: cannot implicitly convert from `i32` to `type`
// CHECK:STDERR: fail_invalid_type.carbon:[[@LINE+6]]:9: error(ImplicitAsConversionFailure): cannot implicitly convert from `i32` to `type`
// CHECK:STDERR: var a: [1; 1];
// CHECK:STDERR: ^
// CHECK:STDERR: fail_invalid_type.carbon:[[@LINE+3]]:9: note: type `i32` does not implement interface `ImplicitAs`
// CHECK:STDERR: fail_invalid_type.carbon:[[@LINE+3]]:9: note(MissingImplInMemberAccessNote): type `i32` does not implement interface `ImplicitAs`
// 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: cannot initialize array of 1 element from 3 initializers
// CHECK:STDERR: fail_out_of_bound.carbon:[[@LINE+3]]:19: error(ArrayInitFromLiteralArgCountMismatch): cannot initialize array of 1 element from 3 initializers
// 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: array index `3` is past the end of type `[i32; 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: 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: cannot implicitly convert from `String` to `i32`
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+7]]:19: error(ImplicitAsConversionFailure): 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: note: type `String` does not implement interface `ImplicitAs`
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:19: note(MissingImplInMemberAccessNote): type `String` does not implement interface `ImplicitAs`
// 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: cannot implicitly convert from `String` to `i32`
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+7]]:19: error(ImplicitAsConversionFailure): 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: note: type `String` does not implement interface `ImplicitAs`
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:19: note(MissingImplInMemberAccessNote): type `String` does not implement interface `ImplicitAs`
// 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: cannot initialize array of 3 elements from 2 initializers
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:19: error(ArrayInitFromLiteralArgCountMismatch): cannot initialize array of 3 elements from 2 initializers
// 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: cannot initialize array of 3 elements from tuple with 2 elements
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:19: error(ArrayInitFromExprArgCountMismatch): cannot initialize array of 3 elements from tuple with 2 elements
// CHECK:STDERR: var d: [i32; 3] = t2;
// CHECK:STDERR: ^~
var d: [i32; 3] = t2;
Expand Down
2 changes: 1 addition & 1 deletion toolchain/check/testdata/array/fail_undefined_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_undefined_bound.carbon

// CHECK:STDERR: fail_undefined_bound.carbon:[[@LINE+3]]:8: error: semantics TODO: `HandleArrayExprWithoutBounds`
// CHECK:STDERR: fail_undefined_bound.carbon:[[@LINE+3]]:8: error(SemanticsTodo): semantics TODO: `HandleArrayExprWithoutBounds`
// CHECK:STDERR: var a: [i32; ];
// CHECK:STDERR: ^~~~~~~
var a: [i32; ];
Expand Down
Loading

0 comments on commit 62c36ec

Please sign in to comment.