Skip to content

Correct warning for deprecated and unrecognised flags

Fixes #19616 (closed).

This MR fully implements the original commit that @rae authored (which unfortunately got lost as I had to split part of it inside wip/adinapoli-suppress-warning-design-a and the rest in this MR, but if he cares about authoring I can revive it :) ).

I think this does what we want: I have removed the extra filtering and should_print_warning function from GHC.Driver.Errors.handleFlagWarnings and this in turn correctly pretty-prints the flag(s) that triggered the warnings, as the tests shows.

I have to say it's pretty satisfying to see also that tests of the form:

Foo.hs:
  Warning: blah

Now they all abide to the standard formatting 😉

Ps. Considering I have a bit of approved-MR backlog to go through, we could just as well merge this MR into wip/adinapoli-suppress-warning-design-a, to expedite the Marge process. No strong opinions here!

Merge request reports