-
Notifications
You must be signed in to change notification settings - Fork 42
Imply @NativeCoroutinesIgnore when container is @HiddenFromObjC #243
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
base: master
Are you sure you want to change the base?
Imply @NativeCoroutinesIgnore when container is @HiddenFromObjC #243
Conversation
| !annotation.isNativeCoroutinesAnnotation(session) && annotation.isRefinementAnnotation(session) | ||
| } | ||
|
|
||
| internal fun FirClassLikeDeclaration.isRefined(session: FirSession): Boolean = |
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.
isRefined is probably not the best name here as types can't be annotated with @RefinesInSwift, so the only option is @HidesFromObjC.
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.
Addressed.
| val annotations = declaration.getNativeCoroutinesAnnotations(context.session) | ||
| val isRefined = declaration.isRefined(context.session) | ||
| val isRefined = | ||
| declaration.isRefined(context.session) || (declaration.getContainingClass()?.isRefined(context.session) |
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.
On the second thought, the whole containment chain needs to be checked for cases where the top-level class is hidden & nested classes have suspend functions/flows.
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.
Addressed.
rickclephas
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.
Looks good, thanks!
I find this PR helpful on its own, but ideally something like this should lead to a warning:
Yeah that would indeed be nice, I'll take a look 👍🏻 .
This PR builds on #164 to suppress exposed suspend function/flow warnings when the containing type is annotated with an annotation that
@HidesFromObjC.I find this PR helpful on its own, but ideally something like this should lead to a warning:
Happy New Year! 🎉