[GHC] #12574: Consistent use of sigs vs signatures in warnings

#12574: Consistent use of sigs vs signatures in warnings -------------------------------------+------------------------------------- Reporter: crockeea | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: 11583 Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- If I have a polymorphic local binding without a type signature, `-Weverything` complains: {{{ warning: [-Wmissing-local-sigs] Polymorphic local binding with no type signature: ... }}} However, when I add `-Wno-missing-local-sigs`, I immediately get a deprecation warning ` -Wno-missing-local-sigs is deprecated: it is replaced by -Wmissing- local-signatures` First, the warning with `-Weveryting` should use the non-depricated `signatures` version. Second, the deprecation warning should probably respect my use of `no`: `-Wno-missing-local-sigs` is replaced by `-Wno- missing-local-signatures`, not `-Wmissing-local-signatures`. Obviously, check for similar cases with the other "sigs" options mentioned in #11583. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12574 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12574: Consistent use of sigs vs signatures in warnings -------------------------------------+------------------------------------- Reporter: crockeea | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.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: #11583, #10752 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by crockeea): * failure: None/Unknown => Incorrect warning at compile-time * related: 11583 => #11583, #10752 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12574#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12574: Consistent use of sigs vs signatures in warnings -------------------------------------+------------------------------------- Reporter: crockeea | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: #11583, #10752 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by mpickering): * keywords: => newcomer -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12574#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12574: Consistent use of sigs vs signatures in warnings -------------------------------------+------------------------------------- Reporter: crockeea | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: #11583, #10752 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by martinceresa): Hi! I've found the error. It seems that when looking for warning messages in DynFlags.hs/wWarningFlagsDeps for 'Opt_WarnMissingLocalSignatures' it finds first the depecrated version message. Swapping those two lines, getting something like this: {{{#!hs wWarningFlagsDeps :: [(Deprecation, FlagSpec WarningFlag)] ..... flagSpec "missing-local-signatures" Opt_WarnMissingLocalSignatures, depFlagSpec "missing-local-sigs" Opt_WarnMissingLocalSignatures "it is replaced by -Wmissing-local-signatures", ..... }}} solves this problem, but it is not the best solution. It is clear that there is an implicit order when looking for warning massages, and we need to check that function to see why it selects just the first it finds. I am new to GHC development so I am still fighting with the code, and it may be worth open a new ticket to modify such function, and solve possibly any other 'bad warning massage'. Cheers. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12574#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12574: Consistent use of sigs vs signatures in warnings -------------------------------------+------------------------------------- Reporter: crockeea | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: #11583, #10752 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by mpickering): The function which uses this ordering is `flagSpecOf`. An acceptable solution would be to sort `wWarningFlagsDeps` there so that non deprecated flags are preferred to the deprecated versions. Fixing the second problem looks more tricky, we can talk about it more once you've sorted out the first problem. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12574#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12574: Consistent use of sigs vs signatures in warnings -------------------------------------+------------------------------------- Reporter: crockeea | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: #11583, #10752 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by martinceresa): The second problem it is more tricky because the warning message for the deprecated flags is give to the 'EwM monad' with (correct me if I am wrong) the 'deprecate' function. So we need to delay this action until we know if we are in a "-Wno" situation,. We can add a new String argument to the wWarningFlagsDeps, and something like this: {{{#!hs wWarningFlagsDeps :: String -> [(Deprecation, FlagSpec WarningFlag)] ... depFlagSpec "missing-local-sigs" Opt_WarnMissingLocalSignatures "it is replaced by " ++ s ++ "missing-local-signatures" }}} And of course all the modifications implied. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12574#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12574: Consistent use of sigs vs signatures in warnings
-------------------------------------+-------------------------------------
Reporter: crockeea | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.0.1
Resolution: | Keywords: newcomer
Operating System: Unknown/Multiple | Architecture:
Type of failure: Incorrect | Unknown/Multiple
warning at compile-time | Test Case:
Blocked By: | Blocking:
Related Tickets: #11583, #10752 | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Matthew Pickering

#12574: Consistent use of sigs vs signatures in warnings -------------------------------------+------------------------------------- Reporter: crockeea | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: #11583, #10752 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => closed * resolution: => fixed * milestone: => 8.2.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12574#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC