Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad import declarations cause kernel to die #31

Closed
edechter opened this issue Nov 2, 2013 · 2 comments
Closed

Bad import declarations cause kernel to die #31

edechter opened this issue Nov 2, 2013 · 2 comments

Comments

@edechter
Copy link
Contributor

edechter commented Nov 2, 2013

IHaskell console does not recover from bad import declarations. For example:

edechter@helmholtz IHaskell (completions) $ IHaskell console
Python 2.7.2 (default, Oct 11 2012, 20:14:37)
Type "copyright", "credits" or "license" for more information.

IPython 1.1.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

IPython profile: haskell

In [1]: import
["import"]
Import: import
IHaskell: parse error (possibly incorrect indentation or mismatched brackets)


kernel died, restart ([y]/n)?

In [1]: import Data.Lizt
["import Data.Lizt"]
Import: import Data.Lizt
IHaskell: Failed to load interface for `Data.Lizt'
Perhaps you meant
  Data.List (from base)
  Data.DList (from dlist-0.5)
  Data.List (needs flag -package haskell2010-1.1.1.0)
Use -v to see a list of the files searched for.

kernel died, restart ([y]/n)?
edechter pushed a commit to edechter/IHaskell that referenced this issue Nov 2, 2013
@edechter
Copy link
Contributor Author

edechter commented Nov 2, 2013

Now the kernel doesn't die and we get an error message instead.

edechter@helmholtz IHaskell (issue31) $ IHaskell console
Python 2.7.2 (default, Oct 11 2012, 20:14:37)
Type "copyright", "credits" or "license" for more information.

IPython 1.1.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

IPython profile: haskell

In [1]: import
["import"]
Import: import
BreakImp: parse error (possibly incorrect indentation or mismatched brackets)

from import declaration:
import

In [2]: import Data.Lizt
["import Data.Lizt"]
Import: import Data.Lizt
BreakImp: Failed to load interface for `Data.Lizt'
Perhaps you meant
  Data.List (from base)
  Data.DList (from dlist-0.5)
  Data.List (needs flag -package haskell2010-1.1.1.0)
Use -v to see a list of the files searched for.

from import declaration:
import Data.Lizt

@gibiansky
Copy link
Member

This is fixed in the commit 9516c70

Also, statements are now evaluated in order, and execution is stopped after the first error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants