Skip to content

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

Merged

Conversation

slavapestov
Copy link
Contributor

No description provided.

@slavapestov slavapestov force-pushed the subclass-existentials-clang-importer branch from 81e5d5c to a5c8a44 Compare April 18, 2017 23:04
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.
@slavapestov slavapestov force-pushed the subclass-existentials-clang-importer branch from a5c8a44 to 5dba1e8 Compare April 19, 2017 04:20
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@slavapestov slavapestov changed the title [WIP] ClangImporter: Support for subclass existentials ClangImporter: Support for subclass existentials Apr 19, 2017
@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - 5dba1e839c540db90d65089e10e2459d524e02f1
Test requested by - @slavapestov

@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - 5dba1e839c540db90d65089e10e2459d524e02f1
Test requested by - @slavapestov

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - 5dba1e839c540db90d65089e10e2459d524e02f1
Test requested by - @slavapestov

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.
@slavapestov slavapestov force-pushed the subclass-existentials-clang-importer branch from de67234 to 57b2c05 Compare April 19, 2017 08:05
@slavapestov
Copy link
Contributor Author

@swift-ci Please clean test

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - de67234c28359543c1f73ffc5f113cbaf030dcc2
Test requested by - @slavapestov

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - de67234c28359543c1f73ffc5f113cbaf030dcc2
Test requested by - @slavapestov

@slavapestov
Copy link
Contributor Author

@swift-ci smoke test Linux

@slavapestov
Copy link
Contributor Author

@slavapestov slavapestov merged commit 53305f1 into swiftlang:master Apr 19, 2017
@aciidgh
Copy link
Contributor

aciidgh commented Apr 19, 2017

Ah, that was a non-deterministic test. It was fixed by: swiftlang/swift-package-manager#1097

@slavapestov
Copy link
Contributor Author

Thanks!

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.

3 participants