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

Error on exit/quit #124

Open
LoadingBG opened this issue Nov 13, 2020 · 3 comments
Open

Error on exit/quit #124

LoadingBG opened this issue Nov 13, 2020 · 3 comments

Comments

@LoadingBG
Copy link

When leaving the REPL using exit, I get an error:

Unhandled exception: Index out of bounds (IndexError)
  from ../../snap/crystal/397/share/crystal/src/indexable.cr:589:8 in '[]'
  from icr/src/icr/executer.cr:29:25 in 'execute'
  from icr/src/icr/console.cr:162:7 in 'execute'
  from icr/src/icr/console.cr:130:9 in 'process_result'
  from icr/src/icr/console.cr:122:7 in 'process_command'
  from icr/src/icr/console.cr:88:9 in 'process_input'
  from icr/src/icr/console.cr:66:12 in 'start'
  from icr/src/icr/cli.cr:126:1 in '__crystal_main'
  from ../../snap/crystal/397/share/crystal/src/crystal/main.cr:105:5 in 'main_user_code'
  from ../../snap/crystal/397/share/crystal/src/crystal/main.cr:91:7 in 'main'
  from ../../snap/crystal/397/share/crystal/src/crystal/main.cr:114:3 in 'main'
  from __libc_start_main
  from _start
  from ???

and with quit:

Showing last frame. Use --error-trace for full trace.

In .icr_UwArnFrEUpNPonR2lwJ0uQ.cr:2:3

 2 | quit
     ^---
icr(0.35.1) > ed local variable or method 'quit' for top-level
@jwoertink
Copy link
Collaborator

If you're building against master, we've renamed that command to #quit https://github.com/crystal-community/icr/pull/119/files Though it's not standard with most REPLs, the idea being that with how ICR works, "magic commands" would conflict with variables or methods being defined. We also have a PR to add in #help. I guess the README needs some updating 😅

@LoadingBG
Copy link
Author

LoadingBG commented Nov 14, 2020

I read what was in the README.md file. Using # before the keyword seems to work. Maybe update the README.md then?

@Fryguy
Copy link

Fryguy commented Jan 7, 2022

This seems to be still happening since at least crystal 1.2.1. I'm not using master; I'm using the distribution from homebrew, which is 0.9.0.

Coming from Ruby, exit is the expected command, so IMO, that one should at least not blow up.

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

3 participants