Replace assert boolean with assert equality: do not report when arguments type are not subtype

#KT-30761 Fixed
This commit is contained in:
Toshiaki Kameyama
2019-04-09 14:55:23 +09:00
committed by Mikhail Glukhikh
parent 93d854362b
commit 849d18669b
8 changed files with 111 additions and 4 deletions
@@ -0,0 +1,12 @@
// RUNTIME_WITH_KOTLIN_TEST
// PROBLEM: none
import kotlin.test.assertTrue
interface Parent
interface Child : Parent
fun test(p: Parent, c: Child?) {
assertTrue<caret>(p == c)
}
@@ -0,0 +1,12 @@
// RUNTIME_WITH_KOTLIN_TEST
// PROBLEM: none
import kotlin.test.assertTrue
interface Parent
interface Child : Parent
fun test(p: Parent, c: Child?) {
assertTrue<caret>(c === p)
}
@@ -0,0 +1,11 @@
// RUNTIME_WITH_KOTLIN_TEST
import kotlin.test.assertTrue
interface Parent
interface Child : Parent
fun test(p: Parent?, c: Child) {
<caret>assertTrue(p == c)
}
@@ -0,0 +1,11 @@
// RUNTIME_WITH_KOTLIN_TEST
import kotlin.test.assertEquals
interface Parent
interface Child : Parent
fun test(p: Parent?, c: Child) {
assertEquals(p, c)
}
@@ -0,0 +1,11 @@
// RUNTIME_WITH_KOTLIN_TEST
import kotlin.test.assertTrue
interface Parent
interface Child : Parent
fun test(p: Parent?, c: Child) {
<caret>assertTrue(c === p)
}
@@ -0,0 +1,11 @@
// RUNTIME_WITH_KOTLIN_TEST
import kotlin.test.assertSame
interface Parent
interface Child : Parent
fun test(p: Parent?, c: Child) {
assertSame(c, p)
}