[FIR] Set correct constraint position for callable reference

This fixes a false positive resolution error for callable references
to functions with a type parameter that's annotated with
@OnlyInputTypes.

#KT-57994 Fixed
This commit is contained in:
Kirill Rakhman
2023-04-24 13:35:18 +02:00
committed by Space Team
parent 89acaae819
commit 7f46225bed
7 changed files with 50 additions and 2 deletions
@@ -0,0 +1,17 @@
// FIR_IDENTICAL
// SKIP_TXT
// WITH_STDLIB
open class BaseClass
class DerivedClass : BaseClass()
fun test() {
val derivedToStringMap: Map<DerivedClass, String> = mapOf()
val mapper: (BaseClass) -> String? = derivedToStringMap::get
foo(mapper)
foo(derivedToStringMap::get)
}
fun foo(mapper: (BaseClass) -> String?) {}