diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2014-10-30 11:39:39 +0000 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2014-11-04 10:38:02 +0000 |
commit | f861fc6ad8e5504a4fecfc9bb0945fe2d313687c (patch) | |
tree | c269d2d3ed4ac9b4eb798cc262fc69cf6f36ce04 /testsuite/tests | |
parent | 4723a0e39b5eb7a47457696aceb67f8e230a42e6 (diff) | |
download | haskell-f861fc6ad8e5504a4fecfc9bb0945fe2d313687c.tar.gz |
Test Trac #9708
Diffstat (limited to 'testsuite/tests')
-rw-r--r-- | testsuite/tests/typecheck/should_compile/T9708.hs | 10 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_compile/T9708.stderr | 17 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_compile/all.T | 1 |
3 files changed, 28 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/T9708.hs b/testsuite/tests/typecheck/should_compile/T9708.hs new file mode 100644 index 0000000000..fa6deb2cdf --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/T9708.hs @@ -0,0 +1,10 @@ +{-# LANGUAGE DataKinds, TypeOperators, TypeFamilies #-} +module TcTypeNatSimple where + +import GHC.TypeLits +import Data.Proxy + +type family SomeFun (n :: Nat) + +ti7 :: (x <= y, y <= x) => Proxy (SomeFun x) -> Proxy y -> () +ti7 _ _ = () diff --git a/testsuite/tests/typecheck/should_compile/T9708.stderr b/testsuite/tests/typecheck/should_compile/T9708.stderr new file mode 100644 index 0000000000..fca5df7bc8 --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/T9708.stderr @@ -0,0 +1,17 @@ +
+T9708.hs:9:8:
+ Could not deduce (SomeFun x ~ SomeFun y)
+ from the context (x <= y, y <= x)
+ bound by the type signature for
+ ti7 :: (x <= y, y <= x) => Proxy (SomeFun x) -> Proxy y -> ()
+ at T9708.hs:9:8-61
+ NB: ‘SomeFun’ is a type function, and may not be injective
+ Expected type: Proxy (SomeFun x) -> Proxy y -> ()
+ Actual type: Proxy (SomeFun y) -> Proxy y -> ()
+ In the ambiguity check for:
+ forall (x :: Nat) (y :: Nat).
+ (x <= y, y <= x) =>
+ Proxy (SomeFun x) -> Proxy y -> ()
+ To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
+ In the type signature for ‘ti7’:
+ ti7 :: (x <= y, y <= x) => Proxy (SomeFun x) -> Proxy y -> ()
diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index 8b8155d186..a6cb78a3cd 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -421,3 +421,4 @@ test('MutRec', normal, compile, ['']) test('T8856', normal, compile, ['']) test('T9117', normal, compile, ['']) test('T9117_2', expect_broken('9117'), compile, ['']) +test('T9708', normal, compile_fail, ['']) |