Skip to content

Incorrect diagnostic for UNPACK/missing strictness

data A = A { a :: {-# UNPACK #-} Maybe Int}
[1 of 1] Compiling Main             ( Temp.hs, Temp.o )

Temp.hs:1:19: error:
    • Unexpected strictness annotation: {-# UNPACK #-}Maybe
    • In the type ‘{-# UNPACK #-}Maybe Int’
      In the definition of data constructor ‘A’
      In the data declaration for ‘A’
  |
1 | data A = A { a :: {-# UNPACK #-} Maybe Int}
  |

The diagnostic is incorrect because it complains about an "unexpected strictness annotation" although the error is the opposite.

A quick glance at the relevant GHC code suggests that it's running into the wrong diagnostic from #7210 (closed). Verified on nightly-2018-01-29.

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