Closed TheDutchDevil closed 6 years ago
@TheDutchDevil thanks for letting me know. I can reproduce the issue locally. I will try my best to work on a fix between Christmas and New Year, otherwise, will be early Jan.
@ryuichis Thanks a lot for your quick response and work on the parser!
Thanks a lot for the quick fix!
@TheDutchDevil no problem, thanks for informing me with the issue. Happy new year!
🚨New Issue Checklist🚨
swift-ast -github-issue /path/to/file.swift
might help me generate this fileIssue Summary
The file attached to this issue can be successfully built and executed using
swiftc
with no additional parameters.Environment
Reproduction Steps
Parse the included file using
swift-ast -dump-ast <file>
and observe that it fails to parse the value matching in the catch clause.Sample code
``` enum VendingMachineError: Error { case insufficientFunds(coinsNeeded: Int) } func throwsSomething() throws -> String { return "This doesn't matter" } do { try throwsSomething() } catch VendingMachineError.insufficientFunds(3) { print("3 coins missing") } catch VendingMachineError.insufficientFunds(let coinsNeeded) { print("Not 3 coins missing") } catch { print("No coins missing") } ``` Command to run `swift-ast` with the code above: `swift-ast /home/nathan/value_ex.swift`Expected Result
A valid ast dump for the test file, it appears that swift-ast does not correctly parse the type instantiation for the value matching.
Actual Behavior