Update basic diagnostic capitalization/punctuation (#4328)

This is a primarily automated change:

- Search & replace for capitalization
-
`(CARBON_DIAGNOSTIC\((?:\n\s+)?\w+,(?:\n\s+)?\s\w+,(?:\n\s+)?\s")([A-Z])`
    - `$1\L$2`
- Search & replace for period
-
`(CARBON_DIAGNOSTIC\((?:\n\s+)?\w+,(?:\n\s+)?\s\w+,(?:\n\s+)?\s"(?:[^)]|\n)+)\.("[,)])`
    - `$1$2`
- Limited search & replace for `ERROR: ` -> `error: ` in streamed things
- Leaving a TODO for command_line because there's more cleanup that can
be done there
- Modify diagnostic_consumer.cpp
    - ERROR -> error
    - WARNING -> warning

---------

Co-authored-by: Richard Smith <richard@metafoo.co.uk>
This commit is contained in:
Jon Ross-Perkins
2024-09-19 21:32:53 +00:00
committed by GitHub
co-authored by Richard Smith
parent 7f6d684b29
commit e7aebbe581
578 changed files with 2166 additions and 2173 deletions
+10 -10
View File
@@ -32,10 +32,10 @@ fn ExplicitAndAlsoDeduced(T:! type, x: T) -> T*;
// TODO: This should presumably be accepted. We shouldn't deduce values for parameters with explicitly-specified values.
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: 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: while deducing parameters of generic declared here
// CHECK:STDERR: fn ExplicitAndAlsoDeduced(T:! type, x: T) -> T*;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
@@ -59,10 +59,10 @@ library "[[@TEST_NAME]]";
fn TupleParam[T:! type](x: (T, i32));
fn CallTupleParam() {
// CHECK:STDERR: fail_todo_deduce_nested.carbon:[[@LINE+7]]:3: ERROR: Cannot deduce value for generic parameter `T`.
// 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: while deducing parameters of generic declared here
// CHECK:STDERR: fn TupleParam[T:! type](x: (T, i32));
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
@@ -72,10 +72,10 @@ fn CallTupleParam() {
fn StructParam[T:! type](x: {.a: T, .b: i32});
fn CallStructParam() {
// CHECK:STDERR: fail_todo_deduce_nested.carbon:[[@LINE+7]]:3: ERROR: Cannot deduce value for generic parameter `T`.
// 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: while deducing parameters of generic declared here
// CHECK:STDERR: fn StructParam[T:! type](x: {.a: T, .b: i32});
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
@@ -91,10 +91,10 @@ library "[[@TEST_NAME]]";
fn ImplicitNotDeducible[T:! type, U:! type](x: T) -> U;
fn CallImplicitNotDeducible() {
// CHECK:STDERR: fail_deduce_incomplete.carbon:[[@LINE+7]]:3: ERROR: Cannot deduce value for generic parameter `U`.
// 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: while deducing parameters of generic declared here
// CHECK:STDERR: fn ImplicitNotDeducible[T:! type, U:! type](x: T) -> U;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
@@ -108,10 +108,10 @@ library "[[@TEST_NAME]]";
fn ImplicitNotDeducible[T:! type](x: T, y: T) -> T;
fn CallImplicitNotDeducible() {
// CHECK:STDERR: fail_deduce_inconsistent.carbon:[[@LINE+6]]:3: ERROR: Inconsistent deductions for value of generic parameter `T`.
// 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: while deducing parameters of generic declared here
// CHECK:STDERR: fn ImplicitNotDeducible[T:! type](x: T, y: T) -> T;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ImplicitNotDeducible(42, {.x = 12});
@@ -8,7 +8,7 @@
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon
// CHECK:STDERR: fail_todo_param_in_type.carbon:[[@LINE+3]]:24: ERROR: Semantics TODO: `symbolic array bound`.
// CHECK:STDERR: fail_todo_param_in_type.carbon:[[@LINE+3]]:24: error: semantics TODO: `symbolic array bound`
// CHECK:STDERR: fn F(N:! i32, a: [i32; N]*);
// CHECK:STDERR: ^
fn F(N:! i32, a: [i32; N]*);
@@ -10,7 +10,7 @@
fn F(T:! type, U:! type) {
var p: T*;
// CHECK:STDERR: fail_type_param_mismatch.carbon:[[@LINE+3]]:3: ERROR: Package `Core` implicitly referenced here, but not found.
// CHECK:STDERR: fail_type_param_mismatch.carbon:[[@LINE+3]]:3: error: package `Core` implicitly referenced here, but not found
// CHECK:STDERR: let n: U = *p;
// CHECK:STDERR: ^~~~~~~~~~~~~~
let n: U = *p;
+12 -12
View File
@@ -24,18 +24,18 @@ library "[[@TEST_NAME]]";
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: 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: previously declared with return type `T*`
// CHECK:STDERR: fn F(T:! type, U:! type) -> T*;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
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: 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: calling function declared here
// CHECK:STDERR: fn F(T:! type, U:! type) -> T*;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
@@ -48,18 +48,18 @@ library "[[@TEST_NAME]]";
fn F(T:! type, U:! type) -> T*;
// CHECK:STDERR: fail_reorder.carbon:[[@LINE+7]]:6: ERROR: Redeclaration differs at parameter 1.
// 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: previous declaration's corresponding parameter here
// CHECK:STDERR: fn F(T:! type, U:! type) -> T*;
// CHECK:STDERR: ^
// CHECK:STDERR:
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: 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: calling function declared here
// CHECK:STDERR: fn F(T:! type, U:! type) -> T*;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
@@ -72,18 +72,18 @@ library "[[@TEST_NAME]]";
fn F(T:! type, U:! type) -> T*;
// CHECK:STDERR: fail_rename.carbon:[[@LINE+7]]:6: ERROR: Redeclaration differs at parameter 1.
// 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: previous declaration's corresponding parameter here
// CHECK:STDERR: fn F(T:! type, U:! type) -> T*;
// CHECK:STDERR: ^
// CHECK:STDERR:
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: 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: calling function declared here
// CHECK:STDERR: fn F(T:! type, U:! type) -> T*;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
return F(T);