usethesource / rascal

The implementation of the Rascal meta-programming language (including interpreter, type checker, parser generator, compiler and JVM based run-time system)
http://www.rascal-mpl.org
Other
404 stars 78 forks source link

Incorrect undefined type error in anti-match #1710

Closed tvdstorm closed 7 months ago

tvdstorm commented 1 year ago

The type-checker reports an undefined type error for an existing ADT used in a negative match (!:=).

Reproduce:

data A = a();
void main() {
    value x = 3;
    if (A _ !:= x) {
        ;
    }
}

The error is at A in the if-conditional. Rascal version: 0.26.5 (VSCode extension version 0.5.3)

jurgenvinju commented 1 year ago

@PaulKlint Is this still an issue or fixed in the latest version? I have problems compiling salix-core due to this bug with the current rascal-maven-plugin.

PaulKlint commented 7 months ago

Thanks for reporting! This was a subtle bug in the typechecker related to the scoping of pattern variables. Fixed in upcoming release.