Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/ASTGen/Sources/ASTGen/Decls.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion test/ASTGen/if_config_expr.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down