From: christiaanb Date: Mon, 21 Jun 2010 15:07:15 +0000 (+0200) Subject: Enum literals are now correctly translated to numbers X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;ds=sidebyside;h=699b4f25f903ae9fa7deacf2eeb6204403178de9;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git Enum literals are now correctly translated to numbers --- diff --git a/clash/CLasH/VHDL/VHDLTools.hs b/clash/CLasH/VHDL/VHDLTools.hs index 8f282b4..3dcd951 100644 --- a/clash/CLasH/VHDL/VHDLTools.hs +++ b/clash/CLasH/VHDL/VHDLTools.hs @@ -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