On Sat, Apr 28, 2012 at 20:24, John Messerly <
jmes...@google.com> wrote:
> Ah, I see what you mean Rémi. This works at runtime, but flags an error:
>
> interface F {
> void foo();
> }
>
> interface B {
> void foo(abc);
> }
>
> class Foo implements F {
> void foo() {
> print('Foo.foo');
> }
> }
>
> class Bar extends Foo implements B {
> void foo([abc=123]) { // error about overriding without same # of required
> params
Personally, I would think that this one *should* be allowed, since it
is compatible with both of the inherited interfaces. Currently it
isn't.
I've just added an issue asking for it:
http://code.google.com/p/dart/issues/detail?id=2824
Even with that, there'll still be interfaces that can't be unified, e.g.:
interface A {
foo([int z]);
}
and
interface B{
foo([int x]);
}
Since optional parameters can be passed both by position and by name,
you can't have the first argument having two names.
/L
--
Lasse R.H. Nielsen
l...@google.com
'Faith without judgement merely degrades the spirit divine'
Google Denmark ApS - Frederiksborggade 20B, 1 sal - 1360 København K -
Denmark - CVR nr. 28 86 69 84