We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug If you try to disable formatting around a "type" the formatter crashes.
To Reproduce Steps to reproduce the behavior: Try to format this:
struct Point { // dslx-fmt::off x: u32, // dslx-fmt::on y: u32, }
It segfaults:
F1202 08:05:30.335632 4899 logging.cc:62] assert.h assertion failed at third_party/xls/common/casts.h:59 in To xls::down_cast(From *) [To = xls::dslx::TypeAnnotation *, From = xls::dslx::AstNode]: f == nullptr || dynamic_cast<To>(f) != nullptr *** Check failure stack trace: *** @ 0x7f84ca3cd399 absl::log_internal::LogMessage::SendToLog() @ 0x7f84ca3cc8ae absl::log_internal::LogMessage::Flush() @ 0x7f84ca3cda19 absl::log_internal::LogMessageFatal::~LogMessageFatal() @ 0x7f84db999574 __assert_fail @ 0x7f8503270f63 xls::dslx::(anonymous namespace)::AstCloner::HandleStructDef()
Basically it's because VerbatimNode doesn't implement TypeAnnotation.
VerbatimNode
TypeAnnotation
Expected behavior Output = input
The text was updated successfully, but these errors were encountered:
This happens in other places too, e.g. in function parameters.
Sorry, something went wrong.
Seems like StructMembers aren't AST nodes so we can't completely replace them with VerbatimNodes.
No branches or pull requests
Describe the bug
If you try to disable formatting around a "type" the formatter crashes.
To Reproduce
Steps to reproduce the behavior:
Try to format this:
It segfaults:
Basically it's because
VerbatimNode
doesn't implementTypeAnnotation
.Expected behavior
Output = input
The text was updated successfully, but these errors were encountered: