mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
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:
co-authored by
Richard Smith
parent
7f6d684b29
commit
e7aebbe581
+15
-15
@@ -47,24 +47,24 @@ 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+10]]: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: 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: 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+10]]: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: 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: fns.carbon:5:1: previously declared here
|
||||
// CHECK:STDERR: fn B(b: i32) -> i32 { return b; }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -76,25 +76,25 @@ 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+10]]: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: 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: 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+10]]: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: 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: extern.carbon:4:1: previously declared here
|
||||
// CHECK:STDERR: extern fn A();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -106,13 +106,13 @@ 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+9]]: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: 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: previously declared here
|
||||
// CHECK:STDERR: fn D();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
extern fn D();
|
||||
|
||||
@@ -48,7 +48,7 @@ package Test library "[[@TEST_NAME]]";
|
||||
|
||||
import library "def";
|
||||
|
||||
// CHECK:STDERR: fail_local_def.carbon:[[@LINE+4]]:13: ERROR: Name `Def` not found.
|
||||
// CHECK:STDERR: fail_local_def.carbon:[[@LINE+4]]:13: error: name `Def` not found
|
||||
// CHECK:STDERR: var f: () = Def();
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR:
|
||||
@@ -60,7 +60,7 @@ package Other library "[[@TEST_NAME]]";
|
||||
|
||||
import Test library "def";
|
||||
|
||||
// CHECK:STDERR: fail_other_def.carbon:[[@LINE+4]]:13: ERROR: Name `Def` not found.
|
||||
// CHECK:STDERR: fail_other_def.carbon:[[@LINE+4]]:13: error: name `Def` not found
|
||||
// CHECK:STDERR: var f: () = Test.Def();
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -78,7 +78,7 @@ package Test library "[[@TEST_NAME]]";
|
||||
|
||||
import library "forward_with_def";
|
||||
|
||||
// CHECK:STDERR: fail_local_forward_with_def.carbon:[[@LINE+4]]:13: ERROR: Name `ForwardWithDef` not found.
|
||||
// CHECK:STDERR: fail_local_forward_with_def.carbon:[[@LINE+4]]:13: error: name `ForwardWithDef` not found
|
||||
// CHECK:STDERR: var f: () = ForwardWithDef();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -90,7 +90,7 @@ package Other library "[[@TEST_NAME]]";
|
||||
|
||||
import Test library "forward_with_def";
|
||||
|
||||
// CHECK:STDERR: fail_other_forward_with_def.carbon:[[@LINE+4]]:13: ERROR: Name `ForwardWithDef` not found.
|
||||
// CHECK:STDERR: fail_other_forward_with_def.carbon:[[@LINE+4]]:13: error: name `ForwardWithDef` not found
|
||||
// CHECK:STDERR: var f: () = Test.ForwardWithDef();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -110,7 +110,7 @@ package Test library "[[@TEST_NAME]]";
|
||||
|
||||
import library "forward";
|
||||
|
||||
// CHECK:STDERR: fail_local_forward.carbon:[[@LINE+4]]:13: ERROR: Name `Forward` not found.
|
||||
// CHECK:STDERR: fail_local_forward.carbon:[[@LINE+4]]:13: error: name `Forward` not found
|
||||
// CHECK:STDERR: var f: () = Forward();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -122,7 +122,7 @@ package Other library "[[@TEST_NAME]]";
|
||||
|
||||
import Test library "forward";
|
||||
|
||||
// CHECK:STDERR: fail_other_forward.carbon:[[@LINE+3]]:13: ERROR: Name `Forward` not found.
|
||||
// CHECK:STDERR: fail_other_forward.carbon:[[@LINE+3]]:13: error: name `Forward` not found
|
||||
// CHECK:STDERR: var f: () = Test.Forward();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~
|
||||
var f: () = Test.Forward();
|
||||
|
||||
@@ -38,10 +38,10 @@ extern fn F() {}
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
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: 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: previously declared here
|
||||
// CHECK:STDERR: extern fn F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -52,10 +52,10 @@ fn F() {}
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
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: 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: previously declared here
|
||||
// CHECK:STDERR: fn F();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -66,18 +66,18 @@ extern fn F() {}
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
extern fn F();
|
||||
// CHECK:STDERR: fail_extern_diag_suppressed.carbon:[[@LINE+7]]:1: ERROR: Redeclaration of `fn F` is redundant.
|
||||
// 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: previously declared here
|
||||
// CHECK:STDERR: extern fn F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
fn F();
|
||||
// CHECK:STDERR: fail_extern_diag_suppressed.carbon:[[@LINE+7]]:1: ERROR: Redeclarations of `fn F` must match use of `extern`.
|
||||
// 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: previously declared here
|
||||
// CHECK:STDERR: extern fn F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -88,10 +88,10 @@ fn F() {}
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn F() {}
|
||||
// CHECK:STDERR: fail_extern_decl_after_def.carbon:[[@LINE+7]]:1: ERROR: Redeclaration of `fn F` is redundant.
|
||||
// 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: previously declared here
|
||||
// CHECK:STDERR: fn F() {}
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -105,7 +105,7 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_in_impl.impl.carbon:[[@LINE+3]]:1: ERROR: `extern` entities must have a declaration in the API file.
|
||||
// CHECK:STDERR: fail_in_impl.impl.carbon:[[@LINE+3]]:1: error: `extern` entities must have a declaration in the API file
|
||||
// CHECK:STDERR: extern fn F() {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
extern fn F() {}
|
||||
|
||||
+5
-5
@@ -54,13 +54,13 @@ 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+10]]: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: 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: previously declared here
|
||||
// CHECK:STDERR: extern fn F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -82,7 +82,7 @@ import library "indirect_two_file_extern";
|
||||
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_indirect_two_file.impl.carbon:[[@LINE+4]]:1: ERROR: `extern` entities must have a declaration in the API file.
|
||||
// CHECK:STDERR: fail_indirect_two_file.impl.carbon:[[@LINE+4]]:1: error: `extern` entities must have a declaration in the API file
|
||||
// CHECK:STDERR: extern fn F() {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -104,7 +104,7 @@ impl library "[[@TEST_NAME]]";
|
||||
|
||||
import library "in_impl_extern";
|
||||
|
||||
// CHECK:STDERR: fail_in_impl.impl.carbon:[[@LINE+3]]:1: ERROR: `extern` entities must have a declaration in the API file.
|
||||
// CHECK:STDERR: fail_in_impl.impl.carbon:[[@LINE+3]]:1: error: `extern` entities must have a declaration in the API file
|
||||
// CHECK:STDERR: extern fn F() {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
extern fn F() {}
|
||||
|
||||
+11
-11
@@ -9,57 +9,57 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/definition/no_prelude/fail_decl_param_mismatch.carbon
|
||||
|
||||
fn F();
|
||||
// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:1: ERROR: Redeclaration differs because of parameter count of 1.
|
||||
// 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: previously declared with parameter count of 0
|
||||
// CHECK:STDERR: fn F();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR:
|
||||
fn F(x: ()) {}
|
||||
|
||||
fn G(x: ());
|
||||
// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:1: ERROR: Redeclaration differs because of parameter count of 0.
|
||||
// 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: previously declared with parameter count of 1
|
||||
// CHECK:STDERR: fn G(x: ());
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
fn G() {}
|
||||
|
||||
fn H(x: ());
|
||||
// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+4]]:9: ERROR: Package `Core` implicitly referenced here, but not found.
|
||||
// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+4]]:9: error: package `Core` implicitly referenced here, but not found
|
||||
// CHECK:STDERR: fn H(x: bool) {}
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR:
|
||||
fn H(x: bool) {}
|
||||
|
||||
fn I();
|
||||
// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:1: ERROR: Function redeclaration differs because return type is `()`.
|
||||
// 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: previously declared with no return type
|
||||
// CHECK:STDERR: fn I();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR:
|
||||
fn I() -> () { return (); }
|
||||
|
||||
fn J() -> ();
|
||||
// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:1: ERROR: Function redeclaration differs because no return type is provided.
|
||||
// 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: previously declared with return type `()`
|
||||
// CHECK:STDERR: fn J() -> ();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
fn J() {}
|
||||
|
||||
fn K() -> ();
|
||||
// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+6]]:1: ERROR: Function redeclaration differs because return type is `{}`.
|
||||
// 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: previously declared with return type `()`
|
||||
// CHECK:STDERR: fn K() -> ();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~
|
||||
fn K() -> {} { return {}; }
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/definition/no_prelude/fail_redef.carbon
|
||||
|
||||
fn F() {}
|
||||
// CHECK:STDERR: fail_redef.carbon:[[@LINE+6]]:1: ERROR: Redefinition of `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: previously defined here
|
||||
// CHECK:STDERR: fn F() {}
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
fn F() {}
|
||||
|
||||
+15
-15
@@ -30,13 +30,13 @@ 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+10]]: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: 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: previously declared here
|
||||
// CHECK:STDERR: extern fn A();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -52,13 +52,13 @@ 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+10]]: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: 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: previously declared here
|
||||
// CHECK:STDERR: fn A();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -74,13 +74,13 @@ 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+10]]: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: 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: previously declared here
|
||||
// CHECK:STDERR: fn A() {}
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -96,13 +96,13 @@ 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+10]]: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: 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: previously defined here
|
||||
// CHECK:STDERR: fn A() {}
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -119,13 +119,13 @@ 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+9]]: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: 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: name is previously declared here
|
||||
// CHECK:STDERR: alias B = A;
|
||||
// CHECK:STDERR: ^
|
||||
fn B() {}
|
||||
|
||||
+11
-11
@@ -37,10 +37,10 @@ library "[[@TEST_NAME]]";
|
||||
class C {}
|
||||
|
||||
fn Foo(a: C);
|
||||
// CHECK:STDERR: fail_parens.carbon:[[@LINE+7]]:11: ERROR: Redeclaration syntax differs here.
|
||||
// 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: comparing with previous declaration here
|
||||
// CHECK:STDERR: fn Foo(a: C);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
@@ -80,10 +80,10 @@ class C {}
|
||||
alias D = C;
|
||||
|
||||
fn Foo(a: C);
|
||||
// CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE+7]]:8: ERROR: Redeclaration differs at parameter 1.
|
||||
// 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: previous declaration's corresponding parameter here
|
||||
// CHECK:STDERR: fn Foo(a: C);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
@@ -97,10 +97,10 @@ class C {}
|
||||
alias D = C;
|
||||
|
||||
fn Foo(a: C);
|
||||
// CHECK:STDERR: fail_alias.carbon:[[@LINE+7]]:11: ERROR: Redeclaration syntax differs here.
|
||||
// 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: comparing with previous declaration here
|
||||
// CHECK:STDERR: fn Foo(a: C);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
@@ -114,10 +114,10 @@ class C {}
|
||||
alias D = C;
|
||||
|
||||
fn Foo[a: C]();
|
||||
// CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE+7]]:11: ERROR: Redeclaration syntax differs here.
|
||||
// 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: comparing with previous declaration here
|
||||
// CHECK:STDERR: fn Foo[a: C]();
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
@@ -156,14 +156,14 @@ library "[[@TEST_NAME]]";
|
||||
class C {}
|
||||
|
||||
fn Foo(a: const C);
|
||||
// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+10]]:11: WARNING: `const` applied repeatedly to the same type has no additional effect.
|
||||
// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+10]]:11: warning: `const` applied repeatedly to the same type has no additional effect
|
||||
// CHECK:STDERR: fn Foo(a: const (const C)) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+6]]:17: ERROR: Redeclaration syntax differs here.
|
||||
// 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: comparing with previous declaration here
|
||||
// CHECK:STDERR: fn Foo(a: const C);
|
||||
// CHECK:STDERR: ^
|
||||
fn Foo(a: const (const C)) {}
|
||||
|
||||
Reference in New Issue
Block a user