annotate dmd/TypeEnum.d @ 114:e28b18c23469

added a module dmd.common for commonly used stuff it currently holds code for consistency checking of predefined versions also added a VisualD project file
author Trass3r
date Wed, 01 Sep 2010 18:21:58 +0200
parents df6d0f967680
children af1bebfd96a4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
1 module dmd.TypeEnum;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
2
114
e28b18c23469 added a module dmd.common for commonly used stuff
Trass3r
parents: 93
diff changeset
3 import dmd.common;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
4 import dmd.Type;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
5 import dmd.EnumDeclaration;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
6 import dmd.Scope;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
7 import dmd.Loc;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
8 import dmd.Id;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
9 import dmd.ErrorExp;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
10 import dmd.Dsymbol;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
11 import dmd.EnumMember;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
12 import dmd.OutBuffer;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
13 import dmd.HdrGenState;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
14 import dmd.Expression;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
15 import dmd.Identifier;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
16 import dmd.MATCH;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
17 import dmd.OutBuffer;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
18 import dmd.CppMangleState;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
19 import dmd.TypeInfoDeclaration;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
20 import dmd.TypeInfoEnumDeclaration;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
21 import dmd.ArrayTypes;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
22 import dmd.TY;
68
ee3a9f34dc48 final bits of codegen implementation to compile Phobos
korDen
parents: 0
diff changeset
23 import dmd.MOD;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
24 import dmd.Util;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
25
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
26 import dmd.backend.TYPE;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
27
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
28 class TypeEnum : Type
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
29 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
30 EnumDeclaration sym;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
31
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
32 this(EnumDeclaration sym)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
33 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
34 super(TY.Tenum);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
35 this.sym = sym;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
36 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
37
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
38 version (DumbClone) {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
39 } else {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
40 Type clone()
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
41 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
42 assert(false);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
43 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
44 }
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 68
diff changeset
45 override Type syntaxCopy()
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
46 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
47 assert(false);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
48 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
49
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 68
diff changeset
50 override ulong size(Loc loc)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
51 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
52 if (!sym.memtype)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
53 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
54 error(loc, "enum %s is forward referenced", sym.toChars());
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
55 return 4;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
56 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
57 return sym.memtype.size(loc);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
58 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
59
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 68
diff changeset
60 override uint alignsize()
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
61 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
62 assert(false);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
63 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
64
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 68
diff changeset
65 override string toChars()
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
66 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
67 assert(false);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
68 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
69
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 68
diff changeset
70 override Type semantic(Loc loc, Scope sc)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
71 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
72 //printf("TypeEnum::semantic() %s\n", toChars());
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
73 //sym.semantic(sc);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
74 return merge();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
75 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
76
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 68
diff changeset
77 override Dsymbol toDsymbol(Scope sc)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
78 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
79 return sym;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
80 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
81
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 68
diff changeset
82 override void toDecoBuffer(OutBuffer buf, int flag)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
83 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
84 string name = sym.mangle();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
85 Type.toDecoBuffer(buf, flag);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
86 buf.printf("%s", name);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
87 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
88
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 68
diff changeset
89 override void toCBuffer2(OutBuffer buf, HdrGenState* hgs, MOD mod)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
90 {
68
ee3a9f34dc48 final bits of codegen implementation to compile Phobos
korDen
parents: 0
diff changeset
91 if (mod != this.mod)
ee3a9f34dc48 final bits of codegen implementation to compile Phobos
korDen
parents: 0
diff changeset
92 {
ee3a9f34dc48 final bits of codegen implementation to compile Phobos
korDen
parents: 0
diff changeset
93 toCBuffer3(buf, hgs, mod);
ee3a9f34dc48 final bits of codegen implementation to compile Phobos
korDen
parents: 0
diff changeset
94 return;
ee3a9f34dc48 final bits of codegen implementation to compile Phobos
korDen
parents: 0
diff changeset
95 }
ee3a9f34dc48 final bits of codegen implementation to compile Phobos
korDen
parents: 0
diff changeset
96 buf.writestring(sym.toChars());
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
97 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
98
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 68
diff changeset
99 override Expression dotExp(Scope sc, Expression e, Identifier ident)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
100 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
101 version (LOGDOTEXP) {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
102 printf("TypeEnum::dotExp(e = '%s', ident = '%s') '%s'\n", e.toChars(), ident.toChars(), toChars());
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
103 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
104 Dsymbol s = sym.search(e.loc, ident, 0);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
105 if (!s)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
106 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
107 if (ident is Id.max ||
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
108 ident is Id.min ||
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
109 ident is Id.init_ ||
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
110 ident is Id.stringof_ ||
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
111 !sym.memtype
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
112 )
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
113 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
114 return getProperty(e.loc, ident);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
115 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
116
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
117 return sym.memtype.dotExp(sc, e, ident);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
118 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
119
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
120 EnumMember m = s.isEnumMember();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
121 Expression em = m.value.copy();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
122 em.loc = e.loc;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
123 return em;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
124 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
125
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 68
diff changeset
126 override Expression getProperty(Loc loc, Identifier ident)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
127 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
128 assert(false);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
129 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
130
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 68
diff changeset
131 override bool isintegral()
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
132 {
73
ef02e2e203c2 Updating to dmd2.033
korDen
parents: 72
diff changeset
133 return sym.memtype.isintegral();
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
134 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
135
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 68
diff changeset
136 override bool isfloating()
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
137 {
73
ef02e2e203c2 Updating to dmd2.033
korDen
parents: 72
diff changeset
138 return sym.memtype.isfloating();
ef02e2e203c2 Updating to dmd2.033
korDen
parents: 72
diff changeset
139 }
ef02e2e203c2 Updating to dmd2.033
korDen
parents: 72
diff changeset
140
79
43073c7c7769 updated to 2.035
Trass3r
parents: 73
diff changeset
141 override bool isreal()
73
ef02e2e203c2 Updating to dmd2.033
korDen
parents: 72
diff changeset
142 {
ef02e2e203c2 Updating to dmd2.033
korDen
parents: 72
diff changeset
143 return sym.memtype.isreal();
ef02e2e203c2 Updating to dmd2.033
korDen
parents: 72
diff changeset
144 }
ef02e2e203c2 Updating to dmd2.033
korDen
parents: 72
diff changeset
145
79
43073c7c7769 updated to 2.035
Trass3r
parents: 73
diff changeset
146 override bool isimaginary()
73
ef02e2e203c2 Updating to dmd2.033
korDen
parents: 72
diff changeset
147 {
ef02e2e203c2 Updating to dmd2.033
korDen
parents: 72
diff changeset
148 return sym.memtype.isimaginary();
ef02e2e203c2 Updating to dmd2.033
korDen
parents: 72
diff changeset
149 }
ef02e2e203c2 Updating to dmd2.033
korDen
parents: 72
diff changeset
150
79
43073c7c7769 updated to 2.035
Trass3r
parents: 73
diff changeset
151 override bool iscomplex()
73
ef02e2e203c2 Updating to dmd2.033
korDen
parents: 72
diff changeset
152 {
ef02e2e203c2 Updating to dmd2.033
korDen
parents: 72
diff changeset
153 return sym.memtype.iscomplex();
ef02e2e203c2 Updating to dmd2.033
korDen
parents: 72
diff changeset
154 }
ef02e2e203c2 Updating to dmd2.033
korDen
parents: 72
diff changeset
155
79
43073c7c7769 updated to 2.035
Trass3r
parents: 73
diff changeset
156 override bool checkBoolean()
73
ef02e2e203c2 Updating to dmd2.033
korDen
parents: 72
diff changeset
157 {
ef02e2e203c2 Updating to dmd2.033
korDen
parents: 72
diff changeset
158 return sym.memtype.checkBoolean();
ef02e2e203c2 Updating to dmd2.033
korDen
parents: 72
diff changeset
159 }
ef02e2e203c2 Updating to dmd2.033
korDen
parents: 72
diff changeset
160
79
43073c7c7769 updated to 2.035
Trass3r
parents: 73
diff changeset
161 override bool isAssignable()
73
ef02e2e203c2 Updating to dmd2.033
korDen
parents: 72
diff changeset
162 {
ef02e2e203c2 Updating to dmd2.033
korDen
parents: 72
diff changeset
163 return sym.memtype.isAssignable();
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
164 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
165
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 68
diff changeset
166 override bool isscalar()
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
167 {
73
ef02e2e203c2 Updating to dmd2.033
korDen
parents: 72
diff changeset
168 return sym.memtype.isscalar();
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
169 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
170
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 68
diff changeset
171 override bool isunsigned()
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
172 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
173 return sym.memtype.isunsigned();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
174 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
175
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 68
diff changeset
176 override MATCH implicitConvTo(Type to)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
177 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
178 MATCH m;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
179
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
180 //printf("TypeEnum::implicitConvTo()\n");
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
181 if (ty == to.ty && sym == (cast(TypeEnum)to).sym)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
182 m = (mod == to.mod) ? MATCHexact : MATCHconst;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
183 else if (sym.memtype.implicitConvTo(to))
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
184 m = MATCHconvert; // match with conversions
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
185 else
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
186 m = MATCHnomatch; // no match
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
187 return m;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
188 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
189
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 68
diff changeset
190 override MATCH constConv(Type to)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
191 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
192 assert(false);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
193 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
194
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 68
diff changeset
195 override Type toBasetype()
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
196 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
197 if (!sym.memtype)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
198 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
199 debug writef("2: ");
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
200 error(sym.loc, "enum %s is forward referenced", sym.toChars());
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
201 return tint32;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
202 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
203
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
204 return sym.memtype.toBasetype();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
205 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
206
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 68
diff changeset
207 override Expression defaultInit(Loc loc)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
208 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
209 version (LOGDEFAULTINIT) {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
210 printf("TypeEnum::defaultInit() '%s'\n", toChars());
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
211 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
212 // Initialize to first member of enum
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
213 //printf("%s\n", sym.defaultval.type.toChars());
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
214 if (!sym.defaultval)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
215 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
216 error(loc, "forward reference of %s.init", toChars());
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
217 return new ErrorExp();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
218 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
219 return sym.defaultval;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
220 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
221
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 68
diff changeset
222 override bool isZeroInit(Loc loc)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
223 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
224 if (!sym.defaultval)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
225 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
226 debug writef("3: ");
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
227 error(loc, "enum %s is forward referenced", sym.toChars());
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
228 return 0;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
229 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
230 return sym.defaultval.isBool(false);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
231 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
232
93
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 79
diff changeset
233 override MATCH deduceType(Scope sc, Type tparam, TemplateParameters parameters, Objects dedtypes)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
234 {
93
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 79
diff changeset
235 // Extra check
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 79
diff changeset
236 if (tparam && tparam.ty == Tenum)
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 79
diff changeset
237 {
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 79
diff changeset
238 TypeEnum tp = cast(TypeEnum)tparam;
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 79
diff changeset
239
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 79
diff changeset
240 if (sym != tp.sym)
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 79
diff changeset
241 return MATCHnomatch;
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 79
diff changeset
242 }
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 79
diff changeset
243 return Type.deduceType(sc, tparam, parameters, dedtypes);
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
244 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
245
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 68
diff changeset
246 override TypeInfoDeclaration getTypeInfoDeclaration()
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
247 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
248 return new TypeInfoEnumDeclaration(this);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
249 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
250
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 68
diff changeset
251 override bool hasPointers()
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
252 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
253 return toBasetype().hasPointers();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
254 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
255
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
256 version (CPP_MANGLE) {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
257 void toCppMangle(OutBuffer buf, CppMangleState* cms)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
258 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
259 assert(false);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
260 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
261 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
262
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 68
diff changeset
263 override type* toCtype()
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
264 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
265 return sym.memtype.toCtype();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
266 }
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 68
diff changeset
267 }