Skip to content

Bad error message when compacting a Compact#

When I run this:

main :: IO ()
main = do
  cpt@(Compact cpt# _ _) <- compact (55 :: Int)
  _ <- compactAdd cpt (MyCompact cpt#)
  return ()

data MyCompact = MyCompact Compact#

I get this error message:

compaction failed: cannot compact mutable objects

This error message is misleading. I don't really know if it makes sense to allow a Compact# to be stored in a compact region, but if someone tries to do it, I would rather the error say:

cannot compact Compact# values

Or something like that.

Trac metadata
Trac field Value
Version 8.2.1-rc2
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