X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcSimplify.lhs;h=1f690bc4ff790d1655b16ce5a0effc2e76421ebf;hb=78d61618421fcd53f3e82cc7fed2da4218208bf5;hp=911e2ff12d8a7f6c4d7a86da0040bb0ce6d19dbd;hpb=0560e796f1d813582e066a5f2bec2684c71df44d;p=ghc-hetmet.git diff --git a/compiler/typecheck/TcSimplify.lhs b/compiler/typecheck/TcSimplify.lhs index 911e2ff..1f690bc 100644 --- a/compiler/typecheck/TcSimplify.lhs +++ b/compiler/typecheck/TcSimplify.lhs @@ -2650,6 +2650,10 @@ mkMonomorphismMsg tidy_env inst_tvs = findGlobals (mkVarSet inst_tvs) tidy_env `thenM` \ (tidy_env, docs) -> returnM (tidy_env, mk_msg docs) where + mk_msg _ | any isRuntimeUnk inst_tvs + = vcat [ptext SLIT("Cannot resolve unknown runtime types:") <+> + (pprWithCommas ppr inst_tvs), + ptext SLIT("Use :print or :force to determine these types")] mk_msg [] = ptext SLIT("Probable fix: add a type signature that fixes these type variable(s)") -- This happens in things like -- f x = show (read "foo") @@ -2658,6 +2662,11 @@ mkMonomorphismMsg tidy_env inst_tvs nest 2 (vcat docs), monomorphism_fix ] + +isRuntimeUnk :: TcTyVar -> Bool +isRuntimeUnk x | SkolemTv RuntimeUnkSkol <- tcTyVarDetails x = True + | otherwise = False + monomorphism_fix :: SDoc monomorphism_fix = ptext SLIT("Probable fix:") <+> (ptext SLIT("give these definition(s) an explicit type signature")