ceylon
ceylon copied to clipboard
constructor delegation in nested class breaks Java backend
Next code:
shared void run(){
A();
}
class A(){
shared class B{
shared Integer i;
shared new(Integer i){
this.i = i;
}
shared new custom(Integer i, Integer j) extends B(i+j){}
}
}
produce next error:
Error:ceylon: An unknown error occurred in the Java backend. See previous messages for more information.
/home/workspace/test/source/test/run.ceylon
Error:(9, 9) ceylon: Ceylon backend error: cannot find symbol
symbol: class B$$delegation$
location: class test.A
Error:ceylon: Ceylon backend error: cannot find symbol
symbol: class B$$delegation$
location: class test.A
Error:(13, 61) ceylon: Ceylon backend error: cannot find symbol
symbol: variable B$$delegation$
location: class test.A
@FroMage apparently I don't have permission to label issues ;-)
To be clear, the problem here is with constructor delegation in nested classes. The workaround is to not use constructor delegation, like this:
class A(){
shared class B{
shared Integer i;
shared new(Integer i){
this.i = i;
}
shared new custom(Integer i, Integer j) {
this.i = i+j;
}
}
}