mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
fix <rdar://problem/20457938> typed pattern is not allowed on if/let condition
Swift SVN r27110
This commit is contained in:
@@ -850,9 +850,11 @@ ParserStatus Parser::parseStmtCondition(StmtCondition &Condition,
|
||||
//
|
||||
if (Tok.is(tok::identifier) && peekToken().is(tok::colon))
|
||||
Pattern = parseSwift1IfLetPattern(IsLet, VarLoc);
|
||||
else
|
||||
else {
|
||||
Pattern = parseMatchingPatternAsLetOrVar(IsLet, VarLoc,
|
||||
/*isExprBasic*/ true);
|
||||
Pattern = parseOptionalPatternTypeAnnotation(Pattern);
|
||||
}
|
||||
Status |= Pattern;
|
||||
|
||||
if (Pattern.isNull() || Pattern.hasCodeCompletion())
|
||||
|
||||
Reference in New Issue
Block a user