Since we might encounter type abstractions before normalizations, the old
behaviour broke on polymorphic functions (Though type arguments would have
been propagated, there would still be type abstractions directly applied
to the propagated types).
Note that this not actually clones the type variables, it just leaves them
untouched. Since we should never introduce new type variables, this should
_probably_ work out...
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