Repository : ssh://darcs.haskell.org//srv/darcs/testsuite On branch : master
http://hackage.haskell.org/trac/ghc/changeset/4e07a12029dc856f79e0057ad955c3dcd657543a >--------------------------------------------------------------- commit 4e07a12029dc856f79e0057ad955c3dcd657543a Author: Simon Peyton Jones <[email protected]> Date: Fri May 25 11:47:17 2012 +0100 Test Trac #6123, and improve an error message in T2627b >--------------------------------------------------------------- tests/indexed-types/should_fail/T2627b.stderr | 12 ++++++++---- tests/indexed-types/should_fail/T6123.hs | 10 ++++++++++ tests/indexed-types/should_fail/T6123.stderr | 10 ++++++++++ tests/indexed-types/should_fail/all.T | 2 +- 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/tests/indexed-types/should_fail/T2627b.stderr b/tests/indexed-types/should_fail/T2627b.stderr index c0e03ce..9d5504f 100644 --- a/tests/indexed-types/should_fail/T2627b.stderr +++ b/tests/indexed-types/should_fail/T2627b.stderr @@ -1,7 +1,11 @@ -T2627b.hs:20:24: - Occurs check: cannot construct the infinite type: - b0 = Dual (Dual b0) - In the expression: conn undefined undefined +T2627b.hs:20:14: + Couldn't match expected type `b0' with actual type `Dual (Dual b0)' + `b0' is untouchable + inside the constraints (b ~ W a2 b2) + bound at a pattern with constructor + Wr :: forall a b. a -> Comm b -> Comm (W a b), + in an equation for `conn' + In the pattern: Wr a r In an equation for `conn': conn (Rd k) (Wr a r) = conn undefined undefined diff --git a/tests/indexed-types/should_fail/T6123.hs b/tests/indexed-types/should_fail/T6123.hs new file mode 100644 index 0000000..78e1d78 --- /dev/null +++ b/tests/indexed-types/should_fail/T6123.hs @@ -0,0 +1,10 @@ +{-# LANGUAGE TypeFamilies #-} + +module T6123 where + +type family Id a + +cid :: a ~ Id a => a -> a +cid x = x + +cundefined = cid undefined diff --git a/tests/indexed-types/should_fail/T6123.stderr b/tests/indexed-types/should_fail/T6123.stderr new file mode 100644 index 0000000..c389866 --- /dev/null +++ b/tests/indexed-types/should_fail/T6123.stderr @@ -0,0 +1,10 @@ + +T6123.hs:10:14: + Couldn't match expected type `a0' with actual type `Id a0' + The type variable `a0' is ambiguous + Possible cause: the monomorphism restriction applied to the following: + cundefined :: a0 (bound at T6123.hs:10:1) + Probable fix: give these definition(s) an explicit type signature + or use -XNoMonomorphismRestriction + In the expression: cid undefined + In an equation for `cundefined': cundefined = cid undefined diff --git a/tests/indexed-types/should_fail/all.T b/tests/indexed-types/should_fail/all.T index d3e691f..8117a72 100644 --- a/tests/indexed-types/should_fail/all.T +++ b/tests/indexed-types/should_fail/all.T @@ -73,6 +73,6 @@ test('T1897b', normal, compile_fail, ['']) test('T5439', normal, compile_fail, ['']) test('T5515', normal, compile_fail, ['']) test('T5763', expect_broken(5673), compile_fail, ['']) - test('T5934', normal, compile_fail, ['']) +test('T6123', normal, compile_fail, ['']) _______________________________________________ Cvs-ghc mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-ghc
