Introduce Parameter: Remove parameters which become unused after occurrence replacement
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
// TARGET:
|
||||
class A(val a: Int, s: String) {
|
||||
fun foo() = (<selection>a + 1</selection>) * 2
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val t = A(1, "2").a
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// TARGET:
|
||||
class A(val a: Int, s: String, val i: Int = a + 1) {
|
||||
fun foo() = (i) * 2
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val t = A(1, "2").a
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// TARGET:
|
||||
class A(val a: Int, s: String) {
|
||||
fun foo() = (<selection>a + 1</selection>) * 2
|
||||
}
|
||||
|
||||
fun test() {
|
||||
A(1, "2")
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// TARGET:
|
||||
class A(val a: Int, s: String, val i: Int = a + 1) {
|
||||
fun foo() = (i) * 2
|
||||
}
|
||||
|
||||
fun test() {
|
||||
A(1, "2")
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// TARGET:
|
||||
class A(val a: Int, s: String) {
|
||||
val x = a + 2
|
||||
|
||||
fun foo() = (<selection>a + 1</selection>) * 2
|
||||
}
|
||||
|
||||
fun test() {
|
||||
A(1, "2")
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// TARGET:
|
||||
class A(val a: Int, s: String, val i: Int = a + 1) {
|
||||
val x = a + 2
|
||||
|
||||
fun foo() = (i) * 2
|
||||
}
|
||||
|
||||
fun test() {
|
||||
A(1, "2")
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fun foo(a: Int, s: String, b: Int): Int {
|
||||
return (<selection>a + b</selection>) * 2
|
||||
}
|
||||
|
||||
fun test() {
|
||||
foo(1, "2", 3)
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fun foo(s: String, i: Int = a + b): Int {
|
||||
return (i) * 2
|
||||
}
|
||||
|
||||
fun test() {
|
||||
foo("2")
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fun foo(a: Int, s: String): Int {
|
||||
return (<selection>a + 1</selection>) * 2
|
||||
}
|
||||
|
||||
fun test() {
|
||||
foo(1, "2")
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fun foo(s: String, i: Int = a + 1): Int {
|
||||
return (i) * 2
|
||||
}
|
||||
|
||||
fun test() {
|
||||
foo("2")
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fun foo(a: Int, s: String): Int {
|
||||
return (<selection>a + 1</selection>) * a
|
||||
}
|
||||
|
||||
fun test() {
|
||||
foo(1, "2")
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fun foo(a: Int, s: String, i: Int = a + 1): Int {
|
||||
return (i) * a
|
||||
}
|
||||
|
||||
fun test() {
|
||||
foo(1, "2")
|
||||
}
|
||||
Reference in New Issue
Block a user