Shorten References: Fix removal of explicit companion references in the position of callee expression
#KT-10102
This commit is contained in:
+17
@@ -0,0 +1,17 @@
|
||||
package b
|
||||
|
||||
import java.util.function.IntPredicate
|
||||
|
||||
interface Factory {
|
||||
operator fun invoke(i: Int): IntPredicate
|
||||
|
||||
companion object {
|
||||
inline operator fun invoke(crossinline f: (Int) -> IntPredicate) = object : Factory {
|
||||
override fun invoke(i: Int) = f(i)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun foo(): Factory = Factory { k ->
|
||||
IntPredicate { n -> n % k == 0 }
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package b
|
||||
|
||||
import java.util.function.IntPredicate
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package b
|
||||
|
||||
import java.util.function.IntPredicate
|
||||
|
||||
interface Factory {
|
||||
operator fun invoke(i: Int): IntPredicate
|
||||
|
||||
companion object {
|
||||
inline operator fun invoke(crossinline f: (Int) -> IntPredicate) = object : Factory {
|
||||
override fun invoke(i: Int) = f(i)
|
||||
}
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package b
|
||||
|
||||
import java.util.function.IntPredicate
|
||||
|
||||
fun <caret>foo(): Factory = Factory { k ->
|
||||
IntPredicate { n -> n % k == 0 }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"mainFile": "b/foo.kt",
|
||||
"type": "MOVE_KOTLIN_TOP_LEVEL_DECLARATIONS",
|
||||
"targetFile": "b/boo.kt"
|
||||
}
|
||||
Reference in New Issue
Block a user