Update Trac ticket URLs to point to GitLab
[ghc.git] / testsuite / tests / typecheck / should_compile / tc228.hs
1 {-# LANGUAGE ExistentialQuantification #-}
2
3 -- Without a type sig this is slightly tricky.
4 -- See #1430
5
6 -- Reason: we get an implication constraint (forall a. Typeable a => Typeable b),
7 -- when generalising unExTypeable. We want to infer a context for the
8 -- whole thing of (Typeable b).
9 -- See Note [Inference and implication constraints] in TcSimplify
10
11
12 module Foo where
13
14 import Data.Typeable
15
16 data ExTypeable = forall a. Typeable a => ExTypeable a
17
18 -- unExTypeable :: Typeable h => ExTypeable -> Maybe h
19 unExTypeable (ExTypeable a) = cast a
20