Commit 8c825633 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Test Trac #9090

parent 72562138
{-# LANGUAGE RankNTypes, ConstraintKinds, TypeFamilies #-}
module T9090 where
import GHC.Exts (Constraint)
type family F (c :: Constraint) :: Constraint
type instance F (Eq a) = Eq a
-- checks
f :: Eq b => (forall a. F (Eq a) => f a -> Bool) -> f b -> Bool
f = error "urk" -- g x = g x
-- checks
f' :: Eq b => (forall a. Eq a => f a -> Bool) -> f b -> Bool
f' = f
-- checks, so GHC seems to think that both types are interchangeable
f'' :: Eq b => (forall a. F (Eq a) => f a -> Bool) -> f b -> Bool
f'' = f'
-- checks
test' y = f' (\ (Just x) -> x /= x) y
-- fails
test y = f (\ (Just x) -> x /= x) y
-- fails too, unsurprisingly
test'' y = f'' (\ (Just x) -> x /= x) y
......@@ -250,3 +250,4 @@ test('Sock', normal, compile, [''])
test('T9211', normal, compile, [''])
test('T9747', normal, compile, [''])
test('T9582', normal, compile, [''])
test('T9090', normal, compile, [''])
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