Repository : ssh://darcs.haskell.org//srv/darcs/testsuite On branch : master
http://hackage.haskell.org/trac/ghc/changeset/9850651f76a3ae9cea5460e27c03e2212810c8df >--------------------------------------------------------------- commit 9850651f76a3ae9cea5460e27c03e2212810c8df Author: Simon Peyton Jones <[email protected]> Date: Mon Apr 30 16:35:03 2012 +0100 Test Trac #6054 >--------------------------------------------------------------- tests/polykinds/Makefile | 8 +++++++- tests/polykinds/T6054.hs | 7 +++++++ tests/polykinds/T6054.stderr | 10 ++++++++++ tests/polykinds/T6054a.hs | 6 ++++++ tests/polykinds/all.T | 1 + 5 files changed, 31 insertions(+), 1 deletions(-) diff --git a/tests/polykinds/Makefile b/tests/polykinds/Makefile index 9f3fb66..4ac688d 100644 --- a/tests/polykinds/Makefile +++ b/tests/polykinds/Makefile @@ -9,9 +9,15 @@ T5881: '$(TEST_HC)' $(TEST_HC_OPTS) -c T5881a.hs '$(TEST_HC)' $(TEST_HC_OPTS) -c T5881.hs -# T6025 is like T5881; needs separat compile +# T6025 is like T5881; needs separate compile T6025: $(RM) -f T6025.hi T6025.o T6025a.hi T6025a.o '$(TEST_HC)' $(TEST_HC_OPTS) -c T6025a.hs '$(TEST_HC)' $(TEST_HC_OPTS) -c T6025.hs +# T6054 is like T5881; needs separate compile +# The second compile fails, and should do so, hence leading "-" +T6054: + $(RM) -f T6054.hi T6054.o T6054a.hi T6054a.o + '$(TEST_HC)' $(TEST_HC_OPTS) -c T6054a.hs + -'$(TEST_HC)' $(TEST_HC_OPTS) -c T6054.hs diff --git a/tests/polykinds/T6054.hs b/tests/polykinds/T6054.hs new file mode 100644 index 0000000..f1801ab --- /dev/null +++ b/tests/polykinds/T6054.hs @@ -0,0 +1,7 @@ +{-# LANGUAGE FlexibleContexts, DataKinds #-} + +module T6054 where + +import T6054a + +foo = print (Proxy :: Bar '() a => Proxy a) diff --git a/tests/polykinds/T6054.stderr b/tests/polykinds/T6054.stderr new file mode 100644 index 0000000..9b190ce --- /dev/null +++ b/tests/polykinds/T6054.stderr @@ -0,0 +1,10 @@ + +T6054.hs:7:14: + No instance for (Bar () '() a0) + arising from an expression type signature + Possible fix: add an instance declaration for (Bar () '() a0) + In the first argument of `print', namely + `(Proxy :: Bar () a => Proxy a)' + In the expression: print (Proxy :: Bar () a => Proxy a) + In an equation for `foo': + foo = print (Proxy :: Bar () a => Proxy a) diff --git a/tests/polykinds/T6054a.hs b/tests/polykinds/T6054a.hs new file mode 100644 index 0000000..5b1077f --- /dev/null +++ b/tests/polykinds/T6054a.hs @@ -0,0 +1,6 @@ +{-# LANGUAGE PolyKinds, FunctionalDependencies, KindSignatures, MultiParamTypeClasses, DataKinds #-} + +module T6054a where + +class Bar a (p :: Bool) | a -> p +data Proxy a = Proxy deriving Show diff --git a/tests/polykinds/all.T b/tests/polykinds/all.T index 5f136b1..3e026da 100644 --- a/tests/polykinds/all.T +++ b/tests/polykinds/all.T @@ -43,3 +43,4 @@ test('T6039', normal, compile_fail, ['']) test('T6021', normal, compile_fail, ['']) test('T6020a', normal, compile, ['']) test('T6044', normal, compile, ['']) +test('T6054', normal, run_command, ['$MAKE -s --no-print-directory T6054']) _______________________________________________ Cvs-ghc mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-ghc
