Tests for code transformation: if statement with assignments <-> assignment with if expression
This commit is contained in:
+21
@@ -0,0 +1,21 @@
|
||||
fun test(n: Int): String {
|
||||
var res: String
|
||||
|
||||
<caret>res = if (n == 1) {
|
||||
if (3 > 2) {
|
||||
println("***")
|
||||
"one"
|
||||
} else {
|
||||
println("***")
|
||||
"???"
|
||||
}
|
||||
} else if (n == 2) {
|
||||
println("***")
|
||||
"two"
|
||||
} else {
|
||||
println("***")
|
||||
"too many"
|
||||
}
|
||||
|
||||
return res
|
||||
}
|
||||
Reference in New Issue
Block a user