[GHC] #15618: Unused binding warning should not apply to newtype constructors

#15618: Unused binding warning should not apply to newtype constructors -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.6.1-beta1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Incorrect Unknown/Multiple | error/warning at compile-time Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- {{{#!hs module Foo (A, foo) where import Data.Type.Coercion newtype A = A Int foo :: Coercion A Int foo = Coercion }}} produces a warning: {{{ NTCon.hs:4:13: warning: [-Wunused-top-binds] Defined but not used: data constructor ‘A’ | 4 | newtype A = A Int | ^^^^^ }}} This is rather silly! 1. It's ''impossible'' to define a newtype without giving it a data constructor. 2. It's ''possible'' to use a newtype without using its data constructor. Therefore, I believe the only reasonable thing to do is suppress the unused binding warning for newtype data constructors. If the newtype itself isn't used, that will be caught anyway. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15618 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15618: Unused binding warning should not apply to newtype constructors -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.6.1-beta1 Resolution: duplicate | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple error/warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: #10347 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => closed * resolution: => duplicate * related: => #10347 Comment: This is a duplicate of #10347, so I'll close this ticket in favor of that one. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15618#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC