Skip to content

Commit 38ba516

Browse files
authored
Merge pull request #10281 from igfoo/igfoo/extractFunctionReference
Kotlin: Remove cast in extractFunctionReference
2 parents 824ac9e + a35c7ab commit 38ba516

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3845,7 +3845,11 @@ open class KotlinFileExtractor(
38453845
return
38463846
}
38473847

3848-
val parameterTypes = type.arguments.map { it as IrType }
3848+
val parameterTypes = type.arguments.map { it as? IrType }.requireNoNullsOrNull()
3849+
if (parameterTypes == null) {
3850+
logger.errorElement("Unexpected: Non-IrType parameter.", functionReferenceExpr)
3851+
return
3852+
}
38493853

38503854
val dispatchReceiverIdx: Int
38513855
val expressionTypeArguments: List<IrType>

0 commit comments

Comments
 (0)