[ASTGen] Update for UnexpectedCodeDeclSyntax addition

This commit is contained in:
Rintaro Ishizaki
2025-09-27 12:04:09 -07:00
parent 9683569f25
commit 7a4b7aa92a
2 changed files with 4 additions and 1 deletions

View File

@@ -67,6 +67,9 @@ extension ASTGenVisitor {
return self.generate(subscriptDecl: node).asDecl
case .typeAliasDecl(let node):
return self.generate(typeAliasDecl: node)?.asDecl
case .unexpectedCodeDecl:
// Ignore unexpected code.
return nil
case .variableDecl(let node):
return self.generate(variableDecl: node)
case .usingDecl(let node):

View File

@@ -46,7 +46,7 @@ func testInvalidContent(baseExpr: MyStruct, otherExpr: Int) {
baseExpr // expected-warning {{expression of type 'MyStruct' is unused}}
#if CONDITION_1
+ otherExpr // expected-error {{unexpected code '+ otherExpr' in conditional compilation block}}
+ otherExpr // expected-error {{unexpected code '+ otherExpr' in conditional compilation clause}}
#endif
baseExpr