[GHC] #14000: Out of scope errors with type families do not mention scope

GHC ghc-devs at haskell.org
Thu Jul 20 16:32:12 UTC 2017


#14000: Out of scope errors with type families do not mention scope
-------------------------------------+-------------------------------------
        Reporter:  EyalLotem         |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:  TypeFamilies
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Poor/confusing    |  Unknown/Multiple
  error message                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by RyanGlScott):

 Interestingly, I tried a random commit from before GHC 8.0.1
 (707b2be97539b83efb91cd9f17f94c91397ad2b4), and I received more
 information in the error messages:

 {{{
 $ inplace/bin/ghc-stage2 --interactive ../Bug.hs
 GHCi, version 8.0.0.20160109: http://www.haskell.org/ghc/  :? for help
 [1 of 1] Compiling Main             ( ../Bug.hs, interpreted )

 ../Bug.hs:5:1: error:
     • Couldn't match expected type ‘T a’ with actual type ‘T a0’
       NB: ‘T’ is a type function, and may not be injective
       The type variable ‘a0’ is ambiguous
     • In the ambiguity check for the inferred type for ‘main’
       To defer the ambiguity check to use sites, enable
 AllowAmbiguousTypes
       When checking the inferred type
         main :: forall a. T a

 ../Bug.hs:5:10: error: Variable not in scope: noSuchThing
 }}}

 So at separate commits, GHC (1) started complaining about this `Couldn't
 match expected type` business (which is questionable), and (2) stopped
 complaining about `noSuchThing` not being in scope (which is definitely
 wrong). I've yet to figure out which commits are responsible.

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


More information about the ghc-tickets mailing list