Wrong diagnostic when last expression in lambda contains assignment operation
#KT-6769 Fixed
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
fun test(bal: Array<Int>) {
|
||||
var bar = 4
|
||||
|
||||
val a = { bar += 4 }
|
||||
a : () -> Unit
|
||||
|
||||
val b = { bar = 4 }
|
||||
b : () -> Unit
|
||||
|
||||
val c = { bal[2] = 3 }
|
||||
c : () -> Unit
|
||||
|
||||
val d = run { bar += 4 }
|
||||
d : Unit
|
||||
}
|
||||
fun <T> run(f: () -> T): T = f()
|
||||
Reference in New Issue
Block a user