Enum literals are now correctly translated to numbers
authorchristiaanb <christiaan.baaij@gmail.com>
Mon, 21 Jun 2010 15:07:15 +0000 (17:07 +0200)
committerchristiaanb <christiaan.baaij@gmail.com>
Mon, 21 Jun 2010 15:07:15 +0000 (17:07 +0200)
clash/CLasH/VHDL/VHDLTools.hs

index 8f282b422afa4c7a5047f15e47f08d03c11466dd..3dcd951bcb7a9822509fc77d0807f2a137734aeb 100644 (file)
@@ -192,7 +192,7 @@ dataconToVHDLExpr dc = do
           let existing_ty = Monad.liftM (fmap fst) $ Map.lookup htype typemap
           case existing_ty of
             Just ty -> do
-              let lit    = idToVHDLExpr $ mkVHDLExtId $ Name.getOccString dcname
+              let lit    = AST.PrimLit $ show $ getConstructorIndex htype $ Name.getOccString dcname
               return lit
             Nothing -> error $ "\nVHDLTools.dataconToVHDLExpr: Trying to make value for non-representable DataCon: " ++ pprString dc
     -- Error when constructing htype