[FIR] Don't report ARGUMENT_TYPE_MISMATCH on error types
This commit is contained in:
committed by
Space Team
parent
32f6b71525
commit
0e84bf2053
@@ -8,5 +8,5 @@ fun <T> _arrayList(vararg values: T) : List<T> = throw Exception()
|
||||
class _Pair<A>(val a: A)
|
||||
|
||||
fun test() {
|
||||
_arrayList(_Pair(1))._sortBy { it -> <!ARGUMENT_TYPE_MISMATCH, UNRESOLVED_REFERENCE!>xxx<!> }
|
||||
_arrayList(_Pair(1)).<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>_sortBy<!> { it -> <!UNRESOLVED_REFERENCE!>xxx<!> }
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@ public inline fun <T: Closeable, R> T.use1(block: (T)-> R) : R {
|
||||
}
|
||||
|
||||
fun main() {
|
||||
C().use1 {
|
||||
C().<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>use1<!> {
|
||||
w -> // ERROR here
|
||||
<!ARGUMENT_TYPE_MISMATCH, UNRESOLVED_REFERENCE!>x<!>
|
||||
<!UNRESOLVED_REFERENCE!>x<!>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,8 +12,8 @@ public inline fun <T: Closeable, R> T.use(block: (t: T)-> R) : R {
|
||||
}
|
||||
|
||||
fun test() {
|
||||
C().use {
|
||||
C().<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>use<!> {
|
||||
it.close()
|
||||
<!ARGUMENT_TYPE_MISMATCH, UNRESOLVED_REFERENCE!>x<!>
|
||||
<!UNRESOLVED_REFERENCE!>x<!>
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -12,9 +12,9 @@ public inline fun <T: Closeable, R> use(t: T, block: T.(T)-> R) : R {
|
||||
}
|
||||
|
||||
fun test() {
|
||||
use(C()) {
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>use<!>(C()) {
|
||||
this.close()
|
||||
it.close()
|
||||
<!ARGUMENT_TYPE_MISMATCH, UNRESOLVED_REFERENCE!>xx<!>
|
||||
<!UNRESOLVED_REFERENCE!>xx<!>
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -12,8 +12,8 @@ public inline fun <T: Closeable, R> T.use(block: T.()-> R) : R {
|
||||
}
|
||||
|
||||
fun test() {
|
||||
C().use {
|
||||
C().<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>use<!> {
|
||||
this.close()
|
||||
<!ARGUMENT_TYPE_MISMATCH, UNRESOLVED_REFERENCE!>x<!>
|
||||
<!UNRESOLVED_REFERENCE!>x<!>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,21 +4,21 @@ import java.lang.Exception
|
||||
fun <K> id(arg: K): K = arg
|
||||
|
||||
fun test() {
|
||||
id(<!ARGUMENT_TYPE_MISMATCH, UNRESOLVED_REFERENCE!>unresolved<!>)!!
|
||||
id(<!UNRESOLVED_REFERENCE!>unresolved<!>)!!
|
||||
<!UNRESOLVED_REFERENCE!>unresolved<!>!!!!
|
||||
try {
|
||||
id(<!ARGUMENT_TYPE_MISMATCH, UNRESOLVED_REFERENCE!>unresolved<!>)
|
||||
id(<!UNRESOLVED_REFERENCE!>unresolved<!>)
|
||||
} catch (e: Exception) {
|
||||
id(<!ARGUMENT_TYPE_MISMATCH, UNRESOLVED_REFERENCE!>unresolved<!>)
|
||||
id(<!UNRESOLVED_REFERENCE!>unresolved<!>)
|
||||
}
|
||||
|
||||
if (true)
|
||||
id(<!ARGUMENT_TYPE_MISMATCH, UNRESOLVED_REFERENCE!>unresolved<!>)
|
||||
id(<!UNRESOLVED_REFERENCE!>unresolved<!>)
|
||||
else
|
||||
id(<!ARGUMENT_TYPE_MISMATCH, UNRESOLVED_REFERENCE!>unresolved<!>)
|
||||
id(<!UNRESOLVED_REFERENCE!>unresolved<!>)
|
||||
|
||||
when {
|
||||
true -> id(<!ARGUMENT_TYPE_MISMATCH, UNRESOLVED_REFERENCE!>unresolved<!>)
|
||||
true -> <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>id<!>(<!UNRESOLVED_REFERENCE!>unresolved<!>)
|
||||
}
|
||||
id(<!ARGUMENT_TYPE_MISMATCH, UNRESOLVED_REFERENCE!>unresolved<!>) ?: id(<!ARGUMENT_TYPE_MISMATCH, UNRESOLVED_REFERENCE!>unresolved<!>)
|
||||
id(<!UNRESOLVED_REFERENCE!>unresolved<!>) ?: id(<!UNRESOLVED_REFERENCE!>unresolved<!>)
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ fun <M> materialize(): M = TODO()
|
||||
|
||||
fun test(b: Boolean) {
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>id<!>(if (b) {
|
||||
id(<!ARGUMENT_TYPE_MISMATCH, UNRESOLVED_REFERENCE!>unresolved<!>)
|
||||
id(<!UNRESOLVED_REFERENCE!>unresolved<!>)
|
||||
} else {
|
||||
id(
|
||||
materialize()
|
||||
|
||||
Reference in New Issue
Block a user