Skip to content

Additional declaration allowed on same line after #endif #1823

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ahoppen opened this issue Jun 20, 2023 · 2 comments · Fixed by #1833
Closed

Additional declaration allowed on same line after #endif #1823

ahoppen opened this issue Jun 20, 2023 · 2 comments · Fixed by #1833
Assignees
Labels
bug Something isn't working SwiftParser Bugs in the (new) Parser written in Swift

Comments

@ahoppen
Copy link
Member

ahoppen commented Jun 20, 2023

Issue Kind

Other

Source Code

struct Foo {
  #if false
  var x: Int
#endif; var x = 1
}

Description

The above example produces an error Extra tokens following conditional compilation directive in the old parser but is incorrectly accepted by the new parser.

@ahoppen ahoppen added bug Something isn't working SwiftParser Bugs in the (new) Parser written in Swift labels Jun 20, 2023
@ahoppen
Copy link
Member Author

ahoppen commented Jun 20, 2023

Tracked in Apple’s issue tracker as rdar://111059688

@ahoppen
Copy link
Member Author

ahoppen commented Jun 21, 2023

Similarly #sourceLocation(file: "other.swift", line: 1); let x = 1 is currently accepted but shouldn’t be

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working SwiftParser Bugs in the (new) Parser written in Swift
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants