[GHC] #9788: `coerce` has an impossible type

#9788: `coerce` has an impossible type -------------------------------------+------------------------------------- Reporter: goldfire | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: 7.10.1 Component: Compiler | Version: 7.8.3 Keywords: | Operating System: Architecture: Unknown/Multiple | Unknown/Multiple Difficulty: Easy (less than 1 | Type of failure: hour) | None/Unknown Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- {{{ GHCi, version 7.8.3: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Prelude> :set -fprint-explicit-foralls Prelude> :set -fprint-explicit-kinds Prelude> import Data.Coerce Prelude Data.Coerce> :t coerce coerce :: forall (k :: BOX) (a :: k) (b :: k). Coercible k a b => a -> b }}} Are those types `a` and `b` really of kind `k`? They certainly shouldn't be. This is worse in HEAD: GHC panics. (Actually, I think panicking is an improvement.) Easy to fix, happily. Will do so in the course of other work. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9788 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9788: `coerce` has an impossible type -------------------------------------+------------------------------------- Reporter: goldfire | Owner: goldfire Type: bug | Status: patch Priority: normal | Milestone: 7.10.1 Component: Compiler | Version: 7.8.3 Resolution: | Keywords: Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Easy (less than 1 Type of failure: | hour) None/Unknown | Blocked By: Test Case: | Related Tickets: Blocking: | Differential Revisions: Phab:D468 | -------------------------------------+------------------------------------- Changes (by goldfire): * status: new => patch * differential: => Phab:D468 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9788#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9788: `coerce` has an impossible type -------------------------------------+------------------------------------- Reporter: goldfire | Owner: goldfire Type: bug | Status: patch Priority: normal | Milestone: 7.10.1 Component: Compiler | Version: 7.8.3 Resolution: | Keywords: Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Easy (less than 1 Type of failure: | hour) None/Unknown | Blocked By: Test Case: | Related Tickets: Blocking: | Differential Revisions: Phab:D468 | -------------------------------------+------------------------------------- Comment (by nomeata): My bad, due to insufficient knowledge about the kind system. Thanks for cleaning up. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9788#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9788: `coerce` has an impossible type -------------------------------------+------------------------------------- Reporter: goldfire | Owner: goldfire Type: bug | Status: patch Priority: highest | Milestone: 7.10.1 Component: Compiler | Version: 7.8.3 Resolution: | Keywords: Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Easy (less than 1 Type of failure: | hour) None/Unknown | Blocked By: Test Case: | Related Tickets: Blocking: | Differential Revisions: Phab:D468 | -------------------------------------+------------------------------------- Changes (by simonpj): * priority: normal => highest Comment: I have no idea how this happens, but thank you for fixing it (for 7.10). Can you also add a regression test? Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9788#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9788: `coerce` has an impossible type -------------------------------------+------------------------------------- Reporter: goldfire | Owner: goldfire Type: bug | Status: patch Priority: highest | Milestone: 7.10.1 Component: Compiler | Version: 7.8.3 Resolution: | Keywords: Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Easy (less than 1 Type of failure: | hour) None/Unknown | Blocked By: Test Case: | Related Tickets: Blocking: | Differential Revisions: Phab:D468 | -------------------------------------+------------------------------------- Comment (by nomeata): It was commit 2f3ea95285d0cccc2a999e7572d8fb78dc2ea441 that made this type signature issue visible. Note that you even updated the users guide with this particular example, so I guess you’ll need to find one that is not horribly wrong :-). The original cause was 976a1087ae75accb4ad9d869d14641b2581c1606 implementing #8541. I back then just assumed that if `Coercible` has to be higher-kinded, then `coerce` has to be too. I guess I was wrong... -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9788#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9788: `coerce` has an impossible type -------------------------------------+------------------------------------- Reporter: goldfire | Owner: goldfire Type: bug | Status: patch Priority: highest | Milestone: 7.10.1 Component: Compiler | Version: 7.8.3 Resolution: | Keywords: Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Easy (less than 1 Type of failure: | hour) None/Unknown | Blocked By: Test Case: | Related Tickets: Blocking: | Differential Revisions: Phab:D468 | -------------------------------------+------------------------------------- Comment (by goldfire): Will update the manual. Does this really need a regression test? I think of this mistake as only a small step above a basic typo. I'm just shocked that we haven't run into this until now! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9788#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9788: `coerce` has an impossible type -------------------------------------+------------------------------------- Reporter: goldfire | Owner: goldfire Type: bug | Status: patch Priority: highest | Milestone: 7.10.1 Component: Compiler | Version: 7.8.3 Resolution: | Keywords: Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Easy (less than 1 Type of failure: | hour) None/Unknown | Blocked By: Test Case: | Related Tickets: Blocking: | Differential Revisions: Phab:D468 | -------------------------------------+------------------------------------- Comment (by simonpj): OK..no test -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9788#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9788: `coerce` has an impossible type
-------------------------------------+-------------------------------------
Reporter: goldfire | Owner: goldfire
Type: bug | Status: patch
Priority: highest | Milestone: 7.10.1
Component: Compiler | Version: 7.8.3
Resolution: | Keywords:
Operating System: | Architecture: Unknown/Multiple
Unknown/Multiple | Difficulty: Easy (less than 1
Type of failure: | hour)
None/Unknown | Blocked By:
Test Case: | Related Tickets:
Blocking: |
Differential Revisions: Phab:D468 |
-------------------------------------+-------------------------------------
Comment (by Richard Eisenberg

#9788: `coerce` has an impossible type -------------------------------------+------------------------------------- Reporter: goldfire | Owner: goldfire Type: bug | Status: closed Priority: highest | Milestone: 7.10.1 Component: Compiler | Version: 7.8.3 Resolution: fixed | Keywords: Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Easy (less than 1 Type of failure: | hour) None/Unknown | Blocked By: Test Case: | Related Tickets: Blocking: | Differential Revisions: Phab:D468 | -------------------------------------+------------------------------------- Changes (by goldfire): * status: patch => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9788#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9788: `coerce` has an impossible type
-------------------------------------+-------------------------------------
Reporter: goldfire | Owner: goldfire
Type: bug | Status: closed
Priority: highest | Milestone: 7.10.1
Component: Compiler | Version: 7.8.3
Resolution: fixed | Keywords:
Operating System: | Architecture: Unknown/Multiple
Unknown/Multiple | Difficulty: Easy (less than 1
Type of failure: | hour)
None/Unknown | Blocked By:
Test Case: | Related Tickets:
Blocking: |
Differential Revisions: Phab:D468 |
-------------------------------------+-------------------------------------
Comment (by Richard Eisenberg
participants (1)
-
GHC