Move tests from tests/ghc-regress/* to just tests/*
[ghc.git] / testsuite / tests / typecheck / should_compile / T3955.hs
1 {-# LANGUAGE GeneralizedNewtypeDeriving #-}
2 {-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-}
3
4 -- Test for Trac #3955
5
6 module T3955 where
7
8 class (Monad m) => MonadReader r m
9 newtype Reader r a = Reader { runReader :: r -> a }
10
11 instance Monad (Reader r) where
12 (>>=) = error "urk"
13 return = error "urk"
14
15 instance MonadReader r (Reader r)
16
17 newtype T a x = T (Reader a x)
18 deriving (Monad, MonadReader a)
19
20 {-
21 [1 of 1] Compiling Main ( bug.hs, interpreted )
22 mkUsageInfo: internal name? a{tv amy}
23 Ok, modules loaded: Main.
24 -}