diff sema/Visitor.d @ 68:381975d76baf new_gen

A LOT of bug fixing - also implemented implicit casts. If you do a --ast-dump-code on a target with some algebra of differant types, you should now see the type casts being made. Also, Tests are again back with only switches failing...
author Anders Johnsen <skabet@gmail.com>
date Thu, 01 May 2008 19:25:49 +0200
parents 9f8131676242
children 13eea2c4e60d ad956143dcdc
line wrap: on
line diff
--- a/sema/Visitor.d	Tue Apr 29 20:15:22 2008 +0200
+++ b/sema/Visitor.d	Thu May 01 19:25:49 2008 +0200
@@ -74,6 +74,8 @@
                 return visitAssignExp(cast(AssignExp)exp);
             case ExpType.CallExp:
                 return visitCallExp(cast(CallExp)exp);
+            case ExpType.CastExp:
+                return visitCastExp(cast(CastExp)exp);
             case ExpType.Identifier:
                 return visitIdentifier(cast(Identifier)exp);
             case ExpType.MemberReference:
@@ -236,6 +238,16 @@
             return ExpT.init;
     }
 
+    ExpT visitCastExp(CastExp exp)
+    {
+        visitExp(exp.castType);
+        visitExp(exp.exp);
+        static if (is(ExpT == void))
+            return;
+        else
+            return ExpT.init;
+    }
+
     ExpT visitNegateExp(NegateExp exp)
     {
         visitExp(exp.exp);