Skip to content

Commit b9d61fe

Browse files
committed
Revert "Revert "Merge pull request swiftlang#26974 from rintaro/syntaxparse-roundtrip2""
This reverts commit 8df497d.
1 parent f5ff30d commit b9d61fe

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/Parse/ParseDecl.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4097,8 +4097,10 @@ parseDeclTypeAlias(Parser::ParseDeclOptions Flags, DeclAttributes &Attributes) {
40974097
Status |= parseIdentifierDeclName(
40984098
*this, Id, IdLoc, "typealias",
40994099
[](const Token &next) { return next.isAny(tok::colon, tok::equal); });
4100-
if (Status.isError())
4100+
if (Status.isError()) {
4101+
TmpCtxt->setTransparent();
41014102
return nullptr;
4103+
}
41024104

41034105
DebuggerContextChange DCC(*this, Id, DeclKind::TypeAlias);
41044106

test/Syntax/round_trip_misc.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ do {
2222
do {
2323
typealias Alias3 = () -> @objc func
2424
}
25+
do {
26+
typealias
27+
}
2528

2629
// Orphan '}' at top level
2730
}

0 commit comments

Comments
 (0)