Skip to content

Commit 278fb49

Browse files
authored
Merge pull request #31486 from AnthonyLatsis/diag-dup-word
[Gardening] Fix repeated word in diagnostic message
2 parents 942e8fb + 6d12fa0 commit 278fb49

5 files changed

+5
-5
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2686,7 +2686,7 @@ ERROR(implementation_only_override_import_without_attr,none,
26862686
// Derived conformances
26872687
ERROR(cannot_synthesize_init_in_extension_of_nonfinal,none,
26882688
"implementation of %0 for non-final class cannot be automatically "
2689-
"synthesized in extension because initializer requirement %1 can only be "
2689+
"synthesized in extension because initializer requirement %1 can only "
26902690
"be satisfied by a 'required' initializer in the class definition",
26912691
(Type, DeclName))
26922692
ERROR(cannot_synthesize_in_crossfile_extension,none,

test/decl/protocol/special/coding/class_codable_failure_diagnostics.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class C6 : Codable {
112112
// Non-final classes cannot synthesize Decodable in an extension.
113113
class C7 {}
114114
extension C7 : Decodable {}
115-
// 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}}
115+
// 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}}
116116

117117
// Check that the diagnostics from an extension end up on the extension
118118
class C8 {

test/decl/protocol/special/coding/class_codable_simple_conditional.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class Conditional<T> {
2222
}
2323

2424
extension Conditional: Codable where T: Codable { // expected-note 2 {{where 'T' = 'Nonconforming'}}
25-
// 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}}
25+
// 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}}
2626
}
2727

2828
// They should receive synthesized init(from:) and an encode(to:).

test/decl/protocol/special/coding/class_codable_simple_conditional_separate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ extension Conditional: Encodable where T: Encodable { // expected-note {{where '
2525
}
2626

2727
extension Conditional: Decodable where T: Decodable {
28-
// 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}}
28+
// 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}}
2929
}
3030

3131
struct OnlyEnc: Encodable {}

test/decl/protocol/special/coding/class_codable_simple_extension.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class SimpleClass { // expected-note {{did you mean 'init'?}}
2020
}
2121
}
2222

23-
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}}
23+
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}}
2424

2525
// They should not receive synthesized init(from:), but should receive an encode(to:).
2626
let _ = SimpleClass.init(from:) // expected-error {{type 'SimpleClass' has no member 'init(from:)'}}

0 commit comments

Comments
 (0)