-
Notifications
You must be signed in to change notification settings - Fork 143
Scala-cli tries to read classfiles from the current directory when not asked for it #1686
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
Comments
@prolativ Thanks for reporting, I'm not convinced this is a problem on the
|
As a workaround, in |
I hope you didn't mean |
And IMO it is an issue with scala-cli (and with coursier as well if you say so). If I run mkdir xyz
cd xyz
echo '@main def run() = println("Hello!")' > Hello.scala
scala-cli compile -d out -S 3.2.1 Hello.scala
cp out/* . and then start the REPL for scala 3.1.3 using sdkman sdk use scala 3.1.3
scala and then I run scala> println() then I don't get the error |
@prolativ Thanks for response, I investigated this in more detail. After checking the help documentation for the
and then I tried using the
Then, I got the same error. In this case, I used the It appears that the It seems that this isn't a bug. The |
At this point I'm not sure myself what behaviour we should expect then. It seems that |
It looks like there is a bug in the |
It looks like this behaviour started in scala 3.1.0 but it seems to be unintentional. Before that (including scala 2) |
I have new observation that explains the difference between the
so classes from the current directory were added here - So now let's check the classpath for
the same as before, The classpath contains the same classes but they are compiled with different versions of Scala, therefore the second command works for you, because |
@julienrf I think that this issue is interest from the SIP perspective. I tried to shortly explain the problem. In
so I could be surprised for some users, as it was described in the issue. Additionally, it appears that the scala runner has a regression in options
@julienrf what is your opinion on |
I don’t think |
It appears, that only few people rely on @julienrf, would you be able to report this bug to the compiler team and ask them for change the behavior of the |
Done in scala/scala3#16715 |
Version(s)
0.1.18
Describe the bug
Scala-cli tries to read classfiles from the current directory when not asked for it
To Reproduce
scala> println()
Output:
Expected behaviour
Scala-cli should ignore classfiles in the current directory unless they are explicitly added to the classpath.
scala
command itself doesn't have this problem.The text was updated successfully, but these errors were encountered: