From 49c84dec1a5612852fb0f484e7dd3be0c99636f4 Mon Sep 17 00:00:00 2001 From: simonpj Date: Tue, 12 Mar 2002 09:12:58 +0000 Subject: [PATCH] [project @ 2002-03-12 09:12:57 by simonpj] Comments --- ghc/compiler/typecheck/TcMType.lhs | 3 +++ ghc/compiler/typecheck/TcType.lhs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ghc/compiler/typecheck/TcMType.lhs b/ghc/compiler/typecheck/TcMType.lhs index f31746a..1a16e59 100644 --- a/ghc/compiler/typecheck/TcMType.lhs +++ b/ghc/compiler/typecheck/TcMType.lhs @@ -454,6 +454,9 @@ zonkType unbound_var_fn ty go (AppTy fun arg) = go fun `thenNF_Tc` \ fun' -> go arg `thenNF_Tc` \ arg' -> returnNF_Tc (mkAppTy fun' arg') + -- NB the mkAppTy; we might have instantiated a + -- type variable to a type constructor, so we need + -- to pull the TyConApp to the top. -- The two interesting cases! go (TyVarTy tyvar) = zonkTyVar unbound_var_fn tyvar diff --git a/ghc/compiler/typecheck/TcType.lhs b/ghc/compiler/typecheck/TcType.lhs index 5b9d8ae..5a815e4 100644 --- a/ghc/compiler/typecheck/TcType.lhs +++ b/ghc/compiler/typecheck/TcType.lhs @@ -373,11 +373,11 @@ tcSplitTyConApp ty = case tcSplitTyConApp_maybe ty of Nothing -> pprPanic "tcSplitTyConApp" (pprType ty) tcSplitTyConApp_maybe :: Type -> Maybe (TyCon, [Type]) --- Newtypes are opaque, so they may be split tcSplitTyConApp_maybe (TyConApp tc tys) = Just (tc, tys) tcSplitTyConApp_maybe (FunTy arg res) = Just (funTyCon, [arg,res]) tcSplitTyConApp_maybe (NoteTy n ty) = tcSplitTyConApp_maybe ty tcSplitTyConApp_maybe (SourceTy (NType tc tys)) = Just (tc,tys) + -- Newtypes are opaque, so they may be split -- However, predicates are not treated -- as tycon applications by the type checker tcSplitTyConApp_maybe other = Nothing -- 1.7.10.4