Open
Description
Code like this
function member
with ([],_) do
false
with ([h|_],m) when h==m do <<<< illegal
true
with ([_|t],m) do
member(t,m)
end
Should generate an error. The illegal pattern gets mapped into a pattern with apply nodes in it,
| | | | | | | |(lineinfo
| | | | | | | | |(member1.ast 4))
| | | | | | | |(body
| | | | | | | | |(body-pattern
| | | | | | | | | |(apply
| | | | | | | | | | |(id __eq__)
| | | | | | | | | | |(tuple
| | | | | | | | | | | |[
| | | | | | | | | | | | |(apply <<<<
| | | | | | | | | | | | | |(apply
| | | | | | | | | | | | | | |(tuple
| | | | | | | | | | | | | | | |[
| | | | | | | | | | | | | | | | |(head-tail
| | | | | | | | | | | | | | | | | |(id h)
| | | | | | | | | | | | | | | | | |(id _))
| | | | | | | | | | | | | | | | |(id m)])
| | | | | | | | | | | | | | |(id when)) <<<<
| | | | | | | | | | | | | |(id h))
| | | | | | | | | | | | |(id m)])))
| | | | | | | | |(stmt-list
| | | | | | | | | |(list
| | | | | | | | | | |[
| | | | | | | | | | | |(lineinfo
| | | | | | | | | | | | |(member1.ast 5))
| | | | | | | | | | | |(clear-ret-val)
| | | | | | | | | | | |(exp-stmt
| | | | | | | | | | | | |(set-ret-val
| | | | | | | | | | | | | |(boolean True)))])))
This needs to be rejected.
Metadata
Metadata
Assignees
Labels
No labels