Old backing field with dollar is now forbidden
This commit is contained in:
+1
-1
@@ -13,7 +13,7 @@ interface NoC {
|
||||
class WithC() {
|
||||
val x : Int
|
||||
init {
|
||||
<warning descr="[BACKING_FIELD_USAGE_DEPRECATED] Backing field usage is deprecated here, soon it will be possible only in property accessors">$x</warning> = 1
|
||||
<error>$x</error> = 1
|
||||
<error>$y</error> = 2
|
||||
val <warning>b</warning> = x
|
||||
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ class WithCPI_Dup(<warning>x</warning> : Int) {
|
||||
|
||||
class WithCPI(x : Int) {
|
||||
val a = 1
|
||||
val b : Int = <warning descr="[BACKING_FIELD_USAGE_DEPRECATED] Backing field usage is deprecated here, soon it will be possible only in property accessors">$a</warning>
|
||||
val b : Int = <error>$a</error>
|
||||
val xy : Int = x
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -2,5 +2,5 @@
|
||||
|
||||
class WithC() {
|
||||
val a = 1
|
||||
val b = <warning descr="[BACKING_FIELD_USAGE_DEPRECATED] Backing field usage is deprecated here, soon it will be possible only in property accessors">$a</warning> // error here, but must not be
|
||||
val b = <error>$a</error> // error here, but must not be
|
||||
}
|
||||
@@ -22,7 +22,7 @@ class A {
|
||||
return 1
|
||||
}
|
||||
set(i: Int) {
|
||||
$prop = i
|
||||
field = i
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ val <info textAttributesKey="KOTLIN_CLASS">Int</info>.<info textAttributesKey="K
|
||||
|
||||
val <info textAttributesKey="KOTLIN_PACKAGE_PROPERTY"><info textAttributesKey="KOTLIN_PROPERTY_WITH_BACKING_FIELD">y</info></info> : <info textAttributesKey="KOTLIN_CLASS">Int</info> = 1
|
||||
<info textAttributesKey="KOTLIN_KEYWORD">get</info>() {
|
||||
return 5.<info textAttributesKey="KOTLIN_EXTENSION_PROPERTY"><info textAttributesKey="KOTLIN_PACKAGE_PROPERTY">sq</info></info> + <info textAttributesKey="KOTLIN_PACKAGE_PROPERTY"><info textAttributesKey="KOTLIN_BACKING_FIELD_ACCESS">$y</info></info> + <info textAttributesKey="KOTLIN_MUTABLE_VARIABLE"><info textAttributesKey="KOTLIN_PACKAGE_PROPERTY">x</info></info>
|
||||
return 5.<info textAttributesKey="KOTLIN_EXTENSION_PROPERTY"><info textAttributesKey="KOTLIN_PACKAGE_PROPERTY">sq</info></info> + <info textAttributesKey="KOTLIN_LOCAL_VARIABLE"><info textAttributesKey="KOTLIN_BACKING_FIELD_VARIABLE">field</info></info> + <info textAttributesKey="KOTLIN_PACKAGE_PROPERTY"><info textAttributesKey="KOTLIN_MUTABLE_VARIABLE">x</info></info>
|
||||
}
|
||||
|
||||
class <info textAttributesKey="KOTLIN_CLASS">Foo</info>(val <info textAttributesKey="KOTLIN_PARAMETER"><info textAttributesKey="KOTLIN_INSTANCE_PROPERTY"><info textAttributesKey="KOTLIN_PROPERTY_WITH_BACKING_FIELD">a</info></info></info> : <info textAttributesKey="KOTLIN_CLASS">Int</info>, <info textAttributesKey="KOTLIN_PARAMETER">b</info> : <info textAttributesKey="KOTLIN_CLASS">String</info>) {
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
class Foo {
|
||||
var <caret>x = ""
|
||||
get() = $x + "!"
|
||||
set(value) { $x = value + "!" }
|
||||
|
||||
fun foo(): String {
|
||||
return $x
|
||||
}
|
||||
get() = field + "!"
|
||||
set(value) { field = value + "!" }
|
||||
}
|
||||
|
||||
@@ -3,8 +3,4 @@ class Foo {
|
||||
var x: String
|
||||
get() = _x + "!"
|
||||
set(value) { _x = value + "!" }
|
||||
|
||||
fun foo(): String {
|
||||
return _x
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
class A {
|
||||
var a: Int
|
||||
var b: Int
|
||||
|
||||
init {
|
||||
<caret>$a = 1
|
||||
b = 2
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
class A {
|
||||
var a: Int =<caret> 1
|
||||
var b: Int
|
||||
|
||||
init {
|
||||
b = 2
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
// "Make 'i' not abstract" "true"
|
||||
class B {
|
||||
<caret>abstract val i: Int = 0
|
||||
get() = $i
|
||||
get() = field
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
// "Make 'i' not abstract" "true"
|
||||
class B {
|
||||
val i: Int = 0
|
||||
get() = $i
|
||||
get() = field
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
class Exp(p1: String) {
|
||||
val /*rename*/prop11: String = p1
|
||||
get(): String {
|
||||
return $prop11
|
||||
return field
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
class Exp(p1: String) {
|
||||
val /*rename*/prop1: String = p1
|
||||
get(): String {
|
||||
return $prop1
|
||||
return field
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user