If function is implemented in Java (with the java keyword), dispatch is not performed on the run-time type of the actual arguments, but their declared type must match the type of the formal parameters.
Reproduce:
module Bug
import lang::json::IO;
void bug() {
value x = "{}";
parseJSON(#value, x);
}
This gives a CallFailed exception:
|.../src/main/rascal/Bug.rsc|(103,1,<11,22>,<11,23>): CallFailed([type(
value(),
()),"{}"])
at bug(|.../src/main/rascal/Bug.rsc|(85,21,<11,4>,<11,25>))
at $(|prompt:///|(0,11,<1,0>,<1,11>))
The exception does not happen when x is declared as str.
If function is implemented in Java (with the
javakeyword), dispatch is not performed on the run-time type of the actual arguments, but their declared type must match the type of the formal parameters.Reproduce:
This gives a
CallFailedexception:The exception does not happen when
xis declared asstr.