X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcMType.lhs;h=c7385e2912a06dba65b958494aaeba2190de4f4a;hb=1a9245caefb80a3c4c5965aaacdf9a607e792e1c;hp=492cbf9edaf8754121e3f9d8658ac2b61b7c2446;hpb=0884a2cb09cd5f609b6163a225ca3b8cce942250;p=ghc-hetmet.git diff --git a/compiler/typecheck/TcMType.lhs b/compiler/typecheck/TcMType.lhs index 492cbf9..c7385e2 100644 --- a/compiler/typecheck/TcMType.lhs +++ b/compiler/typecheck/TcMType.lhs @@ -946,14 +946,14 @@ zonkType unbound_var_fn ty zonk_tc_tyvar :: (TcTyVar -> TcM Type) -- What to do for an unbound mutable var -> TcTyVar -> TcM TcType zonk_tc_tyvar unbound_var_fn tyvar - | not (isMetaTyVar tyvar) -- Skolems - = return (TyVarTy tyvar) - - | otherwise -- Mutables - = do { cts <- readMetaTyVar tyvar - ; case cts of - Flexi -> unbound_var_fn tyvar -- Unbound meta type variable - Indirect ty -> zonkType unbound_var_fn ty } + = ASSERT( isTcTyVar tyvar ) + case tcTyVarDetails tyvar of + SkolemTv {} -> return (TyVarTy tyvar) + FlatSkol ty -> zonkType unbound_var_fn ty + MetaTv _ ref -> do { cts <- readMutVar ref + ; case cts of + Flexi -> unbound_var_fn tyvar + Indirect ty -> zonkType unbound_var_fn ty } -- Zonk the kind of a non-TC tyvar in case it is a coercion variable (their -- kind contains types). @@ -1530,7 +1530,8 @@ dupPredWarn dups = ptext (sLit "Duplicate constraint(s):") <+> pprWithCommas p arityErr :: Outputable a => String -> a -> Int -> Int -> SDoc arityErr kind name n m = hsep [ text kind, quotes (ppr name), ptext (sLit "should have"), - n_arguments <> comma, text "but has been given", int m] + n_arguments <> comma, text "but has been given", + if m==0 then text "none" else int m] where n_arguments | n == 0 = ptext (sLit "no arguments") | n == 1 = ptext (sLit "1 argument")