summaryrefslogtreecommitdiff
path: root/testsuite/tests/programs/joao-circular
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2012-07-21 19:10:48 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2012-07-21 19:10:48 +0100
commitafa3965dbbd76a75ee2161e9da21bcce6afa935a (patch)
treeac23938806ca14cd8c0a16e0f90d75004ca89685 /testsuite/tests/programs/joao-circular
parent7cf9432ad3923851e0222767432e3398f01199df (diff)
downloadhaskell-afa3965dbbd76a75ee2161e9da21bcce6afa935a.tar.gz
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.)
Diffstat (limited to 'testsuite/tests/programs/joao-circular')
-rw-r--r--testsuite/tests/programs/joao-circular/Visfun_Lazy.hs14
1 files changed, 14 insertions, 0 deletions
diff --git a/testsuite/tests/programs/joao-circular/Visfun_Lazy.hs b/testsuite/tests/programs/joao-circular/Visfun_Lazy.hs
index fa768999c0..494604eb1d 100644
--- a/testsuite/tests/programs/joao-circular/Visfun_Lazy.hs
+++ b/testsuite/tests/programs/joao-circular/Visfun_Lazy.hs
@@ -854,6 +854,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)