We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7bef540 commit 244a823Copy full SHA for 244a823
lib/Sema/CSGen.cpp
@@ -2207,9 +2207,12 @@ namespace {
2207
2208
switch (pattern->getKind()) {
2209
case PatternKind::Paren:
2210
- // Parentheses don't affect the type.
2211
- return getTypeForPattern(cast<ParenPattern>(pattern)->getSubPattern(),
2212
- locator);
+ // Parentheses don't affect the canonical type, but record them as
+ // type sugar.
+ return ParenType::get(
2213
+ CS.getASTContext(),
2214
+ getTypeForPattern(
2215
+ cast<ParenPattern>(pattern)->getSubPattern(), locator));
2216
case PatternKind::Var:
2217
// Var doesn't affect the type.
2218
return getTypeForPattern(cast<VarPattern>(pattern)->getSubPattern(),
0 commit comments