diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2013-06-20 10:59:40 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2013-06-20 10:59:40 +0100 |
commit | 5cc67734fd541c07928098e0d5f21ee6b9e3fde8 (patch) | |
tree | ce7e7afbdb81f4cf395ad13808e1de6a5573cd62 /testsuite/tests/gadt | |
parent | a67156eed3561d5964dc4a46e1cbbd66a0368923 (diff) | |
download | haskell-5cc67734fd541c07928098e0d5f21ee6b9e3fde8.tar.gz |
Test Trac #7558
Diffstat (limited to 'testsuite/tests/gadt')
-rw-r--r-- | testsuite/tests/gadt/T7558.hs | 8 | ||||
-rw-r--r-- | testsuite/tests/gadt/T7558.stderr | 13 | ||||
-rw-r--r-- | testsuite/tests/gadt/all.T | 1 |
3 files changed, 22 insertions, 0 deletions
diff --git a/testsuite/tests/gadt/T7558.hs b/testsuite/tests/gadt/T7558.hs new file mode 100644 index 0000000000..129704f955 --- /dev/null +++ b/testsuite/tests/gadt/T7558.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE GADTs #-} +module T7558 where + +data T a b where + MkT :: (a~Maybe b) => a -> Maybe b -> T a b + +f :: T a a -> Bool +f (MkT x y) = [x,y] `seq` True diff --git a/testsuite/tests/gadt/T7558.stderr b/testsuite/tests/gadt/T7558.stderr new file mode 100644 index 0000000000..cf5d73dce8 --- /dev/null +++ b/testsuite/tests/gadt/T7558.stderr @@ -0,0 +1,13 @@ + +T7558.hs:8:4: + Couldn't match type ‛a’ with ‛Maybe a’ + ‛a’ is a rigid type variable bound by + the type signature for f :: T a a -> Bool at T7558.hs:7:6 + Inaccessible code in + a pattern with constructor + MkT :: forall a b. a ~ Maybe b => a -> Maybe b -> T a b, + in an equation for ‛f’ + Relevant bindings include + f :: T a a -> Bool (bound at T7558.hs:8:1) + In the pattern: MkT x y + In an equation for ‛f’: f (MkT x y) = [x, y] `seq` True diff --git a/testsuite/tests/gadt/all.T b/testsuite/tests/gadt/all.T index e3e92df69c..1be8260363 100644 --- a/testsuite/tests/gadt/all.T +++ b/testsuite/tests/gadt/all.T @@ -121,3 +121,4 @@ test('T7321', run_command, ['$MAKE -s --no-print-directory T7321']) test('T7974', normal, compile, ['']) +test('T7558', normal, compile_fail, ['']) |