#2982: GHCi crashes if a :def command gets a pattern-match error
-------------------------------+--------------------------------------------
  Reporter:  simonpj           |          Owner:                  
      Type:  bug               |         Status:  new             
  Priority:  normal            |      Milestone:                  
 Component:  Compiler          |        Version:  6.10.1          
  Severity:  normal            |       Keywords:                  
Difficulty:  Unknown           |       Testcase:                  
        Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
-------------------------------+--------------------------------------------
 Peter Hercek reports
 {{{
 % ghci
 GHCi, version 6.10.1: http://www.haskell.org/ghc/  :? for help
 Loading package ghc-prim ... linking ... done.
 Loading package integer ... linking ... done.
 Loading package base ... linking ... done.
 Prelude> :def err (\_->return $ concat $ replicate (read "\"1\"") "a")
 Prelude> :err
 ghc: panic! (the 'impossible' happened)
    (GHC version 6.10.1 for i386-unknown-linux):
         Prelude.read: no parse

 Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
 }}}
 The "no parse" is quite correct: `(read "\"1\"") :: Int` should fail to
 parse.  But it's wrong that a crashing `:def` should crash out of GHCi.
 Rather it should just return to the prompt, preferably with a failure
 message saying that running a `:def` failed.

 Simon

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2982>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to