comparison dmd/TypeClass.d @ 130:60bb0fe4563e

dmdfe 2.037 first main iteration
author Eldar Insafutdinov <e.insafutdinov@gmail.com>
date Thu, 09 Sep 2010 22:51:44 +0100
parents e28b18c23469
children af1bebfd96a4
comparison
equal deleted inserted replaced
129:010eb8f0e18d 130:60bb0fe4563e
198 { 198 {
199 /* For type.classinfo, we know the classinfo 199 /* For type.classinfo, we know the classinfo
200 * at compile time. 200 * at compile time.
201 */ 201 */
202 if (!sym.vclassinfo) 202 if (!sym.vclassinfo)
203 sym.vclassinfo = new ClassInfoDeclaration(sym); 203 sym.vclassinfo = new TypeInfoClassDeclaration(sym.type);
204 204
205 e = new VarExp(e.loc, sym.vclassinfo); 205 e = new VarExp(e.loc, sym.vclassinfo);
206 e = e.addressOf(sc); 206 e = e.addressOf(sc);
207 e.type = t; // do this so we don't get redundant dereference 207 e.type = t; // do this so we don't get redundant dereference
208 } 208 }
271 { 271 {
272 s = sym.vthis; 272 s = sym.vthis;
273 } 273 }
274 else 274 else
275 { 275 {
276 if (ident !is Id.__sizeof && 276 return noMember(sc, e, ident);
277 ident !is Id.alignof_ &&
278 ident !is Id.init_ &&
279 ident !is Id.mangleof_ &&
280 ident !is Id.stringof_ &&
281 ident !is Id.offsetof)
282 {
283 /* See if we should forward to the alias this.
284 */
285 if (sym.aliasthis)
286 {
287 /* Rewrite e.ident as:
288 * e.aliasthis.ident
289 */
290 e = new DotIdExp(e.loc, e, sym.aliasthis.ident);
291 e = new DotIdExp(e.loc, e, ident);
292 return e.semantic(sc);
293 }
294
295 /* Look for overloaded opDot() to see if we should forward request
296 * to it.
297 */
298 Dsymbol fd = search_function(sym, Id.opDot);
299 if (fd)
300 {
301 /* Rewrite e.ident as:
302 * e.opId().ident
303 */
304 e = build_overload(e.loc, sc, e, null, fd.ident);
305 e = new DotIdExp(e.loc, e, ident);
306 return e.semantic(sc);
307 }
308 }
309
310 return Type.dotExp(sc, e, ident);
311 } 277 }
312 } 278 }
313 279
314 if (!s.isFuncDeclaration()) // because of overloading 280 if (!s.isFuncDeclaration()) // because of overloading
315 s.checkDeprecated(e.loc, sc); 281 s.checkDeprecated(e.loc, sc);