Skip to content

When setting a willSet/didSet param's type, also set the TypeLoc #7377

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
Feb 10, 2017

Conversation

jrose-apple
Copy link
Contributor

@jrose-apple jrose-apple commented Feb 10, 2017

We don't actually need the TypeLoc for anything, but it was still getting type-checked, which means it doesn't get the benefit of inference from the initial value. In some cases the actual type of the ParamDecl seems to get reset to the TypeLoc's type as well. Just do the simple thing and set it directly ahead of time.

Fixes a source compatibility issue with Swift 3.0.

SR-3893

We don't actually need the TypeLoc for anything, but it was still
getting type-checked, which means it doesn't get the benefit of
inference from the initial value. In some cases the actual type of the
ParamDecl seems to get reset to the TypeLoc's type as well. Just do
the simple thing and set it directly ahead of time.

Fixes a source compatibility issue with Swift 3.0.

https://bugs.swift.org/browse/SR-3893
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@slavapestov
Copy link
Contributor

LGTM.

@jrose-apple jrose-apple merged commit df63c36 into swiftlang:master Feb 10, 2017
@jrose-apple jrose-apple deleted the TypeLoc-willSet-didSet branch February 10, 2017 03:15
jrose-apple added a commit to jrose-apple/swift that referenced this pull request Feb 10, 2017
…ftlang#7377)

We don't actually need the TypeLoc for anything, but it was still
getting type-checked, which means it doesn't get the benefit of
inference from the initial value. In some cases the actual type of the
ParamDecl seems to get reset to the TypeLoc's type as well. Just do
the simple thing and set it directly ahead of time.

Fixes a source compatibility issue with Swift 3.0.

https://bugs.swift.org/browse/SR-3893
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.

2 participants