[GHC] #10625: Spurious unused quantified type variable warning with ExistentialQuantification

#10625: Spurious unused quantified type variable warning with ExistentialQuantification -------------------------------------+------------------------------------- Reporter: | Owner: RyanGlScott | Status: new Type: bug | Milestone: Priority: normal | Version: 7.10.1 Component: Compiler | Operating System: Unknown/Multiple Keywords: | Type of failure: Incorrect Architecture: | warning at compile-time Unknown/Multiple | Blocked By: Test Case: | Related Tickets: #5331 Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- When using an existentially quantified type variable that shadows another variable in a data declaration, {{{-Wall}}} produces more warnings than necessary: {{{ $ ghci -XExistentialQuantification -Wall GHCi, version 7.10.1: http://www.haskell.org/ghc/ :? for help λ> data Ex a = forall a. Ex a <interactive>:2:20: Warning: Unused quantified type variable ‘a’ In the definition of data constructor ‘Ex’ <interactive>:2:20: Warning: This binding for ‘a’ shadows the existing binding bound at <interactive>:2:9 }}} The unused quantified type variable warning seems wrong, since it ''is'' being used (as the shadowing warning indicates). Curiously, this warning doesn't seem to appear when doing something similar with {{{RankNTypes}}}: {{{ $ ghci -XRankNTypes -Wall GHCi, version 7.10.1: http://www.haskell.org/ghc/ :? for help λ> data Ex a = Ex (forall a. a) <interactive>:2:24: Warning: This binding for ‘a’ shadows the existing binding bound at <interactive>:2:9 }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10625 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10625: Spurious unused quantified type variable warning with ExistentialQuantification -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 7.10.1 checker) | Keywords: Resolution: | ExistentialQuantification Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: #5331 | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thomie): * keywords: => ExistentialQuantification * component: Compiler => Compiler (Type checker) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10625#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10625: Spurious unused quantified type variable warning with ExistentialQuantification -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler (Type | Version: 7.10.1 checker) | Keywords: Resolution: fixed | ExistentialQuantification Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: #5331 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => closed * resolution: => fixed Comment: I can't reproduce this anymore on GHC 8.1. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10625#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10625: Spurious unused quantified type variable warning with
ExistentialQuantification
-------------------------------------+-------------------------------------
Reporter: RyanGlScott | Owner:
Type: bug | Status: closed
Priority: normal | Milestone:
Component: Compiler (Type | Version: 7.10.1
checker) | Keywords:
Resolution: fixed | ExistentialQuantification
Operating System: Unknown/Multiple | Architecture:
Type of failure: Incorrect | Unknown/Multiple
warning at compile-time | Test Case:
Blocked By: | Blocking:
Related Tickets: #5331 | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Simon Peyton Jones

#10625: Spurious unused quantified type variable warning with ExistentialQuantification -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler (Type | Version: 7.10.1 checker) | Keywords: Resolution: fixed | ExistentialQuantification Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Incorrect | Test Case: warning at compile-time | rename/should_compile/T10625 Blocked By: | Blocking: Related Tickets: #5331 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * testcase: => rename/should_compile/T10625 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10625#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC