[GHC] #12468: GADTs don't refine hole types

GHC ghc-devs at haskell.org
Sat Aug 6 01:21:26 UTC 2016


#12468: GADTs don't refine hole types
-------------------------------------+-------------------------------------
           Reporter:                 |             Owner:
  benjamin.hodgson                   |
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.1
  (Type checker)                     |
           Keywords:                 |  Operating System:  MacOS X
       Architecture:                 |   Type of failure:  Incorrect
  Unknown/Multiple                   |  warning at compile-time
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 Apologies if this is a dupe. I did look!

 {{{
 #!haskell
 {-# LANGUAGE GADTs #-}

 data T a where
     I :: T Int

 f :: T a -> a
 f I = _
 }}}

 This gives the type error:

 {{{
     • Found hole: _ :: a
       Where: ‘a’ is a rigid type variable bound by
                the type signature for:
                  f :: forall a. T a -> a
                at test.hs:6:6
     • In the expression: _
       In an equation for ‘f’: f I = _
     • Relevant bindings include f :: T a -> a (bound at test.hs:7:1)
 }}}

 It should say something about `a` being `Int` in this branch.

 I'm using GHC 8.0.1 on OSX El Capitan. I think this may be a regression; I
 have a vague memory of it working with GHC 7.10.

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


More information about the ghc-tickets mailing list