FIR: avoid cast exception in Candidate.prepareExpectedType
This commit is contained in:
committed by
Mikhail Glukhikh
parent
a5f34a880c
commit
50b2ea7053
@@ -308,7 +308,8 @@ internal fun Candidate.resolveArgument(
|
|||||||
|
|
||||||
private fun Candidate.prepareExpectedType(session: FirSession, argument: FirExpression, parameter: FirValueParameter?): ConeKotlinType? {
|
private fun Candidate.prepareExpectedType(session: FirSession, argument: FirExpression, parameter: FirValueParameter?): ConeKotlinType? {
|
||||||
if (parameter == null) return null
|
if (parameter == null) return null
|
||||||
if (parameter.returnTypeRef is FirILTTypeRefPlaceHolder) return argument.resultType.coneType
|
if (parameter.returnTypeRef is FirILTTypeRefPlaceHolder && argument.resultType is FirResolvedTypeRef)
|
||||||
|
return argument.resultType.coneType
|
||||||
val basicExpectedType = argument.getExpectedType(session, parameter/*, LanguageVersionSettings*/)
|
val basicExpectedType = argument.getExpectedType(session, parameter/*, LanguageVersionSettings*/)
|
||||||
val expectedType = getExpectedTypeWithSAMConversion(session, argument, basicExpectedType) ?: basicExpectedType
|
val expectedType = getExpectedTypeWithSAMConversion(session, argument, basicExpectedType) ?: basicExpectedType
|
||||||
return this.substitutor.substituteOrSelf(expectedType)
|
return this.substitutor.substituteOrSelf(expectedType)
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
// KJS_WITH_FULL_RUNTIME
|
// KJS_WITH_FULL_RUNTIME
|
||||||
public inline fun Int.times(body : () -> Unit) {
|
public inline fun Int.times(body : () -> Unit) {
|
||||||
var count = this;
|
var count = this;
|
||||||
|
|||||||
Reference in New Issue
Block a user