[GHC] #15007: Don't keep shadowed variables in ghci, both renamer and type checker

GHC ghc-devs at haskell.org
Wed Jul 4 13:53:03 UTC 2018


#15007: Don't keep shadowed variables in ghci, both renamer and type checker
-------------------------------------+-------------------------------------
        Reporter:  sighingnow        |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.6.1
       Component:  GHCi              |              Version:  8.5
      Resolution:                    |             Keywords:  TypedHoles
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Incorrect         |  Unknown/Multiple
  error/warning at compile-time      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #11547 #14052     |  Differential Rev(s):  Phab:D4909
  #15202                             |
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by osa1):

 sighingnow, are you sure you rebuilt it correctly? I'm also using a debug-
 enabled compiler and here are the outputs I'm getting:

 {{{
 ~ $ ghc-stage2 --interactive
 GHCi, version 8.7.20180704: http://www.haskell.org/ghc/  :? for help
 Prelude> 1
 1
 Prelude> 1
 1
 Prelude> _

 <interactive>:3:1: error:
     • Found hole: _ :: t
       Where: ‘t’ is a rigid type variable bound by
                the inferred type of it :: t
                at <interactive>:3:1
     • In the expression: _
       In an equation for ‘it’: it = _
     • Relevant bindings include it :: t (bound at <interactive>:3:1)
 Prelude>
 }}}


 {{{
 ~ $ ghc-stage2 --interactive
 GHCi, version 8.7.20180704: http://www.haskell.org/ghc/  :? for help
 Prelude> let x = ()
 Prelude> let x = ()
 Prelude> :t _

 <interactive>:1:1: error:
     • Found hole: _ :: t
       Where: ‘t’ is a rigid type variable bound by
                the inferred type of it :: t
                at <interactive>:1:1
     • In the expression: _
 Prelude>
 }}}

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


More information about the ghc-tickets mailing list