Open davidstreader opened 4 years ago
I don't get any parse errors on this example.
Currently, Dafny looks up case-pattern constructor names in the type of the source expression (that is, the type of t
in failing
). It also does this for nested constructors in patterns. So, currently, case patterns do not support (or (usually) need) qualifications.
Enhancement: Dafny should support (but not insist on) qualifications in patterns. If a qualification (like TL.Leaf
or TL.Twee.Leaf
) is mentioned, then the qualification is the guide to where the constructor name is looked up. If no qualification is given, then the behavior is as today.
Another enhancement: For unqualified constructors in nested patterns, the Dafny implementation should partially solve type constraints before looking up the constructor name (just like it does at the outermost level).
This seems to be a bug But I am no expert.
The function failing produces two parse errors. Yet moved to module inner and with
TL.
removed it can be verified.