According to the language spec you can give a different name to a reference
when it is matched with a particular tag. It doesn't look like these names are
being checked for uniqueness, meaning that the following code gets through to
the code generator, producing Java code which then fails to compile due to the
reuse of the name "p".
###
package bug;
state NamingBug {
method x(p) {
match(p) {
case None { false }
case Some p { true }
}
}
}
###
Output from compilation with plaidc:
###
/Users/iainmcgin/bug/NamingBug.java:94: p is already defined in
invoke(plaid.runtime.PlaidObject,plaid.runtime.PlaidObject)
final plaid.runtime.PlaidObject p;
###
I stumbled across this while implementing some standard library pieces, it was
a mistake, not something I'd actually expect to work.
Original issue reported on code.google.com by iainmc...@gmail.com on 30 Jul 2011 at 3:58
Original issue reported on code.google.com by
iainmc...@gmail.com
on 30 Jul 2011 at 3:58