rascal
rascal copied to clipboard
False positive message: undeclared data-type in left-hand side of no-match
trafficstars
Describe the bug
[ERROR] salix/Core.rsc:195:13: Undefined
Attr
is about this code in salix:
if (vals != []) {
if (void() block := vals[-1]) {
block();
}
else if (Node h := vals[-1]) {
add(h);
}
else if (Attr _ !:= vals[-1]) { // ERROR iS REPORTED HERE
_text(vals[-1]);
}
}
But Attr is used elsewhere in the module and there are no complaints. The code also runs correctly in the interpreter.
I'll try and make a small test case for this bug later
To Reproduce
- clone the salix project: https://github.com/cwi-swat/salix
- run
mvn compile - or edit
src/salix/Core.rscin an IDE that supports the Rascal type-checker