[FIR] Remove FirJsSyntheticNamesProvider and FirNativeSyntheticNamesProvider.kt
This commit is contained in:
+1
-1
@@ -15,4 +15,4 @@ abstract class FirSyntheticNamesProvider : FirSessionComponent {
|
||||
abstract fun possiblePropertyNamesByAccessorName(name: Name): List<Name>
|
||||
}
|
||||
|
||||
val FirSession.syntheticNamesProvider: FirSyntheticNamesProvider by FirSession.sessionComponentAccessor()
|
||||
val FirSession.syntheticNamesProvider: FirSyntheticNamesProvider? by FirSession.nullableSessionComponentAccessor()
|
||||
|
||||
@@ -44,11 +44,23 @@ class FirSyntheticFunctionSymbol(
|
||||
callableId: CallableId
|
||||
) : FirNamedFunctionSymbol(callableId), SyntheticSymbol
|
||||
|
||||
class FirSyntheticPropertiesScope(
|
||||
class FirSyntheticPropertiesScope private constructor(
|
||||
val session: FirSession,
|
||||
private val baseScope: FirTypeScope
|
||||
private val baseScope: FirTypeScope,
|
||||
private val syntheticNamesProvider: FirSyntheticNamesProvider
|
||||
) : FirContainingNamesAwareScope() {
|
||||
private val syntheticNamesProvider = session.syntheticNamesProvider
|
||||
companion object {
|
||||
fun createIfSyntheticNamesProviderIsDefined(
|
||||
session: FirSession,
|
||||
baseScope: FirTypeScope
|
||||
): FirSyntheticPropertiesScope? {
|
||||
val syntheticNamesProvider = session.syntheticNamesProvider
|
||||
return if (syntheticNamesProvider != null)
|
||||
FirSyntheticPropertiesScope(session, baseScope, syntheticNamesProvider)
|
||||
else
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
override fun processPropertiesByName(name: Name, processor: (FirVariableSymbol<*>) -> Unit) {
|
||||
val getterNames = syntheticNamesProvider.possibleGetterNamesByPropertyName(name)
|
||||
|
||||
+2
-2
@@ -105,8 +105,8 @@ class MemberScopeTowerLevel(
|
||||
}
|
||||
|
||||
if (givenExtensionReceiverOptions.isEmpty()) {
|
||||
val withSynthetic = FirSyntheticPropertiesScope(session, scope)
|
||||
withSynthetic.processScopeMembers { symbol ->
|
||||
val withSynthetic = FirSyntheticPropertiesScope.createIfSyntheticNamesProviderIsDefined(session, scope)
|
||||
withSynthetic?.processScopeMembers { symbol ->
|
||||
empty = false
|
||||
output.consumeCandidate(symbol, dispatchReceiverValue, givenExtensionReceiverOptions = emptyList(), scope)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user