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

#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

#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 Resolution: | 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: -------------------------------------+------------------------------------- Comment (by simonpj): I think it works fine in HEAD. Can others verify? {{{ T10632.hs:5:6: warning: Redundant constraint: ?file1::String In the type signature for: f :: (?file1::String) => IO () }}} If so, can someone add this as a regression test? I don't think it's worth messing with 7.10. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10632#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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
Resolution: | 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:
-------------------------------------+-------------------------------------
Comment (by Reid Barton

#10632: ImplicitParams: GHC does not warn about unused implicit parameters -------------------------------------+------------------------------------- Reporter: mwnx | Owner: Type: bug | Status: closed Priority: lowest | Milestone: Component: Compiler | Version: 7.10.1 Resolution: fixed | 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: -------------------------------------+------------------------------------- Changes (by rwbarton): * status: new => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10632#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10632: ImplicitParams: GHC does not warn about unused implicit parameters -------------------------------------+------------------------------------- Reporter: mwnx | Owner: Type: bug | Status: closed Priority: lowest | Milestone: 8.0.1 Component: Compiler | Version: 7.10.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): We may need to disable these warnings by default (including with `-Wall`). See #11370 for details. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10632#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC