mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 15:51:07 +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
@@ -9,30 +9,30 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/builtin/fail_redefined.carbon
|
||||
|
||||
fn A(n: i32, m: i32) -> i32 = "int.sadd";
|
||||
// CHECK:STDERR: fail_redefined.carbon:[[@LINE+7]]:1: ERROR: Redefinition of `fn A`.
|
||||
// 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: previously defined here
|
||||
// CHECK:STDERR: fn A(n: i32, m: i32) -> i32 = "int.sadd";
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
fn A(n: i32, m: i32) -> i32 { return n; }
|
||||
|
||||
fn B(n: i32, m: i32) -> i32 { return n; }
|
||||
// CHECK:STDERR: fail_redefined.carbon:[[@LINE+7]]:1: ERROR: Redefinition of `fn B`.
|
||||
// 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: previously defined here
|
||||
// CHECK:STDERR: fn B(n: i32, m: i32) -> i32 { return n; }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
fn B(n: i32, m: i32) -> i32 = "int.sadd";
|
||||
|
||||
fn C(n: i32, m: i32) -> i32 = "int.sadd";
|
||||
// CHECK:STDERR: fail_redefined.carbon:[[@LINE+6]]:1: ERROR: Redefinition of `fn C`.
|
||||
// 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: 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";
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/builtin/fail_unknown.carbon
|
||||
|
||||
// CHECK:STDERR: fail_unknown.carbon:[[@LINE+3]]:23: ERROR: Unknown builtin function name "unknown.builtin.name".
|
||||
// CHECK:STDERR: fail_unknown.carbon:[[@LINE+3]]:23: error: unknown builtin function name "unknown.builtin.name"
|
||||
// CHECK:STDERR: fn UnknownBuiltin() = "unknown.builtin.name";
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~
|
||||
fn UnknownBuiltin() = "unknown.builtin.name";
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/call/fail_not_callable.carbon
|
||||
|
||||
fn Run() {
|
||||
// CHECK:STDERR: fail_not_callable.carbon:[[@LINE+3]]:16: ERROR: Value of type `String` is not callable.
|
||||
// CHECK:STDERR: fail_not_callable.carbon:[[@LINE+3]]:16: error: value of type `String` is not callable
|
||||
// CHECK:STDERR: var x: i32 = "hello"();
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
var x: i32 = "hello"();
|
||||
|
||||
+12
-12
@@ -13,52 +13,52 @@ fn Run1(a: i32) {}
|
||||
fn Run2(a: i32, b: i32) {}
|
||||
|
||||
fn Main() {
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: ERROR: 1 argument(s) passed to function expecting 0 argument(s).
|
||||
// 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: calling function declared here
|
||||
// CHECK:STDERR: fn Run0() {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
Run0(1);
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: ERROR: 2 argument(s) passed to function expecting 0 argument(s).
|
||||
// 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: calling function declared here
|
||||
// CHECK:STDERR: fn Run0() {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
Run0(0, 1);
|
||||
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: ERROR: 0 argument(s) passed to function expecting 1 argument(s).
|
||||
// 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: calling function declared here
|
||||
// CHECK:STDERR: fn Run1(a: i32) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
Run1();
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: ERROR: 2 argument(s) passed to function expecting 1 argument(s).
|
||||
// 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: calling function declared here
|
||||
// CHECK:STDERR: fn Run1(a: i32) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
Run1(0, 1);
|
||||
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: ERROR: 0 argument(s) passed to function expecting 2 argument(s).
|
||||
// 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: calling function declared here
|
||||
// CHECK:STDERR: fn Run2(a: i32, b: i32) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
Run2();
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE+6]]:3: ERROR: 1 argument(s) passed to function expecting 2 argument(s).
|
||||
// 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: calling function declared here
|
||||
// CHECK:STDERR: fn Run2(a: i32, b: i32) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Run2(0);
|
||||
|
||||
@@ -11,13 +11,13 @@
|
||||
fn G(a: i32) {}
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_param_type.carbon:[[@LINE+9]]:3: ERROR: Cannot implicitly convert from `f64` to `i32`.
|
||||
// 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: 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: initializing parameter 1 of function declared here
|
||||
// CHECK:STDERR: fn G(a: i32) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
G(1.0);
|
||||
|
||||
@@ -11,10 +11,10 @@
|
||||
fn Foo() -> f64 { return 1.0; }
|
||||
|
||||
fn Run() {
|
||||
// CHECK:STDERR: fail_return_type_mismatch.carbon:[[@LINE+6]]:3: ERROR: Cannot implicitly convert from `f64` to `i32`.
|
||||
// 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: type `f64` does not implement interface `ImplicitAs`
|
||||
// CHECK:STDERR: var x: i32 = Foo();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~
|
||||
var x: i32 = Foo();
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/fail_param_in_type.carbon
|
||||
|
||||
// CHECK:STDERR: fail_param_in_type.carbon:[[@LINE+3]]:23: ERROR: Array bound is not a constant.
|
||||
// CHECK:STDERR: fail_param_in_type.carbon:[[@LINE+3]]:23: error: array bound is not a constant
|
||||
// CHECK:STDERR: fn F(n: i32, a: [i32; n]*);
|
||||
// CHECK:STDERR: ^
|
||||
fn F(n: i32, a: [i32; n]*);
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/fail_param_redecl.carbon
|
||||
|
||||
// CHECK:STDERR: fail_param_redecl.carbon:[[@LINE+6]]:14: ERROR: Duplicate name being declared in the same scope.
|
||||
// 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: name is previously declared here
|
||||
// CHECK:STDERR: fn F(n: i32, n: i32);
|
||||
// CHECK:STDERR: ^
|
||||
fn F(n: i32, n: i32);
|
||||
|
||||
+55
-55
@@ -58,57 +58,57 @@ 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+10]]: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: 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: 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+10]]: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: 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: api.carbon:5:1: 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+10]]: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: 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: api.carbon:6:1: 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+10]]: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: 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: api.carbon:7:1: 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+10]]: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: 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: api.carbon:10:1: previously declared here
|
||||
// CHECK:STDERR: fn NS.E();
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -142,68 +142,68 @@ var e: () = NS.E();
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_merge.carbon:[[@LINE+65]]:1: In import.
|
||||
// CHECK:STDERR: fail_merge.carbon:[[@LINE+65]]:1: in import
|
||||
// CHECK:STDERR: import library "api";
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: extern_api.carbon:4:1: ERROR: Duplicate name being declared in the same scope.
|
||||
// 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: 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: api.carbon:4:1: 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: fail_merge.carbon:[[@LINE+52]]:1: in import
|
||||
// CHECK:STDERR: import library "api";
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: extern_api.carbon:5:1: ERROR: Duplicate name being declared in the same scope.
|
||||
// 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: 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: api.carbon:5:1: 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: fail_merge.carbon:[[@LINE+39]]:1: in import
|
||||
// CHECK:STDERR: import library "api";
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: extern_api.carbon:6:1: ERROR: Duplicate name being declared in the same scope.
|
||||
// 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: 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: api.carbon:6:1: 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: fail_merge.carbon:[[@LINE+26]]:1: in import
|
||||
// CHECK:STDERR: import library "api";
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: extern_api.carbon:7:1: ERROR: Duplicate name being declared in the same scope.
|
||||
// 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: 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: api.carbon:7:1: 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: fail_merge.carbon:[[@LINE+13]]:1: in import
|
||||
// CHECK:STDERR: import library "api";
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: extern_api.carbon:10:1: ERROR: Duplicate name being declared in the same scope.
|
||||
// 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: 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: api.carbon:10:1: name is previously declared here
|
||||
// CHECK:STDERR: fn NS.E();
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -220,68 +220,68 @@ var e: () = NS.E();
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+64]]:1: In import.
|
||||
// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+64]]:1: in import
|
||||
// CHECK:STDERR: import library "extern_api";
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: api.carbon:4:1: ERROR: Duplicate name being declared in the same scope.
|
||||
// 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: 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: extern_api.carbon:4:1: 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: fail_merge_reverse.carbon:[[@LINE+51]]:1: in import
|
||||
// CHECK:STDERR: import library "extern_api";
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: api.carbon:5:1: ERROR: Duplicate name being declared in the same scope.
|
||||
// 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: 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: extern_api.carbon:5:1: 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: fail_merge_reverse.carbon:[[@LINE+38]]:1: in import
|
||||
// CHECK:STDERR: import library "extern_api";
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: api.carbon:6:1: ERROR: Duplicate name being declared in the same scope.
|
||||
// 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: 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: extern_api.carbon:6:1: 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: fail_merge_reverse.carbon:[[@LINE+25]]:1: in import
|
||||
// CHECK:STDERR: import library "extern_api";
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: api.carbon:7:1: ERROR: Duplicate name being declared in the same scope.
|
||||
// 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: 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: extern_api.carbon:7:1: 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: fail_merge_reverse.carbon:[[@LINE+12]]:1: in import
|
||||
// CHECK:STDERR: import library "extern_api";
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: api.carbon:10:1: ERROR: Duplicate name being declared in the same scope.
|
||||
// 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: 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: extern_api.carbon:10:1: name is previously declared here
|
||||
// CHECK:STDERR: extern library "redecl_extern_api" fn NS.E();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
import library "extern_api";
|
||||
|
||||
@@ -25,10 +25,10 @@ var x: () = F();
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
extern fn F();
|
||||
// CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: ERROR: Redeclaration of `fn F` is redundant.
|
||||
// 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: previously declared here
|
||||
// CHECK:STDERR: extern fn F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -39,10 +39,10 @@ extern fn F();
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
extern fn F();
|
||||
// CHECK:STDERR: fail_redecl_extern.carbon:[[@LINE+7]]:1: ERROR: Redeclaration of `fn F` is redundant.
|
||||
// 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: previously declared here
|
||||
// CHECK:STDERR: extern fn F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -53,12 +53,12 @@ fn F();
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
class C {
|
||||
// CHECK:STDERR: fail_member_extern.carbon:[[@LINE+4]]:3: ERROR: `extern` not allowed on `fn` declaration that is a member.
|
||||
// CHECK:STDERR: fail_member_extern.carbon:[[@LINE+4]]:3: error: `extern` not allowed on `fn` declaration that is a member
|
||||
// CHECK:STDERR: extern fn F();
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR:
|
||||
extern fn F();
|
||||
// CHECK:STDERR: fail_member_extern.carbon:[[@LINE+3]]:3: ERROR: `extern` not allowed on `fn` declaration that is a member.
|
||||
// CHECK:STDERR: fail_member_extern.carbon:[[@LINE+3]]:3: error: `extern` not allowed on `fn` declaration that is a member
|
||||
// CHECK:STDERR: extern fn G[self: Self]();
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
extern fn G[self: Self]();
|
||||
|
||||
+18
-18
@@ -28,13 +28,13 @@ 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+10]]: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: 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: previously declared with `extern library` here
|
||||
// CHECK:STDERR: extern library "extern_library_owner" fn F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -46,13 +46,13 @@ 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+10]]: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: 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: previously declared here
|
||||
// CHECK:STDERR: extern library "extern_library_owner" fn F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -64,13 +64,13 @@ 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+10]]: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: 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: previously declared with `extern library` here
|
||||
// CHECK:STDERR: extern library "extern_library_owner" fn F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -86,16 +86,16 @@ extern library "extern_library_owner" fn F();
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_extern_library_collision.carbon:[[@LINE+13]]:1: In import.
|
||||
// CHECK:STDERR: fail_extern_library_collision.carbon:[[@LINE+13]]:1: in import
|
||||
// CHECK:STDERR: import library "extern_library";
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: extern_library_copy.carbon:4:1: ERROR: Duplicate name being declared in the same scope.
|
||||
// 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: 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: extern_library.carbon:4:1: name is previously declared here
|
||||
// CHECK:STDERR: extern library "extern_library_owner" fn F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -114,7 +114,7 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import library "extern_library_mismatch"
|
||||
|
||||
// CHECK:STDERR: fail_extern_library_mismatch_owner.carbon:[[@LINE+4]]:1: ERROR: `import` declarations must end with a `;`.
|
||||
// CHECK:STDERR: fail_extern_library_mismatch_owner.carbon:[[@LINE+4]]:1: error: `import` declarations must end with a `;`
|
||||
// CHECK:STDERR: extern fn F();
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -124,7 +124,7 @@ extern fn F();
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_extern_self_library.carbon:[[@LINE+4]]:1: ERROR: `extern library` cannot specify the current library.
|
||||
// CHECK:STDERR: fail_extern_self_library.carbon:[[@LINE+4]]:1: error: `extern library` cannot specify the current library
|
||||
// CHECK:STDERR: extern library "extern_self_library" fn F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -142,13 +142,13 @@ 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+9]]: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: 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: previously declared here
|
||||
// CHECK:STDERR: fn F();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
extern library "extern_of_import" fn F();
|
||||
|
||||
+3
-3
@@ -28,13 +28,13 @@ 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+9]]: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: 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: previously declared with `extern library` here
|
||||
// CHECK:STDERR: extern library "expected" fn F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
extern fn F();
|
||||
|
||||
Vendored
+3
-3
@@ -26,13 +26,13 @@ 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+9]]: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: 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: previously declared with `extern library` here
|
||||
// CHECK:STDERR: extern library default fn F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
extern fn F();
|
||||
|
||||
Vendored
+16
-16
@@ -21,24 +21,24 @@ fn ReturnDUnused() -> D;
|
||||
fn ReturnDUsed() -> D;
|
||||
|
||||
fn Call() {
|
||||
// CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE+10]]:3: ERROR: Function returns incomplete type `C`.
|
||||
// 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: 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: return type declared here
|
||||
// CHECK:STDERR: fn ReturnCUsed() -> C;
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR:
|
||||
ReturnCUsed();
|
||||
// CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE+10]]:3: ERROR: Function returns incomplete type `D`.
|
||||
// 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: 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: return type declared here
|
||||
// CHECK:STDERR: fn ReturnDUsed() -> D;
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -54,36 +54,36 @@ 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+16]]: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: 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: class was forward declared here
|
||||
// CHECK:STDERR: class C;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_use_imported.carbon:[[@LINE-12]]:1: In import.
|
||||
// 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_incomplete_return.carbon:7:20: 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+15]]: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: 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_incomplete_return.carbon:4:1: class was forward declared here
|
||||
// CHECK:STDERR: class C;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_use_imported.carbon:[[@LINE-29]]:1: In import.
|
||||
// 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_incomplete_return.carbon:8:18: return type declared here
|
||||
// CHECK:STDERR: fn ReturnCUsed() -> C;
|
||||
// CHECK:STDERR: ^~~~
|
||||
ReturnCUsed();
|
||||
|
||||
+19
-19
@@ -8,84 +8,84 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/no_prelude/fail_modifiers.carbon
|
||||
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: ERROR: `default` not allowed on `fn` declaration outside of an interface.
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: error: `default` not allowed on `fn` declaration outside of an interface
|
||||
// CHECK:STDERR: default protected fn WrongOrder();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:9: ERROR: `protected` must appear before `default`.
|
||||
// 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: `default` previously appeared here
|
||||
// CHECK:STDERR: default protected fn WrongOrder();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR:
|
||||
default protected fn WrongOrder();
|
||||
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: ERROR: `virtual` not allowed on `fn` declaration outside of a class.
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: error: `virtual` not allowed on `fn` declaration outside of a class
|
||||
// CHECK:STDERR: virtual virtual fn DuplicateVirtual() {}
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:9: ERROR: `virtual` repeated on declaration.
|
||||
// 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: `virtual` previously appeared here
|
||||
// CHECK:STDERR: virtual virtual fn DuplicateVirtual() {}
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR:
|
||||
virtual virtual fn DuplicateVirtual() {}
|
||||
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:9: ERROR: `protected` not allowed on declaration with `private`.
|
||||
// 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: `private` previously appeared here
|
||||
// CHECK:STDERR: private protected fn TwoAccess();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR:
|
||||
private protected fn TwoAccess();
|
||||
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: ERROR: `abstract` not allowed on `fn` declaration outside of a class.
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: error: `abstract` not allowed on `fn` declaration outside of a class
|
||||
// CHECK:STDERR: abstract virtual fn ModifiersConflict() {}
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:10: ERROR: `virtual` not allowed on declaration with `abstract`.
|
||||
// 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: `abstract` previously appeared here
|
||||
// CHECK:STDERR: abstract virtual fn ModifiersConflict() {}
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
abstract virtual fn ModifiersConflict() {}
|
||||
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: ERROR: `base` not allowed on `fn` declaration.
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `base` not allowed on `fn` declaration
|
||||
// CHECK:STDERR: base fn InvalidModifier();
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR:
|
||||
base fn InvalidModifier();
|
||||
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+18]]:1: ERROR: `default` not allowed on `fn` declaration outside of an interface.
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+18]]:1: error: `default` not allowed on `fn` declaration outside of an interface
|
||||
// CHECK:STDERR: default final virtual fn ModifiersConflict2() {}
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+14]]:9: ERROR: `final` not allowed on declaration with `default`.
|
||||
// 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: `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: 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: `default` previously appeared here
|
||||
// CHECK:STDERR: default final virtual fn ModifiersConflict2() {}
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR:
|
||||
default final virtual fn ModifiersConflict2() {}
|
||||
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+6]]:8: ERROR: `private` must appear before `extern`.
|
||||
// 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: `extern` previously appeared here
|
||||
// CHECK:STDERR: extern private fn ExternOrderAndConflict() {}
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
extern private fn ExternOrderAndConflict() {}
|
||||
|
||||
+2
-2
@@ -8,11 +8,11 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/no_prelude/fail_pattern_in_signature.carbon
|
||||
|
||||
// CHECK:STDERR: fail_pattern_in_signature.carbon:[[@LINE+7]]:6: ERROR: Expected name in binding pattern.
|
||||
// CHECK:STDERR: fail_pattern_in_signature.carbon:[[@LINE+7]]:6: error: expected name in binding pattern
|
||||
// CHECK:STDERR: fn F((a: {}, b: {}), c: {});
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_pattern_in_signature.carbon:[[@LINE+3]]:6: ERROR: Semantics TODO: `Error recovery from keyword name.`.
|
||||
// CHECK:STDERR: fail_pattern_in_signature.carbon:[[@LINE+3]]:6: error: semantics TODO: `Error recovery from keyword name.`
|
||||
// CHECK:STDERR: fn F((a: {}, b: {}), c: {});
|
||||
// CHECK:STDERR: ^
|
||||
fn F((a: {}, b: {}), c: {});
|
||||
|
||||
+10
-10
@@ -9,50 +9,50 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/no_prelude/fail_redecl.carbon
|
||||
|
||||
fn A();
|
||||
// CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: ERROR: Redeclaration of `fn A` is redundant.
|
||||
// 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: previously declared here
|
||||
// CHECK:STDERR: fn A();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR:
|
||||
fn A();
|
||||
|
||||
fn B(x: ());
|
||||
// CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: ERROR: Redeclaration of `fn B` is redundant.
|
||||
// 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: previously declared here
|
||||
// CHECK:STDERR: fn B(x: ());
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
fn B(x: ());
|
||||
|
||||
fn C();
|
||||
// CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: ERROR: Redeclaration differs because of parameter count of 1.
|
||||
// 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: previously declared with parameter count of 0
|
||||
// CHECK:STDERR: fn C();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR:
|
||||
fn C(x: ());
|
||||
|
||||
fn D() {}
|
||||
// CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: ERROR: Redeclaration of `fn D` is redundant.
|
||||
// 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: previously declared here
|
||||
// CHECK:STDERR: fn D() {}
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
fn D();
|
||||
|
||||
fn E() {}
|
||||
// CHECK:STDERR: fail_redecl.carbon:[[@LINE+6]]:1: ERROR: Redefinition of `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: previously defined here
|
||||
// CHECK:STDERR: fn E() {}
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
fn E() {}
|
||||
|
||||
+4
-4
@@ -11,7 +11,7 @@
|
||||
// --- fail_no_body.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
// CHECK:STDERR: fail_no_body.carbon:[[@LINE+4]]:1: ERROR: Semantics TODO: `function with positional parameters`.
|
||||
// CHECK:STDERR: fail_no_body.carbon:[[@LINE+4]]:1: error: semantics TODO: `function with positional parameters`
|
||||
// CHECK:STDERR: fn A;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -20,7 +20,7 @@ fn A;
|
||||
// --- fail_todo_brace_body.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
// CHECK:STDERR: fail_todo_brace_body.carbon:[[@LINE+4]]:1: ERROR: Semantics TODO: `function with positional parameters`.
|
||||
// CHECK:STDERR: fail_todo_brace_body.carbon:[[@LINE+4]]:1: error: semantics TODO: `function with positional parameters`
|
||||
// CHECK:STDERR: fn A {
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -31,11 +31,11 @@ fn A {
|
||||
|
||||
// TODO: We don't have parsing support for this yet.
|
||||
library "[[@TEST_NAME]]";
|
||||
// CHECK:STDERR: fail_todo_arrow_body.carbon:[[@LINE+7]]:1: ERROR: Semantics TODO: `function with positional parameters`.
|
||||
// CHECK:STDERR: fail_todo_arrow_body.carbon:[[@LINE+7]]:1: error: semantics TODO: `function with positional parameters`
|
||||
// CHECK:STDERR: fn A => 0;
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_arrow_body.carbon:[[@LINE+3]]:6: ERROR: `fn` declarations must either end with a `;` or have a `{ ... }` block for a definition.
|
||||
// CHECK:STDERR: fail_todo_arrow_body.carbon:[[@LINE+3]]:6: error: `fn` declarations must either end with a `;` or have a `{ ... }` block for a definition
|
||||
// CHECK:STDERR: fn A => 0;
|
||||
// CHECK:STDERR: ^~
|
||||
fn A => 0;
|
||||
|
||||
+7
-7
@@ -30,17 +30,17 @@ 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+14]]: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:
|
||||
// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE+4]]:1: ERROR: No definition found for declaration in impl file
|
||||
// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE+4]]:1: error: no definition found for declaration in impl file
|
||||
// CHECK:STDERR: fn A();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -56,13 +56,13 @@ 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+9]]: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: ^~~~~~~
|
||||
extern fn A();
|
||||
|
||||
+2
-2
@@ -52,7 +52,7 @@ fn C();
|
||||
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_decl_in_api_decl_in_impl.impl.carbon:[[@LINE+4]]:1: ERROR: No definition found for declaration in impl file
|
||||
// CHECK:STDERR: fail_decl_in_api_decl_in_impl.impl.carbon:[[@LINE+4]]:1: error: no definition found for declaration in impl file
|
||||
// CHECK:STDERR: fn C();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -66,7 +66,7 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_decl_only_in_impl.impl.carbon:[[@LINE+3]]:1: ERROR: No definition found for declaration in impl file
|
||||
// CHECK:STDERR: fail_decl_only_in_impl.impl.carbon:[[@LINE+3]]:1: error: no definition found for declaration in impl file
|
||||
// CHECK:STDERR: fn D();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
fn D();
|
||||
|
||||
+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)) {}
|
||||
|
||||
+10
-10
@@ -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]*);
|
||||
|
||||
+1
-1
@@ -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
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user