diff dmd/TypeQualified.d @ 135:af1bebfd96a4 dmd2037

dmd 2.038
author Eldar Insafutdinov <e.insafutdinov@gmail.com>
date Mon, 13 Sep 2010 22:19:42 +0100
parents e28b18c23469
children e3afd1303184
line wrap: on
line diff
--- a/dmd/TypeQualified.d	Sat Sep 11 13:03:39 2010 +0100
+++ b/dmd/TypeQualified.d	Mon Sep 13 22:19:42 2010 +0100
@@ -22,6 +22,7 @@
 import dmd.Dsymbol;
 import dmd.DYNCAST;
 import dmd.Expression;
+import dmd.FuncDeclaration;
 import dmd.Util;
 
 class TypeQualified : Type
@@ -100,6 +101,7 @@
     void resolveHelper(Loc loc, Scope sc, Dsymbol s, Dsymbol scopesym, Expression* pe, Type* pt, Dsymbol* ps)
 	{
 		VarDeclaration v;
+        FuncDeclaration fd;
 		EnumMember em;
 		TupleDeclaration td;
 		Expression e;
@@ -174,7 +176,7 @@
 						{
 							id = cast(Identifier)idents.data[i];
 							//printf("e: '%s', id: '%s', type = %p\n", e.toChars(), id.toChars(), e.type);
-							if (id == Id.offsetof)
+							if (id == Id.offsetof || !e.type)
 							{   e = new DotIdExp(e.loc, e, id);
 								e = e.semantic(sc);
 							}
@@ -195,32 +197,17 @@
 			v = s.isVarDeclaration();
 			if (v)
 			{
-///static if (false) {
-///				// It's not a type, it's an expression
-///				Expression *e = v.getConstInitializer();
-///				if (e)
-///				{
-///					*pe = e.copy();	// make copy so we can change loc
-///					(*pe).loc = loc;
-///				}
-///				else
-///}
-				{
-///static if (false) {
-///					WithScopeSymbol withsym;
-///					if (scopesym && (withsym = scopesym.isWithScopeSymbol()) !is null)
-///					{
-///						// Same as wthis.ident
-///						e = new VarExp(loc, withsym.withstate.wthis);
-///						e = new DotIdExp(loc, e, ident);
-///						//assert(0);	// BUG: should handle this
-///					}
-///					else
-///}
-						*pe = new VarExp(loc, v);
-				}
+				*pe = new VarExp(loc, v);
 				return;
 			}
+//#if 0
+//	fd = s->isFuncDeclaration();
+//	if (fd)
+//	{
+//	    *pe = new DsymbolExp(loc, fd, 1);
+//	    return;
+//	}
+//#endif
 			em = s.isEnumMember();
 			if (em)
 			{