Closed AntoineJonard closed 4 years ago
Umm. In theory it should work with no problems. Maybe a regression... which version of JSweet are you using? (See pom.xml)
It should be 6.2.0, I attach the pom.xml if you want to see more. pom.txt
Nope. You are using 3.0.0-RC3. So I guess it is a bug for that version. If you want to make it work on a stable release, use JDK 8 and replace JSweet version with 2.3.8 for instance and it should work.
In any case this is a version 3 specific bug. Not a limitation of JSweet.
Thanks for the reply, by modifying jdk and JSweet Version it worked.
We are having an issue with method inheritence combined with multiple method signatures. The very simple and common Java code below shows the issue : JavaSuperClass defines one method with 2 signatures while JavaClass overloads one of these signatures.
It leads to Null Exception Error with no other explanations which is itself an issue.
We are guessing that’s something to do with the way JSweet handles “complex overloading”, creating a method that wraps the whole thing. This method sounds to be final
How could we make it work the Java way : we don’t care about optional parameters of JS. Any annotation or so ?
As this issue seems to be a conceptual issue, a special § in the language specs would help.
Code :
` package quickstart;
public class JavaSuperClass{ public JavaSuperClass(){ super(); }
} `
and i redefine only one of the method in a sub class:
` package quickstart;
public class JavaClass extends JavaSuperClass{ public JavaClass(){ }
} `
i get this error when i start to transpile with mvn generate-sources :
2020-06-05 12:06:18.018 ERROR output:55 - internal transpiler error at C:\Users\Utilisateur\jsweet-quickstart\src\main\java\quickstart\JavaClass.java(7) dumping transpiler's strack trace: ... (C:\Users\Utilisateur\jsweet-quickstart\src\main\java\quickstart\JavaClass.java(7,9)) [JCClassDecl] public class JavaClass extends... (C:\Users\Utilisateur\jsweet-quickstart\src\main\java\quickstart\JavaClass.java(3,1)) ... (C:\Users\Utilisateur\jsweet-quickstart\src\main\java\quickstart\JavaClass.java(1,1)) java.lang.NullPointerException