Implement correct is check for SuspendFunction
Let callable references implement SuspendFunction Do not generate CHECKCAST SuspendFunction when LV is 1.2 #KT-25825: Fixed
This commit is contained in:
+6
-2
@@ -125,12 +125,16 @@ internal object CompletedContinuation : Continuation<Any?> {
|
||||
override fun toString(): String = "This continuation is already complete"
|
||||
}
|
||||
|
||||
@SinceKotlin("1.3")
|
||||
// To distinguish suspend function types from ordinary function types all suspend function type shall implement this interface
|
||||
internal interface SuspendFunction
|
||||
|
||||
@SinceKotlin("1.3")
|
||||
// Restricted suspension lambdas inherit from this class
|
||||
internal abstract class RestrictedSuspendLambda(
|
||||
private val arity: Int,
|
||||
completion: Continuation<Any?>?
|
||||
) : RestrictedContinuationImpl(completion), FunctionBase {
|
||||
) : RestrictedContinuationImpl(completion), FunctionBase, SuspendFunction {
|
||||
constructor(arity: Int) : this(arity, null)
|
||||
|
||||
public override fun getArity(): Int = arity
|
||||
@@ -147,7 +151,7 @@ internal abstract class RestrictedSuspendLambda(
|
||||
internal abstract class SuspendLambda(
|
||||
private val arity: Int,
|
||||
completion: Continuation<Any?>?
|
||||
) : ContinuationImpl(completion), FunctionBase {
|
||||
) : ContinuationImpl(completion), FunctionBase, SuspendFunction {
|
||||
constructor(arity: Int) : this(arity, null)
|
||||
|
||||
public override fun getArity(): Int = arity
|
||||
|
||||
Reference in New Issue
Block a user