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>) {
|
fun <T> testCollectionIterator(c: Collection<T>) {
|
||||||
val it = c.iterator()
|
val it = c.iterator()
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
assertEquals(1, it.next())
|
assertEquals(1, it.next() as Any?)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fun <T> testCollectionContainsAll(c: Collection<T>) = assertTrue(c.containsAll(c))
|
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) {
|
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.test.*
|
||||||
|
import kotlin.reflect.KClass
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
val any = Array<Any>::class
|
val any = Array<Any>::class
|
||||||
val string = Array<String>::class
|
val string = Array<String>::class
|
||||||
|
|
||||||
assertNotEquals(any, string)
|
assertNotEquals<KClass<*>>(any, string)
|
||||||
assertNotEquals(any.java, string.java)
|
assertNotEquals<Class<*>>(any.java, string.java)
|
||||||
|
|
||||||
return "OK"
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user