[GHC] #10968: Type hole cause bad type checking

GHC ghc-devs at haskell.org
Wed Oct 14 16:06:45 UTC 2015


#10968: Type hole cause bad type checking
-------------------------------------+-------------------------------------
           Reporter:  ndtimofeev     |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  7.10.2
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 I've tried to compile that incorrect code on ghc-7.10.2 linux x86_64:

 {{{#!hs
 import Control.Monad.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.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10968>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list