Mercurial > projects > ddmd
comparison dmd/TypeDelegate.d @ 96:acd69f84627e
further work
author | Trass3r |
---|---|
date | Tue, 31 Aug 2010 02:12:15 +0200 |
parents | 2e2a5c3f943a |
children | e28b18c23469 |
comparison
equal
deleted
inserted
replaced
95:ae5b11064a9a | 96:acd69f84627e |
---|---|
6 import dmd.OutBuffer; | 6 import dmd.OutBuffer; |
7 import dmd.Id; | 7 import dmd.Id; |
8 import dmd.AddExp; | 8 import dmd.AddExp; |
9 import dmd.PtrExp; | 9 import dmd.PtrExp; |
10 import dmd.IntegerExp; | 10 import dmd.IntegerExp; |
11 import dmd.MATCH; | |
11 import dmd.NullExp; | 12 import dmd.NullExp; |
12 import dmd.TypeFunction; | 13 import dmd.TypeFunction; |
13 import dmd.HdrGenState; | 14 import dmd.HdrGenState; |
14 import dmd.Expression; | 15 import dmd.Expression; |
15 import dmd.Identifier; | 16 import dmd.Identifier; |
75 override ulong size(Loc loc) | 76 override ulong size(Loc loc) |
76 { | 77 { |
77 return PTRSIZE * 2; | 78 return PTRSIZE * 2; |
78 } | 79 } |
79 | 80 |
81 MATCH implicitConvTo(Type to) | |
82 { | |
83 //writef("TypeDelegate::implicitConvTo(this=%p, to=%p)\n", this, to); | |
84 //writef("from: %s\n", toChars()); | |
85 //writef("to : %s\n", to.toChars()); | |
86 if (this == to) | |
87 return MATCHexact; | |
88 static if (false) // not allowing covariant conversions because it interferes with overriding | |
89 { | |
90 if (to.ty == Tdelegate && this.nextOf().covariant(to.nextOf()) == 1) | |
91 return MATCHconvert; | |
92 } | |
93 return MATCHnomatch; | |
94 } | |
95 | |
80 override void toCBuffer2(OutBuffer buf, HdrGenState* hgs, MOD mod) | 96 override void toCBuffer2(OutBuffer buf, HdrGenState* hgs, MOD mod) |
81 { | 97 { |
82 if (mod != this.mod) | 98 if (mod != this.mod) |
83 { | 99 { |
84 toCBuffer3(buf, hgs, mod); | 100 toCBuffer3(buf, hgs, mod); |