[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 <simonpj@…>): In [changeset:"12c0f03a66bcd978bda6472384ddc0348c5a1d7a/ghc" 12c0f03a/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="12c0f03a66bcd978bda6472384ddc0348c5a1d7a" Set GenSigCtxt for the argument part of tcSubType The reason for this change is described in TcUnify Note [Settting the argument context], and Trac #15438. The only effect is on error messages, where it stops GHC reporting an outright falsity (about the type signature for a function) when it finds an errors in a higher-rank situation. The testsuite changes in this patch illustrate the problem. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15438#comment:1> 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: 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