From: simonpj Date: Mon, 22 Apr 2002 11:50:21 +0000 (+0000) Subject: [project @ 2002-04-22 11:50:21 by simonpj] X-Git-Tag: Approx_11550_changesets_converted~2129 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=d9fa58a35fedd36471063e4375ca177632f540e4;p=ghc-hetmet.git [project @ 2002-04-22 11:50:21 by simonpj] Do forall-hoisting recursively --- diff --git a/ghc/compiler/typecheck/TcType.lhs b/ghc/compiler/typecheck/TcType.lhs index 27abbd5..d498e7b 100644 --- a/ghc/compiler/typecheck/TcType.lhs +++ b/ghc/compiler/typecheck/TcType.lhs @@ -737,10 +737,13 @@ hoistForAllTys ty hoist orig_ty (ForAllTy tv ty) = case hoist ty ty of (tvs,theta,tau) -> (tv:tvs,theta,tau) hoist orig_ty (FunTy arg res) - | isPredTy arg = case hoist res res of - (tvs,theta,tau) -> (tvs,arg:theta,tau) + | isPredTy arg' = case hoist res res of + (tvs,theta,tau) -> (tvs,arg':theta,tau) | otherwise = case hoist res res of - (tvs,theta,tau) -> (tvs,theta,mkFunTy arg tau) + (tvs,theta,tau) -> (tvs,theta,mkFunTy arg' tau) + where + arg' = hoistForAllTys arg -- Don't forget to apply hoist recursively + -- to the argument type hoist orig_ty (NoteTy _ ty) = hoist orig_ty ty hoist orig_ty ty = ([], [], orig_ty)