[GHC] #12406: New not-in-scope behaviour + deferred typed holes = disappearing error messages

GHC ghc-devs at haskell.org
Mon Jul 18 10:46:19 UTC 2016


#12406: New not-in-scope behaviour + deferred typed holes = disappearing error
messages
-------------------------------------+-------------------------------------
           Reporter:  ertes          |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.1
           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:
-------------------------------------+-------------------------------------
 The following code snippet (using the [https://hackage.haskell.org/package
 /ref-tf ref-tf library]) is well-typed, and GHC is fine with it:

 {{{#!hs
 import Control.Monad  -- comment this out to cause error
 import Control.Monad.Ref

 main :: IO ()
 main = newRef (pure ()) >>= join . readRef
 }}}

 However, if one comments out the first line, then GHC treats `join` as a
 typed hole due to #10569, but fails to infer its type, causing errors:

 {{{
 test.hs:10:8-23: error: …
     • Couldn't match type ‘Ref m0’ with ‘GHC.IORef.IORef’
       ...
 test.hs:10:29-32: error: …
     Variable not in scope: join :: m0 (f0 ()) -> IO ()
 }}}

 By default the not-in-scope error is reported, but if `-fdefer-typed-
 holes` is in effect, only the type error is reported leaving the user (at
 least me) puzzled.

 Not-in-scope errors should ''always'' be reported.

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


More information about the ghc-tickets mailing list