[GHC] #11680: Out-of-scope suggestion given for an out-of-scope variable when using TH

GHC ghc-devs at haskell.org
Sun Mar 13 04:01:44 UTC 2016


#11680: Out-of-scope suggestion given for an out-of-scope variable when using TH
-------------------------------------+-------------------------------------
        Reporter:  jme               |                Owner:  jme
            Type:  bug               |               Status:  patch
        Priority:  normal            |            Milestone:
       Component:  Template Haskell  |              Version:  8.0.1-rc2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Incorrect         |  Unknown/Multiple
  warning at compile-time            |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D2000
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by jme):

 * status:  new => patch
 * differential:   => Phab:D2000


Comment:

 I've submitted a patch (Phab:D2000).  I'm still not completely happy with
 the form of the new error message, since it states where an exact match to
 an out-of-scope variable is '''not''' in scope:

 {{{
 T11680.hs:37:7: error:
     • Variable not in scope: bar :: ()
     • ‘bar’ (line 82) is not in scope before the splice on lines 78-80
       Perhaps you meant one of these: ‘bat’ (line 40), ‘baz’ (line 43)
 }}}

 But specifying where it '''is''' in scope would have been far wordier.  If
 you think the extra detail would be more helpful to users, though, I'm
 happy to change it.

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


More information about the ghc-tickets mailing list