Fix ghci crash when starting with -fno-implicit-import-qualified
authorZejun Wu <watashi@fb.com>
Tue, 18 Dec 2018 04:35:44 +0000 (23:35 -0500)
committerBen Gamari <ben@smart-cactus.org>
Tue, 18 Dec 2018 04:36:53 +0000 (23:36 -0500)
commita0fb20bae31ed7a50d1a6e4e15c42ba25d836bfc
tree8a2bee666e0e2c443afed18808802f1429b833b1
parented69f8bd1fd4b84b62bb4f10eef7f76e537be07b
Fix ghci crash when starting with -fno-implicit-import-qualified

`ghci -fno-implicit-import-qualified` didn't start with error message:

```
GHCi, version 8.6.2: http://www.haskell.org/ghc/  :? for help

<interactive>:1:6: error:
    Not in scope: ‘System.IO.hSetBuffering’
        No module named ‘System.IO’ is imported.

...
```

This change fixes it and update test T2452 to cover this.

Test Plan:
  TEST=T2452 make accept

harbormaster build runs

Reviewers: simonmar, bgamari, RyanGlScott

Reviewed By: simonmar

Subscribers: rwbarton, carter

Differential Revision: https://phabricator.haskell.org/D5452
ghc/GHCi/UI/Monad.hs
testsuite/tests/ghci/scripts/T2452.script
testsuite/tests/ghci/scripts/T2452.stderr
testsuite/tests/ghci/scripts/T2452.stdout [new file with mode: 0644]
testsuite/tests/ghci/scripts/all.T