Skip to content

[3.1] Track the actual DC of a member access in the constraint system. #7059

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

Conversation

DougGregor
Copy link
Member

Without this, CSGen/CSSimplify and CSApply may have differing
opinions about whether e.g. a let property is settable, which
can lead to invalid ASTs.

Arguably, a better fix would be to remove the dependency on the
exact nested DC. For example, we could treat lets as settable
in all contexts and then just complain later about invalid
attempts to set them. Or we could change CSApply to directly
use the information it already has about how an l-value is used,
rather than trying to figure out whether it might be getting set.
But somehow, tracking a new piece of information through the
entire constraint system seems to be the more minimal change.

Fixes rdar://29810997.

Without this, CSGen/CSSimplify and CSApply may have differing
opinions about whether e.g. a let property is settable, which
can lead to invalid ASTs.

Arguably, a better fix would be to remove the dependency on the
exact nested DC.  For example, we could treat lets as settable
in all contexts and then just complain later about invalid
attempts to set them.  Or we could change CSApply to directly
use the information it already has about how an l-value is used,
rather than trying to figure out whether it *might* be getting set.
But somehow, tracking a new piece of information through the
entire constraint system seems to be the more minimal change.

Fixes rdar://29810997.

(cherry picked from commit 39b65f4)
@DougGregor DougGregor added this to the Swift 3.1 milestone Jan 26, 2017
@DougGregor
Copy link
Member Author

@swift-ci please test

@rjmccall
Copy link
Contributor

@dgregor Can I consider you as having reviewed this? :)

@dgregor
Copy link

dgregor commented Jan 26, 2017

@DougGregor I believe that last comment was meant for you :)

@DougGregor
Copy link
Member Author

@rjmccall yes, I reviewed & approved on the master PR

@ematejska ematejska merged commit 7e4f876 into swiftlang:swift-3.1-branch Jan 27, 2017
@DougGregor DougGregor deleted the track-access-dc-in-constraints-3.1 branch January 30, 2017 17:20
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