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
+9
View File
@@ -1356,6 +1356,15 @@ public trait Progression</*0*/ N : jet.Any> : jet.Iterable<N> {
public abstract override /*1*/ /*fake_override*/ fun iterator(): jet.Iterator<N>
}
public trait PropertyMetadata {
public abstract val name: jet.String
}
public final class PropertyMetadataImpl : jet.PropertyMetadata {
public constructor PropertyMetadataImpl(/*0*/ name: jet.String)
public open override /*1*/ val name: jet.String
}
public trait Range</*0*/ in T : jet.Comparable<T>> {
public abstract val end: T
public abstract val start: T
@@ -1,7 +1,7 @@
class Delegate {
var inner = 1
fun get(t: Any?, p: String): Int = inner
fun set(t: Any?, p: String, i: Int) { inner = i }
fun get(t: Any?, p: PropertyMetadata): Int = inner
fun set(t: Any?, p: PropertyMetadata, i: Int) { inner = i }
}
class B {
@@ -1,5 +1,5 @@
class Delegate {
fun get(t: Any?, p: String): Int = 1
fun get(t: Any?, p: PropertyMetadata): Int = 1
}
class AImpl {
@@ -1,10 +1,10 @@
class Delegate {
var inner = Derived()
fun get(t: Any?, p: String): Derived {
fun get(t: Any?, p: PropertyMetadata): Derived {
inner = Derived(inner.a + "-get")
return inner
}
fun set(t: Any?, p: String, i: Base) { inner = Derived(inner.a + "-" + i.a + "-set") }
fun set(t: Any?, p: PropertyMetadata, i: Base) { inner = Derived(inner.a + "-" + i.a + "-set") }
}
class A {
@@ -1,5 +1,5 @@
class Delegate {
fun get(t: Any?, p: String, s: String = ""): Int = 1
fun get(t: Any?, p: PropertyMetadata, s: String = ""): Int = 1
}
val prop: Int by Delegate()
@@ -3,8 +3,8 @@ class A {
class Delegate {
var inner = 1
fun get(t: Any?, p: String): Int = inner
fun set(t: Any?, p: String, i: Int) { inner = i }
fun get(t: Any?, p: PropertyMetadata): Int = inner
fun set(t: Any?, p: PropertyMetadata, i: Int) { inner = i }
}
}
@@ -1,7 +1,7 @@
class Delegate {
var inner = 1
fun get(t: Any?, p: String): Int = inner
fun set(t: Any?, p: String, i: Int) { inner = i }
fun get(t: Any?, p: PropertyMetadata): Int = inner
fun set(t: Any?, p: PropertyMetadata, i: Int) { inner = i }
}
class A {
@@ -1,7 +1,7 @@
class Delegate {
var inner = 1
fun get(t: Any?, p: String): Int = inner
fun set(t: Any?, p: String, i: Int) { inner = i }
fun get(t: Any?, p: PropertyMetadata): Int = inner
fun set(t: Any?, p: PropertyMetadata, i: Int) { inner = i }
}
fun foo() = Delegate()
@@ -1,7 +1,7 @@
class Delegate {
var inner = 1
fun get(t: Any?, p: String): Int = inner
fun set(t: Any?, p: String, i: Int) { inner = i }
fun get(t: Any?, p: PropertyMetadata): Int = inner
fun set(t: Any?, p: PropertyMetadata, i: Int) { inner = i }
}
val p = Delegate()
@@ -1,5 +1,5 @@
class Delegate {
fun get(t: A, p: String): Int = 1
fun get(t: A, p: PropertyMetadata): Int = 1
}
val A.prop: Int by Delegate()
@@ -1,5 +1,5 @@
class Delegate {
fun get(t: F.A, p: String): Int = 1
fun get(t: F.A, p: PropertyMetadata): Int = 1
}
class F {
@@ -1,6 +1,6 @@
class Delegate<T>(var inner: T) {
fun get(t: Any?, p: String): T = inner
fun set(t: Any?, p: String, i: T) { inner = i }
fun get(t: Any?, p: PropertyMetadata): T = inner
fun set(t: Any?, p: PropertyMetadata, i: T) { inner = i }
}
class A {
@@ -1,7 +1,7 @@
class Delegate {
}
fun Delegate.get(t: Any?, p: String): Int = 1
fun Delegate.get(t: Any?, p: PropertyMetadata): Int = 1
class A {
val prop: Int by Delegate()
@@ -2,7 +2,7 @@ class Delegate {
}
class A {
fun Delegate.get(t: Any?, p: String): Int = 1
fun Delegate.get(t: Any?, p: PropertyMetadata): Int = 1
val prop: Int by Delegate()
}
@@ -1,5 +1,5 @@
class Delegate {
fun get(t: Any?, p: String): Int = 1
fun get(t: Any?, p: PropertyMetadata): Int = 1
}
class A {
@@ -1,7 +1,7 @@
class Delegate {
var inner = 1
fun get(t: Any?, p: String): Int = inner
fun set(t: Any?, p: String, i: Int) { inner = i }
fun get(t: Any?, p: PropertyMetadata): Int = inner
fun set(t: Any?, p: PropertyMetadata, i: Int) { inner = i }
}
class A {
@@ -1,5 +1,5 @@
class Delegate {
fun get(t: Any?, p: String): Int = 1
fun get(t: Any?, p: PropertyMetadata): Int = 1
}
trait A {
@@ -1,6 +1,6 @@
class Delegate<T>(var inner: T) {
fun get(t: Any?, p: String): T = inner
fun set(t: Any?, p: String, i: T) { inner = i }
fun get(t: Any?, p: PropertyMetadata): T = inner
fun set(t: Any?, p: PropertyMetadata, i: T) { inner = i }
}
class A {
@@ -1,7 +1,7 @@
class Delegate {
var inner = 1
fun get(t: Any?, p: String): Int = inner
fun set(t: Any?, p: String, i: Int) { inner = i }
fun get(t: Any?, p: PropertyMetadata): Int = inner
fun set(t: Any?, p: PropertyMetadata, i: Int) { inner = i }
}
class A {
@@ -1,9 +1,9 @@
class Delegate {
var inner = 1
fun get(t: Any?, p: String): Int = inner
fun get(t: Any?, p: PropertyMetadata): Int = inner
}
fun Delegate.set(t: Any?, p: String, i: Int) { inner = i }
fun Delegate.set(t: Any?, p: PropertyMetadata, i: Int) { inner = i }
class A {
var prop: Int by Delegate()
@@ -1,10 +1,10 @@
class Delegate {
var inner = 1
fun get(t: Any?, p: String): Int = inner
fun get(t: Any?, p: PropertyMetadata): Int = inner
}
class A {
fun Delegate.set(t: Any?, p: String, i: Int) { inner = i }
fun Delegate.set(t: Any?, p: PropertyMetadata, i: Int) { inner = i }
var prop: Int by Delegate()
}
@@ -1,5 +1,5 @@
class Delegate {
fun get(t: Any?, p: String): Int = 1
fun get(t: Any?, p: PropertyMetadata): Int = 1
}
val prop: Int by Delegate()
@@ -1,7 +1,7 @@
class Delegate {
var inner = 1
fun get(t: Any?, p: String): Int = inner
fun set(t: Any?, p: String, i: Int) { inner = i }
fun get(t: Any?, p: PropertyMetadata): Int = inner
fun set(t: Any?, p: PropertyMetadata, i: Int) { inner = i }
}
var prop: Int by Delegate()
@@ -1,5 +1,5 @@
class Delegate<T>(val f: (T) -> Int) {
fun get(t: T, p: String): Int = f(t)
fun get(t: T, p: PropertyMetadata): Int = f(t)
}
val p = Delegate<A> { t -> t.foo() }
@@ -1,5 +1,5 @@
class Delegate {
fun get(t: Any?, p: String): Int = 1
fun get(t: Any?, p: PropertyMetadata): Int = 1
}
class A {
@@ -1,7 +1,7 @@
class Delegate {
var inner = 1
fun get(t: Any?, p: String): Int = inner
fun set(t: Any?, p: String, i: Int) { inner = i }
fun get(t: Any?, p: PropertyMetadata): Int = inner
fun set(t: Any?, p: PropertyMetadata, i: Int) { inner = i }
}
class A {
@@ -1,5 +1,5 @@
class Delegate {
fun get(t: Any?, vararg p: String): Int = 1
fun get(t: Any?, vararg p: PropertyMetadata): Int = 1
}
val prop: Int by Delegate()
@@ -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
}