[GHC] #15677: Valid hole fits and GADT type variable names

GHC ghc-devs at haskell.org
Wed Dec 5 16:23:30 UTC 2018


#15677: Valid hole fits and GADT type variable names
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.8.1
       Component:  Compiler          |              Version:  8.6.1
      Resolution:                    |             Keywords:  TypedHoles,
                                     |  GADTs
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Poor/confusing    |  Unknown/Multiple
  error message                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #9091             |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by RyanGlScott):

 * related:   => #9091


Comment:

 Example 3 in #9091 is likely another example of this phenomenon:

 {{{#!hs
 data X a where
   Y :: X Int

 h :: X a -> a -> a
 h Y x = _
 }}}

 {{{
     Found hole ‘_’ with type: Int
     Relevant bindings include
       x :: a (bound at THC.hs:13:5)
       h :: X a -> a -> a (bound at THC.hs:13:1)
     In the expression: _
     In an equation for ‘h’: h Y x = _
 }}}

 Note that in the list of relevant bindings, in reports that `x` is of type
 `a`, although it would be more informative to report it as having type
 `Int` due to the GADT pattern match.

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


More information about the ghc-tickets mailing list