NPE in JS backend
Opened this issue · 2 comments
gavinking commented
Given:
Callable<String,[String]|[Integer, Integer]> fun
= flatten(([String]|[Integer, Integer] _)
=> switch (_)
case ([String s]) s
case ([Integer i, Integer j]) i.string.repeat(j));
String s = fun("");
String w = fun(1, 2);
I get:
Error:(66, 20) ceylon: the 'GenerateJsVisitor' caused an exception visiting a 'InvocationExpression' node: '"java.lang.NullPointerException"' at 'com.redhat.ceylon.compiler.js.InvocationGenerator.generatePositionalArguments(InvocationGenerator.java:413)'
chochos commented
It says w
has no type... strange.
chochos commented
NPE is gone, but the program now breaks at runtime, because the function receives the tuple instead of the args inside it.