diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2012-04-30 16:35:03 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2012-04-30 16:35:03 +0100 |
commit | b71f703d2a75dee0dbceab7102466183410e3a78 (patch) | |
tree | 4ca844b4848a8cddf29ac4af348fe612321a575d /testsuite/tests | |
parent | 0021043415f6f3bac47f9047ac099fce6e337f71 (diff) | |
download | haskell-b71f703d2a75dee0dbceab7102466183410e3a78.tar.gz |
Test Trac #6054
Diffstat (limited to 'testsuite/tests')
-rw-r--r-- | testsuite/tests/polykinds/Makefile | 8 | ||||
-rw-r--r-- | testsuite/tests/polykinds/T6054.hs | 7 | ||||
-rw-r--r-- | testsuite/tests/polykinds/T6054.stderr | 10 | ||||
-rw-r--r-- | testsuite/tests/polykinds/T6054a.hs | 6 | ||||
-rw-r--r-- | testsuite/tests/polykinds/all.T | 1 |
5 files changed, 31 insertions, 1 deletions
diff --git a/testsuite/tests/polykinds/Makefile b/testsuite/tests/polykinds/Makefile index 9f3fb669b3..4ac688d458 100644 --- a/testsuite/tests/polykinds/Makefile +++ b/testsuite/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/testsuite/tests/polykinds/T6054.hs b/testsuite/tests/polykinds/T6054.hs new file mode 100644 index 0000000000..f1801ab26c --- /dev/null +++ b/testsuite/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/testsuite/tests/polykinds/T6054.stderr b/testsuite/tests/polykinds/T6054.stderr new file mode 100644 index 0000000000..9b190ce4d8 --- /dev/null +++ b/testsuite/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/testsuite/tests/polykinds/T6054a.hs b/testsuite/tests/polykinds/T6054a.hs new file mode 100644 index 0000000000..5b1077f0da --- /dev/null +++ b/testsuite/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/testsuite/tests/polykinds/all.T b/testsuite/tests/polykinds/all.T index 5f136b16b9..3e026da116 100644 --- a/testsuite/tests/polykinds/all.T +++ b/testsuite/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']) |