[GHC] #10428: GHC cannot match representations using Coercible constraint

#10428: GHC cannot match representations using Coercible constraint -------------------------------------+------------------------------------- Reporter: crockeea | 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: | -------------------------------------+------------------------------------- The following code compiles in 7.8.4 but fails in 7.10.1: {{{#!hs import Data.Coerce coerceNewtype :: (Coercible (o r) (n m' r)) => [o r] -> [n m' r] coerceNewtype = coerce }}} with the error {{{ Couldn't match representation of type ‘n m' r’ with that of ‘o r’ arising from trying to show that the representations of ‘[o r]’ and ‘[n m' r]’ are the same Relevant role signatures: type role [] representational }}} However, the following compiles: {{{#!hs {-# LANGUAGE TypeFamilies #-} import Data.Coerce coerceNewtype :: (Coercible a b, a ~ (o r), b ~ (n m' r)) => [o r] -> [n m' r] coerceNewtype = coerce }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10428 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10428: GHC cannot match representations using Coercible constraint -------------------------------------+------------------------------------- Reporter: crockeea | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by goldfire): * owner: => goldfire Comment: Hmpf. I'm not terribly surprised that this would happen, but we should be able to nab such an easy case. Will take a look. But not this week. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10428#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10428: GHC cannot match representations using Coercible constraint -------------------------------------+------------------------------------- Reporter: crockeea | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1 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): Curious. With HEAD I get {{{ T10428.hs:5:18: error: Couldn't match representation of type ‘o r’ with that of ‘n m' r’ Inaccessible code in the type signature for: coerceNewtype :: Coercible (o r) (n m' r) => [o r] -> [n m' r] In the ambiguity check for the type signature for ‘coerceNewtype’: coerceNewtype :: forall (o :: * -> *) r (n :: * -> * -> *) m'. Coercible (o r) (n m' r) => [o r] -> [n m' r] To defer the ambiguity check to use sites, enable AllowAmbiguousTypes In the type signature for ‘coerceNewtype’: coerceNewtype :: (Coercible (o r) (n m' r)) => [o r] -> [n m' r] }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10428#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10428: GHC cannot match representations using Coercible constraint -------------------------------------+------------------------------------- Reporter: crockeea | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1 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): comment:2 really shouldn't happen. That one surprises me. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10428#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10428: GHC cannot match representations using Coercible constraint -------------------------------------+------------------------------------- Reporter: crockeea | Owner: goldfire Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.10.1 Resolution: duplicate | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | typecheck/should_compile/T10428 | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by goldfire): * status: new => closed * testcase: => typecheck/should_compile/T10428 * resolution: => duplicate Comment: Turned out this is a duplicate of #10494, discovered separately. Fix on the way. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10428#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10428: GHC cannot match representations using Coercible constraint
-------------------------------------+-------------------------------------
Reporter: crockeea | Owner: goldfire
Type: bug | Status: closed
Priority: normal | Milestone:
Component: Compiler | Version: 7.10.1
Resolution: duplicate | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: None/Unknown | Unknown/Multiple
Blocked By: | Test Case:
Related Tickets: | typecheck/should_compile/T10428
| Blocking:
| Differential Revisions:
-------------------------------------+-------------------------------------
Comment (by Richard Eisenberg

#10428: GHC cannot match representations using Coercible constraint -------------------------------------+------------------------------------- Reporter: crockeea | Owner: goldfire Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.10.1 Resolution: duplicate | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | typecheck/should_compile/T10428 Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by George): There was a question in email as to whether or not the fix is in 7.10.2. I just tried on 7.10.2 and get the same error so it seems it is not in 7.10.2 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10428#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10428: GHC cannot match representations using Coercible constraint -------------------------------------+------------------------------------- Reporter: crockeea | Owner: goldfire Type: bug | Status: closed Priority: normal | Milestone: 7.10.3 Component: Compiler | Version: 7.10.1 Resolution: duplicate | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | typecheck/should_compile/T10428 Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by crockeea): * milestone: => 7.10.3 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10428#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10428: GHC cannot match representations using Coercible constraint -------------------------------------+------------------------------------- Reporter: crockeea | Owner: goldfire Type: bug | Status: closed Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.1 Resolution: duplicate | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | typecheck/should_compile/T10428 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * milestone: 7.10.3 => 8.0.1 Comment: Sadly this won't be fixed in 7.10.3 either on account of the fix depending upon a rather large patch that would be quite tricky to backport (see #10494). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10428#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC