-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Exclude properties of class with type Self #23485
Exclude properties of class with type Self #23485
Conversation
7c9b5b3
to
c317fda
Compare
Is there a reason to exclude this for concrete value types? |
Value types work so I've pushed another commit. @xwu, are you able to run tests for me please? |
I've re-synced to apple/master and tests now pass so this change should be ready to merge. |
29a1c14
to
40016d5
Compare
@swift-ci Please test |
Build failed |
Build failed |
👍, thanks @xwu, LGTM. |
@swift-ci Please test |
@swift-ci Please test |
Build failed |
Build failed |
Thanks @xwu, over to you @slavapestov |
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.
If you want, you can try to lift the restriction on get-only properties returning Self in a subsequent PR. It shouldn't be difficult!
Thanks @slavapestov, another time perhaps. Would you be able to cherry pick it to 5.1 for me please? I've exhausted my git skills with the fork I have which doesn't have a swift-5.1-branch. |
Sure. |
Here you go: #23613 |
ta! |
Hi Apple,
as a followup to #22863, prevent people from declaring properties of type
Self
which seems to not work particularly well as mentioned in the Jira below and the previous PR. This isn't really a solution but prevents compiler crashes and erratic diagnostics. cc @slavapestov. It now gives the error below when a user tries to declare a property with typeSelf
in a class:Resolves #52537.