NI: extract diagnostics from partially resolved call instead of separately handling it including running all checks
^KT-37630 Fixed ^KT-35494 Fixed
This commit is contained in:
+13
@@ -0,0 +1,13 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNCHECKED_CAST -UNUSED_EXPRESSION
|
||||
|
||||
fun <T> consumeLongAndMaterialize(x: Long): T = null as T
|
||||
fun consumeAny(x: Any) = x
|
||||
|
||||
fun main() {
|
||||
consumeAny(consumeLongAndMaterialize(3 * 1000))
|
||||
|
||||
if (true) {
|
||||
consumeLongAndMaterialize(3 * 1000)
|
||||
} else true
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package
|
||||
|
||||
public fun consumeAny(/*0*/ x: kotlin.Any): kotlin.Any
|
||||
public fun </*0*/ T> consumeLongAndMaterialize(/*0*/ x: kotlin.Long): T
|
||||
public fun main(): kotlin.Unit
|
||||
+1
-1
@@ -20,5 +20,5 @@ fun testFunctions() {
|
||||
fun testNestedCalls() {
|
||||
id<String>(inferFromLambda { materialize() })
|
||||
id<String>(inferFromLambda(fun() = materialize()))
|
||||
id<String>(inferFromLambda2(<!TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH!>fun<!EXPECTED_PARAMETERS_NUMBER_MISMATCH!>()<!> = materialize()<!>))
|
||||
id<String>(inferFromLambda2(<!TYPE_MISMATCH, TYPE_MISMATCH!>fun<!EXPECTED_PARAMETERS_NUMBER_MISMATCH!>()<!> = materialize()<!>))
|
||||
}
|
||||
|
||||
+2
-2
@@ -30,7 +30,7 @@ class Foo<out A> {
|
||||
other1.product(
|
||||
other2.product(
|
||||
other3.product(
|
||||
<!TYPE_MISMATCH, TYPE_MISMATCH!>bar { d -> { c -> { b -> { a -> function(<!DEBUG_INFO_EXPRESSION_TYPE("A")!>a<!>, <!DEBUG_INFO_EXPRESSION_TYPE("B")!>b<!>, <!DEBUG_INFO_EXPRESSION_TYPE("C")!>c<!>, <!DEBUG_INFO_EXPRESSION_TYPE("D")!>d<!>) } } } }<!>
|
||||
<!TYPE_MISMATCH!>bar { d -> { c -> { b -> { a -> function(<!DEBUG_INFO_EXPRESSION_TYPE("A")!>a<!>, <!DEBUG_INFO_EXPRESSION_TYPE("B")!>b<!>, <!DEBUG_INFO_EXPRESSION_TYPE("C")!>c<!>, <!DEBUG_INFO_EXPRESSION_TYPE("D")!>d<!>) } } } }<!>
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -43,7 +43,7 @@ class Foo<out A> {
|
||||
other1.product(
|
||||
other2.product(
|
||||
other3.product(
|
||||
<!TYPE_MISMATCH, TYPE_MISMATCH!>other4.product(
|
||||
<!TYPE_MISMATCH!>other4.product(
|
||||
bar { e -> { d -> { c -> { b -> { a -> function(<!DEBUG_INFO_EXPRESSION_TYPE("A")!>a<!>, <!DEBUG_INFO_EXPRESSION_TYPE("B")!>b<!>, <!DEBUG_INFO_EXPRESSION_TYPE("C")!>c<!>, <!DEBUG_INFO_EXPRESSION_TYPE("D")!>d<!>, <!DEBUG_INFO_EXPRESSION_TYPE("E")!>e<!>) } } } } }
|
||||
)<!>
|
||||
)
|
||||
|
||||
Vendored
+2
-2
@@ -35,7 +35,7 @@ fun test5(): Bound? = select(
|
||||
fun test6() {
|
||||
select(
|
||||
null,
|
||||
<!IMPLICIT_NOTHING_TYPE_ARGUMENT_IN_RETURN_POSITION, REIFIED_TYPE_FORBIDDEN_SUBSTITUTION, REIFIED_TYPE_FORBIDDEN_SUBSTITUTION!>materializeReified<!>()
|
||||
<!IMPLICIT_NOTHING_TYPE_ARGUMENT_IN_RETURN_POSITION, REIFIED_TYPE_FORBIDDEN_SUBSTITUTION!>materializeReified<!>()
|
||||
)
|
||||
}
|
||||
|
||||
@@ -48,6 +48,6 @@ fun test7(): Bound? =
|
||||
fun test8() {
|
||||
select(
|
||||
null,
|
||||
<!REIFIED_TYPE_FORBIDDEN_SUBSTITUTION, REIFIED_TYPE_FORBIDDEN_SUBSTITUTION!>materializeReifiedUnbound<!>()
|
||||
<!REIFIED_TYPE_FORBIDDEN_SUBSTITUTION!>materializeReifiedUnbound<!>()
|
||||
)
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -28,7 +28,7 @@ inline fun <reified T : In<T>> testIn(): T {
|
||||
// Unexpected behaviour
|
||||
inline fun <reified T : Out<T>> testOut(): T {
|
||||
<!UNREACHABLE_CODE!>return<!> try {
|
||||
<!IMPLICIT_NOTHING_TYPE_ARGUMENT_IN_RETURN_POSITION, REIFIED_TYPE_FORBIDDEN_SUBSTITUTION, REIFIED_TYPE_FORBIDDEN_SUBSTITUTION!>outBound<!>()
|
||||
<!IMPLICIT_NOTHING_TYPE_ARGUMENT_IN_RETURN_POSITION, REIFIED_TYPE_FORBIDDEN_SUBSTITUTION!>outBound<!>()
|
||||
} catch (ex: Exception) {
|
||||
throw Exception()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user