-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Adding optional message to _unavailableFromAsync
#40378
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
Adding optional message to _unavailableFromAsync
#40378
Conversation
@swift-ci please test |
Build failed |
@swift-ci please clean test Linux |
e3deaca
to
043d391
Compare
@swift-ci please test |
Build failed |
@swift-ci please clean test Linux |
@swift-ci please test |
@swift-ci please clean test Linux |
@@ -4719,7 +4719,7 @@ ERROR(async_named_decl_must_be_available_from_async,none, | |||
"asynchronous %0 %1 must be available from asynchronous contexts", | |||
(DescriptiveDeclKind, DeclName)) | |||
ERROR(async_unavailable_decl,none, | |||
"%0 %1 is unavailable from asynchronous contexts", (DescriptiveDeclKind, DeclBaseName)) | |||
" %0 %1 is unavailable from asynchronous contexts%select{|; %3}2", (DescriptiveDeclKind, DeclBaseName, bool, StringRef)) |
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.
Hate to point it out, but there's an extra space at the beginning here
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.
Oh that's where that space went. Nice catch. Thanks.
Adding the ability to add an optional message to the unavailable from async attribute. This can be used to indicate other possible API to use, or help explain why it's unavailable.
Adding nice error messages for when things go wrong.
eba737a
to
34fc8cd
Compare
@swift-ci please test |
@swift-ci please clean test Linux |
I'm adding an optional
message
field to the_unavailableFromAsync
attribute so that API devs can provide more information about how to proceed. Not all API necessarily have a replacement so this is an optional parameter.Something like a "renamed" declaration would be nice, though
renamed
doesn't make sense since we aren't renaming the API.Commits will get cleaned up once #40149 merges.