[FIR] Fix inference in presence of Unit expected type
This commit is contained in:
committed by
TeamCityServer
parent
8624d97f29
commit
cd578e9d13
compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithExpectedTypeAndBound.fir.kt
Vendored
+2
-2
@@ -2,11 +2,11 @@
|
||||
fun <T : Number> materializeNumber(): T = TODO()
|
||||
|
||||
fun a(): Unit = run {
|
||||
<!NEW_INFERENCE_ERROR!>materializeNumber()<!>
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>materializeNumber<!>()
|
||||
}
|
||||
|
||||
fun b(): Unit = run {
|
||||
run {
|
||||
<!NEW_INFERENCE_ERROR!>materializeNumber()<!>
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>materializeNumber<!>()
|
||||
}
|
||||
}
|
||||
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
interface Base
|
||||
class Foo : Base
|
||||
|
||||
fun <T : Base> myRun(action: () -> T): T = action()
|
||||
|
||||
fun foo(f: (Foo) -> Unit) {}
|
||||
|
||||
fun main() {
|
||||
foo { f: Foo ->
|
||||
<!NEW_INFERENCE_ERROR!>myRun { f }<!>
|
||||
}
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
interface Base
|
||||
|
||||
Reference in New Issue
Block a user