Extraction Engine: Generate function/property accessor with expression body (whenever applicable)
#KT-6405 Fixed
This commit is contained in:
+1
-3
@@ -8,6 +8,4 @@ fun foo(a: Int): Int {
|
||||
return if (b(a, b)) 1 else if (a - b < 0) 2 else b
|
||||
}
|
||||
|
||||
private fun b(a: Int, b: Int): Boolean {
|
||||
return a + b > 0
|
||||
}
|
||||
private fun b(a: Int, b: Int) = a + b > 0
|
||||
|
||||
+1
-3
@@ -8,6 +8,4 @@ fun foo(a: Int): Int {
|
||||
return if (a + b > 0) 1 else i(a, b)
|
||||
}
|
||||
|
||||
private fun i(a: Int, b: Int): Int {
|
||||
return if (a - b < 0) 2 else b
|
||||
}
|
||||
private fun i(a: Int, b: Int) = if (a - b < 0) 2 else b
|
||||
|
||||
+1
-3
@@ -4,6 +4,4 @@ fun foo(a: Int): Int {
|
||||
return if (a + b > 0) i() else if (a - b < 0) 2 else b
|
||||
}
|
||||
|
||||
private fun i(): Int {
|
||||
return 1
|
||||
}
|
||||
private fun i() = 1
|
||||
|
||||
+1
-3
@@ -10,6 +10,4 @@ fun foo(a: Int): Int {
|
||||
}
|
||||
}
|
||||
|
||||
private fun i(b: Int): Int {
|
||||
return b
|
||||
}
|
||||
private fun i(b: Int) = b
|
||||
|
||||
+1
-3
@@ -8,6 +8,4 @@ fun foo(a: Int): Int {
|
||||
}
|
||||
}
|
||||
|
||||
private fun i(): Int {
|
||||
return 0
|
||||
}
|
||||
private fun i() = 0
|
||||
|
||||
+1
-3
@@ -12,6 +12,4 @@ fun foo(a: Int): Int {
|
||||
}
|
||||
}
|
||||
|
||||
private fun i(a: Int, b: Int): Int {
|
||||
return a + b
|
||||
}
|
||||
private fun i(a: Int, b: Int) = a + b
|
||||
|
||||
+1
-3
@@ -5,6 +5,4 @@
|
||||
// SIBLING:
|
||||
fun foo(a: Int, b: Int): Int = i(a, b)
|
||||
|
||||
private fun i(a: Int, b: Int): Int {
|
||||
return a + b
|
||||
}
|
||||
private fun i(a: Int, b: Int) = a + b
|
||||
|
||||
+1
-3
@@ -8,6 +8,4 @@ fun foo(a: Int): Int {
|
||||
return i(a, b)
|
||||
}
|
||||
|
||||
private fun i(a: Int, b: Int): Int {
|
||||
return if (a + b > 0) 1 else if (a - b < 0) 2 else b
|
||||
}
|
||||
private fun i(a: Int, b: Int) = if (a + b > 0) 1 else if (a - b < 0) 2 else b
|
||||
+1
-3
@@ -8,6 +8,4 @@ fun foo(a: Int): Int {
|
||||
return i(a, b)
|
||||
}
|
||||
|
||||
private fun i(a: Int, b: Int): Int {
|
||||
return a + b
|
||||
}
|
||||
private fun i(a: Int, b: Int) = a + b
|
||||
+1
-3
@@ -5,6 +5,4 @@ fun foo(t: Array<Int>) {
|
||||
t.check(function())
|
||||
}
|
||||
|
||||
private fun function(): (Int) -> Boolean {
|
||||
return { it + 1 > 1 }
|
||||
}
|
||||
private fun function() = { it + 1 > 1 }
|
||||
+1
-3
@@ -5,6 +5,4 @@ fun foo(t: Array<Int>) {
|
||||
t.check(function())
|
||||
}
|
||||
|
||||
private fun function(): (Int) -> Boolean {
|
||||
return { it + 1 > 1 }
|
||||
}
|
||||
private fun function() = { it + 1 > 1 }
|
||||
+1
-3
@@ -5,6 +5,4 @@ fun foo(t: Array<Int>) {
|
||||
t.check(1, 2, function())
|
||||
}
|
||||
|
||||
private fun function(): (Int) -> Boolean {
|
||||
return { it + 1 > 1 }
|
||||
}
|
||||
private fun function() = { it + 1 > 1 }
|
||||
+1
-3
@@ -5,6 +5,4 @@ fun foo(t: Array<Int>) {
|
||||
t.check(a = 1, b = 2, f = function())
|
||||
}
|
||||
|
||||
private fun function(): (Int) -> Boolean {
|
||||
return { it + 1 > 1 }
|
||||
}
|
||||
private fun function() = { it + 1 > 1 }
|
||||
Reference in New Issue
Block a user