From a2b8cfae9cad1ad7040993f7f2458dd73fb968cd Mon Sep 17 00:00:00 2001 From: christiaanb Date: Tue, 8 Jun 2010 15:43:39 +0200 Subject: [PATCH] Do not function extract functions that still have free type variables --- clash/CLasH/Normalize.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clash/CLasH/Normalize.hs b/clash/CLasH/Normalize.hs index ea171ca..4ce4ffa 100644 --- a/clash/CLasH/Normalize.hs +++ b/clash/CLasH/Normalize.hs @@ -380,7 +380,7 @@ funextract c expr@(App _ _) | is_var fexpr = do -- We could use is_applicable here instead of is_fun, but I think -- arguments to functions could only have forall typing when existential -- typing is enabled. Not sure, though. - doarg arg | not (is_simple arg) && is_fun arg = do + doarg arg | not (is_simple arg) && is_fun arg && not (has_free_tyvars arg) = do -- Create a new top level binding that binds the argument. Its body will -- be extended with lambda expressions, to take any free variables used -- by the argument expression. -- 2.30.2