Cannot extend constructor with default parameter : Java Backend error + JS Runtime error

26 views
Skip to first unread message

Stephane Gallès

unread,
May 6, 2015, 1:36:22 PM5/6/15
to ceylo...@googlegroups.com

I don't know if it is an issue for ceylon-spec or for ceylon-js + ceylon-compiler

class Foo {
   
    shared
new Bar(Integer a = 1){
       
print(a);
   
}
   
    shared
new () extends Bar(){}
   
}

shared
void run(){
   
Foo.Bar();
}

1) Java backend errors :
Foo(org.boo.Foo.Bar) is already defined in org.boo.Foo
Foo$Bar$a() is already defined in org.boo.Foo
no suitable constructor found for Foo(org.boo.Foo.Bar$delegation$)
    constructor org.boo.Foo.Foo() is not applicable
      (actual and formal argument lists differ in length)
    constructor org.boo.Foo.Foo(org.boo.Foo.Bar,long) is not applicable
      (actual and formal argument lists differ in length)
    constructor org.boo.Foo.Foo(org.boo.Foo.Bar$delegation$,long) is not applicable
      (actual and formal argument lists differ in length)
    constructor org.boo.Foo.Foo(org.boo.Foo.Bar) is not applicable
      (actual argument org.boo.Foo.Bar$delegation$ cannot be converted to org.boo.Foo.Bar by method invocation conversion)


2) JS runtime error :
When executed prints out <null> instead of 1


 

Gavin King

unread,
May 6, 2015, 1:49:10 PM5/6/15
to ceylo...@googlegroups.com
Looks like backend problems to me.
> --
> You received this message because you are subscribed to the Google Groups
> "ceylon-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ceylon-dev+...@googlegroups.com.
> To post to this group, send email to ceylo...@googlegroups.com.
> Visit this group at http://groups.google.com/group/ceylon-dev.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ceylon-dev/b5a55846-092f-45d4-9eb8-7bb266e4002d%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Gavin King
ga...@ceylon-lang.org
http://profiles.google.com/gavin.king
http://ceylon-lang.org
http://hibernate.org
http://seamframework.org

Stephane Gallès

unread,
May 6, 2015, 6:21:42 PM5/6/15
to ceylo...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages