rascal
rascal copied to clipboard
Higher-order function bug
Describe the bug It seems the interpreter cannot always correctly choose which alternative to use, if multiple candidates exist. Encountered while working on a StackOverflow question from Bolderax.
To Reproduce
rascal>import List;
ok
rascal>mapper([[]], size)
list[int]: [0]
rascal>import Set;
ok
rascal>mapper([[]], size)
|std:///Set.rsc|(5814,255,<277,0>,<290,33>): Java("IllegalArgumentException","argument type mismatch")
at sun.reflect.NativeMethodAccessorImpl.invoke0(|unknown:///NativeMethodAccessorImpl.java|(0,0,<0,0>,<0,0>))
at size(|std:///List.rsc|(8946,3,<392,56>,<392,59>))
at $shell$(|prompt:///|(0,11,<1,0>,<1,11>)ok
rascal>mapper([[]], List::size)
list[int]: [0]
Desktop (please complete the following information):
- VSCode, Rascal 0.19.6
- Eclipse, Rascal 0.19.4 (although this gives a ClassCastException instead of an IllegalArgumentException)