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

Where's my side order of effect #10209

Closed
scabug opened this issue Feb 26, 2017 · 3 comments
Closed

Where's my side order of effect #10209

scabug opened this issue Feb 26, 2017 · 3 comments
Labels

Comments

@scabug
Copy link

scabug commented Feb 26, 2017

Seems to lose a side effect.

$ scala
Welcome to Scala 2.12.1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_111).
Type in expressions for evaluation. Or try :help.

scala>  object A { val u: Unit = { println("ok"); () } }
defined object A

scala> A.u

scala> A
ok
res1: A.type = A$@5b35c7d
@scabug
Copy link
Author

scabug commented Feb 26, 2017

Imported From: https://issues.scala-lang.org/browse/SI-10209?orig=1
Reporter: @som-snytt
Affected Versions: 2.12.1

@scabug
Copy link
Author

scabug commented Mar 1, 2017

@lrytz said (edited on Mar 1, 2017 11:05:44 AM UTC):
The getter call is replaced by BoxedUnit.UNIT because isExprSafeToInline. I'm not sure if that's intentional, the doc comment says

"References to modules [] are side-effecting [] but they are safe to inline because the expression result from evaluating them is always the same"

Related to scala/scala-dev#112

@scabug scabug added the quickfix label Apr 7, 2017
@scabug scabug added this to the Backlog milestone Apr 7, 2017
@som-snytt
Copy link

Duplicates #8666 which was closed in favor of umbrella ticket #5304

By "umbrella ticket" is meant "mass grave for tickets." Or is it more like how a squirrel tries to remember where the nuts are buried? Years later, it results in many more oak trees, where by "more oak trees" is meant "more tickets."

@som-snytt som-snytt closed this as not planned Won't fix, can't repro, duplicate, stale Jan 2, 2024
@SethTisue SethTisue removed this from the Backlog milestone Jan 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants