FIR: fix exception in ConeKotlinType.returnType
This commit is contained in:
+4
-5
@@ -78,12 +78,11 @@ private fun isFunctionalTypeWithReceiver(typeRef: FirTypeRef) =
|
|||||||
coneTypeSafe.lookupTag.classId.asString() == "kotlin/ExtensionFunctionType"
|
coneTypeSafe.lookupTag.classId.asString() == "kotlin/ExtensionFunctionType"
|
||||||
}
|
}
|
||||||
|
|
||||||
private val ConeKotlinType.returnType: ConeKotlinType
|
private val ConeKotlinType.returnType: ConeKotlinType?
|
||||||
get() {
|
get() {
|
||||||
require(this is ConeClassType)
|
require(this is ConeClassType)
|
||||||
val projection = typeArguments.last()
|
val projection = typeArguments.last()
|
||||||
require(projection is ConeTypedProjection)
|
return (projection as? ConeTypedProjection)?.type
|
||||||
return projection.type
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private val ConeKotlinType.valueParameterTypes: List<ConeKotlinType?>
|
private val ConeKotlinType.valueParameterTypes: List<ConeKotlinType?>
|
||||||
@@ -139,8 +138,8 @@ private fun extractLambdaInfoFromFunctionalType(
|
|||||||
val parameters = extractLambdaParameters(expectedType, argument)
|
val parameters = extractLambdaParameters(expectedType, argument)
|
||||||
|
|
||||||
val argumentAsFunctionExpression = argument//.safeAs<FunctionExpression>()
|
val argumentAsFunctionExpression = argument//.safeAs<FunctionExpression>()
|
||||||
val receiverType = argumentAsFunctionExpression?.receiverType ?: expectedType.receiverType(expectedTypeRef)
|
val receiverType = argumentAsFunctionExpression.receiverType ?: expectedType.receiverType(expectedTypeRef)
|
||||||
val returnType = argumentAsFunctionExpression?.returnType ?: expectedType.returnType
|
val returnType = argumentAsFunctionExpression.returnType ?: expectedType.returnType ?: return null
|
||||||
|
|
||||||
return ResolvedLambdaAtom(
|
return ResolvedLambdaAtom(
|
||||||
argument,
|
argument,
|
||||||
|
|||||||
Reference in New Issue
Block a user