Type hole cause bad type checking
I've tried to compile that incorrect code on ghc-7.10.2 linux x86_64:
import Control.Monad.Trans.Reader
type Tst m = ReaderT () (ReaderT Int m)
f :: Monad m => Tst m ()
f = return ()
f1 :: ReaderT () m () -> ReaderT () m ()
f1 ev = f >> _ >> ev
main :: IO ()
main = print $ runReaderT (f1 (return ())) ()
But тypechecker does not reject f1 and have that:
[1 of 1] Compiling Main ( /home/ndtimofeev/tst.hs, /home/ndtimofeev/tst.o )
ghc: panic! (the 'impossible' happened)
(GHC version 7.10.2 for x86_64-unknown-linux):
StgCmmEnv: variable not found
$dFunctor_aYS
local binds for:
f_rsZ
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
If switch hole to undefined, i have normal typechecking error.