From: christiaanb Date: Tue, 8 Jun 2010 13:43:39 +0000 (+0200) Subject: Do not function extract functions that still have free type variables X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=a2b8cfae9cad1ad7040993f7f2458dd73fb968cd;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git Do not function extract functions that still have free type variables --- 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.