mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Revert r1144, r1145, and r1146. These changes (which removed ParenType
in favor of a single-element non-canonical TupleType) broke the type
system, in that supposed sugar (the TupleType) supported a different
set of operations from the canonical type. For example, a
single-element unlabelled tuple type supports elementwise projection
(foo.$0), but the underlying element does not (or supports it
differently).
The IR-gen failure was due to a very related problem: IR-gen
was not updated to reflect that a single unlabelled tuple element
is the same type as its element type, and therefore it was giving
different representations to these types ({ %foo } and %foo,
respectively), which broke widespread assumptions.
The removal of ParenType was done in pursuit of an AST invariant
that's not actually particularly interesting in the first place
and which, furthermore, is problematic to attain.
Swift SVN r1182
This commit is contained in:
@@ -36,6 +36,9 @@ static bool checkFullyTyped(Parser &P, Type type) {
|
||||
case TypeKind::Dependent:
|
||||
return false;
|
||||
|
||||
case TypeKind::Paren:
|
||||
return checkFullyTyped(P, cast<ParenType>(type)->getUnderlyingType());
|
||||
|
||||
case TypeKind::LValue:
|
||||
return checkFullyTyped(P, cast<LValueType>(type)->getObjectType());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user