rascal
rascal copied to clipboard
Type constructor subtype issue?
Describe the bug
I had an unexpected error;
Error: [ERROR] String.rsc:547:011: Type parameter
CharClassshould be less than![], foundTree
In this code:
public str squeeze(str src, type[&CharClass <: ![]] _) = visit(src) {
case /<c:.><c>+/ => c
when &CharClass _ := Tree::char(charAt(c, 0))
};
The interpreter does not have the same error. I think the code is correct. Something with the := check? Or comparability or lub with char classes?