-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[embedded] Improve the diagnostic message when using an existential #69081
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
[embedded] Improve the diagnostic message when using an existential #69081
Conversation
|
@swift-ci please test |
eeckstein
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm.
Just a small comment about the wording.
include/swift/AST/DiagnosticsSIL.def
Outdated
| ERROR(non_final_generic_class_function,none, | ||
| "classes cannot have non-final generic fuctions in embedded Swift", ()) | ||
| ERROR(embedded_swift_existential_type,none, | ||
| "Existential type %0 is unavailable in embedded Swift", (Type)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: I think we don't use "existential" as user facing term. There are a few other error messages which contain "existential", but I think it's better to call it "protocol-type" or "protocol as type", like it's done for other sema error messages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
value of protocol type %0 is what we use in Sema.
Another nit: the message shouldn't be capitalized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about this wording?
ERROR(embedded_swift_existential_type,none,
"using values of protocol type %0 is not allowed in embedded Swift", (Type))
ERROR(embedded_swift_existential,none,
"using values of protocol types is not allowed in embedded Swift", ())
|
@swift-ci please test |
include/swift/AST/DiagnosticsSIL.def
Outdated
| ERROR(embedded_swift_existential_type,none, | ||
| "using values of protocol type %0 is not allowed in embedded Swift", (Type)) | ||
| ERROR(embedded_swift_existential,none, | ||
| "using values of protocol types is not allowed in embedded Swift", ()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about cannot use a value of protocol type %0 in embedded Swift? this aligns better with the rest of the diagnostic we have.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds great, let's go with that. Thanks!
|
@swift-ci please test |
d6a4cad to
30046b1
Compare
|
@swift-ci please test |
No description provided.