Default constructors for interfaces with default implementation classes ?

53 views
Skip to first unread message

Sean Eagan

unread,
May 3, 2012, 12:13:12 PM5/3/12
to General Dart Discussion

Given:

interface Foo default _Foo {}
class _Foo implements Foo {
  _Foo();
}

It is not currently allowed to instantiate Foo:

new Foo();

Should this be allowed ?

If not, then it also shouldn't be allowed to have a default clause on an interface unless it declares at least one constructor.

Cheers,
Sean Eagan

Sean Eagan

unread,
May 3, 2012, 9:20:55 PM5/3/12
to General Dart Discussion

filed a bug:


Cheers,
Sean

Bob Nystrom

unread,
May 4, 2012, 1:35:51 PM5/4/12
to Sean Eagan, General Dart Discussion
Sorry for the delay here. This is an excellent question. I don't see the value in having a default class without any constructors either.

Filing a bug is probably the best way to summon Gilad on this. :)

Thanks!
- bob
Reply all
Reply to author
Forward
0 new messages