Intentions: Move class member to companion object
#KT-9697 In Progress
This commit is contained in:
@@ -0,0 +1 @@
|
||||
org.jetbrains.kotlin.idea.intentions.MoveMemberToCompanionObjectIntention
|
||||
@@ -0,0 +1,5 @@
|
||||
// IS_APPLICABLE: false
|
||||
|
||||
abstract class A {
|
||||
abstract fun <caret>foo()
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// IS_APPLICABLE: false
|
||||
|
||||
abstract class A {
|
||||
abstract val <caret>foo: Int
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
class A {
|
||||
final fun <caret>foo() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
class A {
|
||||
companion object {
|
||||
fun foo() {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
open class A {
|
||||
open fun <caret>foo() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
open class A {
|
||||
companion object {
|
||||
fun foo() {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// IS_APPLICABLE: false
|
||||
|
||||
enum class E {
|
||||
A,
|
||||
<caret>B,
|
||||
C
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// IS_APPLICABLE: false
|
||||
|
||||
interface A {
|
||||
fun foo()
|
||||
}
|
||||
|
||||
class B: A {
|
||||
override fun <caret>foo() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// IS_APPLICABLE: false
|
||||
|
||||
interface A {
|
||||
fun <caret>foo()
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// IS_APPLICABLE: false
|
||||
|
||||
class A {
|
||||
inner class B {
|
||||
fun <caret>foo() {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// IS_APPLICABLE: false
|
||||
|
||||
fun foo() {
|
||||
class A {
|
||||
fun <caret>bar() {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// IS_APPLICABLE: false
|
||||
|
||||
object A {
|
||||
fun <caret>foo() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// IS_APPLICABLE: false
|
||||
|
||||
fun foo() {
|
||||
fun <caret>bar() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// SHOULD_FAIL_WITH: Function <b><code>foo</code></b> is overridden by declaration(s) in a subclass
|
||||
open class A {
|
||||
open fun <caret>foo() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class B: A() {
|
||||
override fun foo() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// SHOULD_FAIL_WITH: Property <b><code>foo</code></b> is overridden by declaration(s) in a subclass
|
||||
open class A {
|
||||
open val <caret>foo: Int = 1
|
||||
}
|
||||
|
||||
class B: A() {
|
||||
override val foo: Int = 2
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// SHOULD_FAIL_WITH: Usages of outer class instance inside of property 'y' won't be processed
|
||||
class A {
|
||||
val x = 1
|
||||
val <caret>y = x + 1
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// IS_APPLICABLE: false
|
||||
|
||||
interface A {
|
||||
val foo: Int
|
||||
}
|
||||
|
||||
class B: A {
|
||||
override val <caret>foo: Int = 1
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// IS_APPLICABLE: false
|
||||
|
||||
fun <caret>foo() {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user