Don't error on type abstraction when cloning binders.
[matthijs/master-project/cλash.git] / cλash / CLasH / Utils / Core / CoreTools.hs
index cd85b4d0102e257d8f650782e9fdac516fbe6c2f..bfe3971d8114456ab01d8bc306f730d74d34d99e 100644 (file)
@@ -361,8 +361,8 @@ genUniques' subst (CoreSyn.App f arg) = do
   f' <- genUniques' subst f
   arg' <- genUniques' subst arg
   return (CoreSyn.App f' arg')
-genUniques' subst (CoreSyn.Lam bndr res) | CoreSyn.isTyVar bndr =
-  error $ "Cloning type variables not supported!"
+-- Don't change type abstractions
+genUniques' subst expr@(CoreSyn.Lam bndr res) | CoreSyn.isTyVar bndr = return expr
 genUniques' subst (CoreSyn.Lam bndr res) = do
   -- Generate a new unique for the bound variable
   (subst', bndr') <- genUnique subst bndr