Repository : ssh://darcs.haskell.org//srv/darcs/testsuite On branch : ghc-7.6
http://hackage.haskell.org/trac/ghc/changeset/549a5fd3c9f523988903a924c7010fea88beb9d5 >--------------------------------------------------------------- commit 549a5fd3c9f523988903a924c7010fea88beb9d5 Author: Simon Peyton Jones <[email protected]> Date: Sat Jul 21 19:10:48 2012 +0100 Add a type signature for a function with an ambiguous type There's a comment with visit_PPSArgs to explain. GHC was rightfully rejecting visit_PPS as having an ambiguous type. And it does! It worked before because the ambiguity involved only standard classes and hence was resolved. (I suppose this could be a warning instead. But I'm fixing the test anyway.) >--------------------------------------------------------------- tests/programs/joao-circular/Visfun_Lazy.hs | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/tests/programs/joao-circular/Visfun_Lazy.hs b/tests/programs/joao-circular/Visfun_Lazy.hs index 7d57ab9..6430e54 100644 --- a/tests/programs/joao-circular/Visfun_Lazy.hs +++ b/tests/programs/joao-circular/Visfun_Lazy.hs @@ -855,6 +855,20 @@ visit_PPCArgs (C_NilPPCArgs_1 ) x_ifillerrs x_ifillfmts x_ifillmins x_ireqs = (x x_fmts = ([] ) x_fillmins = ([] ) x_error = ([] ) + + +visit_PPSArgs :: PPSArgs -> [T_Frame] -> (T_Errs, T_Fmts, Integer, T_Mins) +-- This function's most general type is +-- visit_PPSArgs :: forall a. (Integral a, Show a) +-- => PPSArgs -> [T_Frame] -> (T_Errs, T_Fmts, a, T_Mins) +-- But in the same mutually recusive group is visit_PPS whose type becomes +-- visit_PPS :: forall a. (Integral a, Show a) +-- => PPS -> T_Frame -> (Bool, T_Formats, INT, INT, INT) +-- which GHC now (rightfully) rejects that as ambiguous, even though +-- acutally default resolution will allow it at call sites, +-- So I've added a type signature +-- SLPJ July 2012 + visit_PPSArgs (C_ConsArgs_1 t_PPS t_PPSArgs_2 ) x_reqs = (x_error , x_fmts , x_len , x_mins ) where x_reqs_2 = (tail_T_Reqs x_reqs) _______________________________________________ Cvs-ghc mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-ghc
