
#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 (Type | Version: checker) | Resolution: | 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: | -------------------------------------+------------------------------------- Comment (by thomie): Which version of GHC are you using that this is accepted? ghc-7.10.2 reports: {{{ Test.hs:3:6: Could not deduce (Eq a0) from the context (Eq a) bound by the type signature for f :: Eq a => b -> b at Test.hs:3:6-19 The type variable ‘a0’ is ambiguous In the ambiguity check for the type signature for ‘f’: f :: forall b a. Eq a => b -> b To defer the ambiguity check to use sites, enable AllowAmbiguousTypes In the type signature for ‘f’: f :: Eq a => b -> b }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10991#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler