[FIR] Report type-parameterized implicit invoke call over type-parameterized property access

^KT-59988
This commit is contained in:
Evgeniy.Zhelenskiy
2023-11-20 04:59:11 +01:00
committed by Space Team
parent 86c09a1c78
commit f5168527ae
14 changed files with 47 additions and 44 deletions
@@ -6,15 +6,15 @@ FILE: typeArgumentsNotAllowed.kt
super<R|kotlin/Any|>()
}
public abstract val x: <ERROR TYPE REF: Type arguments not allowed>
public get(): <ERROR TYPE REF: Type arguments not allowed>
public abstract val x: <ERROR TYPE REF: Type arguments not allowed for type parameters>
public get(): <ERROR TYPE REF: Type arguments not allowed for type parameters>
public abstract fun foo(): <ERROR TYPE REF: Type arguments not allowed>
public abstract fun foo(): <ERROR TYPE REF: Type arguments not allowed for type parameters>
}
public final fun <T> foo(): R|kotlin/Unit| {
R|rest/bar<Inapplicable(INAPPLICABLE): rest/bar>#|<<ERROR TYPE REF: Type arguments not allowed>>()
R|rest/bar|<R|kotlin/collections/List<kotlin/collections/List<ERROR CLASS: Type arguments not allowed>>|>()
R|rest/bar<Inapplicable(INAPPLICABLE): rest/bar>#|<<ERROR TYPE REF: Type arguments not allowed for type parameters>>()
R|rest/bar|<R|kotlin/collections/List<kotlin/collections/List<ERROR CLASS: Type arguments not allowed for type parameters>>|>()
}
public final fun <T> bar(): R|kotlin/Unit| {
}
@@ -43,9 +43,9 @@ FILE: typeArgumentsNotAllowed.kt
public final fun <G> gest(): R|kotlin/Unit| {
}
public final fun <T> fest(): R|kotlin/Unit| {
lval b: R|kotlin/collections/List<ERROR CLASS: Type arguments not allowed>|
R|rest/gest<Inapplicable(INAPPLICABLE): rest/gest>#|<<ERROR TYPE REF: Type arguments not allowed>>()
lval b: R|kotlin/collections/List<ERROR CLASS: Type arguments not allowed for type parameters>|
R|rest/gest<Inapplicable(INAPPLICABLE): rest/gest>#|<<ERROR TYPE REF: Type arguments not allowed for type parameters>>()
R|rest/gest|<R|T|>()
lval c: R|kotlin/collections/List<kotlin/collections/List<kotlin/collections/List<ERROR CLASS: Type arguments not allowed>>>|
R|rest/gest|<R|kotlin/collections/List<kotlin/collections/List<ERROR CLASS: Type arguments not allowed>>|>()
lval c: R|kotlin/collections/List<kotlin/collections/List<kotlin/collections/List<ERROR CLASS: Type arguments not allowed for type parameters>>>|
R|rest/gest|<R|kotlin/collections/List<kotlin/collections/List<ERROR CLASS: Type arguments not allowed for type parameters>>|>()
}
@@ -52,7 +52,7 @@ fun f4() {
receiver.hello1
receiver.<!EXPLICIT_TYPE_ARGUMENTS_IN_PROPERTY_ACCESS!>hello1<!><Int>
receiver.hello1<Int, String>() // legal `String.invoke` call
receiver.<!TYPE_ARGUMENTS_NOT_ALLOWED!>hello1<!><Int, String>()
receiver.<!EXPLICIT_TYPE_ARGUMENTS_IN_PROPERTY_ACCESS!>hello1<!><String>
receiver.<!EXPLICIT_TYPE_ARGUMENTS_IN_PROPERTY_ACCESS!>hello1<!><Int, String>
receiver.<!EXPLICIT_TYPE_ARGUMENTS_IN_PROPERTY_ACCESS!>hello1<!><Int, String, String>
@@ -60,14 +60,14 @@ fun f4() {
with (ContextImpl<String>()) {
hello2
<!EXPLICIT_TYPE_ARGUMENTS_IN_PROPERTY_ACCESS!>hello2<!><String>
hello2<String, Int>() // legal `String.invoke` call
<!TYPE_ARGUMENTS_NOT_ALLOWED!>hello2<!><String, Int>()
<!EXPLICIT_TYPE_ARGUMENTS_IN_PROPERTY_ACCESS!>hello2<!><Int>
<!EXPLICIT_TYPE_ARGUMENTS_IN_PROPERTY_ACCESS!>hello2<!><String, Int>
<!EXPLICIT_TYPE_ARGUMENTS_IN_PROPERTY_ACCESS!>hello2<!><String, Int, Int>
receiver.hello3
receiver.<!EXPLICIT_TYPE_ARGUMENTS_IN_PROPERTY_ACCESS!>hello3<!><Int, String>
receiver.hello3<Int, String>() // legal `String.invoke` call
receiver.<!TYPE_ARGUMENTS_NOT_ALLOWED!>hello3<!><Int, String>()
receiver.<!EXPLICIT_TYPE_ARGUMENTS_IN_PROPERTY_ACCESS!>hello3<!><String, Int>
receiver.<!EXPLICIT_TYPE_ARGUMENTS_IN_PROPERTY_ACCESS!>hello3<!><Int>
receiver.<!EXPLICIT_TYPE_ARGUMENTS_IN_PROPERTY_ACCESS!>hello3<!><Int, String, String>