K2: Avoid losing diagnostics for synthetic calls

Some of the changed tests may duplicate other existing diagnostics,
but that should not be reason not to report them at all.

There might be another job to be done to avoid diagnostic duplications
This commit is contained in:
Denis.Zharkov
2022-11-23 13:19:43 +01:00
committed by Space Team
parent fe5adab652
commit d7399ed1cf
31 changed files with 97 additions and 74 deletions
@@ -13,12 +13,12 @@ class B<T>(data: T) : A<T>(data)
fun case1() {
val tryVal: B<String> =
try {
<!TYPE_MISMATCH, TYPE_MISMATCH!>try {
throwExceptionA(false)
A("")
} catch (e: Exception) {
B("")
}
}<!>
}
@@ -27,12 +27,12 @@ fun case1() {
fun case2() {
val tryVal: A<String> =
try {
<!TYPE_MISMATCH, TYPE_MISMATCH!>try {
throwExceptionA(false)
A("")
} catch (e: Exception) {
null
}
}<!>
}
/*
@@ -42,14 +42,14 @@ fun case2() {
*/
fun case3() {
val tryVal: A<Int> =
try {
<!TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH!>try {
throwExceptionA(false)
A(2)
} catch (e: ExcA) {
A(null) //diag duplication
} catch (e: ExcB) {
B(null) //diag duplication
}
}<!>
}
class ExcA() : Exception()
@@ -262,10 +262,10 @@ fun case_16() {
}
// TESTCASE NUMBER: 17
val case_17 = if (nullableIntProperty == null == true == false) 0 else {
val case_17 = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>if (nullableIntProperty == null == true == false) 0 else {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>nullableIntProperty<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>nullableIntProperty<!><!UNSAFE_CALL!>.<!>java
}
}<!>
//TESTCASE NUMBER: 18
fun case_18(a: DeepObject.A.B.C.D.E.F.G.J?) {
@@ -732,11 +732,11 @@ fun case_37(x: Nothing?, y: Nothing?) {
fun case_38() {
val z = null
if (<!SENSELESS_COMPARISON!>Object.prop_2 != z<!>)
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>if (<!SENSELESS_COMPARISON!>Object.prop_2 != z<!>)
else {
Object.prop_2
Object.prop_2.java
}
}<!>
}
// TESTCASE NUMBER: 39