rascal
rascal copied to clipboard
ClassCastException in top-down visit
Describe the bug
rascal>toDefaultRec({-276798823r185339102,-173549339r466608811,0})
java.lang.ClassCastException: class io.usethesource.vallang.impl.persistent.List cannot be cast to class io.usethesource.vallang.ISet (io.usethesource.vallang.impl.persistent.List and io.usethesource.vallang.ISet are in unnamed module of loader 'app')
(internal error)
at $shell$(|main://$shell$|)
java.lang.ClassCastException: class io.usethesource.vallang.impl.persistent.List cannot be cast to class io.usethesource.vallang.ISet (io.usethesource.vallang.impl.persistent.List and io.usethesource.vallang.ISet are in unnamed module of loader 'app')
at org.rascalmpl.interpreter.TraversalEvaluator.traverseSetOnce(TraversalEvaluator.java:475)
at org.rascalmpl.interpreter.TraversalEvaluator.traverseOnce(TraversalEvaluator.java:169)
This is triggered with a function like this:
value rewrite(value x) = top-down visit(x) {
case value z => r(z);
}
value r(set[value] s)= [*s];
default r(value a) = a;