From 6d12fa0a830753183af35762eac3ea7a4feed962 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Sat, 2 May 2020 01:10:13 +0300 Subject: [PATCH] [Gardening] Fix repeated word in diagnostic message --- include/swift/AST/DiagnosticsSema.def | 2 +- .../special/coding/class_codable_failure_diagnostics.swift | 2 +- .../special/coding/class_codable_simple_conditional.swift | 2 +- .../coding/class_codable_simple_conditional_separate.swift | 2 +- .../special/coding/class_codable_simple_extension.swift | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/swift/AST/DiagnosticsSema.def b/include/swift/AST/DiagnosticsSema.def index e225c26427bbd..5378756985ba1 100644 --- a/include/swift/AST/DiagnosticsSema.def +++ b/include/swift/AST/DiagnosticsSema.def @@ -2686,7 +2686,7 @@ ERROR(implementation_only_override_import_without_attr,none, // Derived conformances ERROR(cannot_synthesize_init_in_extension_of_nonfinal,none, "implementation of %0 for non-final class cannot be automatically " - "synthesized in extension because initializer requirement %1 can only be " + "synthesized in extension because initializer requirement %1 can only " "be satisfied by a 'required' initializer in the class definition", (Type, DeclName)) ERROR(cannot_synthesize_in_crossfile_extension,none, diff --git a/test/decl/protocol/special/coding/class_codable_failure_diagnostics.swift b/test/decl/protocol/special/coding/class_codable_failure_diagnostics.swift index f6b8c0b6f3ffd..ba35fb4e92e4a 100644 --- a/test/decl/protocol/special/coding/class_codable_failure_diagnostics.swift +++ b/test/decl/protocol/special/coding/class_codable_failure_diagnostics.swift @@ -112,7 +112,7 @@ class C6 : Codable { // Non-final classes cannot synthesize Decodable in an extension. class C7 {} extension C7 : Decodable {} -// expected-error@-1 {{implementation of 'Decodable' for non-final class cannot be automatically synthesized in extension because initializer requirement 'init(from:)' can only be be satisfied by a 'required' initializer in the class definition}} +// expected-error@-1 {{implementation of 'Decodable' for non-final class cannot be automatically synthesized in extension because initializer requirement 'init(from:)' can only be satisfied by a 'required' initializer in the class definition}} // Check that the diagnostics from an extension end up on the extension class C8 { diff --git a/test/decl/protocol/special/coding/class_codable_simple_conditional.swift b/test/decl/protocol/special/coding/class_codable_simple_conditional.swift index e9268afea2640..6dd447e6508d5 100644 --- a/test/decl/protocol/special/coding/class_codable_simple_conditional.swift +++ b/test/decl/protocol/special/coding/class_codable_simple_conditional.swift @@ -22,7 +22,7 @@ class Conditional { } extension Conditional: Codable where T: Codable { // expected-note 2 {{where 'T' = 'Nonconforming'}} - // expected-error@-1 2 {{implementation of 'Decodable' for non-final class cannot be automatically synthesized in extension because initializer requirement 'init(from:)' can only be be satisfied by a 'required' initializer in the class definition}} + // expected-error@-1 2 {{implementation of 'Decodable' for non-final class cannot be automatically synthesized in extension because initializer requirement 'init(from:)' can only be satisfied by a 'required' initializer in the class definition}} } // They should receive synthesized init(from:) and an encode(to:). diff --git a/test/decl/protocol/special/coding/class_codable_simple_conditional_separate.swift b/test/decl/protocol/special/coding/class_codable_simple_conditional_separate.swift index 6fa14f24fc8aa..0033a58b734a8 100644 --- a/test/decl/protocol/special/coding/class_codable_simple_conditional_separate.swift +++ b/test/decl/protocol/special/coding/class_codable_simple_conditional_separate.swift @@ -25,7 +25,7 @@ extension Conditional: Encodable where T: Encodable { // expected-note {{where ' } extension Conditional: Decodable where T: Decodable { - // expected-error@-1 2 {{implementation of 'Decodable' for non-final class cannot be automatically synthesized in extension because initializer requirement 'init(from:)' can only be be satisfied by a 'required' initializer in the class definition}} + // expected-error@-1 2 {{implementation of 'Decodable' for non-final class cannot be automatically synthesized in extension because initializer requirement 'init(from:)' can only be satisfied by a 'required' initializer in the class definition}} } struct OnlyEnc: Encodable {} diff --git a/test/decl/protocol/special/coding/class_codable_simple_extension.swift b/test/decl/protocol/special/coding/class_codable_simple_extension.swift index dc37466a2b519..90b21c3331f00 100644 --- a/test/decl/protocol/special/coding/class_codable_simple_extension.swift +++ b/test/decl/protocol/special/coding/class_codable_simple_extension.swift @@ -20,7 +20,7 @@ class SimpleClass { // expected-note {{did you mean 'init'?}} } } -extension SimpleClass : Codable {} // expected-error 2 {{implementation of 'Decodable' for non-final class cannot be automatically synthesized in extension because initializer requirement 'init(from:)' can only be be satisfied by a 'required' initializer in the class definition}} +extension SimpleClass : Codable {} // expected-error 2 {{implementation of 'Decodable' for non-final class cannot be automatically synthesized in extension because initializer requirement 'init(from:)' can only be satisfied by a 'required' initializer in the class definition}} // They should not receive synthesized init(from:), but should receive an encode(to:). let _ = SimpleClass.init(from:) // expected-error {{type 'SimpleClass' has no member 'init(from:)'}}