[GHC] #10991: Don't permit type variables in the context unless they are in the type

GHC ghc-devs at haskell.org
Tue Oct 20 11:41:54 UTC 2015


#10991: Don't permit type variables in the context unless they are in the type
-------------------------------------+-------------------------------------
           Reporter:  bernalex       |             Owner:  bernalex
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:
  (Type checker)                     |
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  GHC accepts
  Unknown/Multiple                   |  invalid program
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 GHC accepts the following:
 {{{
 f :: Eq a => b -> b
 f b = b
 }}}

 This is not valid Haskell 2010[0], so we should not permit it.


 [0]  «The context cx must only contain type variables referenced in t»,
 https://www.haskell.org/report/node/2010/haskellch4.html#x10-660004.1.3

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


More information about the ghc-tickets mailing list