Convert to scope function: enable on single function call
#KT-29099 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
e1fdf0aa43
commit
5f7dee4194
@@ -1,5 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
// IS_APPLICABLE: false
|
||||
|
||||
class Foo {
|
||||
fun foo(i: Int) {}
|
||||
@@ -7,6 +6,7 @@ class Foo {
|
||||
fun test(f: Foo) {
|
||||
val f = Foo()<caret>
|
||||
f.foo(1)
|
||||
f.foo(2)
|
||||
bar(2, this)
|
||||
}
|
||||
}
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
class Foo {
|
||||
fun foo(i: Int) {}
|
||||
|
||||
fun test(f: Foo) {
|
||||
val f = Foo().apply {
|
||||
foo(1)
|
||||
foo(2)
|
||||
}
|
||||
bar(2, this)
|
||||
}
|
||||
}
|
||||
|
||||
fun bar(i: Int, f: Foo) {}
|
||||
@@ -0,0 +1,10 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
class C {
|
||||
fun foo() {}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val c = C()
|
||||
c.foo()<caret>
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
class C {
|
||||
fun foo() {}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val c = C().apply {
|
||||
foo()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user