"introduce backing property" intention
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
// "Introduce backing property" "true"
|
||||
|
||||
class Foo {
|
||||
var x = ""
|
||||
get() = $x + "!"
|
||||
set(value) { $x = value + "!" }
|
||||
|
||||
fun foo(): String {
|
||||
return $<caret>x
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Introduce backing property" "true"
|
||||
|
||||
class Foo {
|
||||
private var _x = ""
|
||||
var x: String
|
||||
get() = _x + "!"
|
||||
set(value) { _x = value + "!" }
|
||||
|
||||
fun foo(): String {
|
||||
return _x
|
||||
}
|
||||
}
|
||||
+1
@@ -1,5 +1,6 @@
|
||||
// "Change 'A.x' type to '(Int) -> Int'" "false"
|
||||
// ACTION: Change 'C.x' type to '(String) -> Int'
|
||||
// ACTION: Introduce backing property
|
||||
// ERROR: <html>Return type is '(kotlin.Int) → kotlin.Int', which is not a subtype of overridden<br/><b>public</b> <b>abstract</b> <b>val</b> x: (kotlin.String) → kotlin.Int <i>defined in</i> A</html>
|
||||
interface A {
|
||||
val x: (String) -> Int
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// "Specify type explicitly" "false"
|
||||
// ACTION: Convert property to function
|
||||
// ACTION: Introduce backing property
|
||||
// ERROR: Unresolved reference: foo
|
||||
|
||||
class A() {
|
||||
|
||||
+1
@@ -1,5 +1,6 @@
|
||||
// "Change 'B.x' type to '(String) -> [ERROR : Ay]'" "false"
|
||||
// ACTION: Change 'A.x' type to '(Int) -> Int'
|
||||
// ACTION: Introduce backing propertty
|
||||
// ERROR: <html>Return type is '(kotlin.Int) → kotlin.Int', which is not a subtype of overridden<br/><b>public</b> <b>abstract</b> <b>val</b> x: (kotlin.String) → [ERROR : Ay] <i>defined in</i> A</html>
|
||||
// ERROR: Unresolved reference: Ay
|
||||
interface A {
|
||||
|
||||
Reference in New Issue
Block a user