From 8963597a9ec246d8bac113c0ffc05b8192572ed2 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Wed, 19 Aug 2009 17:32:11 +0200 Subject: [PATCH] Let vhld_ty handle free tyvars gracefully. Previously, free type vars could result in ugly errors from eval_tfp_int and friends. Now, a type with free type vars is correctly marked as non-representable. --- "c\316\273ash/CLasH/VHDL/VHDLTools.hs" | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git "a/c\316\273ash/CLasH/VHDL/VHDLTools.hs" "b/c\316\273ash/CLasH/VHDL/VHDLTools.hs" index 0d95f55..39506f8 100644 --- "a/c\316\273ash/CLasH/VHDL/VHDLTools.hs" +++ "b/c\316\273ash/CLasH/VHDL/VHDLTools.hs" @@ -289,7 +289,8 @@ vhdl_ty_either tything = Just ty -> vhdl_ty_either' ty vhdl_ty_either' :: Type.Type -> TypeSession (Either String (Maybe AST.TypeMark)) -vhdl_ty_either' ty = do +vhdl_ty_either' ty | ty_has_free_tyvars ty = return $ Left $ "VHDLTools.vhdl_ty_either': Cannot create type: type has free type variables: " ++ pprString ty + | otherwise = do typemap <- getA tsTypes htype_either <- mkHType ty case htype_either of -- 2.30.2