Update basic diagnostic capitalization/punctuation (#4328)

This is a primarily automated change:

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

---------

Co-authored-by: Richard Smith <richard@metafoo.co.uk>
This commit is contained in:
Jon Ross-Perkins
2024-09-19 21:32:53 +00:00
committed by GitHub
co-authored by Richard Smith
parent 7f6d684b29
commit e7aebbe581
578 changed files with 2166 additions and 2173 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ interface Simple {
}
impl i32 as Simple {
// CHECK:STDERR: fail_call_invalid.carbon:[[@LINE+3]]:14: ERROR: Name `Undeclared` not found.
// CHECK:STDERR: fail_call_invalid.carbon:[[@LINE+3]]:14: error: name `Undeclared` not found
// CHECK:STDERR: fn G[self: Undeclared]();
// CHECK:STDERR: ^~~~~~~~~~
fn G[self: Undeclared]();
@@ -13,7 +13,7 @@ interface GenericInterface(T:! type) {
}
class C {
// CHECK:STDERR: fail_extend_impl_forall.carbon:[[@LINE+3]]:3: ERROR: Cannot `extend` a parameterized `impl`.
// CHECK:STDERR: fail_extend_impl_forall.carbon:[[@LINE+3]]:3: error: cannot `extend` a parameterized `impl`
// CHECK:STDERR: extend impl forall [T:! type] as GenericInterface(T) {
// CHECK:STDERR: ^~~~~~
extend impl forall [T:! type] as GenericInterface(T) {
@@ -10,7 +10,7 @@
interface I {}
// CHECK:STDERR: fail_extend_impl_scope.carbon:[[@LINE+3]]:1: ERROR: `extend impl` can only be used in a class.
// CHECK:STDERR: fail_extend_impl_scope.carbon:[[@LINE+3]]:1: error: `extend impl` can only be used in a class
// CHECK:STDERR: extend impl i32 as I {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~
extend impl i32 as I {}
@@ -11,7 +11,7 @@
interface I {}
class C {
// CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+4]]:3: ERROR: Cannot `extend` an `impl` with an explicit self type.
// CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+4]]:3: error: cannot `extend` an `impl` with an explicit self type
// CHECK:STDERR: extend impl i32 as I {}
// CHECK:STDERR: ^~~~~~
// CHECK:STDERR:
@@ -19,10 +19,10 @@ class C {
}
class D {
// CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+7]]:3: ERROR: Cannot `extend` an `impl` with an explicit self type.
// CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+7]]:3: error: cannot `extend` an `impl` with an explicit self type
// CHECK:STDERR: extend impl D as I;
// CHECK:STDERR: ^~~~~~
// CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+4]]:15: Remove the explicit `Self` type here.
// CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+4]]:15: remove the explicit `Self` type here
// CHECK:STDERR: extend impl D as I;
// CHECK:STDERR: ^
// CHECK:STDERR:
@@ -30,10 +30,10 @@ class D {
}
class E {
// CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+6]]:3: ERROR: Cannot `extend` an `impl` with an explicit self type.
// CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+6]]:3: error: cannot `extend` an `impl` with an explicit self type
// CHECK:STDERR: extend impl Self as I {}
// CHECK:STDERR: ^~~~~~
// CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+3]]:15: Remove the explicit `Self` type here.
// CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+3]]:15: remove the explicit `Self` type here
// CHECK:STDERR: extend impl Self as I {}
// CHECK:STDERR: ^~~~
extend impl Self as I {}
@@ -9,7 +9,7 @@
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/fail_extend_non_interface.carbon
class C {
// CHECK:STDERR: fail_extend_non_interface.carbon:[[@LINE+3]]:3: ERROR: Semantics TODO: `extending non-interface constraint`.
// CHECK:STDERR: fail_extend_non_interface.carbon:[[@LINE+3]]:3: error: semantics TODO: `extending non-interface constraint`
// CHECK:STDERR: extend impl as i32;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~
extend impl as i32;
@@ -10,10 +10,10 @@
interface I {
class C {
// CHECK:STDERR: fail_extend_partially_defined_interface.carbon:[[@LINE+6]]:5: ERROR: `extend impl` requires a definition for interface `I`.
// CHECK:STDERR: fail_extend_partially_defined_interface.carbon:[[@LINE+6]]:5: error: `extend impl` requires a definition for interface `I`
// CHECK:STDERR: extend impl as I;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_extend_partially_defined_interface.carbon:[[@LINE-5]]:1: Interface is currently being defined.
// CHECK:STDERR: fail_extend_partially_defined_interface.carbon:[[@LINE-5]]:1: interface is currently being defined
// CHECK:STDERR: interface I {
// CHECK:STDERR: ^~~~~~~~~~~~~
extend impl as I;
@@ -11,10 +11,10 @@
interface I;
class C {
// CHECK:STDERR: fail_extend_undefined_interface.carbon:[[@LINE+6]]:3: ERROR: `extend impl` requires a definition for interface `I`.
// CHECK:STDERR: fail_extend_undefined_interface.carbon:[[@LINE+6]]:3: error: `extend impl` requires a definition for interface `I`
// CHECK:STDERR: extend impl as I;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_extend_undefined_interface.carbon:[[@LINE-6]]:1: Interface was forward declared here.
// CHECK:STDERR: fail_extend_undefined_interface.carbon:[[@LINE-6]]:1: interface was forward declared here
// CHECK:STDERR: interface I;
// CHECK:STDERR: ^~~~~~~~~~~~
extend impl as I;
+1 -1
View File
@@ -12,7 +12,7 @@ interface Simple {
fn F();
}
// CHECK:STDERR: fail_impl_as_scope.carbon:[[@LINE+3]]:6: ERROR: `impl as` can only be used in a class.
// CHECK:STDERR: fail_impl_as_scope.carbon:[[@LINE+3]]:6: error: `impl as` can only be used in a class
// CHECK:STDERR: impl as Simple {
// CHECK:STDERR: ^~
impl as Simple {
@@ -10,7 +10,7 @@
interface I { let T:! type; }
// CHECK:STDERR: fail_impl_bad_assoc_const.carbon:[[@LINE+3]]:1: ERROR: Semantics TODO: `impl of interface with associated constant`.
// CHECK:STDERR: fail_impl_bad_assoc_const.carbon:[[@LINE+3]]:1: error: semantics TODO: `impl of interface with associated constant`
// CHECK:STDERR: impl bool as I {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
impl bool as I {}
+30 -30
View File
@@ -11,10 +11,10 @@
interface I { fn F(); }
class NoF {
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:3: ERROR: Missing implementation of F in impl of interface I.
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:3: error: missing implementation of F in impl of interface I
// CHECK:STDERR: impl as I {}
// CHECK:STDERR: ^~~~~~~~~~~
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-6]]:15: Associated function F declared here.
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-6]]:15: associated function F declared here
// CHECK:STDERR: interface I { fn F(); }
// CHECK:STDERR: ^~~~~~~
// CHECK:STDERR:
@@ -23,10 +23,10 @@ class NoF {
class FNotFunction {
impl as I {
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: ERROR: Associated function F implemented by non-function.
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: associated function F implemented by non-function
// CHECK:STDERR: class F;
// CHECK:STDERR: ^~~~~~~~
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-18]]:15: Associated function F declared here.
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-18]]:15: associated function F declared here
// CHECK:STDERR: interface I { fn F(); }
// CHECK:STDERR: ^~~~~~~
// CHECK:STDERR:
@@ -39,10 +39,10 @@ fn PossiblyF();
// TODO: Should this be permitted?
class FAlias {
impl as I {
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:11: ERROR: Associated function F implemented by non-function.
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:11: error: associated function F implemented by non-function
// CHECK:STDERR: alias F = PossiblyF;
// CHECK:STDERR: ^
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-34]]:15: Associated function F declared here.
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-34]]:15: associated function F declared here
// CHECK:STDERR: interface I { fn F(); }
// CHECK:STDERR: ^~~~~~~
// CHECK:STDERR:
@@ -52,10 +52,10 @@ class FAlias {
class FExtraParam {
impl as I {
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: ERROR: Redeclaration differs because of parameter count of 1.
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: redeclaration differs because of parameter count of 1
// CHECK:STDERR: fn F(b: bool);
// CHECK:STDERR: ^~~~~~~~~~~~~~
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-47]]:15: Previously declared with parameter count of 0.
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-47]]:15: previously declared with parameter count of 0
// CHECK:STDERR: interface I { fn F(); }
// CHECK:STDERR: ^~~~~~~
// CHECK:STDERR:
@@ -65,10 +65,10 @@ class FExtraParam {
class FExtraImplicitParam {
impl as I {
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: ERROR: Redeclaration differs because of implicit parameter list.
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: redeclaration differs because of implicit parameter list
// CHECK:STDERR: fn F[self: Self]();
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-60]]:15: Previously declared without implicit parameter list.
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-60]]:15: previously declared without implicit parameter list
// CHECK:STDERR: interface I { fn F(); }
// CHECK:STDERR: ^~~~~~~
// CHECK:STDERR:
@@ -79,10 +79,10 @@ class FExtraImplicitParam {
// TODO: Should this be permitted?
class FExtraReturnType {
impl as I {
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: ERROR: Function redeclaration differs because return type is `bool`.
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: function redeclaration differs because return type is `bool`
// CHECK:STDERR: fn F() -> bool;
// CHECK:STDERR: ^~~~~~~~~~~~~~~
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-74]]:15: Previously declared with no return type.
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-74]]:15: previously declared with no return type
// CHECK:STDERR: interface I { fn F(); }
// CHECK:STDERR: ^~~~~~~
// CHECK:STDERR:
@@ -94,10 +94,10 @@ interface J { fn F[self: bool](b: bool) -> bool; }
class FMissingParam {
impl as J {
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: ERROR: Redeclaration differs because of parameter count of 0.
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: redeclaration differs because of parameter count of 0
// CHECK:STDERR: fn F[self: bool]() -> bool;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-7]]:15: Previously declared with parameter count of 1.
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-7]]:15: previously declared with parameter count of 1
// CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; }
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
@@ -107,10 +107,10 @@ class FMissingParam {
class FMissingImplicitParam {
impl as J {
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: ERROR: Redeclaration differs because of missing implicit parameter list.
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: redeclaration differs because of missing implicit parameter list
// CHECK:STDERR: fn F(b: bool) -> bool;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-20]]:15: Previously declared with implicit parameter list.
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-20]]:15: previously declared with implicit parameter list
// CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; }
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
@@ -120,10 +120,10 @@ class FMissingImplicitParam {
class FMissingReturnType {
impl as J {
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: ERROR: Function redeclaration differs because no return type is provided.
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: function redeclaration differs because no return type is provided
// CHECK:STDERR: fn F[self: bool](b: bool);
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-33]]:15: Previously declared with return type `bool`.
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-33]]:15: previously declared with return type `bool`
// CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; }
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
@@ -133,10 +133,10 @@ class FMissingReturnType {
class FDifferentParamType {
impl as J {
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:22: ERROR: Redeclaration differs at parameter 1.
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:22: error: redeclaration differs at parameter 1
// CHECK:STDERR: fn F[self: bool](b: Self) -> bool;
// CHECK:STDERR: ^
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-46]]:32: Previous declaration's corresponding parameter here.
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-46]]:32: previous declaration's corresponding parameter here
// CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; }
// CHECK:STDERR: ^
// CHECK:STDERR:
@@ -146,10 +146,10 @@ class FDifferentParamType {
class FDifferentImplicitParamType {
impl as J {
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:10: ERROR: Redeclaration differs at implicit parameter 1.
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:10: error: redeclaration differs at implicit parameter 1
// CHECK:STDERR: fn F[self: Self](b: bool) -> bool;
// CHECK:STDERR: ^~~~
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-59]]:20: Previous declaration's corresponding implicit parameter here.
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-59]]:20: previous declaration's corresponding implicit parameter here
// CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; }
// CHECK:STDERR: ^~~~
// CHECK:STDERR:
@@ -159,10 +159,10 @@ class FDifferentImplicitParamType {
class FDifferentReturnType {
impl as J {
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: ERROR: Function redeclaration differs because return type is `FDifferentReturnType`.
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: function redeclaration differs because return type is `FDifferentReturnType`
// CHECK:STDERR: fn F[self: bool](b: bool) -> Self;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-72]]:15: Previously declared with return type `bool`.
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-72]]:15: previously declared with return type `bool`
// CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; }
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
@@ -173,10 +173,10 @@ class FDifferentReturnType {
// TODO: This should probably be permitted.
class FDifferentParamName {
impl as J {
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:22: ERROR: Redeclaration differs at parameter 1.
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:22: error: redeclaration differs at parameter 1
// CHECK:STDERR: fn F[self: bool](not_b: bool) -> bool;
// CHECK:STDERR: ^~~~~
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-86]]:32: Previous declaration's corresponding parameter here.
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-86]]:32: previous declaration's corresponding parameter here
// CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; }
// CHECK:STDERR: ^
// CHECK:STDERR:
@@ -190,10 +190,10 @@ interface SelfNested {
class SelfNestedBadParam {
impl as SelfNested {
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:10: ERROR: Redeclaration differs at parameter 1.
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:10: error: redeclaration differs at parameter 1
// CHECK:STDERR: fn F(x: (SelfNestedBadParam*, {.x: i32, .y: i32})) -> [SelfNestedBadParam; 4];
// CHECK:STDERR: ^
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-8]]:8: Previous declaration's corresponding parameter here.
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-8]]:8: previous declaration's corresponding parameter here
// CHECK:STDERR: fn F(x: (Self*, {.x: Self, .y: i32})) -> [Self; 4];
// CHECK:STDERR: ^
// CHECK:STDERR:
@@ -203,10 +203,10 @@ class SelfNestedBadParam {
class SelfNestedBadReturnType {
impl as SelfNested {
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+6]]:5: ERROR: Function redeclaration differs because return type is `[SelfNestedBadParam; 4]`.
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+6]]:5: error: function redeclaration differs because return type is `[SelfNestedBadParam; 4]`
// CHECK:STDERR: fn F(x: (SelfNestedBadReturnType*, {.x: SelfNestedBadReturnType, .y: i32})) -> [SelfNestedBadParam; 4];
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-21]]:3: Previously declared with return type `[SelfNestedBadReturnType; 4]`.
// CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-21]]:3: previously declared with return type `[SelfNestedBadReturnType; 4]`
// CHECK:STDERR: fn F(x: (Self*, {.x: Self, .y: i32})) -> [Self; 4];
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fn F(x: (SelfNestedBadReturnType*, {.x: SelfNestedBadReturnType, .y: i32})) -> [SelfNestedBadParam; 4];
@@ -8,14 +8,14 @@
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/fail_impl_bad_interface.carbon
// CHECK:STDERR: fail_impl_bad_interface.carbon:[[@LINE+10]]:1: ERROR: Semantics TODO: `impl as non-interface`.
// CHECK:STDERR: fail_impl_bad_interface.carbon:[[@LINE+10]]:1: error: semantics TODO: `impl as non-interface`
// CHECK:STDERR: impl i32 as false {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
// CHECK:STDERR: fail_impl_bad_interface.carbon:[[@LINE+6]]:13: ERROR: Cannot implicitly convert from `bool` to `type`.
// CHECK:STDERR: fail_impl_bad_interface.carbon:[[@LINE+6]]:13: error: cannot implicitly convert from `bool` to `type`
// CHECK:STDERR: impl i32 as false {}
// CHECK:STDERR: ^~~~~
// CHECK:STDERR: fail_impl_bad_interface.carbon:[[@LINE+3]]:13: Type `bool` does not implement interface `ImplicitAs`.
// CHECK:STDERR: fail_impl_bad_interface.carbon:[[@LINE+3]]:13: type `bool` does not implement interface `ImplicitAs`
// CHECK:STDERR: impl i32 as false {}
// CHECK:STDERR: ^~~~~
impl i32 as false {}
+2 -2
View File
@@ -12,10 +12,10 @@ interface I {}
impl i32 as I {}
// CHECK:STDERR: fail_redefinition.carbon:[[@LINE+6]]:1: ERROR: Redefinition of `impl i32 as I`.
// CHECK:STDERR: fail_redefinition.carbon:[[@LINE+6]]:1: error: redefinition of `impl i32 as I`
// CHECK:STDERR: impl i32 as I {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~
// CHECK:STDERR: fail_redefinition.carbon:[[@LINE-5]]:1: Previous definition was here.
// CHECK:STDERR: fail_redefinition.carbon:[[@LINE-5]]:1: previous definition was here
// CHECK:STDERR: impl i32 as I {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~
impl i32 as I {}
@@ -10,7 +10,7 @@
interface I { let T:! type; }
// CHECK:STDERR: fail_todo_impl_assoc_const.carbon:[[@LINE+3]]:14: ERROR: Semantics TODO: `HandleWhereOperand`.
// CHECK:STDERR: fail_todo_impl_assoc_const.carbon:[[@LINE+3]]:14: error: semantics TODO: `HandleWhereOperand`
// CHECK:STDERR: impl bool as I where .T = bool {}
// CHECK:STDERR: ^~~~~~~
impl bool as I where .T = bool {}
@@ -17,12 +17,12 @@ class C {
}
fn F(c: C) {
// CHECK:STDERR: fail_alias_impl_not_found.carbon:[[@LINE+4]]:3: ERROR: Cannot access member of interface `I` in type `C` that does not implement that interface.
// CHECK:STDERR: fail_alias_impl_not_found.carbon:[[@LINE+4]]:3: error: cannot access member of interface `I` in type `C` that does not implement that interface
// CHECK:STDERR: C.F();
// CHECK:STDERR: ^~~
// CHECK:STDERR:
C.F();
// CHECK:STDERR: fail_alias_impl_not_found.carbon:[[@LINE+3]]:3: ERROR: Cannot access member of interface `I` in type `C` that does not implement that interface.
// CHECK:STDERR: fail_alias_impl_not_found.carbon:[[@LINE+3]]:3: error: cannot access member of interface `I` in type `C` that does not implement that interface
// CHECK:STDERR: c.F();
// CHECK:STDERR: ^~~
c.F();
@@ -18,7 +18,7 @@ class C {
fn F() -> i32 {
// TODO: This should produce a more useful error message.
// CHECK:STDERR: fail_todo_undefined_impl.carbon:[[@LINE+3]]:10: ERROR: Cannot access member of interface `I` in type `C` that does not implement that interface.
// CHECK:STDERR: fail_todo_undefined_impl.carbon:[[@LINE+3]]:10: error: cannot access member of interface `I` in type `C` that does not implement that interface
// CHECK:STDERR: return C.F();
// CHECK:STDERR: ^~~
return C.F();
@@ -10,7 +10,7 @@
interface I {}
// CHECK:STDERR: fail_impl_bad_type.carbon:[[@LINE+3]]:6: ERROR: Package `Core` implicitly referenced here, but not found.
// CHECK:STDERR: fail_impl_bad_type.carbon:[[@LINE+3]]:6: error: package `Core` implicitly referenced here, but not found
// CHECK:STDERR: impl true as I {}
// CHECK:STDERR: ^~~~
impl true as I {}
@@ -36,7 +36,7 @@ fn G(a: A) { a.(Action(B).Op)(); }
impl library "[[@TEST_NAME]]";
// CHECK:STDERR: fail_action.impl.carbon:[[@LINE+4]]:14: ERROR: Cannot access member of interface `Action` in type `A` that does not implement that interface.
// CHECK:STDERR: fail_action.impl.carbon:[[@LINE+4]]:14: error: cannot access member of interface `Action` in type `A` that does not implement that interface
// CHECK:STDERR: fn G(a: A) { a.(Action(C).Op)(); }
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
// CHECK:STDERR:
@@ -72,7 +72,7 @@ impl library "[[@TEST_NAME]]";
class C {}
fn MakeC(a: A) -> C {
// CHECK:STDERR: fail_factory.impl.carbon:[[@LINE+3]]:10: ERROR: Cannot access member of interface `Factory` in type `A` that does not implement that interface.
// CHECK:STDERR: fail_factory.impl.carbon:[[@LINE+3]]:10: error: cannot access member of interface `Factory` in type `A` that does not implement that interface
// CHECK:STDERR: return a.(Factory(C).Make)();
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~
return a.(Factory(C).Make)();
@@ -58,7 +58,7 @@ impl () as 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: impl () as C;
// CHECK:STDERR: ^~~~~~~~~~~~~
// CHECK:STDERR:
@@ -74,7 +74,7 @@ impl library "[[@TEST_NAME]]";
interface D {};
// 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: impl () as D;
// CHECK:STDERR: ^~~~~~~~~~~~~
impl () as D;