Allow removing trivial property accessor body when the accessor can not be fully deleted in redundant getter/setter inspections

This commit is contained in:
Ilya Kirillov
2019-05-29 13:51:08 +03:00
parent 95a6f59c62
commit 8fa9b9923f
14 changed files with 116 additions and 37 deletions
@@ -0,0 +1,8 @@
// PROBLEM: none
class Foo {
val foo: String = ""
@Deprecated("") <caret>get() {
1 + 2
return field
}
}
@@ -0,0 +1,6 @@
class Foo {
val foo: String = ""
@Deprecated("") <caret>get() {
return field
}
}
@@ -0,0 +1,4 @@
class Foo {
val foo: String = ""
@Deprecated("") <caret>get
}
@@ -0,0 +1,4 @@
class Foo {
val foo: String = ""
@Deprecated("") <caret>get() = field
}
@@ -0,0 +1,4 @@
class Foo {
val foo: String = ""
@Deprecated("") get
}
@@ -0,0 +1,8 @@
// PROBLEM: none
class Foo {
var foo: String = ""
@Deprecated("") <caret>set(foo) {
1 + 2
field = foo
}
}
@@ -0,0 +1,6 @@
class Foo {
var foo: String = ""
@Deprecated("") <caret>set(x) {
field = x
}
}
@@ -0,0 +1,4 @@
class Foo {
var foo: String = ""
@Deprecated("") set
}