mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 13:40:11 +01:00
Fix typo in ImplDeclInInvalidScope diagnostic (#7785)
And update the associated file test.
This commit is contained in:
@@ -147,7 +147,7 @@ static auto ScopesMatch(Context& context, const SemIR::Impl& new_impl,
|
||||
|
||||
// The redecl is is an invalid scope.
|
||||
CARBON_DIAGNOSTIC(ImplDeclInInvalidScope, Error,
|
||||
"impl redeclation not in a declarative scope; "
|
||||
"impl redeclaration not in a declarative scope; "
|
||||
"redeclaration is allowed only in a class or namespace");
|
||||
context.emitter().Emit(new_impl.latest_decl_id(), ImplDeclInInvalidScope);
|
||||
return ImplRedeclType::DiagnosedInvalidRedecl;
|
||||
|
||||
+4
-4
@@ -246,7 +246,7 @@ interface Z {}
|
||||
fn F() {
|
||||
class C {}
|
||||
impl C as Z;
|
||||
// CHECK:STDERR: fail_redecl_in_fn_scope.carbon:[[@LINE+8]]:3: error: impl redeclation not in a declarative scope; redeclaration is allowed only in a class or namespace [ImplDeclInInvalidScope]
|
||||
// CHECK:STDERR: fail_redecl_in_fn_scope.carbon:[[@LINE+8]]:3: error: impl redeclaration not in a declarative scope; redeclaration is allowed only in a class or namespace [ImplDeclInInvalidScope]
|
||||
// CHECK:STDERR: impl C as Z {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -268,7 +268,7 @@ fn F() {
|
||||
}
|
||||
|
||||
fn G() {
|
||||
// CHECK:STDERR: fail_redecl_in_different_fn_scope.carbon:[[@LINE+8]]:3: error: impl redeclation not in a declarative scope; redeclaration is allowed only in a class or namespace [ImplDeclInInvalidScope]
|
||||
// CHECK:STDERR: fail_redecl_in_different_fn_scope.carbon:[[@LINE+8]]:3: error: impl redeclaration not in a declarative scope; redeclaration is allowed only in a class or namespace [ImplDeclInInvalidScope]
|
||||
// CHECK:STDERR: impl C as Z {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -288,7 +288,7 @@ fn F() {
|
||||
if (true) {
|
||||
class C {}
|
||||
impl C as Z;
|
||||
// CHECK:STDERR: fail_redecl_in_block_scope.carbon:[[@LINE+8]]:5: error: impl redeclation not in a declarative scope; redeclaration is allowed only in a class or namespace [ImplDeclInInvalidScope]
|
||||
// CHECK:STDERR: fail_redecl_in_block_scope.carbon:[[@LINE+8]]:5: error: impl redeclaration not in a declarative scope; redeclaration is allowed only in a class or namespace [ImplDeclInInvalidScope]
|
||||
// CHECK:STDERR: impl C as Z {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -311,7 +311,7 @@ fn F() {
|
||||
impl C as Z;
|
||||
}
|
||||
if (true) {
|
||||
// CHECK:STDERR: fail_redecl_in_different_block_scope.carbon:[[@LINE+8]]:5: error: impl redeclation not in a declarative scope; redeclaration is allowed only in a class or namespace [ImplDeclInInvalidScope]
|
||||
// CHECK:STDERR: fail_redecl_in_different_block_scope.carbon:[[@LINE+8]]:5: error: impl redeclaration not in a declarative scope; redeclaration is allowed only in a class or namespace [ImplDeclInInvalidScope]
|
||||
// CHECK:STDERR: impl C as Z {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
|
||||
Reference in New Issue
Block a user