First thank you for this awesome project. I like to report an issue with constructor overloading. This was not happening at version jsweet-transpiler-1.2.0-20161018.144151-38.jar
I created a githup repo so you can easily recreate the issue: https://github.com/alievrenkut/jsweet-tests
Basically if we write below code:
` public ConstructorTest (final OtherObject1 obj1) {
this(obj1, new InnerTest());
}
public ConstructorTest (final OtherObject1 obj1, final InnerTest InnerTest) {
this(obj1, InnerTest, createPrefix(obj1, InnerTest));
}`
first constuctor will compile as:
`if(((obj1 != null && obj1 instanceof test.OtherObject1) || obj1 === null) && InnerTest === undefined && prefix === undefined && s1 === undefined && s2 === undefined) {
let __args = Array.prototype.slice.call(arguments);
{
let __args = Array.prototype.slice.call(arguments);
let InnerTest : any = new ConstructorTest.InnerTest();
{
let __args = Array.prototype.slice.call(arguments);
let prefix : any = ConstructorTest.createPrefix(__args[0], __args[1]); // there is no __args[1] exists. Second argument should be InnerTest
{
let __args = Array.prototype.slice.call(arguments);
let s1 : any = __args[1].s1 != null?__args[1].s1:ConstructorTest.getDefault1();
let s2 : any = __args[1].s2 != null?__args[1].s2:ConstructorTest.getDefault2();
}
}
}
} `
There is problem with line:
let prefix : any = ConstructorTest.createPrefix(__args[0], __args[1]);
There is no __args[1] exists. Second argument should be InnerTest
Thanks for reporting. Overloading is quite tricky, especially constructor overloading. I'll work on it when possible (in the meantime you can certainly workaround the issue).
Hi,
First thank you for this awesome project. I like to report an issue with constructor overloading. This was not happening at version jsweet-transpiler-1.2.0-20161018.144151-38.jar I created a githup repo so you can easily recreate the issue: https://github.com/alievrenkut/jsweet-tests
Basically if we write below code:
first constuctor will compile as:
There is problem with line:
let prefix : any = ConstructorTest.createPrefix(__args[0], __args[1]);
There is no __args[1] exists. Second argument should be InnerTestBest Regards, Ali