Deprecated conventions (get -> getValue, plus -> unaryPlus) quickfix

This commit is contained in:
Yan Zhulanow
2015-10-12 18:08:07 +03:00
parent f9e89596fd
commit 528482f625
11 changed files with 138 additions and 2 deletions
+7
View File
@@ -45,7 +45,14 @@ class Foo {
set(value) { $x = value }
}
class CustomDelegate {
operator fun get(thisRef: Any?, prop: PropertyMetadata): String = ""
operator fun set(thisRef: Any?, prop: PropertyMetadata, value: String) {}
}
class B {
var a: String by CustomDelegate()
fun plus(a: A): A = A()
}
+8 -1
View File
@@ -36,7 +36,7 @@ const val i = 1
annotation class Fancy(val param: Int)
@Fancy(<caret>i) class D
@Fancy(i) class D
class Foo {
var x: Int = 0
@@ -44,7 +44,14 @@ class Foo {
set(value) { field = value }
}
class CustomDelegate {
operator fun getValue(thisRef: Any?, prop: PropertyMetadata): String = ""
operator fun setValue(thisRef: Any?, prop: PropertyMetadata, value: String) {}
}
class B {
var a: String by CustomDelegate()
operator fun plus(a: A): A = A()
}
@@ -0,0 +1,8 @@
// "Rename to 'getValue'" "true"
class CustomDelegate
operator fun CustomDelegate.get(thisRef: Any?, prop: PropertyMetadata): String = ""
class Example {
val a: String by <caret>CustomDelegate()
}
@@ -0,0 +1,8 @@
// "Rename to 'getValue'" "true"
class CustomDelegate
operator fun CustomDelegate.getValue(thisRef: Any?, prop: PropertyMetadata): String = ""
class Example {
val a: String by CustomDelegate()
}
@@ -0,0 +1,9 @@
// "Rename to 'setValue'" "true"
class CustomDelegate {
operator fun get(thisRef: Any?, prop: PropertyMetadata): String = ""
operator fun set(thisRef: Any?, prop: PropertyMetadata, value: String) {}
}
class Example {
var a: String by <caret>CustomDelegate()
}
@@ -0,0 +1,9 @@
// "Rename to 'setValue'" "true"
class CustomDelegate {
operator fun get(thisRef: Any?, prop: PropertyMetadata): String = ""
operator fun setValue(thisRef: Any?, prop: PropertyMetadata, value: String) {}
}
class Example {
var a: String by CustomDelegate()
}