-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AST/Sema/SILGen: Implement tuple conversions
TupleShuffleExpr could not express the full range of tuple conversions that were accepted by the constraint solver; in particular, while it could re-order elements or introduce and eliminate labels, it could not convert the tuple element types to their supertypes. This was the source of the annoying "cannot express tuple conversion" diagnostic. Replace TupleShuffleExpr with DestructureTupleExpr, which evaluates a source expression of tuple type and binds its elements to OpaqueValueExprs. The DestructureTupleExpr's result expression can then produce an arbitrary value written in terms of these OpaqueValueExprs, as long as each OpaqueValueExpr is used exactly once. This is sufficient to express conversions such as (Int, Float) => (Int?, Any), as well as the various cases that were already supported, such as (x: Int, y: Float) => (y: Float, x: Int). https://bugs.swift.org/browse/SR-2672, rdar://problem/12340004
- Loading branch information
1 parent
ab81406
commit e2c9c52
Showing
15 changed files
with
295 additions
and
357 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.