Skip to content

Disable assertions that check TokenKind #1311

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

Merged
Merged
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
10 changes: 8 additions & 2 deletions Sources/SwiftSyntax/Raw/RawSyntaxNodes.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,15 @@ public struct Raw${node.name}: Raw${node.name if node.is_base() else node.base_t
% end
% end
% if child.is_optional:
assert(${child.swift_name} == nil || ${' || '.join([f'{child.swift_name}?.tokenKind{base} == {choice}' for (base, choice) in choices])}, "Received \(String(describing: ${child.swift_name}?.tokenKind))")
%{
# FIXME: Assert disabled because normal CI doesn't have assertions enabled and debug CI seems to fail in a variety of places with this assertion
# assert(${child.swift_name} == nil || ${' || '.join([f'{child.swift_name}?.tokenKind{base} == {choice}' for (base, choice) in choices])}, "Received \(String(describing: ${child.swift_name}?.tokenKind))")
}%
% else:
assert(${' || '.join([f'{child.swift_name}.tokenKind{base} == {choice}' for (base, choice) in choices])}, "Received \(${child.swift_name}.tokenKind)")
%{
# FIXME: Assert disabled because normal CI doesn't have assertions enabled and debug CI seems to fail in a variety of places with this assertion
# assert(${' || '.join([f'{child.swift_name}.tokenKind{base} == {choice}' for (base, choice) in choices])}, "Received \(${child.swift_name}.tokenKind)")
}%
% end
% end
% end
Expand Down
Loading