Convert to scope function: refactor
This commit is contained in:
committed by
Mikhail Glukhikh
parent
0501a108c0
commit
f15c8f78fa
@@ -0,0 +1,14 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
class MyClass {
|
||||
fun foo1() = Unit
|
||||
fun foo2() = Unit
|
||||
fun foo3() = Unit
|
||||
|
||||
fun foo4() {
|
||||
<caret>val a = MyClass()
|
||||
a.foo1()
|
||||
a.foo2()
|
||||
a.foo3()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
class MyClass {
|
||||
fun foo1() = Unit
|
||||
fun foo2() = Unit
|
||||
fun foo3() = Unit
|
||||
|
||||
fun foo4() {
|
||||
val a = MyClass().also {
|
||||
it.foo1()
|
||||
it.foo2()
|
||||
it.foo3()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
class MyClass {
|
||||
fun foo1() = Unit
|
||||
fun foo2() = Unit
|
||||
fun foo3() = Unit
|
||||
|
||||
fun foo4() {
|
||||
<caret>val a = MyClass()
|
||||
a.foo1()
|
||||
a.foo2()
|
||||
a.foo3()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
class MyClass {
|
||||
fun foo1() = Unit
|
||||
fun foo2() = Unit
|
||||
fun foo3() = Unit
|
||||
|
||||
fun foo4() {
|
||||
val a = MyClass().apply {
|
||||
foo1()
|
||||
foo2()
|
||||
foo3()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
class MyClass {
|
||||
fun foo1() = Unit
|
||||
fun foo2() = Unit
|
||||
fun foo3() = Unit
|
||||
|
||||
fun foo4() {
|
||||
val a = MyClass()
|
||||
a.foo1()<caret>
|
||||
a.foo2()
|
||||
a.foo3()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
class MyClass {
|
||||
fun foo1() = Unit
|
||||
fun foo2() = Unit
|
||||
fun foo3() = Unit
|
||||
|
||||
fun foo4() {
|
||||
val a = MyClass()
|
||||
a.run {
|
||||
foo1()
|
||||
foo2()
|
||||
foo3()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// IS_APPLICABLE: false
|
||||
|
||||
class MyClass {
|
||||
fun foo1() = Unit
|
||||
fun foo2() = Unit
|
||||
fun foo3() = Unit
|
||||
|
||||
fun foo4() {
|
||||
<caret>val a = MyClass()
|
||||
a.foo1()
|
||||
a.foo2()
|
||||
a.foo3()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
class MyClass {
|
||||
fun foo1() = Unit
|
||||
fun foo2() = Unit
|
||||
fun foo3() = Unit
|
||||
|
||||
fun foo4() {
|
||||
val a = MyClass()
|
||||
a.foo1()<caret>
|
||||
a.foo2()
|
||||
a.foo3()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
class MyClass {
|
||||
fun foo1() = Unit
|
||||
fun foo2() = Unit
|
||||
fun foo3() = Unit
|
||||
|
||||
fun foo4() {
|
||||
val a = MyClass()
|
||||
with(a) {
|
||||
foo1()
|
||||
foo2()
|
||||
foo3()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// IS_APPLICABLE: false
|
||||
|
||||
class MyClass {
|
||||
fun foo1() = Unit
|
||||
fun foo2() = Unit
|
||||
fun foo3() = Unit
|
||||
|
||||
fun foo4() {
|
||||
<caret>val a = MyClass()
|
||||
a.foo1()
|
||||
a.foo2()
|
||||
a.foo3()
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user