[GHC] #10632: ImplicitParams: GHC does not warn about unused implicit parameters

GHC ghc-devs at haskell.org
Sun Jul 12 13:06:59 UTC 2015


#10632: ImplicitParams: GHC does not warn about unused implicit parameters
-------------------------------------+-------------------------------------
              Reporter:  mwnx        |             Owner:
                  Type:  bug         |            Status:  new
              Priority:  lowest      |         Milestone:
             Component:  Compiler    |           Version:  7.10.1
              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:              |
-------------------------------------+-------------------------------------
 When using -XImplicitParams, and an implicit parameter is not used within
 a function which accepts said parameter, no warning is issued (with -Wall
 turned on).

 Example:
 {{{#!hs
 {-# LANGUAGE ImplicitParams #-}

 f :: (?file1 :: String) => IO ()
 f = putStrLn $ "f2: "

 main :: IO ()
 main = let ?file1 = "A" in f
 }}}

 Here, I would expect a warning about ?file1 being unused in f.

 As far as I can tell (but I'm quite the layman in these matters), issuing
 a warning here would be desirable, possible, and quite easy. Sorry for the
 bug report if there's a reason for the status quo.

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


More information about the ghc-tickets mailing list