-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
False positive dead code elimination on pure expressions #17317
Comments
WIP notes:
|
aherlihy
added a commit
to aherlihy/scala3
that referenced
this issue
Feb 2, 2024
aherlihy
added a commit
to aherlihy/scala3
that referenced
this issue
Feb 2, 2024
aherlihy
added a commit
to aherlihy/scala3
that referenced
this issue
Feb 2, 2024
Another minimization (I just needed it to convince myself the problem was indeed the //> using scala "3.2.2"
package objectInit
object Hello:
println("hello world")
object HelloProxy:
val hello = Hello
@main def doesntPrint: Unit =
import HelloProxy.hello
hello
@main def prints: Unit =
HelloProxy.hello Run with: $ scala-cli --server=false -M objectInit.prints objectInit.scala
$ scala-cli --server=false -M objectInit.doesntPrint objectInit.scala |
sjrd
added a commit
that referenced
this issue
Feb 9, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Compiler version
3.3.0-RC3, 3.2.2
Minimized code
Sample 1
Sample 2
Instead of a package object, use a top-level definition.
Output
Expectation
Notes:
main
:Notably the code is just a
return
, as the call is erased from the output.foo.Hello
.The text was updated successfully, but these errors were encountered: