"Replace 'invoke' with direct call" intention: do not add unnecessary parenthesis
#KT-37967 Fixed
This commit is contained in:
committed by
Vladimir Dolzhenko
parent
2f29b38b19
commit
9b3c3ae4ba
+11
@@ -0,0 +1,11 @@
|
||||
class A {
|
||||
val b = B()
|
||||
}
|
||||
|
||||
class B {
|
||||
operator fun invoke() {}
|
||||
}
|
||||
|
||||
fun test(a: A) {
|
||||
a.b.<caret>invoke()
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
class A {
|
||||
val b = B()
|
||||
}
|
||||
|
||||
class B {
|
||||
operator fun invoke() {}
|
||||
}
|
||||
|
||||
fun test(a: A) {
|
||||
a.b()
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
class A {
|
||||
fun b() = B()
|
||||
}
|
||||
|
||||
class B {
|
||||
operator fun invoke() {}
|
||||
}
|
||||
|
||||
fun test(a: A) {
|
||||
a.b().<caret>invoke()
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
class A {
|
||||
fun b() = B()
|
||||
}
|
||||
|
||||
class B {
|
||||
operator fun invoke() {}
|
||||
}
|
||||
|
||||
fun test(a: A) {
|
||||
a.b()()
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
class A {
|
||||
fun b() = B()
|
||||
}
|
||||
|
||||
class B {
|
||||
operator fun invoke(f: () -> Unit) {}
|
||||
}
|
||||
|
||||
fun test(a: A) {
|
||||
a.b().<caret>invoke {
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
class A {
|
||||
fun b() = B()
|
||||
}
|
||||
|
||||
class B {
|
||||
operator fun invoke(f: () -> Unit) {}
|
||||
}
|
||||
|
||||
fun test(a: A) {
|
||||
(a.b()) {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user