Mercurial > projects > ddmd
comparison dmd/TypeQualified.d @ 52:69d078c417c6
Identifier <-> TemplateInstance casts workaround
author | korDen |
---|---|
date | Sat, 21 Aug 2010 11:50:50 +0400 |
parents | 10317f0c89a5 |
children | 51605de93870 |
comparison
equal
deleted
inserted
replaced
51:b7d29f613539 | 52:69d078c417c6 |
---|---|
46 { | 46 { |
47 //printf("TypeQualified::syntaxCopyHelper(%s) %s\n", t->toChars(), toChars()); | 47 //printf("TypeQualified::syntaxCopyHelper(%s) %s\n", t->toChars(), toChars()); |
48 idents.setDim(t.idents.dim); | 48 idents.setDim(t.idents.dim); |
49 for (int i = 0; i < idents.dim; i++) | 49 for (int i = 0; i < idents.dim; i++) |
50 { | 50 { |
51 Identifier id = cast(Identifier)t.idents.data[i]; | 51 Object o = cast(Object)t.idents.data[i]; |
52 if (id.dyncast() == DYNCAST.DYNCAST_DSYMBOL) | 52 if (TemplateInstance ti = cast(TemplateInstance)o) |
53 { | 53 { |
54 TemplateInstance ti = cast(TemplateInstance)id; | 54 o = ti.syntaxCopy(null); |
55 | 55 } |
56 ti = cast(TemplateInstance)ti.syntaxCopy(null); | 56 |
57 id = cast(Identifier)ti; | 57 idents.data[i] = cast(void*)o; |
58 } | 58 } |
59 | 59 } |
60 idents.data[i] = cast(void*)id; | 60 |
61 } | 61 void addIdent(Object ident) |
62 } | |
63 | |
64 void addIdent(Identifier ident) | |
65 { | 62 { |
66 idents.push(cast(void*)ident); | 63 idents.push(cast(void*)ident); |
67 } | 64 } |
68 | 65 |
69 void toCBuffer2Helper(OutBuffer buf, HdrGenState* hgs) | 66 void toCBuffer2Helper(OutBuffer buf, HdrGenState* hgs) |