diff sema/ImplicitCast.d @ 80:682e20aa224f new_gen

Pointers working now - big YAY
author Anders Johnsen <skabet@gmail.com>
date Fri, 02 May 2008 17:33:50 +0200
parents 70a002b3fba4
children 9a35a973175a
line wrap: on
line diff
--- a/sema/ImplicitCast.d	Fri May 02 16:39:04 2008 +0200
+++ b/sema/ImplicitCast.d	Fri May 02 17:33:50 2008 +0200
@@ -79,10 +79,12 @@
         auto identifierType = exp.identifier.type;
         auto expType = exp.exp.type;
 
-        if(identifierType.byteSize != expType.byteSize)
+        if(identifierType != expType)
         {
+            Stdout(&identifierType)(identifierType).newline;
+            Stdout(&expType)(expType).newline;
             if(!expType.hasImplicitConversionTo(identifierType))
-                throw error(__LINE__, "Cannot make implicit cast");
+                throw error(__LINE__, "Cannot make implicit cast between");
 
             auto castExp = new CastExp(
                     new Identifier(expType.name),
@@ -98,9 +100,9 @@
 
         if(stmt.exp)
         {
-            auto returnType = (cast(DFunction)stmt.env.parentFunction.type).returnType;
+            auto returnType = stmt.env.parentFunction.type.asFunction.returnType;
             auto expType = stmt.exp.type;
-            if(returnType.byteSize != expType.byteSize)
+            if(returnType != expType)
             {
                 if(!expType.hasImplicitConversionTo(returnType))
                     throw error(__LINE__, "Cannot make implicit cast");