Changeset 779
- Timestamp:
- 12/05/10 07:48:25 (14 years ago)
- Files:
-
- branches/dmd-1.x/src/expression.c (modified) (1 diff)
- trunk/src/expression.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/dmd-1.x/src/expression.c
r755 r779 2141 2141 return e; 2142 2142 } 2143 2143 } 2144 2144 e = new VarExp(loc, v); 2145 2145 e->type = type; 2146 2146 e = e->semantic(sc); 2147 2147 return e->deref(); 2148 2148 } 2149 2149 fld = s->isFuncLiteralDeclaration(); 2150 2150 if (fld) 2151 2151 { //printf("'%s' is a function literal\n", fld->toChars()); 2152 2152 e = new FuncExp(loc, fld); 2153 2153 return e->semantic(sc); 2154 2154 } 2155 2155 f = s->isFuncDeclaration(); 2156 2156 if (f) 2157 2157 { //printf("'%s' is a function\n", f->toChars()); 2158 2158 2159 2159 if (!f->originalType && f->scope) // semantic not yet run 2160 2160 f->semantic(f->scope); 2161 if (f->isUnitTestDeclaration()) 2162 { 2163 error("cannot call unittest function %s", toChars()); 2164 return new ErrorExp(); 2165 } 2161 2166 if (!f->type->deco) 2162 2167 { 2163 2168 error("forward reference to %s", toChars()); 2164 2169 return new ErrorExp(); 2165 2170 } 2166 2171 return new VarExp(loc, f); 2167 2172 } 2168 2173 cd = s->isClassDeclaration(); 2169 2174 if (cd && thiscd && cd->isBaseOf(thiscd, NULL) && sc->func->needThis()) 2170 2175 { 2171 2176 // We need to add an implicit 'this' if cd is this class or a base class. 2172 2177 DotTypeExp *dte; 2173 2178 2174 2179 dte = new DotTypeExp(loc, new ThisExp(loc), s); 2175 2180 return dte->semantic(sc); 2176 2181 } 2177 2182 imp = s->isImport(); 2178 2183 if (imp) 2179 2184 { 2180 2185 if (!imp->pkg) trunk/src/expression.c
r769 r779 2309 2309 return e; 2310 2310 } 2311 2311 2312 2312 e = new VarExp(loc, v); 2313 2313 e->type = type; 2314 2314 e = e->semantic(sc); 2315 2315 return e->deref(); 2316 2316 } 2317 2317 fld = s->isFuncLiteralDeclaration(); 2318 2318 if (fld) 2319 2319 { //printf("'%s' is a function literal\n", fld->toChars()); 2320 2320 e = new FuncExp(loc, fld); 2321 2321 return e->semantic(sc); 2322 2322 } 2323 2323 f = s->isFuncDeclaration(); 2324 2324 if (f) 2325 2325 { //printf("'%s' is a function\n", f->toChars()); 2326 2326 2327 2327 if (!f->originalType && f->scope) // semantic not yet run 2328 2328 f->semantic(f->scope); 2329 if (f->isUnitTestDeclaration()) 2330 { 2331 error("cannot call unittest function %s", toChars()); 2332 return new ErrorExp(); 2333 } 2329 2334 if (!f->type->deco) 2330 2335 { 2331 2336 error("forward reference to %s", toChars()); 2332 2337 return new ErrorExp(); 2333 2338 } 2334 2339 return new VarExp(loc, f, hasOverloads); 2335 2340 } 2336 2341 o = s->isOverloadSet(); 2337 2342 if (o) 2338 2343 { //printf("'%s' is an overload set\n", o->toChars()); 2339 2344 return new OverExp(o); 2340 2345 } 2341 2346 cd = s->isClassDeclaration(); 2342 2347 if (cd && thiscd && cd->isBaseOf(thiscd, NULL) && sc->func->needThis()) 2343 2348 { 2344 2349 // We need to add an implicit 'this' if cd is this class or a base class. 2345 2350 DotTypeExp *dte; 2346 2351 2347 2352 dte = new DotTypeExp(loc, new ThisExp(loc), s); 2348 2353 return dte->semantic(sc);
