Fix compiler tests with incompatible types in assertEquals arguments.
This commit is contained in:
@@ -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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user