Convert Member to Extension Intention: Drop open/final modifiers, add imports when necessary, transform Java-site calls
#KT-8876 Fixed
This commit is contained in:
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"mainFile": "x/test.kt",
|
||||
"intentionClass": "org.jetbrains.kotlin.idea.intentions.declarations.ConvertMemberToExtensionIntention",
|
||||
"withRuntime": "true"
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package x
|
||||
|
||||
interface A {
|
||||
}
|
||||
|
||||
fun A.foo(n: Int) {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package y;
|
||||
|
||||
import x.A;
|
||||
import x.TestKt;
|
||||
|
||||
class J {
|
||||
static void foo(A a) {
|
||||
TestKt.foo(a, 1);
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package y
|
||||
|
||||
import x.A
|
||||
import x.foo
|
||||
|
||||
fun bar(a: A) {
|
||||
a.foo(1)
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package x
|
||||
|
||||
interface A {
|
||||
fun <caret>foo(n: Int)
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package y;
|
||||
|
||||
import x.A;
|
||||
|
||||
class J {
|
||||
static void foo(A a) {
|
||||
a.foo(1);
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package y
|
||||
|
||||
import x.A
|
||||
|
||||
fun bar(a: A) {
|
||||
a.foo(1)
|
||||
}
|
||||
Reference in New Issue
Block a user