[FIR] Fix incorrect inference of return type of anonymous functions
Also remove incorrect subtype check checkers Test unsafeVarianceInAliasedFunctionalType.kt started to fail because of KT-54894. This bug existed before, changes from this commit just unhided it (previously it was hidden because incorrect subtype check in `isSubtypeForTypeMismatch` which is used by FirFunctionReturnTypeMismatchChecker
This commit is contained in:
committed by
Space Team
parent
1b42298025
commit
991d8c18aa
+11
@@ -0,0 +1,11 @@
|
||||
class Foo<out T>(val baz: Baz<T>)
|
||||
|
||||
class Bar {
|
||||
val foo: Foo<*> = TODO()
|
||||
|
||||
fun <T> bar(): Baz<T> {
|
||||
return <!RETURN_TYPE_MISMATCH!>foo.baz<!>
|
||||
}
|
||||
}
|
||||
|
||||
typealias Baz<T> = (@UnsafeVariance T) -> Unit
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// FIR_IDENTICAL
|
||||
class Foo<out T>(val baz: Baz<T>)
|
||||
|
||||
class Bar {
|
||||
|
||||
Reference in New Issue
Block a user