[FIR] Set source on callee reference of implicit invoke receiver

This fixes an IllegalArgumentException when a diagnostic was reported on
it because no source was set.

#KT-61829 Fixed
This commit is contained in:
Kirill Rakhman
2023-09-13 12:08:36 +02:00
committed by Space Team
parent a224f9db34
commit ce65d3c7b8
7 changed files with 45 additions and 2 deletions
@@ -0,0 +1,13 @@
FILE: incorrectGenericLambdaProperty.kt
public final fun main(args: R|kotlin/Array<kotlin/String>|): R|kotlin/Unit| {
lval <T> passIt: R|(ERROR CLASS: No type for parameter) -> ERROR CLASS: Symbol not found for T| = fun <anonymous>(<destruct>: <ERROR TYPE REF: No type for parameter>): <ERROR TYPE REF: Symbol not found for T> <inline=Unknown> {
lval t: <ERROR TYPE REF: Symbol not found for T> = R|<local>/<destruct>|.<Unresolved name: component1>#()
^ {
R|<local>/t|
}
}
R|<local>/passIt<CS errors: <local>/passIt>#|<<ERROR TYPE REF: Cannot infer argument for type parameter T>>.R|SubstitutionOverride<kotlin/Function1.invoke: <ERROR TYPE REF: Symbol not found for T>><Inapplicable(INAPPLICABLE): kotlin/Function1.invoke>#|<R|kotlin/Int|>(Int(1))
R|<local>/passIt<CS errors: <local>/passIt>#|<<ERROR TYPE REF: Cannot infer argument for type parameter T>>.R|SubstitutionOverride<kotlin/Function1.invoke: <ERROR TYPE REF: Symbol not found for T>>|(Int(1))
}
@@ -0,0 +1,5 @@
fun main(args: Array<String>) {
val <!LOCAL_VARIABLE_WITH_TYPE_PARAMETERS!><T><!> passIt = { <!COMPONENT_FUNCTION_MISSING, VALUE_PARAMETER_WITH_NO_TYPE_ANNOTATION!>(t: <!UNRESOLVED_REFERENCE!>T<!>)<!> -> t }
<!INAPPLICABLE_CANDIDATE, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>passIt<!><Int>(1)
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>passIt<!>(1)
}