roamingthings
12/19/2017, 2:21 PMalso()
to swap two values here or if this is bug.
Given the following code:
fun main(args: Array<String>) {
var x0 = 25
var y0 = 26
var x1 = 27
var y1 = 28
x0 = y0.also { y0 = x0 }
x1 = y1.also { y1 = x1 }
println("x0=$x0, y0=$y0, x1=$x1, y1=$y1")
}
Kotlin/JVM will produce the following output (x0 <-> y0 and x1 <-> y1):
x0=26, y0=25, x1=28, y1=27
Whereas Kotlin/Native does the following:
x0=25, y0=25, x1=27, y1=27
Any thoughts?louiscad
12/19/2017, 3:03 PMroamingthings
12/19/2017, 3:08 PMolonho
12/19/2017, 3:58 PMroamingthings
12/19/2017, 4:41 PMolonho
12/19/2017, 5:11 PMroamingthings
12/19/2017, 7:07 PMtfire
12/21/2017, 12:13 AM