This attribute specifies how an error is represented for a swift async method. rdar://71941280
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Get rid of a useless return.
clang/lib/Sema/SemaDeclAttr.cpp | ||
---|---|---|
5977 | My understanding is that swift_error and swift_async_error don't conflict with each other. swift_error describes how the non-async swift function handles errors, whereas swift_async_error describes how the swift async function handles errors. Since both swift functions are generated, I think it can make sense to have both attributes on one ObjC function. I think it can make sense to have swift_async_error without swift_async, since the swift importer infers some functions are async without the swift_async attribute using heuristics based on parameter names. I guess we could mimic those heuristics here to diagnose when swift_async_error doesn't make sense alone, but ISTM that it makes more sense to do that check in the swift importer. |
LGTM modulo some testing requests. Thanks!
clang/lib/Sema/SemaDeclAttr.cpp | ||
---|---|---|
5977 | Thanks for the information!
Fine by me then! Can you add a test case with a comment showing that this is explicitly expected to be okay?
Also fine by me then! I don't think we need to go to great effort here to diagnose that (the swift importer can gain extra logic if that's useful). I think this is also worth a test case with a comment. (In both cases, I'm thinking mostly about code archeology projects in the future to answer "did they think of" kind of questions.) |
You can elide this return.