#3085: warn about language extensions that are not used
---------------------------------------------+------------------------------
Reporter: PVerswyvelen | Owner:
Type: feature request | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 6.10.1
Severity: normal | Resolution:
Keywords: warnings extensions language | Difficulty: Unknown
Testcase: | Os: Unknown/Multiple
Architecture: Unknown/Multiple |
---------------------------------------------+------------------------------
Changes (by guest):
* cc: [email protected] (added)
Comment:
Replying to [comment:9 simonmar]:
> In contrast, the "try removing the extension and see if it still works"
method is foolproof and doesn't require any changes to the compiler.
Someone could implement that using the GHC API...
I'm not so sure that it's foolproof. For example Template-Haskell can
change the meaning of programs
{{{
foo = bar $(baz) -- ($) or TH?
}}}
but they still may compile; and there are probably more subtle extensions
with meaning-changes.
Perhaps you can avoid that issue by comparing the output to make sure it's
exactly the same. But I've heard that GHC is not designed to be
deterministic (that it sometimes produces different ABIs from the same
source-code and options), so I guess that wouldn't even work.
However we know, as a conservative estimate, that if an extension flag is
not even consulted, then the extension must not have been used; so GHC
could warn sometimes. (Although the merits of having an "unreliable"
warning like this may be in question.)
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3085#comment:11>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs