Skip to content

GHCi ignores cmd line flags XMonomorphismRestr.. XNoExtendedDef..#10857

Roland Senn requested to merge RolandSenn/ghc:T10857_2 into master

GHCi maintains two sets of options:

  • The loading options apply when loading modules
  • The interactive options apply when evaluating expressions and commands typed at the GHCi prompt.

The loading options are mostly created in ghc/Main.hs:main' from the command line flags and from config files. In the function ghc/GHCi/UI.hs:interactiveUI the loading options are copied to the interactive options.

These interactive options (but not the loading options!) are supplemented unconditionally by setting ExtendedDefaultRules ON and MonomorphismRestriction OFF. The unconditional setting of these options eventually overwrite settings already specified at the command line.

Therefore instead of unconditionally setting ExtendedDefaultRules and MonomorphismRestriction for the interactive options, we first check, whether they were not already set before.

Note this is a copy of Phab:D5554.

Edited by Roland Senn

Merge request reports