Fix tests: "infix modifier required" and "operator modifier required" errors
This commit is contained in:
+4
-4
@@ -13,9 +13,9 @@ fun box(): String {
|
||||
val prop = J::prop
|
||||
if (prop !is KMutableProperty1<*, *>) return "Fail instanceof"
|
||||
if (prop.name != "prop") return "Fail name: ${prop.name}"
|
||||
if (prop.get(j) != ":(") return "Fail get before: ${prop[j]}"
|
||||
prop[j] = ":)"
|
||||
if (prop.get(j) != ":)") return "Fail get after: ${prop[j]}"
|
||||
if (prop.get(j) != ":(") return "Fail get before: ${prop.get(j)}"
|
||||
prop.set(j, ":)")
|
||||
if (prop.get(j) != ":)") return "Fail get after: ${prop.get(j)}"
|
||||
|
||||
|
||||
if (prop == K::prop) return "Fail J::prop == K::prop (these are different properties)"
|
||||
@@ -29,7 +29,7 @@ fun box(): String {
|
||||
if (prop != prop2) return "Fail: property references from :: and from properties differ: $prop != $prop2"
|
||||
if (prop2 !is KMutableProperty1<*, *>) return "Fail instanceof 2"
|
||||
(prop2 as KMutableProperty1<J, String>).set(j, "::)")
|
||||
if (prop.get(j) != "::)") return "Fail get after 2: ${prop[j]}"
|
||||
if (prop.get(j) != "::)") return "Fail get after 2: ${prop.get(j)}"
|
||||
|
||||
|
||||
val ext = klass.memberExtensionProperties.firstOrNull { it.name == "ext" } ?: "Fail: no 'ext' property in memberExtensionProperties"
|
||||
|
||||
+2
-2
@@ -5,6 +5,6 @@ fun box(): String {
|
||||
val a = J()
|
||||
val p = J::class.members.single { it.name == "result" } as KMutableProperty1<J, String>
|
||||
p.isAccessible = true
|
||||
p[a] = "OK"
|
||||
return p[a]
|
||||
p.set(a, "OK")
|
||||
return p.get(a)
|
||||
}
|
||||
|
||||
+1
-1
@@ -3,5 +3,5 @@ open class K
|
||||
fun box(): String {
|
||||
val f = J::value
|
||||
val a = J()
|
||||
return if (f.get(a) == 42) "OK" else "Fail: ${f[a]}"
|
||||
return if (f.get(a) == 42) "OK" else "Fail: ${f.get(a)}"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user