[FIR] Consider explicit returns during computing return type of anonymous function
Introduce FirAnonymousFunctionReturnExpressionInfo ^KT-59386
This commit is contained in:
committed by
Space Team
parent
212c10e674
commit
8f5294a508
Vendored
+2
-2
@@ -10,13 +10,13 @@ val a: () -> Unit = l@{
|
||||
if (true) 42
|
||||
}
|
||||
|
||||
val b: () -> Unit = l@{
|
||||
val b: () -> Unit = <!INITIALIZER_TYPE_MISMATCH!>l@{
|
||||
// Error, coercion can't be applied at this position!
|
||||
if (true) return@l "hello"
|
||||
|
||||
// However, this is OK, because here coercion is applied
|
||||
"hello"
|
||||
}
|
||||
}<!>
|
||||
|
||||
val c: () -> Unit = {
|
||||
// Interesting enough, for such expessions we use expected type Unit
|
||||
|
||||
Reference in New Issue
Block a user