diff dmd/TypeEnum.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 0c8cc2a10f99
line wrap: on
line diff
--- a/dmd/TypeEnum.d	Sat Sep 11 13:03:39 2010 +0100
+++ b/dmd/TypeEnum.d	Mon Sep 13 22:19:42 2010 +0100
@@ -189,11 +189,20 @@
 	
     override MATCH constConv(Type to)
 	{
-		assert(false);
+        if (equals(to))
+	        return MATCHexact;
+        if (ty == to.ty && sym == (cast(TypeEnum)to).sym &&
+	        MODimplicitConv(mod, to.mod))
+	        return MATCHconst;
+        return MATCHnomatch;
 	}
 	
     override Type toBasetype()
 	{
+        if (sym.scope_)
+        {
+    	    sym.semantic(null);	// attempt to resolve forward reference
+        }
 		if (!sym.memtype)
 		{
 			debug writef("2: ");