Mercurial > projects > ddmd
comparison dmd/TypeIdentifier.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 | b7d29f613539 |
children | e28b18c23469 |
comparison
equal
deleted
inserted
replaced
71:8e24ef1dd139 | 72:2e2a5c3f943a |
---|---|
35 Type clone() | 35 Type clone() |
36 { | 36 { |
37 assert(false); | 37 assert(false); |
38 } | 38 } |
39 } | 39 } |
40 Type syntaxCopy() | 40 override Type syntaxCopy() |
41 { | 41 { |
42 TypeIdentifier t = new TypeIdentifier(loc, ident); | 42 TypeIdentifier t = new TypeIdentifier(loc, ident); |
43 t.syntaxCopyHelper(this); | 43 t.syntaxCopyHelper(this); |
44 t.mod = mod; | 44 t.mod = mod; |
45 | 45 |
46 return t; | 46 return t; |
47 } | 47 } |
48 | 48 |
49 //char *toChars(); | 49 //char *toChars(); |
50 | 50 |
51 void toDecoBuffer(OutBuffer buf, int flag) | 51 override void toDecoBuffer(OutBuffer buf, int flag) |
52 { | 52 { |
53 Type.toDecoBuffer(buf, flag); | 53 Type.toDecoBuffer(buf, flag); |
54 string name = ident.toChars(); | 54 string name = ident.toChars(); |
55 buf.printf("%d%s", name.length, name); | 55 buf.printf("%d%s", name.length, name); |
56 } | 56 } |
57 | 57 |
58 void toCBuffer2(OutBuffer buf, HdrGenState* hgs, MOD mod) | 58 override void toCBuffer2(OutBuffer buf, HdrGenState* hgs, MOD mod) |
59 { | 59 { |
60 if (mod != this.mod) | 60 if (mod != this.mod) |
61 { | 61 { |
62 toCBuffer3(buf, hgs, mod); | 62 toCBuffer3(buf, hgs, mod); |
63 return; | 63 return; |
71 * it represents a Type or an Expression. | 71 * it represents a Type or an Expression. |
72 * Output: | 72 * Output: |
73 * if expression, *pe is set | 73 * if expression, *pe is set |
74 * if type, *pt is set | 74 * if type, *pt is set |
75 */ | 75 */ |
76 void resolve(Loc loc, Scope sc, Expression* pe, Type* pt, Dsymbol* ps) | 76 override void resolve(Loc loc, Scope sc, Expression* pe, Type* pt, Dsymbol* ps) |
77 { | 77 { |
78 Dsymbol scopesym; | 78 Dsymbol scopesym; |
79 | 79 |
80 //printf("TypeIdentifier::resolve(sc = %p, idents = '%s')\n", sc, toChars()); | 80 //printf("TypeIdentifier::resolve(sc = %p, idents = '%s')\n", sc, toChars()); |
81 Dsymbol s = sc.search(loc, ident, &scopesym); | 81 Dsymbol s = sc.search(loc, ident, &scopesym); |
86 | 86 |
87 /***************************************** | 87 /***************************************** |
88 * See if type resolves to a symbol, if so, | 88 * See if type resolves to a symbol, if so, |
89 * return that symbol. | 89 * return that symbol. |
90 */ | 90 */ |
91 Dsymbol toDsymbol(Scope sc) | 91 override Dsymbol toDsymbol(Scope sc) |
92 { | 92 { |
93 //printf("TypeIdentifier::toDsymbol('%s')\n", toChars()); | 93 //printf("TypeIdentifier::toDsymbol('%s')\n", toChars()); |
94 if (!sc) | 94 if (!sc) |
95 return null; | 95 return null; |
96 //printf("ident = '%s'\n", ident.toChars()); | 96 //printf("ident = '%s'\n", ident.toChars()); |
112 } | 112 } |
113 | 113 |
114 return s; | 114 return s; |
115 } | 115 } |
116 | 116 |
117 Type semantic(Loc loc, Scope sc) | 117 override Type semantic(Loc loc, Scope sc) |
118 { | 118 { |
119 Type t; | 119 Type t; |
120 Expression e; | 120 Expression e; |
121 Dsymbol s; | 121 Dsymbol s; |
122 | 122 |
154 } | 154 } |
155 //t.print(); | 155 //t.print(); |
156 return t; | 156 return t; |
157 } | 157 } |
158 | 158 |
159 MATCH deduceType(Scope sc, Type tparam, TemplateParameters parameters, Objects dedtypes) | 159 override MATCH deduceType(Scope sc, Type tparam, TemplateParameters parameters, Objects dedtypes) |
160 { | 160 { |
161 // Extra check | 161 // Extra check |
162 if (tparam && tparam.ty == Tident) | 162 if (tparam && tparam.ty == Tident) |
163 { | 163 { |
164 TypeIdentifier tp = cast(TypeIdentifier)tparam; | 164 TypeIdentifier tp = cast(TypeIdentifier)tparam; |
173 } | 173 } |
174 } | 174 } |
175 return Type.deduceType(sc, tparam, parameters, dedtypes); | 175 return Type.deduceType(sc, tparam, parameters, dedtypes); |
176 } | 176 } |
177 | 177 |
178 Type reliesOnTident() | 178 override Type reliesOnTident() |
179 { | 179 { |
180 return this; | 180 return this; |
181 } | 181 } |
182 | 182 |
183 Expression toExpression() | 183 override Expression toExpression() |
184 { | 184 { |
185 Expression e = new IdentifierExp(loc, ident); | 185 Expression e = new IdentifierExp(loc, ident); |
186 for (int i = 0; i < idents.dim; i++) | 186 for (int i = 0; i < idents.dim; i++) |
187 { | 187 { |
188 Identifier id = cast(Identifier)idents.data[i]; | 188 Identifier id = cast(Identifier)idents.data[i]; |