Update Trac ticket URLs to point to GitLab
[ghc.git] / testsuite / tests / simplCore / should_compile / simpl014.hs
1 {-# OPTIONS_GHC -Wno-redundant-constraints -Wno-simplifiable-class-constraints #-}
2 {-# OPTIONS_GHC -O2 #-}
3 {-# LANGUAGE RankNTypes, GADTs, FlexibleContexts #-}
4
5 -- This one make SpecConstr generate bogus code (hence -O2),
6 -- with a lint error, in GHC 6.4.1
7 -- C.f. https://gitlab.haskell.org/ghc/ghc/issues/737
8
9 module ShouldCompile where
10
11 data IHandler st where
12 IHandler :: forall st ev res.
13 Serialize (TxContext ev) => String -> IO ev
14 -> (res -> IO ()) -> Ev st ev res -> IHandler st
15 -- Weird test case: (Serialize (TxContext ev)) is simplifiable
16
17 data Ev st ev res = Ev
18 data TxContext evt = TxContext
19 data TxConfig = TxConfig
20 data M a = M a
21
22 class Serialize a where
23 instance Serialize a => Serialize (TxContext a)
24 instance Serialize Int
25 instance Serialize ()
26
27 data IHR st = forall res ev. Serialize (TxContext ev) => IHR (TxContext ev)
28
29
30 runHandler :: M (IHR st) -> IHandler st -> IO ()
31 runHandler queue ih@(IHandler tstring inp out run) = runHandler queue ih
32