Commit f861fc6a authored by Simon Peyton Jones's avatar Simon Peyton Jones

Test Trac #9708

parent 4723a0e3
{-# 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 _ _ = ()
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 -> ()
...@@ -421,3 +421,4 @@ test('MutRec', normal, compile, ['']) ...@@ -421,3 +421,4 @@ test('MutRec', normal, compile, [''])
test('T8856', normal, compile, ['']) test('T8856', normal, compile, [''])
test('T9117', normal, compile, ['']) test('T9117', normal, compile, [''])
test('T9117_2', expect_broken('9117'), compile, ['']) test('T9117_2', expect_broken('9117'), compile, [''])
test('T9708', normal, compile_fail, [''])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment