[GHC] #13421: Confusing error when using BangPatterns without pragma

GHC ghc-devs at haskell.org
Tue Mar 14 01:09:13 UTC 2017


#13421: Confusing error when using BangPatterns without pragma
-------------------------------------+-------------------------------------
           Reporter:  schyler        |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.1
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  Poor/confusing
  Unknown/Multiple                   |  error message
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 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.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13421>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list