[Analysis API] optimize scope members processing when a candidate name set is known
Use KtScope.getCallableSymbols/getClassifier symbols overloads which accept a candidate name set. ^KT-58653
This commit is contained in:
committed by
Space Team
parent
29be88e3c9
commit
41976a2932
+1
-1
@@ -197,7 +197,7 @@ internal open class SymbolLightClassForClassOrObject : SymbolLightClassForNamedC
|
||||
// Compiler will generate 'equals/hashCode/toString' for data class if they are not final.
|
||||
// We want to mimic that.
|
||||
val nonFinalFunctionsFromAny = classOrObjectSymbol.getMemberScope()
|
||||
.getCallableSymbols { name -> name.isFromAny }
|
||||
.getCallableSymbols(EQUALS, HASHCODE_NAME, TO_STRING)
|
||||
.filterIsInstance<KtFunctionSymbol>()
|
||||
.filterNot {
|
||||
it.modality == Modality.FINAL || (it.getContainingSymbol() as? KtNamedClassOrObjectSymbol)?.modality == Modality.FINAL
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ internal class SymbolLightClassForInlineClass : SymbolLightClassForClassOrObject
|
||||
?.singleOrNull()
|
||||
|
||||
if (inlineClassParameterSymbol != null) {
|
||||
val propertySymbol = declaredMemberScope.getCallableSymbols { it == inlineClassParameterSymbol.name }
|
||||
val propertySymbol = declaredMemberScope.getCallableSymbols(inlineClassParameterSymbol.name)
|
||||
.singleOrNull { it is KtPropertySymbol && it.isFromPrimaryConstructor } as? KtPropertySymbol
|
||||
|
||||
if (propertySymbol != null) {
|
||||
|
||||
Reference in New Issue
Block a user