Skip to content
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

[concurrency] Allow ObjC completion-handler methods to be imported as effectful properties #36670

Merged
merged 4 commits into from
Apr 2, 2021

Conversation

kavon
Copy link
Member

@kavon kavon commented Mar 31, 2021

The scope of this PR is limited to ObjC methods that have only a completion-handler argument, since those are the most likely kinds of APIs that have not yet chosen whether they should be represented as an async method or async property.

TODOs:

  • Basic implementation (through SILGen looking OK)
  • Test IDE interface printing
  • Write SILGen test
  • Write execution test

resolves rdar://73726567

@kavon kavon force-pushed the objc-effectful-properties branch 3 times, most recently from 67815cc to b52efc5 Compare April 2, 2021 03:31
@kavon kavon marked this pull request as ready for review April 2, 2021 03:37
lib/ClangImporter/ImportType.cpp Outdated Show resolved Hide resolved
lib/ClangImporter/ImportType.cpp Show resolved Hide resolved
@kavon kavon force-pushed the objc-effectful-properties branch 3 times, most recently from c20d0d6 to a7e81f0 Compare April 2, 2021 14:58
kavon added 4 commits April 2, 2021 08:33
…properties

either as an `async` or `async throws` property, by marking it
with swift_async_name("getter:PROPERTY_NAME()") where `PROPERTY_NAME`
will be the name of the property it will be imported as.

This is in lieu of being imported as an async method. It's still
imported as an `@objc` method as well.
@kavon kavon force-pushed the objc-effectful-properties branch from a7e81f0 to 1586ca8 Compare April 2, 2021 15:33
@kavon kavon changed the title [concurrency] Allow ObjC 'get'-like methods to be imported as (effectful) properties [concurrency] Allow ObjC 'get'-like methods to be imported as effectful properties Apr 2, 2021
@kavon kavon changed the title [concurrency] Allow ObjC 'get'-like methods to be imported as effectful properties [concurrency] Allow ObjC completion-handler methods to be imported as effectful properties Apr 2, 2021
@kavon
Copy link
Member Author

kavon commented Apr 2, 2021

@swift-ci please smoke test and merge

1 similar comment
@kavon
Copy link
Member Author

kavon commented Apr 2, 2021

@swift-ci please smoke test and merge

@kavon
Copy link
Member Author

kavon commented Apr 2, 2021

Linux failure was something unrelated to this PR

@kavon
Copy link
Member Author

kavon commented Apr 2, 2021

@swift-ci please smoke test Linux platform

@kavon kavon merged commit 04e4d97 into swiftlang:main Apr 2, 2021
@kavon kavon deleted the objc-effectful-properties branch April 5, 2021 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants