Top-3 for 2.066

Adam D. Ruppe destructionator at gmail.com
Wed Feb 26 07:34:16 PST 2014


On Wednesday, 26 February 2014 at 10:36:14 UTC, Per Nordlöw wrote:
> Make it possible to defined implicit conversions between 
> wrapped types in order to, for instance, correctly implement 
> NotNull for reference types.

I'm pretty sure multiple alias this would do the trick.

interface A {}
interface B {}
class C : A, B {}
class D : C {}

NotNull!D should implicitly cast to NotNull!C AND to D (the 
latter gives access to the methods here too so it should be 
preferred).

NotNull!C should implicitly cast to C (the first one to try), 
NotNull!A, NotNull!B, and NotNull!Object.

Multiple alias this would allow that.

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


More information about the Digitalmars-d mailing list