[FIR] Remove FirLambdaArgumentExpression
It's not really necessary if the information about if the lambda was a trailing lambda can be directly saved in FirAnonymousFunctionExpression. Removing the FIR node uncovered a couple of bugs (UNINITIALIZED_ENUM_ENTRY, ERROR_IN_CONTRACT_DESCRIPTION) that were caused by assuming that a lambda is always a trailing lambda. #KT-66124
This commit is contained in:
committed by
Space Team
parent
1a5fa8d3f6
commit
03fc0fd381
+6
@@ -0,0 +1,6 @@
|
||||
fun foo(l1: (Int) -> Unit) {
|
||||
}
|
||||
|
||||
fun test() {
|
||||
<expr>foo label@ {}</expr>
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
KtSuccessCallInfo:
|
||||
call = KtSimpleFunctionCall:
|
||||
isImplicitInvoke = false
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = null
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Unit
|
||||
symbol = /foo(l1: kotlin.Function1<kotlin.Int, kotlin.Unit>): kotlin.Unit
|
||||
valueParameters = [
|
||||
KtVariableLikeSignature:
|
||||
name = l1
|
||||
receiverType = null
|
||||
returnType = kotlin.Function1<kotlin.Int, kotlin.Unit>
|
||||
symbol = l1: kotlin.Function1<kotlin.Int, kotlin.Unit>
|
||||
callableIdIfNonLocal = null
|
||||
]
|
||||
callableIdIfNonLocal = /foo
|
||||
typeArgumentsMapping = {}
|
||||
argumentMapping = {
|
||||
label@ {} -> (KtVariableLikeSignature:
|
||||
name = l1
|
||||
receiverType = null
|
||||
returnType = kotlin.Function1<kotlin.Int, kotlin.Unit>
|
||||
symbol = l1: kotlin.Function1<kotlin.Int, kotlin.Unit>
|
||||
callableIdIfNonLocal = null)
|
||||
}
|
||||
analysis/analysis-api/testData/components/callResolver/resolveCall/labeledLambdaInsideParentheses.kt
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
fun foo() {
|
||||
<expr>bar(2, l@{ it })</expr>
|
||||
}
|
||||
|
||||
fun bar(a: Int, b: (Int) -> Int) {
|
||||
b(a)
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
KtSuccessCallInfo:
|
||||
call = KtSimpleFunctionCall:
|
||||
isImplicitInvoke = false
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = null
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Unit
|
||||
symbol = /bar(a: kotlin.Int, b: kotlin.Function1<kotlin.Int, kotlin.Int>): kotlin.Unit
|
||||
valueParameters = [
|
||||
KtVariableLikeSignature:
|
||||
name = a
|
||||
receiverType = null
|
||||
returnType = kotlin.Int
|
||||
symbol = a: kotlin.Int
|
||||
callableIdIfNonLocal = null,
|
||||
KtVariableLikeSignature:
|
||||
name = b
|
||||
receiverType = null
|
||||
returnType = kotlin.Function1<kotlin.Int, kotlin.Int>
|
||||
symbol = b: kotlin.Function1<kotlin.Int, kotlin.Int>
|
||||
callableIdIfNonLocal = null
|
||||
]
|
||||
callableIdIfNonLocal = /bar
|
||||
typeArgumentsMapping = {}
|
||||
argumentMapping = {
|
||||
2 -> (KtVariableLikeSignature:
|
||||
name = a
|
||||
receiverType = null
|
||||
returnType = kotlin.Int
|
||||
symbol = a: kotlin.Int
|
||||
callableIdIfNonLocal = null),
|
||||
l@{ it } -> (KtVariableLikeSignature:
|
||||
name = b
|
||||
receiverType = null
|
||||
returnType = kotlin.Function1<kotlin.Int, kotlin.Int>
|
||||
symbol = b: kotlin.Function1<kotlin.Int, kotlin.Int>
|
||||
callableIdIfNonLocal = null)
|
||||
}
|
||||
Reference in New Issue
Block a user