-
Notifications
You must be signed in to change notification settings - Fork 441
Don’t eat closing braces while trying to recover to a declaration start keyword #1023
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
Don’t eat closing braces while trying to recover to a declaration start keyword #1023
Conversation
@swift-ci Please test |
let baselineRootConverter = SourceLocationConverter(file: "Baseline.swift", source: baseline.root.description) | ||
let nodeRootConverter = SourceLocationConverter(file: "Actual.swift", source: node.root.description) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May as well use these when printing the nodes above as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea 👍
|| fileURL.absoluteString.contains("26190-swift-iterabledeclcontext-getmembers.swift") | ||
|| fileURL.absoluteString.contains("26139-swift-abstractclosureexpr-setparams.swift") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These aren't even that bad, pretty surprising to me that they cause a stack overflow. Isn't even 100 nested braces!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue here appears to be debug builds. In release builds, these are just fine.
This was caused by the latest SwiftSyntaxBuilder API update
e2bd89e
to
2e7b363
Compare
@swift-ci please test |
@swift-ci Please test |
Previously, when given
recovery to the second
class
(because^
is unexpected) would also consume the closing}
nestingB
insideA
. That’s unexpected. Recovery of decl keywords inside member decl lists should not consume closing braces.While doing this, also fix a few miscellaneous bugs in the test infrastructure.