Fix compiler tests with incompatible types in assertEquals arguments.

This commit is contained in:
Ilya Gorbunov
2015-10-22 23:16:39 +03:00
parent 579ce8091c
commit e2c9267305
3 changed files with 5 additions and 4 deletions
@@ -12,7 +12,7 @@ fun <T> testCollectionContains(c: Collection<T>) = assertTrue(c.contains(1))
fun <T> testCollectionIterator(c: Collection<T>) {
val it = c.iterator()
while (it.hasNext()) {
assertEquals(1, it.next())
assertEquals(1, it.next() as Any?)
}
}
fun <T> testCollectionContainsAll(c: Collection<T>) = assertTrue(c.containsAll(c))
@@ -20,5 +20,5 @@ fun box(): String {
}
public fun <T, R> checkAccessor(prop: KProperty0<T>, value: R) {
assertEquals(prop.get(), value, "Property ${prop} has wrong value")
assertEquals<Any?>(prop.get(), value, "Property ${prop} has wrong value")
}
@@ -1,11 +1,12 @@
import kotlin.test.*
import kotlin.reflect.KClass
fun box(): String {
val any = Array<Any>::class
val string = Array<String>::class
assertNotEquals(any, string)
assertNotEquals(any.java, string.java)
assertNotEquals<KClass<*>>(any, string)
assertNotEquals<Class<*>>(any.java, string.java)
return "OK"
}