-
Notifications
You must be signed in to change notification settings - Fork 10.5k
ClangImporter: Support for subclass existentials #8847
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
ClangImporter: Support for subclass existentials #8847
Conversation
81e5d5c
to
a5c8a44
Compare
Class-constrained existentials usually have unknown reference counting in Swift, because they can contain either Objective-C or native Swift classes. But if the class existential has a superclass bound which is known to be an imported Objective-C class, we can use Objective-C reference counting instead of unknown reference counting. This is tested with the next commit that adds ClangImporter support.
a5c8a44
to
5dba1e8
Compare
@swift-ci Please test |
Build failed |
@swift-ci Please test |
Build failed |
Build failed |
In Swift 3, an Objective-C type like SomeClass <SomeProtocol> is imported as SomeClass. The protocol qualification is erased unless the class bound is 'id' or 'Class'. Importing such types as class-constrained existentials is a source breaking change, so the new behavior is only enabled in Swift 4 mode. Furthermore as a transitional step the staging flag -enable-experimental-subclass-existentials has to be passed in also. The flag will soon be removed.
de67234
to
57b2c05
Compare
@swift-ci Please clean test |
Build failed |
Build failed |
@swift-ci smoke test Linux |
@aciidb0mb3r Can you take a look at the Linux test failure here? https://ci.swift.org/job/swift-PR-Linux/6876/consoleFull#-5114079ee1a197b-acac-4b17-83cf-a53b95139a76 |
Ah, that was a non-deterministic test. It was fixed by: swiftlang/swift-package-manager#1097 |
Thanks! |
No description provided.