Don't report the same diagnsotics several times

This commit is contained in:
Victor Petukhov
2021-05-26 12:58:48 +03:00
parent e942052eb6
commit 4a767c597e
62 changed files with 202 additions and 166 deletions
+6 -5
View File
@@ -1,3 +1,4 @@
// !WITH_NEW_INFERENCE
/*
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
*
@@ -10,18 +11,18 @@
*/
fun test1(): Int {
val x: String = if (true) <!TYPE_MISMATCH!>{
val x: String = if (true) <!TYPE_MISMATCH{NI}!>{
when {
true -> Any()
else -> null
true -> <!TYPE_MISMATCH{OI}!>Any()<!>
else -> <!NULL_FOR_NONNULL_TYPE{OI}!>null<!>
}
}<!> else ""
return x.hashCode()
}
fun test2(): Int {
val x: String = <!TYPE_MISMATCH, TYPE_MISMATCH!>when {
true -> Any()
val x: String = <!TYPE_MISMATCH{NI}!>when {
true -> <!TYPE_MISMATCH{OI}!>Any()<!>
else -> null
} ?: return 0<!>
return x.hashCode()