Skip to content

Assertion failure with coerce

The following file (found during investigation of #22644) causes an assertion failure on HEAD

module X where

import Data.Coerce

type T :: (* -> *) -> * -> *
data T m a = MkT (m a)

p :: Coercible a b => T Maybe a -> T Maybe b
p = coerce
<no location info>: error:
    ASSERT failed!
  CallStack (from HasCallStack):
    assert, called at compiler/GHC/Tc/Solver/Types.hs:280:9 in ghc:GHC.Tc.Solver.Types
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information