"Replace 'invoke' with direct call" intention: do not add unnecessary parenthesis

#KT-37967 Fixed
This commit is contained in:
Toshiaki Kameyama
2020-04-03 11:33:53 +09:00
committed by Vladimir Dolzhenko
parent 2f29b38b19
commit 9b3c3ae4ba
8 changed files with 97 additions and 8 deletions
@@ -0,0 +1,11 @@
class A {
val b = B()
}
class B {
operator fun invoke() {}
}
fun test(a: A) {
a.b.<caret>invoke()
}
@@ -0,0 +1,11 @@
class A {
val b = B()
}
class B {
operator fun invoke() {}
}
fun test(a: A) {
a.b()
}
@@ -0,0 +1,11 @@
class A {
fun b() = B()
}
class B {
operator fun invoke() {}
}
fun test(a: A) {
a.b().<caret>invoke()
}
@@ -0,0 +1,11 @@
class A {
fun b() = B()
}
class B {
operator fun invoke() {}
}
fun test(a: A) {
a.b()()
}
@@ -0,0 +1,12 @@
class A {
fun b() = B()
}
class B {
operator fun invoke(f: () -> Unit) {}
}
fun test(a: A) {
a.b().<caret>invoke {
}
}
@@ -0,0 +1,12 @@
class A {
fun b() = B()
}
class B {
operator fun invoke(f: () -> Unit) {}
}
fun test(a: A) {
(a.b()) {
}
}