[GHC] #11197: Overeager deferred type errors

GHC ghc-devs at haskell.org
Fri May 18 03:16:29 UTC 2018


#11197: Overeager deferred type errors
-------------------------------------+-------------------------------------
        Reporter:  goldfire          |                Owner:  goldfire
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.6.1
       Component:  Compiler (Type    |              Version:  7.11
  checker)                           |
      Resolution:                    |             Keywords:  TypeInType
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by sighingnow):

 When `-fdefer-type-errors` is enabled, the program

 {{{#!hs
 main = do
   putStrLn "Hi there."
   putStrLn 1
 }}}

 works well. However the program

 {{{#!hs
 main = do
   putStrLn "Hi there."
   putStrLn True
 }}}

 emits the deferred type error message eagerly and doesn't execute
 `putStrLn "Hi there."`.

 In the first case, the type error is `EvVarDest evar`:

 {{{
 Wanted = WC {wc_simple = [WD] $dNum_a1zB {0}:: Num String (CDictCan(psc))}
 }}}

 However in the second case, the type error is `HoleDest hole`:

 {{{
 Wanted = WC {wc_simple = [WD] hole{co_a1zO} {0}:: (Bool :: *) GHC.Prim.~#
 ([Char] :: *)}
 }}}

 Seems that the coercion hole is placed at wrong place. This ticket may
 related to Trac #14584.

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


More information about the ghc-tickets mailing list