[GHC] #12509: ghci -XSafe fails in an inscrutable way

GHC ghc-devs at haskell.org
Sun Aug 21 19:59:16 UTC 2016


#12509: ghci -XSafe  fails in an inscrutable way
-------------------------------------+-------------------------------------
           Reporter:  int-e          |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.1
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 Trying to run `ghci -XSafe` produces the following output:

 {{{
 GHCi, version 8.0.1: http://www.haskell.org/ghc/  :? for help

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

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

 <interactive>:1:46: error:
     Not in scope: data constructor ‘System.IO.NoBuffering’
     No module named ‘System.IO’ is imported.

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

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

 <interactive>:1:111: error:
     Not in scope: data constructor ‘System.IO.NoBuffering’
     No module named ‘System.IO’ is imported.

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

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

 <interactive>:1:176: error:
     Not in scope: data constructor ‘System.IO.NoBuffering’
     No module named ‘System.IO’ is imported.
 }}}

 I'm not sure whether this should work, but in any case the error message
 is horrible. I tried adding `-trust base` to no avail.

 For comparison, ghc-7.10.3 starts with no trouble:

 {{{
 > ghci -XSafe
 GHCi, version 7.10.2: http://www.haskell.org/ghc/  :? for help
 Prelude>
 }}}

 (Motivation: I'm using ghci in Safe mode to track down import problems
 with SafeHaskell. As a workaround, I can use `:set -XSafe` after ghci's
 startup is done.)

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


More information about the ghc-tickets mailing list