summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2012-08-21 14:38:18 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2012-08-21 14:38:18 +0100
commit13dc09cc98b4120b5c89a799efb73d889abf72c2 (patch)
tree2c1b903efbae44535315759b42ce5ae2ae185fad
parentf3457760057f280a568a301b44364f5f8631fcfb (diff)
downloadhaskell-13dc09cc98b4120b5c89a799efb73d889abf72c2.tar.gz
Test Trac #7173
-rw-r--r--testsuite/tests/typecheck/should_compile/T7173.hs18
-rw-r--r--testsuite/tests/typecheck/should_compile/all.T1
2 files changed, 19 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/T7173.hs b/testsuite/tests/typecheck/should_compile/T7173.hs
new file mode 100644
index 0000000000..231b18bc19
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T7173.hs
@@ -0,0 +1,18 @@
+module T7173 where
+
+
+-- se and sb are mutually recursive
+-- se takes a numeric parameter (which it ignores)
+-- sb passes it a constant 10
+--
+-- so sb :: Num a => ...type not involving a...
+--
+-- So the ambiguity check must default ambiguous p,
+-- rather than complaining that sb is ambiguous.
+
+showEnv' env t = se 10 env t
+ where
+ se p env (Bind n b sc) = sb env n b
+ sb env n t = se 10 env t
+
+data TT n = Bind n (TT n) (TT n)
diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T
index 6b9aa4e87b..6aef886fce 100644
--- a/testsuite/tests/typecheck/should_compile/all.T
+++ b/testsuite/tests/typecheck/should_compile/all.T
@@ -384,3 +384,4 @@ test('TcLambdaCase', if_compiler_lt('ghc', '7.5', skip), compile, [''])
test('T7147', normal, compile, [''])
test('T7171',normal,run_command,
['$MAKE -s --no-print-directory T5792'])
+test('T7173', normal, compile, [''])