[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:
committed by
Space Team
parent
04b9faf9e6
commit
c963eadb44
+12
@@ -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 ->
|
||||
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
`<destruct>`: X
|
||||
+22
@@ -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
|
||||
+8
@@ -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
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
val a: kotlin.Int
|
||||
+17
@@ -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
|
||||
+12
@@ -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) ->
|
||||
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
val a: kotlin.Int
|
||||
+17
@@ -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
|
||||
+8
@@ -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
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
val `<unused var>`: kotlin.Int
|
||||
+17
@@ -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
|
||||
+12
@@ -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) ->
|
||||
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
val `<unused var>`: kotlin.Int
|
||||
+17
@@ -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
|
||||
Reference in New Issue
Block a user