Change String argument of property delegate method to PropertyMetadata

This commit is contained in:
Natalia.Ukhorskaya
2013-04-25 18:41:35 +04:00
parent 6e2584d0de
commit b9e5227b58
63 changed files with 174 additions and 83 deletions
@@ -1,7 +1,7 @@
val a: Int by Delegate()
class Delegate {
fun get(t: Any?, p: String): Int {
fun get(t: Any?, p: PropertyMetadata): Int {
t.equals(p) // to avoid UNUSED_PARAMETER warning
return 1
}
@@ -1,7 +1,7 @@
val a by Delegate()
class Delegate {
fun get(t: Any?, p: String): Int {
fun get(t: Any?, p: PropertyMetadata): Int {
t.equals(p) // to avoid UNUSED_PARAMETER warning
return 1
}
@@ -3,7 +3,7 @@ abstract class A {
}
class Delegate {
fun get(t: Any?, p: String): Int {
fun get(t: Any?, p: PropertyMetadata): Int {
t.equals(p) // to avoid UNUSED_PARAMETER warning
return 1
}
@@ -5,7 +5,7 @@ class B {
}
class Delegate {
fun get(t: Any?, p: String): Int {
fun get(t: Any?, p: PropertyMetadata): Int {
t.equals(p) // to avoid UNUSED_PARAMETER warning
return 1
}
@@ -11,7 +11,7 @@ fun foo() {
}
class Delegate {
fun get(t: Any?, p: String): Int {
fun get(t: Any?, p: PropertyMetadata): Int {
t.equals(p) // to avoid UNUSED_PARAMETER warning
return 1
}
@@ -11,7 +11,7 @@ fun foo() {
}
class Delegate {
fun get(t: Any?, p: String): String {
fun get(t: Any?, p: PropertyMetadata): String {
t.equals(p) // to avoid UNUSED_PARAMETER warning
return ""
}
@@ -1,7 +1,7 @@
val a: Int by A(1)
class A<T: Any>(i: T) {
fun get(t: Any?, p: String): T {
fun get(t: Any?, p: PropertyMetadata): T {
t.equals(p) // to avoid UNUSED_PARAMETER warning
throw Exception()
}
@@ -4,7 +4,7 @@ class Derived: Base()
val a: Base by A()
class A {
fun get(t: Any?, p: String): Derived {
fun get(t: Any?, p: PropertyMetadata): Derived {
t.equals(p) // to avoid UNUSED_PARAMETER warning
return Derived()
}
@@ -3,7 +3,7 @@ trait T {
}
class Delegate {
fun get(t: Any?, p: String): Int {
fun get(t: Any?, p: PropertyMetadata): Int {
t.equals(p) // to avoid UNUSED_PARAMETER warning
return 1
}
@@ -7,7 +7,7 @@ class D {
val cTopLevel: Int by <!DELEGATE_SPECIAL_FUNCTION_MISSING!>IncorrectThis<A>()<!>
class IncorrectThis<T> {
fun get<R>(t: Any?, p: String): Int {
fun get<R>(t: Any?, p: PropertyMetadata): Int {
t.equals(p) // to avoid UNUSED_PARAMETER warning
return 1
}
@@ -5,7 +5,7 @@ class Local {
}
class Delegate {
fun get(t: Any?, p: String): Int {
fun get(t: Any?, p: PropertyMetadata): Int {
t.equals(p) // to avoid UNUSED_PARAMETER warning
return 1
}
@@ -1,7 +1,7 @@
var a: Int by <!DELEGATE_SPECIAL_FUNCTION_MISSING!>A()<!>
class A {
fun get(t: Any?, p: String): Int {
fun get(t: Any?, p: PropertyMetadata): Int {
t.equals(p) // to avoid UNUSED_PARAMETER warning
return 1
}
@@ -3,7 +3,7 @@ class B {
}
class Delegate<T: Any>(val init: T) {
fun get(t: Any?, p: String): Int {
fun get(t: Any?, p: PropertyMetadata): Int {
t.equals(p) // to avoid UNUSED_PARAMETER warning
throw Exception()
}
@@ -1,7 +1,7 @@
<!PUBLIC_MEMBER_SHOULD_SPECIFY_TYPE!>public val a<!> by Delegate()
class Delegate {
fun get(t: Any?, p: String): Int {
fun get(t: Any?, p: PropertyMetadata): Int {
t.equals(p) // to avoid UNUSED_PARAMETER warning
return 1
}
@@ -6,7 +6,7 @@ val c by <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>d<!>
val d by <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>c<!>
class Delegate(i: Int) {
fun get(t: Any?, p: String): Int {
fun get(t: Any?, p: PropertyMetadata): Int {
t.equals(p) // to avoid UNUSED_PARAMETER warning
return 1
}
@@ -2,7 +2,7 @@ val a: Int by Delegate()
<!ACCESSOR_FOR_DELEGATED_PROPERTY!>get() = 1<!>
class Delegate {
fun get(t: Any?, p: String): Int {
fun get(t: Any?, p: PropertyMetadata): Int {
t.equals(p) // to avoid UNUSED_PARAMETER warning
return 1
}
@@ -3,12 +3,12 @@ var a: Int by Delegate()
<!ACCESSOR_FOR_DELEGATED_PROPERTY!>set(i) {}<!>
class Delegate {
fun get(t: Any?, p: String): Int {
fun get(t: Any?, p: PropertyMetadata): Int {
t.equals(p) // to avoid UNUSED_PARAMETER warning
return 1
}
fun set(t: Any?, p: String, i: Int) {
fun set(t: Any?, p: PropertyMetadata, i: Int) {
t.equals(p) || i.equals(null) // to avoid UNUSED_PARAMETER warning
}
}
@@ -7,11 +7,11 @@ var cTopLevel: Int by <!DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE!>Delegate()<!>
class A
class Delegate {
fun get(t: Any?, p: String): Int {
fun get(t: Any?, p: PropertyMetadata): Int {
t.equals(p) // to avoid UNUSED_PARAMETER warning
return 1
}
fun set(t: A, p: String, i: Int) {
fun set(t: A, p: PropertyMetadata, i: Int) {
t.equals(p) // to avoid UNUSED_PARAMETER warning
i.equals(null)
}
@@ -4,12 +4,12 @@ class Derived: Base()
var a: Derived by A()
class A {
fun get(t: Any?, p: String): Derived {
fun get(t: Any?, p: PropertyMetadata): Derived {
t.equals(p) // to avoid UNUSED_PARAMETER warning
return Derived()
}
fun set(t: Any?, p: String, i: Base) {
fun set(t: Any?, p: PropertyMetadata, i: Base) {
t.equals(p) // to avoid UNUSED_PARAMETER warning
i.equals(null) // to avoid UNUSED_PARAMETER warning
}
@@ -5,7 +5,7 @@ class A {
}
class Delegate(i: Int) {
fun get(t: Any?, p: String): Int {
fun get(t: Any?, p: PropertyMetadata): Int {
t.equals(p) // to avoid UNUSED_PARAMETER warning
return 1
}
@@ -5,11 +5,11 @@ class A {
var aTopLevel: Int by Delegate()
class Delegate {
fun get(t: Any?, p: String): Int {
fun get(t: Any?, p: PropertyMetadata): Int {
t.equals(p) // to avoid UNUSED_PARAMETER warning
return 1
}
fun set(t: Any?, p: String, a: Int) {
fun set(t: Any?, p: PropertyMetadata, a: Int) {
t.equals(p) // to avoid UNUSED_PARAMETER warning
a.equals(null)
}
@@ -5,11 +5,11 @@ class A {
var aTopLevel: Int by Delegate()
class Delegate {
fun get(<!UNUSED_PARAMETER!>t<!>: Nothing?, p: String): Int {
fun get(<!UNUSED_PARAMETER!>t<!>: Nothing?, p: PropertyMetadata): Int {
p.equals(null) // to avoid UNUSED_PARAMETER warning
return 1
}
fun set(<!UNUSED_PARAMETER!>t<!>: Nothing?, p: String, a: Int) {
fun set(<!UNUSED_PARAMETER!>t<!>: Nothing?, p: PropertyMetadata, a: Int) {
p.equals(a) // to avoid UNUSED_PARAMETER warning
}
}
@@ -5,11 +5,11 @@ class A {
var aTopLevel: Int by <!DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE, DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE!>Delegate()<!>
class Delegate {
fun get(<!UNUSED_PARAMETER!>t<!>: Nothing, p: String): Int {
fun get(<!UNUSED_PARAMETER!>t<!>: Nothing, p: PropertyMetadata): Int {
p.equals(null) // to avoid UNUSED_PARAMETER warning
return 1
}
fun set(<!UNUSED_PARAMETER!>t<!>: Nothing, p: String, a: Int) {
fun set(<!UNUSED_PARAMETER!>t<!>: Nothing, p: PropertyMetadata, a: Int) {
p.equals(a) // to avoid UNUSED_PARAMETER warning
}
}
@@ -3,12 +3,12 @@ class A {
}
class Delegate {
fun get(t: Int, p: String): Int {
fun get(t: Int, p: PropertyMetadata): Int {
t.equals(p) // to avoid UNUSED_PARAMETER warning
return 1
}
fun get(t: String, p: String): Int {
fun get(t: String, p: PropertyMetadata): Int {
t.equals(p) // to avoid UNUSED_PARAMETER warning
return 1
}
@@ -1,7 +1,7 @@
val c: Int by <!DELEGATE_SPECIAL_FUNCTION_RETURN_TYPE_MISMATCH!>Delegate()<!>
class Delegate {
fun get(t: Any?, p: String): String {
fun get(t: Any?, p: PropertyMetadata): String {
t.equals(p) // to avoid UNUSED_PARAMETER warning
return ""
}
@@ -13,7 +13,7 @@ class C {
val cTopLevel: Int by Delegate<Nothing?>()
class Delegate<T> {
fun get(t: T, p: String): Int {
fun get(t: T, p: PropertyMetadata): Int {
t.equals(p) // to avoid UNUSED_PARAMETER warning
return 1
}
@@ -5,11 +5,11 @@ class A {
var aTopLevel: Int by <!DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE!>Delegate()<!>
class Delegate {
fun get(t: Any?, p: String): Int {
fun get(t: Any?, p: PropertyMetadata): Int {
t.equals(p) // to avoid UNUSED_PARAMETER warning
return 1
}
fun set(t: Any?, p: String, i: String) {
fun set(t: Any?, p: PropertyMetadata, i: String) {
t.equals(p) // to avoid UNUSED_PARAMETER warning
i.equals(null)
}
@@ -7,7 +7,7 @@ val bTopLevel: Int by <!DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE!>Delegate()<!>
class A
class Delegate {
fun get(t: A, p: String): Int {
fun get(t: A, p: PropertyMetadata): Int {
t.equals(p) // to avoid UNUSED_PARAMETER warning
return 1
}
@@ -5,7 +5,7 @@ class A {
val aTopLevel: Int by <!DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE!>Delegate()<!>
class Delegate {
fun get(t: Any?, p: String, a: Int): Int {
fun get(t: Any?, p: PropertyMetadata, a: Int): Int {
t.equals(p) // to avoid UNUSED_PARAMETER warning
return a
}
@@ -5,12 +5,12 @@ class A {
var aTopLevel: Int by <!DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE!>Delegate()<!>
class Delegate {
fun get(t: Any?, p: String): Int {
fun get(t: Any?, p: PropertyMetadata): Int {
t.equals(p) // to avoid UNUSED_PARAMETER warning
return 1
}
fun set(t: Any?, p: String, a: Int, c: Int) {
fun set(t: Any?, p: PropertyMetadata, a: Int, c: Int) {
t.equals(p) // to avoid UNUSED_PARAMETER warning
c.equals(a)
}
@@ -1,12 +1,12 @@
var b: Int by Delegate()
class Delegate {
fun get(t: Any?, p: String): Int {
fun get(t: Any?, p: PropertyMetadata): Int {
t.equals(p) // to avoid UNUSED_PARAMETER warning
return 1
}
fun set(t: Any?, p: String, i: Int): Int {
fun set(t: Any?, p: PropertyMetadata, i: Int): Int {
t.equals(p) // to avoid UNUSED_PARAMETER warning
return i
}