[GHC] #8806: Invalid constraints should fail to type check

GHC ghc-devs at haskell.org
Thu Feb 20 00:06:41 UTC 2014


#8806: Invalid constraints should fail to type check
-------------------------------------------+-------------------------------
       Reporter:  erikd                    |             Owner:  erikd
           Type:  bug                      |            Status:  new
       Priority:  normal                   |         Milestone:
      Component:  Compiler (Type checker)  |           Version:  7.6.3
       Keywords:                           |  Operating System:
   Architecture:  Unknown/Multiple         |  Unknown/Multiple
     Difficulty:  Unknown                  |   Type of failure:
     Blocked By:                           |  None/Unknown
Related Tickets:                           |         Test Case:
                                           |          Blocking:
-------------------------------------------+-------------------------------
 With ghc-7.6.3 the following code:

 {{{
 f :: Int => Int
 f x = x + 1
 }}}

 should fail to type check, but instead compiles and runs as if it was:

 {{{
 f :: Int -> Int
 f x = x + 1
 }}}

 With 7.8rc1 and git HEAD this results in an error:

 {{{
 Expected a constraint, but ‛Int’ has kind ‛*’
 In the type signature for ‛f’: f :: Int => Int
 }}}


 We should add a "shouldn't type check" test to avoid the possibilty of a
 regression.

 Also:

 {{{
 g :: (Int => Show a) => Int
 g = undefined
 }}}

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


More information about the ghc-tickets mailing list