[GHC] #10495: Total inability to infer type for coerce
#10495: Total inability to infer type for coerce -------------------------------------+------------------------------------- Reporter: goldfire | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.11 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Blocked By: Test Case: | Related Tickets: Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- If I say {{{ import Data.Coerce foo = coerce }}} I get {{{ Couldn't match representation of type ‘a0’ with that of ‘b0’ ‘a0’ is untouchable inside the constraints: () bound by the inferred type of foo :: a0 -> b0 at /Users/rae/temp/bug/App.hs:3:1-12 Relevant bindings include foo :: a0 -> b0 (bound at /Users/rae/temp/bug/App.hs:3:1) In the expression: coerce In an equation for ‘foo’: foo = coerce }}} How awful. Eta-expanding `foo` works fine, though. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10495> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10495: Total inability to infer type for coerce -------------------------------------+------------------------------------- Reporter: goldfire | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by simonpj): Try `NonMonmorphismRestriction`; works fine. This is just the MR biting. I'm not sure there is much we can do here. Simon -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10495#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10495: Total inability to infer type for coerce -------------------------------------+------------------------------------- Reporter: goldfire | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by goldfire): Yes; I realized that soon after posting the ticket. But the error message is terrible -- there's nothing about untouchable variables here. A fix to the error message is on the way. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10495#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10495: Total inability to infer type for coerce -------------------------------------+------------------------------------- Reporter: goldfire | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by Richard Eisenberg <eir@…>): In [changeset:"0de0b14691e0b0789988332ad5addc2a31b09ba6/ghc"]: {{{ #!CommitTicketReference repository="ghc" revision="0de0b14691e0b0789988332ad5addc2a31b09ba6" Fix #10495. This change means that the intricate reasoning in TcErrors around getting messages just right for nominal equalities is skipped for representational equalities. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10495#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10495: Poor error message for Coercible constraint unsatisfiability -------------------------------------+------------------------------------- Reporter: goldfire | Owner: goldfire Type: bug | Status: merge Priority: normal | Milestone: 7.10.3 Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | typecheck/should_fail/T10495 | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by goldfire): * status: new => merge * testcase: => typecheck/should_fail/T10495 * milestone: => 7.10.3 Comment: Merge (into 7.10.3) if convenient. This is just about error messages, so not very important. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10495#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10495: Poor error message for Coercible constraint unsatisfiability -------------------------------------+------------------------------------- Reporter: goldfire | Owner: goldfire Type: bug | Status: merge Priority: normal | Milestone: 7.10.3 Component: Compiler | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | typecheck/should_fail/T10495 Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by bgamari): * version: 7.11 => 7.10.1 Comment: The reference to untouchable variables appeared in 7.10.1. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10495#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10495: Poor error message for Coercible constraint unsatisfiability -------------------------------------+------------------------------------- Reporter: goldfire | Owner: goldfire Type: bug | Status: closed Priority: normal | Milestone: 7.10.3 Component: Compiler | Version: 7.10.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | typecheck/should_fail/T10495 Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: This was merged to `ghc-7.10` as d02954efebbff51a7292bf60ea83db4d35dc3476. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10495#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC