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

GHC ghc-devs at haskell.org
Sun Nov 18 05:31:53 UTC 2018


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

Comment (by -Jie-):

 We ran into the same issue in our project.
 Simplified version:
 {{{
 module Test (test) where

 import Data.Coerce (coerce)

 newtype N = N Int

 data Test = Test N

 test :: Test
 test = Test $ coerce (0 :: Int)
 }}}

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


More information about the ghc-tickets mailing list