Fix anonymous function literals handling in type checker
- [NI] Create type info directly if the expected type is functional. - Properly handle suspended function expected type.
This commit is contained in:
committed by
Mikhail Zarechenskiy
parent
6facdcb7ea
commit
26cc08be65
+5
@@ -4,3 +4,8 @@ val test1: suspend () -> Unit = {}
|
||||
val test2: suspend Any.() -> Unit = {}
|
||||
val test3: suspend Any.(Int) -> Int = { k: Int -> k + 1 }
|
||||
val test4: SuspendFn = {}
|
||||
|
||||
val test1f: suspend () -> Unit = fun () {}
|
||||
val test2f: suspend Any.() -> Unit = fun Any.() {}
|
||||
val test3f: suspend Any.(Int) -> Int = fun (k: Int) = k + 1
|
||||
val test4f: SuspendFn = fun Any.() {}
|
||||
|
||||
+4
@@ -1,7 +1,11 @@
|
||||
package
|
||||
|
||||
public val test1: suspend () -> kotlin.Unit
|
||||
public val test1f: suspend () -> kotlin.Unit
|
||||
public val test2: suspend kotlin.Any.() -> kotlin.Unit
|
||||
public val test2f: suspend kotlin.Any.() -> kotlin.Unit
|
||||
public val test3: suspend kotlin.Any.(kotlin.Int) -> kotlin.Int
|
||||
public val test3f: suspend kotlin.Any.(kotlin.Int) -> kotlin.Int
|
||||
public val test4: SuspendFn /* = suspend () -> kotlin.Unit */
|
||||
public val test4f: SuspendFn /* = suspend () -> kotlin.Unit */
|
||||
public typealias SuspendFn = suspend () -> kotlin.Unit
|
||||
|
||||
Reference in New Issue
Block a user