https://d.puremagic.com/issues/show_bug.cgi?id=6083


Adam D. Ruppe <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]


--- Comment #5 from Adam D. Ruppe <[email protected]> 2014-02-26 
07:42:39 PST ---
I'm not so sure about the ambiguity thing. Consider the following case of a
wrapped NotNull!T:

interface A { void foo(); }
interface B {}
class C : A, B { void foo() {} }
class D : C {}

NotNull!D should implicitly cast to D (a not null is always a maybe null),
which gives access to the methods, as well as NotNull!C - classes can always
implicitly cast to their base.

NotNull!C should implicitly cast to C, NotNull!A, NotNull!B, and
NotNull!Object.


Now consider we call

NotNull!D d = ...;
d.foo();

what happens?

1) foo is not a member of NotNull!D, so we try to match the alias thises.

2) D.foo works, so we add that to the ok list.

3) NotNull!C doesn't work, which triggers its list: C.foo also works.


Is this an error? C.foo and D.foo refer to the same function, since it is an
overridden virtual, but it would compile as both and might be considered
ambiguous.

However it is implemented, I'd argue it is important that this works since this
is one of my main use cases for multiple alias this.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to