Skip to content

[ClangImporter] Handle property with getter that returns instancetype #12414

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
merged 1 commit into from
Oct 16, 2017

Conversation

jrose-apple
Copy link
Contributor

@jrose-apple jrose-apple commented Oct 13, 2017

We just import this as a property, and Swift doesn't support properties with dynamic Self type, even if they are read-only. Don't mark the getter as returning dynamic Self in this case.

(This was only a problem in builds with the AST verifier turned on.)

SR-5684 / rdar://problem/33897488

We just import this as a property, and Swift doesn't support
properties with dynamic Self type, even if they are read-only. Don't
mark the getter as returning dynamic Self in this case.

(This was only a problem in builds with the AST verifier turned on.)

https://bugs.swift.org/browse/SR-5684
@jrose-apple jrose-apple force-pushed the no-instancetype-for-you branch from ae13b75 to d56a927 Compare October 13, 2017 03:04
@jrose-apple
Copy link
Contributor Author

Fixing this sooner rather than later because SwiftPM is running into it. cc @aciidb0mb3r

@swift-ci Please test

@aciidgh
Copy link
Contributor

aciidgh commented Oct 13, 2017

Thanks a lot @jrose-apple 🎉😱👍

/cc @briancroom

@slavapestov
Copy link
Contributor

Ah, oops.

At one point I did look into making get-only properties support a Self type, but there was too much stuff to fix up because the code path for handling dynamic Self returns is really specific to functions right now. If we ever get that sorted out it seems like we could conditionally import these properties with the right type if -swift-version is 7 or whatever.

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @jrose-apple

@jrose-apple jrose-apple merged commit 2f932ff into swiftlang:master Oct 16, 2017
@jrose-apple jrose-apple deleted the no-instancetype-for-you branch October 16, 2017 17:18
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.

4 participants