[GHC] #13512: GHC incorrectly warns that a variable used in a type application is unused

GHC ghc-devs at haskell.org
Thu Aug 3 21:46:35 UTC 2017


#13512: GHC incorrectly warns that a variable used in a type application is unused
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  8.0.1
  checker)                           |             Keywords:
      Resolution:                    |  TypeApplications, newcomer
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:                    |
-------------------------------------+-------------------------------------

Comment (by RyanGlScott):

 Similarly, using a scoped type variable in a type annotation doesn't count
 as a use:

 {{{#!hs
 {-# LANGUAGE GADTs #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 {-# LANGUAGE TypeApplications #-}
 {-# LANGUAGE TypeInType #-}

 {-# OPTIONS_GHC -Wunused-foralls #-}
 module Bug where

 import Data.Proxy

 proxy :: forall k (a :: k). Proxy a
 proxy = Proxy

 data SomeProxy where
   SomeProxy :: forall k (a :: k). Proxy a -> SomeProxy

 someProxy :: forall k (a :: k). SomeProxy
 someProxy = SomeProxy (proxy :: Proxy a)
 }}}

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


More information about the ghc-tickets mailing list