Should not allow repeated variable name in pattern
Bug #509939 reported by
Matt Giuca
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mars |
Fix Released
|
Low
|
Matt Giuca |
Bug Description
Mars allows the same variable name to be used multiple times in a pattern, which means the variable will be bound several times. In the current backend (interpret), this binds the variable to its rightmost value.
eg:
x :: Pair(Int, Int)
switch x:
case Pair(n, n):
return n
It should be a compiler error. (Hugs gives the error: "Repeated variable "n" in pattern").
Related branches
tags: | added: language |
Changed in mars: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Fixed in trunk r951.