Introduce Variable: Forbid inside of type references and 'super' references
#KT-8324 Fixed
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
open class A(n: Int)
|
||||
|
||||
class B {
|
||||
constructor(x: Int) : <selection>A</selection>(x + 1)
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
Cannot refactor in this place
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
interface T
|
||||
|
||||
object O : T
|
||||
|
||||
fun foo() {
|
||||
val x = object : T by <selection>O</selection> {}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
interface T
|
||||
|
||||
object O : T
|
||||
|
||||
fun foo() {
|
||||
val o = O
|
||||
val x = object : T by o {}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
interface T
|
||||
|
||||
object O : T
|
||||
|
||||
fun foo() {
|
||||
val x = object : <selection>T</selection> by O {}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
Cannot refactor in this place
|
||||
@@ -0,0 +1,5 @@
|
||||
open class A(n: Int)
|
||||
|
||||
fun foo() {
|
||||
val x = object : A(<selection>1</selection>) {}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
open class A(n: Int)
|
||||
|
||||
fun foo() {
|
||||
val i = 1
|
||||
val x = object : A(i) {}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fun foo() {
|
||||
val x = object : <selection>Any</selection>() {}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
Cannot refactor in this place
|
||||
@@ -0,0 +1,5 @@
|
||||
interface T
|
||||
|
||||
fun foo() {
|
||||
val x = object : <selection>T</selection> {}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
Cannot refactor in this place
|
||||
@@ -0,0 +1,11 @@
|
||||
open class A {
|
||||
open fun foo() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class B : A() {
|
||||
override fun foo() {
|
||||
<selection>super</selection>.foo()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
Cannot refactor in this place
|
||||
@@ -0,0 +1,9 @@
|
||||
class A {
|
||||
fun bar() {
|
||||
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
<selection>this</selection>.foo()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
class A {
|
||||
fun bar() {
|
||||
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
val a = this
|
||||
a.foo()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user