Replace assert boolean with assert equality: do not report when arguments type are not subtype
#KT-30761 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
93d854362b
commit
849d18669b
+12
@@ -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)
|
||||
}
|
||||
+12
@@ -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)
|
||||
}
|
||||
+11
@@ -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)
|
||||
}
|
||||
+11
@@ -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)
|
||||
}
|
||||
+11
@@ -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)
|
||||
}
|
||||
+11
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user