[GHC] #16260: Use of plugins causes -XSafe to fail

GHC ghc-devs at haskell.org
Thu Jan 31 20:23:57 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 mpickering):

 I'm sympathetic to this but the fact is a plugin can arbitrarily change
 `TcGblEnv` so the only option is to mark the affected modules as `Unsafe`.

 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'm reluctant to do this though purely to
 satisfy safe haskell checks.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16260#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list