This is a repro of a case that recently started failing in one of swift-format's tests against the main branch (I'm using the 2021-04-26 development snapshot as my current environment).
When parsing the following source code:
{{ let x: (A -> B)}}
(Note that "A" should have its own parentheses surrounding it for this to be valid.)
The parser crashes with the following message:
Assertion failed: (isValid() && "length does not make sense for an invalid range"), function getByteLength, file /Users/buildnode/jenkins/workspace/oss-swift-package-macos/swift/include/swift/Basic/SourceLoc.h, line 218.
I would expect this to fail in some other, non-crashing fashion, such as expressing the syntax using Unknown* nodes.
To reproduce:
Download the attached project.
Use a development toolchain that is syntax-compatible with swift-syntax's main branch (at the time I'm writing this, 2021-04-26 worked).
Run swift run TriviaCrash.
The text was updated successfully, but these errors were encountered:
Attachment: Download
Additional Detail from JIRA
md5: 103052cad603311e83a1a277c4a8f594
Issue Description:
This is a repro of a case that recently started failing in one of swift-format's tests against the main branch (I'm using the 2021-04-26 development snapshot as my current environment).
When parsing the following source code:
{{ let x: (A -> B)}}
(Note that "A" should have its own parentheses surrounding it for this to be valid.)
The parser crashes with the following message:
Assertion failed: (isValid() && "length does not make sense for an invalid range"), function getByteLength, file /Users/buildnode/jenkins/workspace/oss-swift-package-macos/swift/include/swift/Basic/SourceLoc.h, line 218.
I would expect this to fail in some other, non-crashing fashion, such as expressing the syntax using Unknown* nodes.
To reproduce:
Download the attached project.
Use a development toolchain that is syntax-compatible with swift-syntax's main branch (at the time I'm writing this, 2021-04-26 worked).
Run
swift run TriviaCrash
.The text was updated successfully, but these errors were encountered: