[GHC] #16260: Use of plugins causes -XSafe to fail
GHC
ghc-devs at haskell.org
Thu Jan 31 20:42:15 UTC 2019
#16260: Use of plugins causes -XSafe to fail
-------------------------------------+-------------------------------------
Reporter: watashi | Owner: watashi
Type: bug | Status: closed
Priority: normal | Milestone:
Component: Compiler | Version: 8.7
Resolution: fixed | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: GHC rejects | Unknown/Multiple
valid program | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by watashi):
> Perhaps a better solution is to make all the fields which can modify the
AST return Maybe so that if any modifications take place then the module
is marked Unsafe. Plugins can return Nothing if they want to purely
inspect information.
I thought about this as well. But `keepRenamedSource` is a useful
couterexample that modifies the return value but doesn't affect the final
output.
I am not familiar with all the use cases of source plugins. Assuming we
push the responsibility the plugin authors, how bad will it be if they
forget calling `recordUnsafeInfer` when they should? Is this worse than
`-fno-safe-haskell`?
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16260#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list