Replace fold/unfold intentions with a set of specialized ones

This commit is contained in:
Alexey Sedunov
2013-04-16 14:33:58 +04:00
parent 9e441b0525
commit 64e578297c
113 changed files with 972 additions and 437 deletions
@@ -0,0 +1,21 @@
fun test(n: Int): String {
var res: String
if (n == 1) {
<caret>res = if (3 > 2) {
println("***")
"one"
} else {
println("***")
"???"
}
} else if (n == 2) {
println("***")
res = "two"
} else {
println("***")
res = "too many"
}
return res
}
@@ -0,0 +1,21 @@
fun test(n: Int): String {
var res: String
if (n == 1) {
<caret>if (3 > 2) {
println("***")
res = "one"
} else {
println("***")
res = "???"
}
} else if (n == 2) {
println("***")
res = "two"
} else {
println("***")
res = "too many"
}
return res
}
@@ -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
}
@@ -0,0 +1,21 @@
fun test(n: Int): String {
var res: String
<caret>if (n == 1) {
res = if (3 > 2) {
println("***")
"one"
} else {
println("***")
"???"
}
} else res = if (n == 2) {
println("***")
"two"
} else {
println("***")
"too many"
}
return res
}
@@ -0,0 +1,7 @@
fun test(n: Int): String {
var res: String
<caret>res = if (n == 1) "one" else "two"
return res
}
@@ -0,0 +1,7 @@
fun test(n: Int): String {
var res: String
<caret>if (n == 1) res = "one" else res = "two"
return res
}
@@ -0,0 +1,7 @@
fun test(n: Int): String {
var res: String = "!"
<caret>res += if (n == 1) "one" else "two"
return res
}
@@ -0,0 +1,7 @@
fun test(n: Int): String {
var res: String = "!"
<caret>if (n == 1) res += "one" else res += "two"
return res
}
@@ -0,0 +1,13 @@
fun test(n: Int): String {
var res: String
<caret>res = if (n == 1) {
println("***")
"one"
} else {
println("***")
"two"
}
return res
}
@@ -0,0 +1,13 @@
fun test(n: Int): String {
var res: String
<caret>if (n == 1) {
println("***")
res = "one"
} else {
println("***")
res = "two"
}
return res
}
@@ -0,0 +1,12 @@
// IS_APPLICABLE: false
fun test(n: Int): String {
var res: String
<caret>if (n == 1) {
"one"
} else {
"two"
}
return res
}