[commit: ghc] master: Test Trac #9036 (c4e9f24)
git at git.haskell.org
git at git.haskell.org
Mon Apr 28 07:56:59 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/c4e9f243398942499c9f5e21318e6ceb048d5880/ghc
>---------------------------------------------------------------
commit c4e9f243398942499c9f5e21318e6ceb048d5880
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Mon Apr 28 08:55:32 2014 +0100
Test Trac #9036
>---------------------------------------------------------------
c4e9f243398942499c9f5e21318e6ceb048d5880
testsuite/tests/indexed-types/should_fail/T9036.hs | 18 ++++++++++++++++++
.../tests/indexed-types/should_fail/T9036.stderr | 12 ++++++++++++
testsuite/tests/indexed-types/should_fail/all.T | 1 +
3 files changed, 31 insertions(+)
diff --git a/testsuite/tests/indexed-types/should_fail/T9036.hs b/testsuite/tests/indexed-types/should_fail/T9036.hs
new file mode 100644
index 0000000..550adb4
--- /dev/null
+++ b/testsuite/tests/indexed-types/should_fail/T9036.hs
@@ -0,0 +1,18 @@
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE TypeOperators #-}
+{-# LANGUAGE TypeFamilies #-}
+
+
+module T9036 where
+
+class UncurryM t where
+ type GetMonad t :: * -> *
+
+class Curry a b where
+ type Curried a b :: *
+
+gSimple :: String -> String -> [String]
+gSimple = simpleLogger (return ())
+
+simpleLogger :: Maybe (GetMonad t after) -> t `Curried` [t]
+simpleLogger _ _ = undefined
diff --git a/testsuite/tests/indexed-types/should_fail/T9036.stderr b/testsuite/tests/indexed-types/should_fail/T9036.stderr
new file mode 100644
index 0000000..2df53c7
--- /dev/null
+++ b/testsuite/tests/indexed-types/should_fail/T9036.stderr
@@ -0,0 +1,12 @@
+
+T9036.hs:17:17:
+ Couldn't match type ‘GetMonad t0’ with ‘GetMonad t’
+ NB: ‘GetMonad’ is a type function, and may not be injective
+ The type variable ‘t0’ is ambiguous
+ Expected type: Maybe (GetMonad t after) -> Curried t [t]
+ Actual type: Maybe (GetMonad t0 after) -> Curried t0 [t0]
+ In the ambiguity check for:
+ forall t after. Maybe (GetMonad t after) -> Curried t [t]
+ To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
+ In the type signature for ‘simpleLogger’:
+ simpleLogger :: Maybe (GetMonad t after) -> t `Curried` [t]
diff --git a/testsuite/tests/indexed-types/should_fail/all.T b/testsuite/tests/indexed-types/should_fail/all.T
index 54a33cd..003b51d 100644
--- a/testsuite/tests/indexed-types/should_fail/all.T
+++ b/testsuite/tests/indexed-types/should_fail/all.T
@@ -119,4 +119,5 @@ test('T8129',
test('T8368', normal, compile_fail, [''])
test('T8368a', normal, compile_fail, [''])
test('T8518', normal, compile_fail, [''])
+test('T9036', normal, compile_fail, [''])
More information about the ghc-commits
mailing list