[GHC] #10351: Inferred type is rejected

GHC ghc-devs at haskell.org
Fri Apr 24 10:48:00 UTC 2015


#10351: Inferred type is rejected
-------------------------------------+-------------------------------------
              Reporter:  simonpj     |             Owner:
                  Type:  bug         |            Status:  new
              Priority:  normal      |         Milestone:
             Component:  Compiler    |           Version:  7.10.1
              Keywords:              |  Operating System:  Unknown/Multiple
          Architecture:              |   Type of failure:  None/Unknown
  Unknown/Multiple                   |        Blocked By:
             Test Case:              |   Related Tickets:
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------
 Consider
 {{{
 class C a where
  op :: a -> ()

 f x = op [x]
 }}}
 we get
 {{{
 Foo.hs:14:1: error:
     Non type-variable argument in the constraint: C [t]
     (Use FlexibleContexts to permit this)
     When checking that ‘f’ has the inferred type
       f :: forall t. C [t] => t -> ()
 }}}
 Arguably, if `FlexibleContexts` is not on, we should not infer a type that
 will immediately be rejected.

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


More information about the ghc-tickets mailing list