Skip to content

Sema: Fix another SE-0110 issue [4.0] #9455

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

  • Description: Fixes a spot in the type checker where we were not wrapping a single-argument function input in a paren type, which caused type check failures in 4.0 mode.

  • Scope of the issue: Affects anyone migrating code from Swift 3 to Swift 4.

  • Risk: Low, this is a very narrow fix and the new type is more "correct".

  • Origination: Unmasked with the implementation of SE-0110 which is only enabled in Swift 4 mode, but the bug has been there all along.

  • Tested: New test case added.

  • Radar: rdar://problem/31725325.

  • Reviewed by: Mark Lacey

@slavapestov
Copy link
Contributor Author

@rudkx Can you review for 4.0?

@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@rudkx
Copy link
Contributor

rudkx commented May 10, 2017

LGTM. Thanks!

@swift-ci
Copy link
Contributor

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

@slavapestov
Copy link
Contributor Author

Oops, looks like I should have run the tests locally first. Something that used to be ambiguous is no longer ambiguous -- might be an accidental bug fix but I need to investigate. I'll ping you when it's ready to review for real.

The formal type of methods should be (Type) -> (Args...) -> (),
not Type -> (Args...) -> ().

This only matters in Swift 4 mode, where it was preventing the
newly-added test case from type checking.

Fixes <rdar://problem/31725325>.
@slavapestov slavapestov force-pushed the se-0110-strikes-again-4.0 branch from a8bfa20 to c49a06a Compare May 10, 2017 05:30
@slavapestov
Copy link
Contributor Author

@rudkx The expected error that was no longer occurring in that test was something I added back when I implemented SE-0110, with a FIXME... and promptly forgot to ever investigate. It was the same bug. I've updated the test, this should be green now. There's no change to the logic, can I assume the LGTM still stands?

@slavapestov
Copy link
Contributor Author

@swift-ci Please test

1 similar comment
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

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

@rudkx
Copy link
Contributor

rudkx commented May 10, 2017

Yes, LGTM still stands - the change looks like the right thing to do.

@ematejska ematejska merged commit f5dac67 into swiftlang:swift-4.0-branch May 10, 2017
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