Skip to content

`coerce` has an impossible type

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.

Trac metadata
Trac field Value
Version 7.8.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information