[GHC] #14761: Incorrect diagnostic for UNPACK/missing strictness

GHC ghc-devs at haskell.org
Mon Feb 5 14:11:07 UTC 2018


#14761: Incorrect diagnostic for UNPACK/missing strictness
-------------------------------------+-------------------------------------
           Reporter:  dminuoso       |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.2.2
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  Incorrect
  Unknown/Multiple                   |  error/warning at compile-time
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:  #7210
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 {{{#!hs
 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. Verified on nightly-2018-01-29.

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


More information about the ghc-tickets mailing list