Skip to content

Commit aae0881

Browse files
authored
Merge pull request #79854 from DougGregor/se-0458-eof-disambig
2 parents 3169cda + b9cb5ce commit aae0881

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/Parse/ParseExpr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ ParserResult<Expr> Parser::parseExprSequenceElement(Diag<> message,
439439
if (Tok.isContextualKeyword("unsafe") &&
440440
!(peekToken().isAtStartOfLine() ||
441441
peekToken().isAny(tok::r_paren, tok::r_brace, tok::r_square,
442-
tok::equal, tok::colon, tok::comma) ||
442+
tok::equal, tok::colon, tok::comma, tok::eof) ||
443443
(isExprBasic && peekToken().is(tok::l_brace)) ||
444444
peekToken().is(tok::period) ||
445445
(peekToken().isAny(tok::l_paren, tok::l_square) &&

test/Unsafe/safe.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ func moreUnsafeFunc(unsafe: [Int]) {
207207
// expected-warning@-1{{no unsafe operations occur within 'unsafe' expression}}
208208

209209
_ = unsafe[1]
210+
211+
_ = "\(unsafe)"
210212
}
211213

212214
func yetMoreUnsafeFunc(unsafe: () -> Void) {

0 commit comments

Comments
 (0)