[FIR2IR] Fix cast insertion for SAM conversion
The rule is: no cast is required iff the argument type is a non-reflection function type and a subtype of the expected function type. We approximate the cone types using the FIR2IR specific config to account for intersection types, captured types, etc. #KT-63345 Fixed #KT-63510 #KT-62865
This commit is contained in:
committed by
Space Team
parent
dd1d36816b
commit
b857c28ab3
+8
@@ -79,3 +79,11 @@ fun test8(a: () -> Unit) {
|
||||
fun test9() {
|
||||
run1(::test9)
|
||||
}
|
||||
|
||||
// KT-63345
|
||||
fun test10(a: Any) {
|
||||
@Suppress("CANNOT_CHECK_FOR_ERASED")
|
||||
if (a is Unrelated && a is (() -> Unit)) {
|
||||
run1(a)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user