[GHC] #15401: Weird GHCi bug

GHC ghc-devs at haskell.org
Mon Jul 16 21:35:11 UTC 2018


#15401: Weird GHCi bug
-------------------------------------+-------------------------------------
           Reporter:  vagarenko      |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:  8.6.1
          Component:  GHCi           |           Version:  8.4.3
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:  x86_64         |   Type of failure:  None/Unknown
  (amd64)                            |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 Take a look at this GHCi session:
 {{{#!hs
 $ ghci
 GHCi, version 8.4.3: http://www.haskell.org/ghc/  :? for help
 }}}
 type `do {_}`
 {{{#!hs
 Prelude> do {_}

 <interactive>:1:5: error:
     * Found hole: _ :: t
       Where: `t' is a rigid type variable bound by
                the inferred type of it :: t
                at <interactive>:1:1-6
     * In a stmt of a 'do' block: _
       In the expression: do _
       In an equation for `it': it = do _
     * Relevant bindings include it :: t (bound at <interactive>:1:1)
       Valid substitutions include
         undefined :: forall (a :: TYPE r).
                      GHC.Stack.Types.HasCallStack =>
                      a
           (imported from `Prelude' (and originally defined in `GHC.Err'))
 }}}
 looks ok

 type `()`
 {{{#!hs
 Prelude> ()
 ()
 }}}
 ok

 type `do {_}` again
 {{{#!hs
 Prelude> do {_}

 <interactive>:3:5: error:
     * Found hole: _ :: t
       Where: `t' is a rigid type variable bound by
                the inferred type of it :: t
                at <interactive>:3:1-6
     * In a stmt of a 'do' block: _
       In the expression: do _
       In an equation for `it': it = do _
     * Relevant bindings include it :: t (bound at <interactive>:3:1)
       Valid substitutions include
         undefined :: forall (a :: TYPE r).
                      GHC.Stack.Types.HasCallStack =>
                      a
           (imported from `Prelude' (and originally defined in `GHC.Err'))
 }}}
 ok, same message

 type `()` second type
 {{{#!hs
 Prelude> ()
 ()
 }}}
 ok,

 type `do {_}` third time:
 {{{#!hs
 Prelude> do {_}

 <interactive>:1:1: error:
     GHC internal error: `Ghci1.it' is not in scope during type checking,
 but it passed the renamer
     tcl_env of environment: []
 Prelude>
 }}}
 what's happening?

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


More information about the ghc-tickets mailing list