You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scala code runner version 3.1.1-RC1-bin-SNAPSHOT-git-bf753c7 -- Copyright 2002-2021, LAMP/EPFL
Minimized code
#!/usr/bin/env scala3
println("hello, world")
Output
Welcome to Scala3.1.1-RC1-bin-SNAPSHOT-git-bf753c7 (16.0.2, JavaJavaHotSpot(TM) 64-BitServerVM).
Type in expressions for evaluation. Ortry:help.
scala>
Expectation
Assuming scala3 script in PATH redirects to dist\bin\scala, it should run the script and print "hello, world".
Instead it enters the REPL.
The problem occurs whenever a script hashbang line ends with anything other than exactly "scala".
In the example script above, a wrapper script called scala3 would redirect correctly, but is not recognized as a scala hashbang.
In MainGenericRunner line 149, the test for whether a command line argument is a scala script is needlessly restrictive:
if arg.endsWith(".scala") || arg.endsWith(".sc") || (line.nonEmpty &&raw"#!.*scala".r.matches(line.get)) then
The regex doesn't permit any characters following "scala".
This is a regression that affects release candidates later than scala3-3.0.2, such as scala3-3.1.0-RC2.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Compiler version
Scala code runner version 3.1.1-RC1-bin-SNAPSHOT-git-bf753c7 -- Copyright 2002-2021, LAMP/EPFL
Minimized code
Output
Expectation
Assuming
scala3
script in PATH redirects todist\bin\scala
, it should run the script and print "hello, world".Instead it enters the REPL.
The problem occurs whenever a script hashbang line ends with anything other than exactly "scala".
In the example script above, a wrapper script called
scala3
would redirect correctly, but is not recognized as a scala hashbang.In MainGenericRunner line 149, the test for whether a command line argument is a scala script is needlessly restrictive:
The regex doesn't permit any characters following "scala".
This is a regression that affects release candidates later than
scala3-3.0.2
, such asscala3-3.1.0-RC2
.The text was updated successfully, but these errors were encountered: