mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Constraint system] Maintain paren type sugar for patterns.
This commit is contained in:
@@ -2207,9 +2207,12 @@ namespace {
|
||||
|
||||
switch (pattern->getKind()) {
|
||||
case PatternKind::Paren:
|
||||
// Parentheses don't affect the type.
|
||||
return getTypeForPattern(cast<ParenPattern>(pattern)->getSubPattern(),
|
||||
locator);
|
||||
// Parentheses don't affect the canonical type, but record them as
|
||||
// type sugar.
|
||||
return ParenType::get(
|
||||
CS.getASTContext(),
|
||||
getTypeForPattern(
|
||||
cast<ParenPattern>(pattern)->getSubPattern(), locator));
|
||||
case PatternKind::Var:
|
||||
// Var doesn't affect the type.
|
||||
return getTypeForPattern(cast<VarPattern>(pattern)->getSubPattern(),
|
||||
|
||||
Reference in New Issue
Block a user