[AA FIR] support symbol pointer restore for value parameter from delegated setter
^KT-54051
This commit is contained in:
committed by
Space Team
parent
55ca2d608b
commit
dfc59d5d07
+6
@@ -106,6 +106,12 @@ public class Fe10IdeNormalAnalysisSourceModuleSymbolByPsiTestGenerated extends A
|
|||||||
runTest("analysis/analysis-api/testData/symbols/symbolByPsi/delegateField.kt");
|
runTest("analysis/analysis-api/testData/symbols/symbolByPsi/delegateField.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("delegatedProp.kt")
|
||||||
|
public void testDelegatedProp() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/symbols/symbolByPsi/delegatedProp.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("deprecated.kt")
|
@TestMetadata("deprecated.kt")
|
||||||
public void testDeprecated() throws Exception {
|
public void testDeprecated() throws Exception {
|
||||||
|
|||||||
+2
-2
@@ -26,7 +26,7 @@ internal class KtFirValueParameterSymbolPointer(
|
|||||||
}
|
}
|
||||||
|
|
||||||
val function = ownerSymbol.firSymbol.fir as? FirFunction ?: return null
|
val function = ownerSymbol.firSymbol.fir as? FirFunction ?: return null
|
||||||
val firValueParameterSymbol = function.valueParameters.getOrNull(index)?.takeIf { it.name == name } ?: return null
|
val firValueParameterSymbol = function.valueParameters.getOrNull(index)?.symbol?.takeIf { it.name == name } ?: return null
|
||||||
return analysisSession.firSymbolBuilder.variableLikeBuilder.buildValueParameterSymbol(firValueParameterSymbol.symbol)
|
return analysisSession.firSymbolBuilder.variableLikeBuilder.buildValueParameterSymbol(firValueParameterSymbol)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+6
@@ -106,6 +106,12 @@ public class FirIdeNormalAnalysisSourceModuleSymbolByPsiTestGenerated extends Ab
|
|||||||
runTest("analysis/analysis-api/testData/symbols/symbolByPsi/delegateField.kt");
|
runTest("analysis/analysis-api/testData/symbols/symbolByPsi/delegateField.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("delegatedProp.kt")
|
||||||
|
public void testDelegatedProp() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/symbols/symbolByPsi/delegatedProp.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("deprecated.kt")
|
@TestMetadata("deprecated.kt")
|
||||||
public void testDeprecated() throws Exception {
|
public void testDeprecated() throws Exception {
|
||||||
|
|||||||
+6
@@ -106,6 +106,12 @@ public class FirStandaloneNormalAnalysisSourceModuleSymbolByPsiTestGenerated ext
|
|||||||
runTest("analysis/analysis-api/testData/symbols/symbolByPsi/delegateField.kt");
|
runTest("analysis/analysis-api/testData/symbols/symbolByPsi/delegateField.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("delegatedProp.kt")
|
||||||
|
public void testDelegatedProp() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/symbols/symbolByPsi/delegatedProp.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("deprecated.kt")
|
@TestMetadata("deprecated.kt")
|
||||||
public void testDeprecated() throws Exception {
|
public void testDeprecated() throws Exception {
|
||||||
|
|||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
var delegatedProp: kotlin.String
|
||||||
|
get()
|
||||||
|
set(value: kotlin.String)
|
||||||
+110
@@ -0,0 +1,110 @@
|
|||||||
|
KtKotlinPropertySymbol:
|
||||||
|
annotationsList: []
|
||||||
|
callableIdIfNonLocal: /delegatedProp
|
||||||
|
contextReceivers: []
|
||||||
|
getter: KtPropertyGetterSymbol:
|
||||||
|
annotationsList: []
|
||||||
|
callableIdIfNonLocal: null
|
||||||
|
contextReceivers: []
|
||||||
|
hasBody: false
|
||||||
|
hasStableParameterNames: true
|
||||||
|
isDefault: true
|
||||||
|
isExtension: false
|
||||||
|
isInline: false
|
||||||
|
isOverride: false
|
||||||
|
modality: FINAL
|
||||||
|
origin: SOURCE
|
||||||
|
receiverParameter: null
|
||||||
|
returnType: kotlin/String
|
||||||
|
symbolKind: ACCESSOR
|
||||||
|
typeParameters: []
|
||||||
|
valueParameters: []
|
||||||
|
visibility: Public
|
||||||
|
getContainingModule: KtSourceModule "Sources of main"
|
||||||
|
deprecationStatus: null
|
||||||
|
hasBackingField: false
|
||||||
|
hasGetter: true
|
||||||
|
hasSetter: true
|
||||||
|
initializer: null
|
||||||
|
isConst: false
|
||||||
|
isDelegatedProperty: true
|
||||||
|
isExtension: false
|
||||||
|
isFromPrimaryConstructor: false
|
||||||
|
isLateInit: false
|
||||||
|
isOverride: false
|
||||||
|
isStatic: false
|
||||||
|
isVal: false
|
||||||
|
modality: FINAL
|
||||||
|
name: delegatedProp
|
||||||
|
origin: SOURCE
|
||||||
|
receiverParameter: null
|
||||||
|
returnType: kotlin/String
|
||||||
|
setter: KtPropertySetterSymbol:
|
||||||
|
annotationsList: []
|
||||||
|
callableIdIfNonLocal: null
|
||||||
|
contextReceivers: []
|
||||||
|
hasBody: false
|
||||||
|
hasStableParameterNames: true
|
||||||
|
isDefault: true
|
||||||
|
isExtension: false
|
||||||
|
isInline: false
|
||||||
|
isOverride: false
|
||||||
|
modality: FINAL
|
||||||
|
origin: SOURCE
|
||||||
|
parameter: KtValueParameterSymbol:
|
||||||
|
annotationsList: []
|
||||||
|
callableIdIfNonLocal: null
|
||||||
|
contextReceivers: []
|
||||||
|
generatedPrimaryConstructorProperty: null
|
||||||
|
hasDefaultValue: false
|
||||||
|
isCrossinline: false
|
||||||
|
isExtension: false
|
||||||
|
isImplicitLambdaParameter: false
|
||||||
|
isNoinline: false
|
||||||
|
isVararg: false
|
||||||
|
name: value
|
||||||
|
origin: SOURCE
|
||||||
|
receiverParameter: null
|
||||||
|
returnType: kotlin/String
|
||||||
|
symbolKind: LOCAL
|
||||||
|
typeParameters: []
|
||||||
|
getContainingModule: KtSourceModule "Sources of main"
|
||||||
|
deprecationStatus: null
|
||||||
|
receiverParameter: null
|
||||||
|
returnType: kotlin/Unit
|
||||||
|
symbolKind: ACCESSOR
|
||||||
|
typeParameters: []
|
||||||
|
valueParameters: [
|
||||||
|
KtValueParameterSymbol:
|
||||||
|
annotationsList: []
|
||||||
|
callableIdIfNonLocal: null
|
||||||
|
contextReceivers: []
|
||||||
|
generatedPrimaryConstructorProperty: null
|
||||||
|
hasDefaultValue: false
|
||||||
|
isCrossinline: false
|
||||||
|
isExtension: false
|
||||||
|
isImplicitLambdaParameter: false
|
||||||
|
isNoinline: false
|
||||||
|
isVararg: false
|
||||||
|
name: value
|
||||||
|
origin: SOURCE
|
||||||
|
receiverParameter: null
|
||||||
|
returnType: kotlin/String
|
||||||
|
symbolKind: LOCAL
|
||||||
|
typeParameters: []
|
||||||
|
getContainingModule: KtSourceModule "Sources of main"
|
||||||
|
deprecationStatus: null
|
||||||
|
]
|
||||||
|
visibility: Public
|
||||||
|
getContainingModule: Could not render due to kotlin.NotImplementedError: An operation is not implemented: org.jetbrains.kotlin.analysis.api.descriptors.symbols.psiBased.KtFe10PsiDefaultPropertySetterSymbol
|
||||||
|
|
||||||
|
deprecationStatus: null
|
||||||
|
symbolKind: TOP_LEVEL
|
||||||
|
typeParameters: []
|
||||||
|
visibility: Public
|
||||||
|
getContainingModule: KtSourceModule "Sources of main"
|
||||||
|
deprecationStatus: null
|
||||||
|
getterDeprecationStatus: null
|
||||||
|
javaGetterName: getDelegatedProp
|
||||||
|
javaSetterName: setDelegatedProp
|
||||||
|
setterDeprecationStatus: null
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
// WITH_STDLIB
|
||||||
|
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K1
|
||||||
|
var delegatedProp: String by Delegate()
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
var delegatedProp: kotlin.String
|
||||||
|
get()
|
||||||
|
set(delegatedProp: kotlin.String)
|
||||||
@@ -0,0 +1,109 @@
|
|||||||
|
KtKotlinPropertySymbol:
|
||||||
|
annotationsList: []
|
||||||
|
callableIdIfNonLocal: /delegatedProp
|
||||||
|
contextReceivers: []
|
||||||
|
getter: KtPropertyGetterSymbol:
|
||||||
|
annotationsList: []
|
||||||
|
callableIdIfNonLocal: null
|
||||||
|
contextReceivers: []
|
||||||
|
hasBody: true
|
||||||
|
hasStableParameterNames: true
|
||||||
|
isDefault: false
|
||||||
|
isExtension: false
|
||||||
|
isInline: false
|
||||||
|
isOverride: false
|
||||||
|
modality: FINAL
|
||||||
|
origin: SOURCE
|
||||||
|
receiverParameter: null
|
||||||
|
returnType: kotlin/String
|
||||||
|
symbolKind: ACCESSOR
|
||||||
|
typeParameters: []
|
||||||
|
valueParameters: []
|
||||||
|
visibility: Public
|
||||||
|
getContainingModule: KtSourceModule "Sources of main"
|
||||||
|
deprecationStatus: null
|
||||||
|
hasBackingField: false
|
||||||
|
hasGetter: true
|
||||||
|
hasSetter: true
|
||||||
|
initializer: null
|
||||||
|
isConst: false
|
||||||
|
isDelegatedProperty: true
|
||||||
|
isExtension: false
|
||||||
|
isFromPrimaryConstructor: false
|
||||||
|
isLateInit: false
|
||||||
|
isOverride: false
|
||||||
|
isStatic: false
|
||||||
|
isVal: false
|
||||||
|
modality: FINAL
|
||||||
|
name: delegatedProp
|
||||||
|
origin: SOURCE
|
||||||
|
receiverParameter: null
|
||||||
|
returnType: kotlin/String
|
||||||
|
setter: KtPropertySetterSymbol:
|
||||||
|
annotationsList: []
|
||||||
|
callableIdIfNonLocal: null
|
||||||
|
contextReceivers: []
|
||||||
|
hasBody: true
|
||||||
|
hasStableParameterNames: true
|
||||||
|
isDefault: false
|
||||||
|
isExtension: false
|
||||||
|
isInline: false
|
||||||
|
isOverride: false
|
||||||
|
modality: FINAL
|
||||||
|
origin: SOURCE
|
||||||
|
parameter: KtValueParameterSymbol:
|
||||||
|
annotationsList: []
|
||||||
|
callableIdIfNonLocal: null
|
||||||
|
contextReceivers: []
|
||||||
|
generatedPrimaryConstructorProperty: null
|
||||||
|
hasDefaultValue: false
|
||||||
|
isCrossinline: false
|
||||||
|
isExtension: false
|
||||||
|
isImplicitLambdaParameter: false
|
||||||
|
isNoinline: false
|
||||||
|
isVararg: false
|
||||||
|
name: delegatedProp
|
||||||
|
origin: SOURCE
|
||||||
|
receiverParameter: null
|
||||||
|
returnType: kotlin/String
|
||||||
|
symbolKind: LOCAL
|
||||||
|
typeParameters: []
|
||||||
|
getContainingModule: KtSourceModule "Sources of main"
|
||||||
|
deprecationStatus: null
|
||||||
|
receiverParameter: null
|
||||||
|
returnType: kotlin/Unit
|
||||||
|
symbolKind: ACCESSOR
|
||||||
|
typeParameters: []
|
||||||
|
valueParameters: [
|
||||||
|
KtValueParameterSymbol:
|
||||||
|
annotationsList: []
|
||||||
|
callableIdIfNonLocal: null
|
||||||
|
contextReceivers: []
|
||||||
|
generatedPrimaryConstructorProperty: null
|
||||||
|
hasDefaultValue: false
|
||||||
|
isCrossinline: false
|
||||||
|
isExtension: false
|
||||||
|
isImplicitLambdaParameter: false
|
||||||
|
isNoinline: false
|
||||||
|
isVararg: false
|
||||||
|
name: delegatedProp
|
||||||
|
origin: SOURCE
|
||||||
|
receiverParameter: null
|
||||||
|
returnType: kotlin/String
|
||||||
|
symbolKind: LOCAL
|
||||||
|
typeParameters: []
|
||||||
|
getContainingModule: KtSourceModule "Sources of main"
|
||||||
|
deprecationStatus: null
|
||||||
|
]
|
||||||
|
visibility: Public
|
||||||
|
getContainingModule: KtSourceModule "Sources of main"
|
||||||
|
deprecationStatus: null
|
||||||
|
symbolKind: TOP_LEVEL
|
||||||
|
typeParameters: []
|
||||||
|
visibility: Public
|
||||||
|
getContainingModule: KtSourceModule "Sources of main"
|
||||||
|
deprecationStatus: null
|
||||||
|
getterDeprecationStatus: null
|
||||||
|
javaGetterName: getDelegatedProp
|
||||||
|
javaSetterName: setDelegatedProp
|
||||||
|
setterDeprecationStatus: null
|
||||||
Reference in New Issue
Block a user