[GHC] #10347: Spurious "unused constructor" warning with Coercible

GHC ghc-devs at haskell.org
Thu Apr 23 14:47:53 UTC 2015


#10347: Spurious "unused constructor" warning with Coercible
-------------------------------------+-------------------------------------
        Reporter:  goldfire          |                   Owner:  goldfire
            Type:  bug               |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  Compiler          |                 Version:  7.11
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  Incorrect         |  Unknown/Multiple
  warning at compile-time            |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by goldfire):

 Good point. Here's a revised test case:

 {{{
 module T10347 (N, mkN) where

 import Data.Coerce

 newtype N a = MkN Int

 mkN :: Int -> N a
 mkN = coerce
 }}}

 Now you ''can'' make an `N a`, but the warning still appears. This is
 actually much simpler than the original test case.

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


More information about the ghc-tickets mailing list