Always set `safeInferred`, not only when it turns `False`
previously, `safeFlagCheck` would be happy to switch the `safeFlag` to `False`, but not the other way around. This meant that after :set -XGeneralizedNewtypeDeriving :set -XNoGeneralizedNewtypeDeriving in GHCi all loaded files would be still be infered as unsafe. This fixes #19243. This is a corner case, but somewhat relevant once ghci by default starts with `GeneralizedNewtypeDeriving` on (due to GHC2021).
Showing
- compiler/GHC/Driver/Session.hs 3 additions, 4 deletionscompiler/GHC/Driver/Session.hs
- testsuite/tests/safeHaskell/ghci/T19243.hs 4 additions, 0 deletionstestsuite/tests/safeHaskell/ghci/T19243.hs
- testsuite/tests/safeHaskell/ghci/T19243.script 5 additions, 0 deletionstestsuite/tests/safeHaskell/ghci/T19243.script
- testsuite/tests/safeHaskell/ghci/T19243.stdout 4 additions, 0 deletionstestsuite/tests/safeHaskell/ghci/T19243.stdout
- testsuite/tests/safeHaskell/ghci/all.T 1 addition, 0 deletionstestsuite/tests/safeHaskell/ghci/all.T
Loading
Please register or sign in to comment