Extract Function: Choose default visibility at analysis phase
This commit is contained in:
+1
-1
@@ -10,7 +10,7 @@ fun foo(a: Int): Int {
|
||||
}
|
||||
}
|
||||
|
||||
fun b(a: Int, b: Int): Boolean {
|
||||
private fun b(a: Int, b: Int): Boolean {
|
||||
if (a > 0) throw Exception("")
|
||||
if (a + b > 0) return true
|
||||
println(a - b)
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ fun foo(a: Int): Int {
|
||||
}
|
||||
}
|
||||
|
||||
fun b(a: Int, b: Int): Boolean {
|
||||
private fun b(a: Int, b: Int): Boolean {
|
||||
if (a > 0) throw Exception("")
|
||||
if (a + b > 0) return true
|
||||
println(a - b)
|
||||
|
||||
+1
-1
@@ -10,6 +10,6 @@ fun foo(a: Int): Int {
|
||||
return t
|
||||
}
|
||||
|
||||
fun i(a: Int, b: Int): Int {
|
||||
private fun i(a: Int, b: Int): Int {
|
||||
return if (a > 0) throw Exception("") else a + b
|
||||
}
|
||||
+1
-1
@@ -9,7 +9,7 @@ fun foo(a: Int) {
|
||||
if (b(a, b)) return
|
||||
}
|
||||
|
||||
fun b(a: Int, b: Int): Boolean {
|
||||
private fun b(a: Int, b: Int): Boolean {
|
||||
if (a > 0) throw Exception("")
|
||||
if (b + a > 0) return true
|
||||
println(a - b)
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ fun foo(a: Int): Int {
|
||||
return b
|
||||
}
|
||||
|
||||
fun i(b: Int): Int {
|
||||
private fun i(b: Int): Int {
|
||||
var b1 = b
|
||||
if (n == 10) throw Exception("")
|
||||
b1++
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ fun foo(a: Int): Int {
|
||||
return i(a, b)
|
||||
}
|
||||
|
||||
fun i(a: Int, b: Int): Int {
|
||||
private fun i(a: Int, b: Int): Int {
|
||||
if (a > 0) throw Exception("") else return a + b
|
||||
return a - b
|
||||
}
|
||||
Reference in New Issue
Block a user