[Analysis API FIR] fix KtSymbol creation for _ destructuring parameter

We need to have a corresponding declaration in the FIR tree,
so we can create a symbol for it

^KT-60904 fixed
^KT-60904 fixed
This commit is contained in:
Ilya Kirillov
2023-08-15 18:52:46 +02:00
committed by Space Team
parent 04b9faf9e6
commit c963eadb44
36 changed files with 431 additions and 11 deletions
@@ -0,0 +1,12 @@
// LOOK_UP_FOR_ELEMENT_OF_TYPE: KtParameter
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
data class X(val a: Int, val b: Int)
fun x(action: (X, Int) -> Unit) {}
fun main() {
x { <expr>(a, b)</expr>, i ->
}
}
@@ -0,0 +1,22 @@
KtValueParameterSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
generatedPrimaryConstructorProperty: null
hasDefaultValue: false
isCrossinline: false
isExtension: false
isImplicitLambdaParameter: false
isNoinline: false
isVararg: false
name: <destruct>
origin: SOURCE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: X
symbolKind: LOCAL
typeParameters: []
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
@@ -0,0 +1,8 @@
// LOOK_UP_FOR_ELEMENT_OF_TYPE: KtDestructuringDeclarationEntry
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
data class X(val a: Int, val b: Int)
fun main(x: X) {
val (<expr>a</expr>, b) = x
}
@@ -0,0 +1,17 @@
KtLocalVariableSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
isExtension: false
isVal: true
name: a
origin: SOURCE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Int
symbolKind: LOCAL
typeParameters: []
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
@@ -0,0 +1,12 @@
// LOOK_UP_FOR_ELEMENT_OF_TYPE: KtDestructuringDeclarationEntry
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
data class X(val a: Int, val b: Int)
fun x(action: (X) -> Unit) {}
fun main() {
x { (<expr>a</expr>, b) ->
}
}
@@ -0,0 +1,17 @@
KtLocalVariableSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
isExtension: false
isVal: true
name: a
origin: SOURCE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Int
symbolKind: LOCAL
typeParameters: []
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
@@ -0,0 +1,8 @@
// LOOK_UP_FOR_ELEMENT_OF_TYPE: KtDestructuringDeclarationEntry
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
data class X(val a: Int, val b: Int)
fun main(x: X) {
val (<expr>_</expr>, b) = x
}
@@ -0,0 +1,17 @@
KtLocalVariableSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
isExtension: false
isVal: true
name: <unused var>
origin: SOURCE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Int
symbolKind: LOCAL
typeParameters: []
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
@@ -0,0 +1,12 @@
// LOOK_UP_FOR_ELEMENT_OF_TYPE: KtDestructuringDeclarationEntry
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
data class X(val a: Int, val b: Int)
fun x(action: (X) -> Unit) {}
fun main() {
x { (<expr>_</expr>, b) ->
}
}
@@ -0,0 +1,17 @@
KtLocalVariableSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
isExtension: false
isVal: true
name: <unused var>
origin: SOURCE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Int
symbolKind: LOCAL
typeParameters: []
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null