[GHC] #15438: Misleading error message for higher rank type

#15438: Misleading error message for higher rank type -------------------------------------+------------------------------------- Reporter: simonpj | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Consider {{{ foo :: (forall a b. C a b => b -> b) -> Int foo = error "urk" }}} With GHC (for ages, incl 8.6) we get {{{ • Could not deduce (C a0 b) from the context: C a b bound by the type signature for: foo :: forall a b. C a b => b -> b <======= Not true! at Foo.hs:7:8-43 The type variable ‘a0’ is ambiguous • In the ambiguity check for ‘foo’ To defer the ambiguity check to use sites, enable AllowAmbiguousTypes In the type signature: foo :: (forall a b. C a b => b -> b) -> Int }}} But `foo`'s type signature is NOT `foo :: forall a b. C a b => b -> b`!! Let's fix this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15438 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15438: Misleading error message for higher rank type
-------------------------------------+-------------------------------------
Reporter: simonpj | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone: 8.6.1
Component: Compiler | Version: 8.4.3
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Simon Peyton Jones

#15438: Misleading error message for higher rank type -------------------------------------+------------------------------------- Reporter: simonpj | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | typecheck/should_fail/T15438 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => closed * testcase: => typecheck/should_fail/T15438 * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15438#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC