Skip to content

Commit 7b757b0

Browse files
smarterfelixmulder
authored andcommitted
dotty.runtime.LazyVals: Fix for 2.12 shifting semantics
See discussion at https://gitter.im/scala/contributors?at=598b4b3eee5c9a4c5fa61568
1 parent 0c44b9b commit 7b757b0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/src/dotty/runtime/LazyVals.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ object LazyVals {
3434
if (debug)
3535
println(s"CAS($t, $offset, $e, $v, $ord)")
3636
val mask = ~(LAZY_VAL_MASK << ord * BITS_PER_LAZY_VAL)
37-
val n = (e & mask) | (v << (ord * BITS_PER_LAZY_VAL))
37+
val n = (e & mask) | (v.toLong << (ord * BITS_PER_LAZY_VAL))
3838
compareAndSet(t, offset, e, n)
3939
}
4040
@inline def setFlag(t: Object, offset: Long, v: Int, ord: Int) = {

0 commit comments

Comments
 (0)