Mercurial > projects > ddmd
diff dmd/TypeDelegate.d @ 96:acd69f84627e
further work
author | Trass3r |
---|---|
date | Tue, 31 Aug 2010 02:12:15 +0200 |
parents | 2e2a5c3f943a |
children | e28b18c23469 |
line wrap: on
line diff
--- a/dmd/TypeDelegate.d Mon Aug 30 23:08:44 2010 +0200 +++ b/dmd/TypeDelegate.d Tue Aug 31 02:12:15 2010 +0200 @@ -8,6 +8,7 @@ import dmd.AddExp; import dmd.PtrExp; import dmd.IntegerExp; +import dmd.MATCH; import dmd.NullExp; import dmd.TypeFunction; import dmd.HdrGenState; @@ -77,6 +78,21 @@ return PTRSIZE * 2; } + MATCH implicitConvTo(Type to) + { + //writef("TypeDelegate::implicitConvTo(this=%p, to=%p)\n", this, to); + //writef("from: %s\n", toChars()); + //writef("to : %s\n", to.toChars()); + if (this == to) + return MATCHexact; +static if (false) // not allowing covariant conversions because it interferes with overriding +{ + if (to.ty == Tdelegate && this.nextOf().covariant(to.nextOf()) == 1) + return MATCHconvert; +} + return MATCHnomatch; + } + override void toCBuffer2(OutBuffer buf, HdrGenState* hgs, MOD mod) { if (mod != this.mod)