Fix tests: "infix modifier required" and "operator modifier required" errors

This commit is contained in:
Yan Zhulanow
2015-11-26 15:56:56 +03:00
parent a3ff3ffc45
commit 9d1af5a17e
635 changed files with 1283 additions and 1617 deletions
@@ -20,7 +20,7 @@ fun box(): String {
val a = A()
mutable as KMutableProperty2<A, String, String>
assert(mutable[a, ""] == "before") { "Fail 3: ${mutable.get(a, "")}" }
mutable[a, ""] = "OK"
assert(mutable.get(a, "") == "before") { "Fail 3: ${mutable.get(a, "")}" }
mutable.set(a, "", "OK")
return mutable.get(a, "")
}
@@ -13,7 +13,7 @@ fun box(): String {
val a = A("")
mutable as KMutableProperty1<A, String>
assert(mutable[a] == "before") { "Fail 3: ${mutable.get(a)}" }
mutable[a] = "OK"
assert(mutable.get(a) == "before") { "Fail 3: ${mutable.get(a)}" }
mutable.set(a, "OK")
return mutable.get(a)
}
@@ -9,14 +9,14 @@ fun box(): String {
run {
val foo: KProperty1<A, *> = javaClass<A>().kotlin.memberProperties.single()
assert(foo.name == "foo") { "Fail name: $foo (${foo.name})" }
assert(foo.get(A()) == "member") { "Fail value: ${foo[A()]}" }
assert(foo.get(A()) == "member") { "Fail value: ${foo.get(A())}" }
}
run {
val foo: KProperty2<A, *, *> = javaClass<A>().kotlin.memberExtensionProperties.single()
assert(foo.name == "foo") { "Fail name: $foo (${foo.name})" }
foo as KProperty2<A, Unit, *>
assert(foo.get(A(), Unit) == "extension") { "Fail value: ${foo[A(), Unit]}" }
assert(foo.get(A(), Unit) == "extension") { "Fail value: ${foo.get(A(), Unit)}" }
}
return "OK"
@@ -11,15 +11,15 @@ fun box(): String {
p.isAccessible = true
try {
p[null] = "OK"
p.set(null, "OK")
return "Fail: set should check that first argument is Obj"
} catch (e: IllegalArgumentException) {}
try {
p[null]
p.get(null)
return "Fail: get should check that first argument is Obj"
} catch (e: IllegalArgumentException) {}
p[Obj] = "OK"
return p[Obj]
p.set(Obj, "OK")
return p.get(Obj)
}
@@ -25,5 +25,5 @@ fun box(): String {
f.set(a, ":)")
return if (f[a] != ":)") "Fail: ${f[a]}" else "OK"
return if (f.get(a) != ":)") "Fail: ${f.get(a)}" else "OK"
}