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

"scala -i" hangs, cannot preload file before starting the REPL #4945

Closed
scabug opened this issue Aug 26, 2011 · 7 comments
Closed

"scala -i" hangs, cannot preload file before starting the REPL #4945

scabug opened this issue Aug 26, 2011 · 7 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Aug 26, 2011

In Scala 2.9.1.RC4, the "-i 'file'" command line argument (which is supposed to preload a file before starting the REPL) does not work. For example, consider a file "preload.scala" containing just 'println("Hello world.")'. Scala 2.9.1.RC4 says "Loading preload.scala..." and never yields the prompt. It hangs indefinitely. Conversely, the "-i" command line arguments works as expected in Scala 2.9.0.1, yielding the prompt after printing "Hello world."

@scabug
Copy link
Author

scabug commented Aug 26, 2011

Imported From: https://issues.scala-lang.org/browse/SI-4945?orig=1
Reporter: David B. Dahl (dahl)
Affected Versions: 2.9.1

@scabug
Copy link
Author

scabug commented Aug 27, 2011

@paulp said:
That's unfortunate. As a workaround, supply command line option -Yrepl-sync.

@scabug
Copy link
Author

scabug commented Oct 7, 2011

Hendy Irawan (ceefour) said:
Thanks Paul ! Workaround works!

Still happens on 2.9.1

@scabug
Copy link
Author

scabug commented Mar 9, 2012

@paulp said:
This seems to have acquired even more breakage.

scala3 -Yrepl-sync -i bip.scala 
Loading bip.scala...
bad option: '-i:bip.scala'

@scabug
Copy link
Author

scabug commented Aug 7, 2012

@adriaanm said:
scala/scala#1070

@scabug
Copy link
Author

scabug commented Aug 7, 2012

Hendy Irawan (ceefour) said:
Thank you !! :)

@scabug
Copy link
Author

scabug commented Mar 20, 2013

Ryan Hendrickson (ryan.hendrickson_bwater) said (edited on Mar 20, 2013 5:45:42 PM UTC):
I'm still seeing the hang on 2.10.0, unless I supply -Yrepl-sync.

Although hold up, I'm running the REPL by calling ILoop directly, not by running the scala shell script, and I see that your fix for this involves just adding that option in MainGenericRunner, which I bypass. Sorry about that; I guess this is just one of the sharp corners when playing with internal APIs.

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

No branches or pull requests

2 participants