Skip to content

Sema fixes for SE-0110 #6908

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 7 commits into from
Jan 20, 2017

Conversation

slavapestov
Copy link
Contributor

@slavapestov slavapestov commented Jan 19, 2017

Fixes some issues with argument tuple handling, including compatibility problems in Swift 3 mode, and further tightening up and testing of the Swift 4 behavior.

@slavapestov slavapestov force-pushed the sema-substitution-fixes branch from 3f130e1 to 977b7c8 Compare January 19, 2017 09:30
@slavapestov slavapestov changed the title Sema substitution fixes Sema fixes for SE-0110 and other things Jan 19, 2017
@slavapestov slavapestov force-pushed the sema-substitution-fixes branch 2 times, most recently from 39e956d to f37a1a4 Compare January 19, 2017 11:28
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

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

@slavapestov slavapestov force-pushed the sema-substitution-fixes branch from f37a1a4 to af274fa Compare January 20, 2017 01:30
@slavapestov
Copy link
Contributor Author

@swift-ci Please test Linux

@slavapestov slavapestov changed the title Sema fixes for SE-0110 and other things Sema fixes for SE-0110 Jan 20, 2017
A change was recently made to canonicalize replacement types in
GenericSignature::getSubstitutions().

This resulted in ParenType being stripped off, which triggered
the 'tuple splat' diagnostic on code that was accepted in Swift 3.0.

I believe this canonicalization step is unnecessary; we
canonicalize using a brand-new ArchetypeBuilder that has no
generic signature added to it, so this is just equivalent to a
call to getCanonicalType().

Also adding the generic signature in question to the builder is
not the right answer either; the replacement types might be
written in terms of a different generic signature, or possibly
in terms of archetypes.

Taking this out seems to have no effect except changing a few
SIL dumps to contain sugared types, which should be harmless.

Part of fixing <rdar://problem/29739905>.
We would lose ParenType sugar in function types as a result.

Fixes part of <rdar://problem/29739905>.
Completes the fix of <rdar://problem/29739905>.
Instead of passing the original type and DeclContext, we just
need a GenericSignature.
ConstraintSystem::simplifyType() replaced types with their fixed types
from the global map.

Solution::simplifyType() replaced types with their fixed types from the
current bindings.

There were some minor differences between the two, and some dead code.
@slavapestov slavapestov force-pushed the sema-substitution-fixes branch from af274fa to c86b5ae Compare January 20, 2017 04:08
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

2 similar comments
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov slavapestov merged commit 703a63f into swiftlang:master Jan 20, 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.

2 participants