[FIR] Only support @ExtensionFunctionType on true functional types

^KT-59874
This commit is contained in:
Nikolay Lunyak
2023-09-13 15:05:46 +03:00
committed by Space Team
parent 6210da0c98
commit 4b67a504be
5 changed files with 12 additions and 30 deletions
@@ -1,14 +0,0 @@
fun foo(a: (String) -> Unit) {
"".<!UNRESOLVED_REFERENCE!>a<!>()
}
interface A : (String) -> Unit {}
typealias AliasedEFT = ExtensionFunctionType
fun foo(a: <!WRONG_EXTENSION_FUNCTION_TYPE!>@AliasedEFT<!> A) {
// @Extension annotation on an unrelated type shouldn't have any effect on this diagnostic.
// Only kotlin.Function{n} type annotated with @Extension should
"".a()
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
fun foo(a: (String) -> Unit) {
"".<!UNRESOLVED_REFERENCE!>a<!>()
}
@@ -1,14 +0,0 @@
fun foo(a: (String) -> Unit) {
"".<!UNRESOLVED_REFERENCE!>a<!>()
}
interface A : (String) -> Unit {}
typealias AliasedEFT = ExtensionFunctionType
fun foo(a: <!WRONG_EXTENSION_FUNCTION_TYPE!>@AliasedEFT<!> A) {
// @Extension annotation on an unrelated type shouldn't have any effect on this diagnostic.
// Only kotlin.Function{n} type annotated with @Extension should
"".<!UNRESOLVED_REFERENCE!>a<!>()
}