Move: Fix processing of implicit extension 'invoke' calls
Also fix bogus "unused import" inspection reported on such calls #KT-17496 Fixed
This commit is contained in:
+4
@@ -0,0 +1,4 @@
|
||||
package bar
|
||||
|
||||
class CrExtended
|
||||
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package foo
|
||||
|
||||
import bar.CrExtended
|
||||
|
||||
fun test(ce: CrExtended) {
|
||||
valWithFunType()
|
||||
ce.valWithExtFunType()
|
||||
with(1) {
|
||||
extValWithFunType()
|
||||
ce.extValWithExtFunType()
|
||||
}
|
||||
|
||||
::valWithFunType
|
||||
::valWithExtFunType
|
||||
1::extValWithFunType
|
||||
1::extValWithExtFunType
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package foo
|
||||
|
||||
import bar.CrExtended
|
||||
|
||||
val valWithFunType = fun (): Unit {}
|
||||
val valWithExtFunType = fun CrExtended.(): Unit {}
|
||||
val Int.extValWithFunType get() = fun (): Unit {}
|
||||
val Int.extValWithExtFunType get() = fun CrExtended.(): Unit {}
|
||||
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package bar
|
||||
|
||||
import foo.*
|
||||
|
||||
class CrExtended
|
||||
|
||||
fun <caret>test(ce: CrExtended) {
|
||||
valWithFunType()
|
||||
ce.valWithExtFunType()
|
||||
with(1) {
|
||||
extValWithFunType()
|
||||
ce.extValWithExtFunType()
|
||||
}
|
||||
|
||||
::valWithFunType
|
||||
::valWithExtFunType
|
||||
1::extValWithFunType
|
||||
1::extValWithExtFunType
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package foo
|
||||
|
||||
import bar.CrExtended
|
||||
|
||||
val valWithFunType = fun (): Unit {}
|
||||
val valWithExtFunType = fun CrExtended.(): Unit {}
|
||||
val Int.extValWithFunType get() = fun (): Unit {}
|
||||
val Int.extValWithExtFunType get() = fun CrExtended.(): Unit {}
|
||||
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"mainFile": "bar/test.kt",
|
||||
"type": "MOVE_KOTLIN_TOP_LEVEL_DECLARATIONS",
|
||||
"targetPackage": "foo"
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package bar
|
||||
|
||||
class CrExtended
|
||||
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package baz
|
||||
|
||||
import bar.CrExtended
|
||||
import foo.extValWithExtFunType
|
||||
import foo.extValWithFunType
|
||||
import foo.valWithExtFunType
|
||||
import foo.valWithFunType
|
||||
|
||||
fun test(ce: CrExtended) {
|
||||
valWithFunType()
|
||||
ce.valWithExtFunType()
|
||||
with(1) {
|
||||
extValWithFunType()
|
||||
ce.extValWithExtFunType()
|
||||
}
|
||||
|
||||
::valWithFunType
|
||||
::valWithExtFunType
|
||||
1::extValWithFunType
|
||||
1::extValWithExtFunType
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package foo
|
||||
|
||||
import bar.CrExtended
|
||||
|
||||
val valWithFunType = fun (): Unit {}
|
||||
val valWithExtFunType = fun CrExtended.(): Unit {}
|
||||
val Int.extValWithFunType get() = fun (): Unit {}
|
||||
val Int.extValWithExtFunType get() = fun CrExtended.(): Unit {}
|
||||
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package bar
|
||||
|
||||
import foo.*
|
||||
|
||||
class CrExtended
|
||||
|
||||
fun <caret>test(ce: CrExtended) {
|
||||
valWithFunType()
|
||||
ce.valWithExtFunType()
|
||||
with(1) {
|
||||
extValWithFunType()
|
||||
ce.extValWithExtFunType()
|
||||
}
|
||||
|
||||
::valWithFunType
|
||||
::valWithExtFunType
|
||||
1::extValWithFunType
|
||||
1::extValWithExtFunType
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package foo
|
||||
|
||||
import bar.CrExtended
|
||||
|
||||
val valWithFunType = fun (): Unit {}
|
||||
val valWithExtFunType = fun CrExtended.(): Unit {}
|
||||
val Int.extValWithFunType get() = fun (): Unit {}
|
||||
val Int.extValWithExtFunType get() = fun CrExtended.(): Unit {}
|
||||
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"mainFile": "bar/test.kt",
|
||||
"type": "MOVE_KOTLIN_TOP_LEVEL_DECLARATIONS",
|
||||
"targetPackage": "baz"
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package bar
|
||||
|
||||
import foo.CrExtended
|
||||
import foo.extValWithExtFunType
|
||||
import foo.extValWithFunType
|
||||
import foo.valWithExtFunType
|
||||
import foo.valWithFunType
|
||||
|
||||
fun test(ce: CrExtended) {
|
||||
valWithFunType()
|
||||
ce.valWithExtFunType()
|
||||
with(1) {
|
||||
extValWithFunType()
|
||||
ce.extValWithExtFunType()
|
||||
}
|
||||
|
||||
::valWithFunType
|
||||
::valWithExtFunType
|
||||
1::extValWithFunType
|
||||
1::extValWithExtFunType
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package foo
|
||||
|
||||
val valWithFunType = fun (): Unit {}
|
||||
val valWithExtFunType = fun CrExtended.(): Unit {}
|
||||
val Int.extValWithFunType get() = fun (): Unit {}
|
||||
val Int.extValWithExtFunType get() = fun CrExtended.(): Unit {}
|
||||
|
||||
class CrExtended
|
||||
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package foo
|
||||
|
||||
val valWithFunType = fun (): Unit {}
|
||||
val valWithExtFunType = fun CrExtended.(): Unit {}
|
||||
val Int.extValWithFunType get() = fun (): Unit {}
|
||||
val Int.extValWithExtFunType get() = fun CrExtended.(): Unit {}
|
||||
|
||||
class CrExtended
|
||||
|
||||
fun <caret>test(ce: CrExtended) {
|
||||
valWithFunType()
|
||||
ce.valWithExtFunType()
|
||||
with(1) {
|
||||
extValWithFunType()
|
||||
ce.extValWithExtFunType()
|
||||
}
|
||||
|
||||
::valWithFunType
|
||||
::valWithExtFunType
|
||||
1::extValWithFunType
|
||||
1::extValWithExtFunType
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"mainFile": "foo/test.kt",
|
||||
"type": "MOVE_KOTLIN_TOP_LEVEL_DECLARATIONS",
|
||||
"targetPackage": "bar"
|
||||
}
|
||||
Reference in New Issue
Block a user