Skip to content

[SR-14135]Updating diagnostic message for convenience init in struct #37267

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/swift/AST/DiagnosticsSema.def
Original file line number Diff line number Diff line change
Expand Up @@ -3470,7 +3470,7 @@ ERROR(cfclass_designated_init_in_extension,none,
"designated initializer cannot be declared in an extension of %0",
(DeclName))
ERROR(enumstruct_convenience_init,none,
"delegating initializers in %0 are not marked with 'convenience'",
"initializers in %0 are not marked with 'convenience'",
(StringRef))
ERROR(nonclass_convenience_init,none,
"convenience initializer not allowed in non-class type %0",
Expand Down
2 changes: 1 addition & 1 deletion test/decl/func/complete_object_init.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class DerivesA : A {
}

struct S {
convenience init(int i: Int) { // expected-error{{delegating initializers in structs are not marked with 'convenience'}}
convenience init(int i: Int) { // expected-error{{initializers in structs are not marked with 'convenience'}}
self.init(double: Double(i))
}

Expand Down
2 changes: 1 addition & 1 deletion test/decl/init/basic_init.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ extension InitStruct {
struct MyStruct {
init(k: Int) {
}
convenience init() { // expected-error {{delegating initializers in structs are not marked with 'convenience'}} {{3-15=}}
convenience init() { // expected-error {{initializers in structs are not marked with 'convenience'}} {{3-15=}}
self.init(k: 1)
}
}