Mercurial > projects > ddmd
comparison dmd/TemplateDeclaration.d @ 72:2e2a5c3f943a
reduced warnings by adding override to the methods
think this also normalizes different line endings used all over the place
author | Trass3r |
---|---|
date | Sat, 28 Aug 2010 16:19:48 +0200 |
parents | cab4c37afb89 |
children | 7e0d548de9e6 |
comparison
equal
deleted
inserted
replaced
71:8e24ef1dd139 | 72:2e2a5c3f943a |
---|---|
147 this.members = decldefs; | 147 this.members = decldefs; |
148 | 148 |
149 instances = new Array(); | 149 instances = new Array(); |
150 } | 150 } |
151 | 151 |
152 Dsymbol syntaxCopy(Dsymbol) | 152 override Dsymbol syntaxCopy(Dsymbol) |
153 { | 153 { |
154 //printf("TemplateDeclaration.syntaxCopy()\n"); | 154 //printf("TemplateDeclaration.syntaxCopy()\n"); |
155 TemplateDeclaration td; | 155 TemplateDeclaration td; |
156 TemplateParameters p; | 156 TemplateParameters p; |
157 Array d; | 157 Array d; |
174 d = Dsymbol.arraySyntaxCopy(members); | 174 d = Dsymbol.arraySyntaxCopy(members); |
175 td = new TemplateDeclaration(loc, ident, p, e, d); | 175 td = new TemplateDeclaration(loc, ident, p, e, d); |
176 return td; | 176 return td; |
177 } | 177 } |
178 | 178 |
179 void semantic(Scope sc) | 179 override void semantic(Scope sc) |
180 { | 180 { |
181 version (LOG) { | 181 version (LOG) { |
182 printf("TemplateDeclaration.semantic(this = %p, id = '%s')\n", this, ident.toChars()); | 182 printf("TemplateDeclaration.semantic(this = %p, id = '%s')\n", this, ident.toChars()); |
183 } | 183 } |
184 if (semanticRun) | 184 if (semanticRun) |
270 | 270 |
271 /********************************** | 271 /********************************** |
272 * Overload existing TemplateDeclaration 'this' with the new one 's'. | 272 * Overload existing TemplateDeclaration 'this' with the new one 's'. |
273 * Return !=0 if successful; i.e. no conflict. | 273 * Return !=0 if successful; i.e. no conflict. |
274 */ | 274 */ |
275 bool overloadInsert(Dsymbol s) | 275 override bool overloadInsert(Dsymbol s) |
276 { | 276 { |
277 TemplateDeclaration *pf; | 277 TemplateDeclaration *pf; |
278 TemplateDeclaration f; | 278 TemplateDeclaration f; |
279 | 279 |
280 version (LOG) { | 280 version (LOG) { |
320 } | 320 } |
321 | 321 |
322 return true; | 322 return true; |
323 } | 323 } |
324 | 324 |
325 void toCBuffer(OutBuffer buf, HdrGenState* hgs) | 325 override void toCBuffer(OutBuffer buf, HdrGenState* hgs) |
326 { | 326 { |
327 assert(false); | 327 assert(false); |
328 } | 328 } |
329 | 329 |
330 string kind() | 330 override string kind() |
331 { | 331 { |
332 return (onemember && onemember.isAggregateDeclaration()) | 332 return (onemember && onemember.isAggregateDeclaration()) |
333 ? onemember.kind() | 333 ? onemember.kind() |
334 : "template"; | 334 : "template"; |
335 } | 335 } |
336 | 336 |
337 string toChars() | 337 override string toChars() |
338 { | 338 { |
339 OutBuffer buf = new OutBuffer(); | 339 OutBuffer buf = new OutBuffer(); |
340 HdrGenState hgs; | 340 HdrGenState hgs; |
341 | 341 |
342 /// memset(&hgs, 0, hgs.sizeof); | 342 /// memset(&hgs, 0, hgs.sizeof); |
360 } | 360 } |
361 buf.writeByte(0); | 361 buf.writeByte(0); |
362 return buf.extractString(); | 362 return buf.extractString(); |
363 } | 363 } |
364 | 364 |
365 void emitComment(Scope sc) | 365 override void emitComment(Scope sc) |
366 { | 366 { |
367 assert(false); | 367 assert(false); |
368 } | 368 } |
369 | 369 |
370 // void toDocBuffer(OutBuffer *buf); | 370 // void toDocBuffer(OutBuffer *buf); |
1281 error("declaration %s is already defined", tp.ident.toChars()); | 1281 error("declaration %s is already defined", tp.ident.toChars()); |
1282 | 1282 |
1283 s.semantic(sc); | 1283 s.semantic(sc); |
1284 } | 1284 } |
1285 | 1285 |
1286 TemplateDeclaration isTemplateDeclaration() { return this; } | 1286 override TemplateDeclaration isTemplateDeclaration() { return this; } |
1287 | 1287 |
1288 TemplateTupleParameter isVariadic() | 1288 TemplateTupleParameter isVariadic() |
1289 { | 1289 { |
1290 return .isVariadic(parameters); | 1290 return .isVariadic(parameters); |
1291 } | 1291 } |
1292 | 1292 |
1293 /*********************************** | 1293 /*********************************** |
1294 * We can overload templates. | 1294 * We can overload templates. |
1295 */ | 1295 */ |
1296 bool isOverloadable() | 1296 override bool isOverloadable() |
1297 { | 1297 { |
1298 return 1; | 1298 return 1; |
1299 } | 1299 } |
1300 } | 1300 } |