Pattern matching does not work for negative literals
Bug #912145 reported by
Matt Giuca
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mars |
Fix Committed
|
High
|
Matt Giuca |
Bug Description
Case statements do not match negative literals. I believe this is a regression since we removed the - sign from the integer literal syntax and made it part of the expression syntax. An example:
var x :: Int
switch x:
case 4:
pass
case -4:
pass
case _:
pass
Need to make the minus sign an explicit part of the pattern syntax.
Related branches
To post a comment you must log in.
I don't understand why the assignment statement equivalent (-4 = x) succeeds. (At least: fails correctly.)