Fix tests: "infix modifier required" and "operator modifier required" errors
This commit is contained in:
+2
-2
@@ -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, "")
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -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)
|
||||
}
|
||||
|
||||
+2
-2
@@ -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"
|
||||
|
||||
Vendored
+4
-4
@@ -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)
|
||||
}
|
||||
|
||||
+1
-1
@@ -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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user