Skip to content

Confusing error when using BangPatterns without pragma

If you have something like this

putTagType :: TagType -> Put
putTagType !x = putWord8 $! fromIntegral $! fromEnum x
{-# INLINE putTagType #-}

and forget to put the pragma for BangPatterns you get this:

/Users/kvanb/git/mineserver/mineserver-nbt/src/Mineserver/NBT/TagType.hs:40:1: error:
    The type signature for ‘putTagType’ lacks an accompanying binding

/Users/kvanb/git/mineserver/mineserver-nbt/src/Mineserver/NBT/TagType.hs:42:12: error:
    The INLINE pragma for ‘putTagType’ lacks an accompanying binding
Warning: File listed in mineserver-nbt/mineserver-nbt.cabal file does not exist: README.md

which leaves you very confused thinking you made a typo.

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