[AA] Add synthetic properties scopes to scope context for position
This commit is contained in:
committed by
teamcity
parent
5d8e23e971
commit
116de97f54
+65
-15
@@ -45,6 +45,7 @@ import org.jetbrains.kotlin.fir.scopes.impl.*
|
|||||||
import org.jetbrains.kotlin.fir.symbols.impl.*
|
import org.jetbrains.kotlin.fir.symbols.impl.*
|
||||||
import org.jetbrains.kotlin.fir.symbols.lazyResolveToPhase
|
import org.jetbrains.kotlin.fir.symbols.lazyResolveToPhase
|
||||||
import org.jetbrains.kotlin.fir.symbols.lazyResolveToPhaseWithCallableMembers
|
import org.jetbrains.kotlin.fir.symbols.lazyResolveToPhaseWithCallableMembers
|
||||||
|
import org.jetbrains.kotlin.fir.types.ConeKotlinType
|
||||||
import org.jetbrains.kotlin.name.FqName
|
import org.jetbrains.kotlin.name.FqName
|
||||||
import org.jetbrains.kotlin.name.Name
|
import org.jetbrains.kotlin.name.Name
|
||||||
import org.jetbrains.kotlin.psi.KtElement
|
import org.jetbrains.kotlin.psi.KtElement
|
||||||
@@ -160,16 +161,17 @@ internal class KtFirScopeProvider(
|
|||||||
return KtCompositeScope.create(subScopes, token)
|
return KtCompositeScope.create(subScopes, token)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getTypeScope(type: KtType): KtTypeScope? = getFirTypeScope(type)?.let { convertToKtTypeScope(it) }
|
override fun getTypeScope(type: KtType): KtTypeScope? {
|
||||||
|
check(type is KtFirType) { "KtFirScopeProvider can only work with KtFirType, but ${type::class} was provided" }
|
||||||
|
return getFirTypeScope(type)
|
||||||
|
?.withSyntheticPropertiesScopeOrSelf(type.coneType)
|
||||||
|
?.let { convertToKtTypeScope(it) }
|
||||||
|
}
|
||||||
|
|
||||||
override fun getSyntheticJavaPropertiesScope(type: KtType): KtTypeScope? {
|
override fun getSyntheticJavaPropertiesScope(type: KtType): KtTypeScope? {
|
||||||
check(type is KtFirType) { "KtFirScopeProvider can only work with KtFirType, but ${type::class} was provided" }
|
check(type is KtFirType) { "KtFirScopeProvider can only work with KtFirType, but ${type::class} was provided" }
|
||||||
val firTypeScope = getFirTypeScope(type) ?: return null
|
val typeScope = getFirTypeScope(type) ?: return null
|
||||||
return FirSyntheticPropertiesScope.createIfSyntheticNamesProviderIsDefined(
|
return getFirSyntheticPropertiesScope(type.coneType, typeScope)?.let { convertToKtTypeScope(it) }
|
||||||
firResolveSession.useSiteFirSession,
|
|
||||||
type.coneType,
|
|
||||||
firTypeScope
|
|
||||||
)?.let { convertToKtTypeScope(it) }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getImportingScopeContext(file: KtFile): KtScopeContext {
|
override fun getImportingScopeContext(file: KtFile): KtScopeContext {
|
||||||
@@ -209,7 +211,9 @@ internal class KtFirScopeProvider(
|
|||||||
}
|
}
|
||||||
|
|
||||||
val firScopes = towerDataElementsIndexed.flatMap { (index, towerDataElement) ->
|
val firScopes = towerDataElementsIndexed.flatMap { (index, towerDataElement) ->
|
||||||
val availableScopes = towerDataElement.getAvailableScopes().flatMap { flattenFirScope(it) }
|
val availableScopes = towerDataElement
|
||||||
|
.getAvailableScopes { coneType -> withSyntheticPropertiesScopeOrSelf(coneType) }
|
||||||
|
.flatMap { flattenFirScope(it) }
|
||||||
availableScopes.map { IndexedValue(index, it) }
|
availableScopes.map { IndexedValue(index, it) }
|
||||||
}
|
}
|
||||||
val ktScopesWithKinds = createScopesWithKind(firScopes)
|
val ktScopesWithKinds = createScopesWithKind(firScopes)
|
||||||
@@ -245,7 +249,7 @@ internal class KtFirScopeProvider(
|
|||||||
is FirNameAwareOnlyClassifiersScope -> getScopeKind(firScope.delegate, indexInTower)
|
is FirNameAwareOnlyClassifiersScope -> getScopeKind(firScope.delegate, indexInTower)
|
||||||
|
|
||||||
is FirLocalScope -> KtScopeKind.LocalScope(indexInTower)
|
is FirLocalScope -> KtScopeKind.LocalScope(indexInTower)
|
||||||
is FirTypeScope -> KtScopeKind.SimpleTypeScope(indexInTower)
|
is FirTypeScope -> KtScopeKind.TypeScope(indexInTower)
|
||||||
is FirTypeParameterScope -> KtScopeKind.TypeParameterScope(indexInTower)
|
is FirTypeParameterScope -> KtScopeKind.TypeParameterScope(indexInTower)
|
||||||
is FirPackageMemberScope -> KtScopeKind.PackageMemberScope(indexInTower)
|
is FirPackageMemberScope -> KtScopeKind.PackageMemberScope(indexInTower)
|
||||||
|
|
||||||
@@ -275,14 +279,23 @@ internal class KtFirScopeProvider(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getFirTypeScope(type: KtType): FirTypeScope? {
|
private fun getFirTypeScope(type: KtFirType): FirTypeScope? = type.coneType.scope(
|
||||||
check(type is KtFirType) { "KtFirScopeProvider can only work with KtFirType, but ${type::class} was provided" }
|
firResolveSession.useSiteFirSession,
|
||||||
return type.coneType.scope(
|
getScopeSession(),
|
||||||
|
FakeOverrideTypeCalculator.Forced,
|
||||||
|
requiredMembersPhase = FirResolvePhase.STATUS,
|
||||||
|
)
|
||||||
|
|
||||||
|
private fun getFirSyntheticPropertiesScope(coneType: ConeKotlinType, typeScope: FirTypeScope): FirSyntheticPropertiesScope? =
|
||||||
|
FirSyntheticPropertiesScope.createIfSyntheticNamesProviderIsDefined(
|
||||||
firResolveSession.useSiteFirSession,
|
firResolveSession.useSiteFirSession,
|
||||||
getScopeSession(),
|
coneType,
|
||||||
FakeOverrideTypeCalculator.Forced,
|
typeScope
|
||||||
requiredMembersPhase = FirResolvePhase.STATUS,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
private fun FirTypeScope.withSyntheticPropertiesScopeOrSelf(coneType: ConeKotlinType): FirTypeScope {
|
||||||
|
val syntheticPropertiesScope = getFirSyntheticPropertiesScope(coneType, this) ?: return this
|
||||||
|
return FirTypeScopeWithSyntheticProperties(typeScope = this, syntheticPropertiesScope)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun buildJavaEnhancementDeclaredMemberScope(
|
private fun buildJavaEnhancementDeclaredMemberScope(
|
||||||
@@ -310,6 +323,43 @@ internal class KtFirScopeProvider(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class FirTypeScopeWithSyntheticProperties(
|
||||||
|
val typeScope: FirTypeScope,
|
||||||
|
val syntheticPropertiesScope: FirSyntheticPropertiesScope,
|
||||||
|
) : FirTypeScope() {
|
||||||
|
override fun getCallableNames(): Set<Name> = typeScope.getCallableNames() + syntheticPropertiesScope.getCallableNames()
|
||||||
|
override fun getClassifierNames(): Set<Name> = typeScope.getClassifierNames()
|
||||||
|
override fun mayContainName(name: Name): Boolean = typeScope.mayContainName(name) || syntheticPropertiesScope.mayContainName(name)
|
||||||
|
override val scopeOwnerLookupNames: List<String> get() = typeScope.scopeOwnerLookupNames
|
||||||
|
|
||||||
|
override fun processDirectOverriddenFunctionsWithBaseScope(
|
||||||
|
functionSymbol: FirNamedFunctionSymbol,
|
||||||
|
processor: (FirNamedFunctionSymbol, FirTypeScope) -> ProcessorAction,
|
||||||
|
): ProcessorAction = typeScope.processDirectOverriddenFunctionsWithBaseScope(functionSymbol, processor)
|
||||||
|
|
||||||
|
override fun processDirectOverriddenPropertiesWithBaseScope(
|
||||||
|
propertySymbol: FirPropertySymbol,
|
||||||
|
processor: (FirPropertySymbol, FirTypeScope) -> ProcessorAction,
|
||||||
|
): ProcessorAction = typeScope.processDirectOverriddenPropertiesWithBaseScope(propertySymbol, processor)
|
||||||
|
|
||||||
|
override fun processClassifiersByNameWithSubstitution(name: Name, processor: (FirClassifierSymbol<*>, ConeSubstitutor) -> Unit) {
|
||||||
|
typeScope.processClassifiersByNameWithSubstitution(name, processor)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun processFunctionsByName(name: Name, processor: (FirNamedFunctionSymbol) -> Unit) {
|
||||||
|
typeScope.processFunctionsByName(name, processor)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun processPropertiesByName(name: Name, processor: (FirVariableSymbol<*>) -> Unit) {
|
||||||
|
typeScope.processPropertiesByName(name, processor)
|
||||||
|
syntheticPropertiesScope.processPropertiesByName(name, processor)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun processDeclaredConstructors(processor: (FirConstructorSymbol) -> Unit) {
|
||||||
|
typeScope.processDeclaredConstructors(processor)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private class EnumEntryContainingNamesAwareScope(private val originalScope: FirContainingNamesAwareScope) : FirContainingNamesAwareScope() {
|
private class EnumEntryContainingNamesAwareScope(private val originalScope: FirContainingNamesAwareScope) : FirContainingNamesAwareScope() {
|
||||||
override fun getCallableNames(): Set<Name> = originalScope.getCallableNames()
|
override fun getCallableNames(): Set<Name> = originalScope.getCallableNames()
|
||||||
override fun getClassifierNames(): Set<Name> = originalScope.getClassifierNames()
|
override fun getClassifierNames(): Set<Name> = originalScope.getClassifierNames()
|
||||||
|
|||||||
+6
@@ -75,4 +75,10 @@ public class FirIdeDependentAnalysisSourceModuleScopeContextForPositionTestGener
|
|||||||
public void testSimpleScopeContextForPosition() throws Exception {
|
public void testSimpleScopeContextForPosition() throws Exception {
|
||||||
runTest("analysis/analysis-api/testData/components/scopeProvider/scopeContextForPosition/simpleScopeContextForPosition.kt");
|
runTest("analysis/analysis-api/testData/components/scopeProvider/scopeContextForPosition/simpleScopeContextForPosition.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("syntheticPropertiesScope.kt")
|
||||||
|
public void testSyntheticPropertiesScope() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/scopeProvider/scopeContextForPosition/syntheticPropertiesScope.kt");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+6
@@ -81,4 +81,10 @@ public class FirIdeDependentAnalysisSourceModuleTypeScopeTestGenerated extends A
|
|||||||
public void testTypeParamList() throws Exception {
|
public void testTypeParamList() throws Exception {
|
||||||
runTest("analysis/analysis-api/testData/components/scopeProvider/typeScope/typeParamList.kt");
|
runTest("analysis/analysis-api/testData/components/scopeProvider/typeScope/typeParamList.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("typeWithSyntheticProperties.kt")
|
||||||
|
public void testTypeWithSyntheticProperties() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/scopeProvider/typeScope/typeWithSyntheticProperties.kt");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+6
@@ -75,4 +75,10 @@ public class FirIdeNormalAnalysisSourceModuleScopeContextForPositionTestGenerate
|
|||||||
public void testSimpleScopeContextForPosition() throws Exception {
|
public void testSimpleScopeContextForPosition() throws Exception {
|
||||||
runTest("analysis/analysis-api/testData/components/scopeProvider/scopeContextForPosition/simpleScopeContextForPosition.kt");
|
runTest("analysis/analysis-api/testData/components/scopeProvider/scopeContextForPosition/simpleScopeContextForPosition.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("syntheticPropertiesScope.kt")
|
||||||
|
public void testSyntheticPropertiesScope() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/scopeProvider/scopeContextForPosition/syntheticPropertiesScope.kt");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+6
@@ -81,4 +81,10 @@ public class FirIdeNormalAnalysisSourceModuleTypeScopeTestGenerated extends Abst
|
|||||||
public void testTypeParamList() throws Exception {
|
public void testTypeParamList() throws Exception {
|
||||||
runTest("analysis/analysis-api/testData/components/scopeProvider/typeScope/typeParamList.kt");
|
runTest("analysis/analysis-api/testData/components/scopeProvider/typeScope/typeParamList.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("typeWithSyntheticProperties.kt")
|
||||||
|
public void testTypeWithSyntheticProperties() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/scopeProvider/typeScope/typeWithSyntheticProperties.kt");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+6
@@ -75,4 +75,10 @@ public class FirStandaloneNormalAnalysisSourceModuleScopeContextForPositionTestG
|
|||||||
public void testSimpleScopeContextForPosition() throws Exception {
|
public void testSimpleScopeContextForPosition() throws Exception {
|
||||||
runTest("analysis/analysis-api/testData/components/scopeProvider/scopeContextForPosition/simpleScopeContextForPosition.kt");
|
runTest("analysis/analysis-api/testData/components/scopeProvider/scopeContextForPosition/simpleScopeContextForPosition.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("syntheticPropertiesScope.kt")
|
||||||
|
public void testSyntheticPropertiesScope() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/scopeProvider/scopeContextForPosition/syntheticPropertiesScope.kt");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+6
@@ -81,4 +81,10 @@ public class FirStandaloneNormalAnalysisSourceModuleTypeScopeTestGenerated exten
|
|||||||
public void testTypeParamList() throws Exception {
|
public void testTypeParamList() throws Exception {
|
||||||
runTest("analysis/analysis-api/testData/components/scopeProvider/typeScope/typeParamList.kt");
|
runTest("analysis/analysis-api/testData/components/scopeProvider/typeScope/typeParamList.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("typeWithSyntheticProperties.kt")
|
||||||
|
public void testTypeWithSyntheticProperties() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/scopeProvider/typeScope/typeWithSyntheticProperties.kt");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-10
@@ -90,7 +90,7 @@ public interface KtScopeProviderMixIn : KtAnalysisSessionMixIn {
|
|||||||
* Inside the `LIST_KT_ELEMENT.getKtType().getTypeScope()` would contain the `get(i: Int): String` method with substituted type `T = String`
|
* Inside the `LIST_KT_ELEMENT.getKtType().getTypeScope()` would contain the `get(i: Int): String` method with substituted type `T = String`
|
||||||
*
|
*
|
||||||
* @return type scope for the given type if given `KtType` is not error type, `null` otherwise.
|
* @return type scope for the given type if given `KtType` is not error type, `null` otherwise.
|
||||||
* Returned [KtTypeScope] doesn't include synthetic Java properties. To get such properties use [getSyntheticJavaPropertiesScope].
|
* Returned [KtTypeScope] includes synthetic Java properties.
|
||||||
*
|
*
|
||||||
* @see KtTypeScope
|
* @see KtTypeScope
|
||||||
* @see KtTypeProviderMixIn.getKtType
|
* @see KtTypeProviderMixIn.getKtType
|
||||||
@@ -105,11 +105,10 @@ public interface KtScopeProviderMixIn : KtAnalysisSessionMixIn {
|
|||||||
withValidityAssertion { analysisSession.scopeProvider.getSyntheticJavaPropertiesScope(this) }
|
withValidityAssertion { analysisSession.scopeProvider.getSyntheticJavaPropertiesScope(this) }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Scopes in returned [KtScopeContext] don't include synthetic Java properties.
|
|
||||||
* To get such properties use [getSyntheticJavaPropertiesScope].
|
|
||||||
*
|
|
||||||
* For each scope in [KtScopeContext] an index is calculated. The indexes are relative to position, and they are only known for
|
* For each scope in [KtScopeContext] an index is calculated. The indexes are relative to position, and they are only known for
|
||||||
* scopes obtained with [getScopeContextForPosition].
|
* scopes obtained with [getScopeContextForPosition].
|
||||||
|
*
|
||||||
|
* Scopes with [KtScopeKind.TypeScope] include synthetic Java properties.
|
||||||
*/
|
*/
|
||||||
public fun KtFile.getScopeContextForPosition(positionInFakeFile: KtElement): KtScopeContext =
|
public fun KtFile.getScopeContextForPosition(positionInFakeFile: KtElement): KtScopeContext =
|
||||||
withValidityAssertion { analysisSession.scopeProvider.getScopeContextForPosition(this, positionInFakeFile) }
|
withValidityAssertion { analysisSession.scopeProvider.getScopeContextForPosition(this, positionInFakeFile) }
|
||||||
@@ -174,14 +173,10 @@ public sealed class KtScopeKind {
|
|||||||
|
|
||||||
public class LocalScope(override val indexInTower: Int) : KtScopeKind()
|
public class LocalScope(override val indexInTower: Int) : KtScopeKind()
|
||||||
|
|
||||||
public sealed class TypeScope : KtScopeKind()
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents [KtTypeScope], which doesn't include synthetic Java properties of corresponding type.
|
* Represents [KtScope] for type, which include synthetic Java properties of corresponding type.
|
||||||
*/
|
*/
|
||||||
public class SimpleTypeScope(override val indexInTower: Int) : TypeScope()
|
public class TypeScope(override val indexInTower: Int) : KtScopeKind()
|
||||||
|
|
||||||
public class SyntheticJavaPropertiesScope(override val indexInTower: Int) : TypeScope()
|
|
||||||
|
|
||||||
public sealed class NonLocalScope : KtScopeKind()
|
public sealed class NonLocalScope : KtScopeKind()
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ implicit receivers:
|
|||||||
scopes:
|
scopes:
|
||||||
LocalScope, index = 0, empty
|
LocalScope, index = 0, empty
|
||||||
|
|
||||||
SimpleTypeScope, index = 1
|
TypeScope, index = 1
|
||||||
classifiers: 0
|
classifiers: 0
|
||||||
callables: 4
|
callables: 4
|
||||||
fun memberInContext()
|
fun memberInContext()
|
||||||
|
|||||||
Vendored
+1
-1
@@ -9,7 +9,7 @@ implicit receivers:
|
|||||||
scopes:
|
scopes:
|
||||||
LocalScope, index = 0, empty
|
LocalScope, index = 0, empty
|
||||||
|
|
||||||
SimpleTypeScope, index = 1
|
TypeScope, index = 1
|
||||||
classifiers: 0
|
classifiers: 0
|
||||||
callables: 4
|
callables: 4
|
||||||
KtFunctionSymbol:
|
KtFunctionSymbol:
|
||||||
|
|||||||
analysis/analysis-api/testData/components/scopeProvider/scopeContextForPosition/enumEntry.pretty.txt
Vendored
+2
-2
@@ -11,7 +11,7 @@ scopes:
|
|||||||
|
|
||||||
LocalScope, index = 1, empty
|
LocalScope, index = 1, empty
|
||||||
|
|
||||||
SimpleTypeScope, index = 2
|
TypeScope, index = 2
|
||||||
classifiers: 1
|
classifiers: 1
|
||||||
companion object
|
companion object
|
||||||
callables: 11
|
callables: 11
|
||||||
@@ -40,7 +40,7 @@ scopes:
|
|||||||
companion object
|
companion object
|
||||||
callables: 0
|
callables: 0
|
||||||
|
|
||||||
SimpleTypeScope, index = 5
|
TypeScope, index = 5
|
||||||
classifiers: 0
|
classifiers: 0
|
||||||
callables: 3
|
callables: 3
|
||||||
fun equals(other: kotlin.Any?): kotlin.Boolean
|
fun equals(other: kotlin.Any?): kotlin.Boolean
|
||||||
|
|||||||
Vendored
+2
-2
@@ -17,7 +17,7 @@ scopes:
|
|||||||
|
|
||||||
LocalScope, index = 1, empty
|
LocalScope, index = 1, empty
|
||||||
|
|
||||||
SimpleTypeScope, index = 2
|
TypeScope, index = 2
|
||||||
classifiers: 1
|
classifiers: 1
|
||||||
KtNamedClassOrObjectSymbol:
|
KtNamedClassOrObjectSymbol:
|
||||||
annotationsList: []
|
annotationsList: []
|
||||||
@@ -642,7 +642,7 @@ scopes:
|
|||||||
visibility: Public
|
visibility: Public
|
||||||
callables: 0
|
callables: 0
|
||||||
|
|
||||||
SimpleTypeScope, index = 5
|
TypeScope, index = 5
|
||||||
classifiers: 0
|
classifiers: 0
|
||||||
callables: 3
|
callables: 3
|
||||||
KtFunctionSymbol:
|
KtFunctionSymbol:
|
||||||
|
|||||||
analysis/analysis-api/testData/components/scopeProvider/scopeContextForPosition/errorType.pretty.txt
Vendored
+2
-2
@@ -7,13 +7,13 @@ implicit receivers:
|
|||||||
owner symbol: KtFirAnonymousFunctionSymbol
|
owner symbol: KtFirAnonymousFunctionSymbol
|
||||||
|
|
||||||
scopes:
|
scopes:
|
||||||
SimpleTypeScope, index = 0, empty
|
TypeScope, index = 0, empty
|
||||||
|
|
||||||
LocalScope, index = 1, empty
|
LocalScope, index = 1, empty
|
||||||
|
|
||||||
LocalScope, index = 2, empty
|
LocalScope, index = 2, empty
|
||||||
|
|
||||||
SimpleTypeScope, index = 3
|
TypeScope, index = 3
|
||||||
classifiers: 0
|
classifiers: 0
|
||||||
callables: 5
|
callables: 5
|
||||||
fun add(e: T)
|
fun add(e: T)
|
||||||
|
|||||||
Vendored
+2
-2
@@ -16,13 +16,13 @@ implicit receivers:
|
|||||||
owner symbol: KtFirAnonymousFunctionSymbol
|
owner symbol: KtFirAnonymousFunctionSymbol
|
||||||
|
|
||||||
scopes:
|
scopes:
|
||||||
SimpleTypeScope, index = 0, empty
|
TypeScope, index = 0, empty
|
||||||
|
|
||||||
LocalScope, index = 1, empty
|
LocalScope, index = 1, empty
|
||||||
|
|
||||||
LocalScope, index = 2, empty
|
LocalScope, index = 2, empty
|
||||||
|
|
||||||
SimpleTypeScope, index = 3
|
TypeScope, index = 3
|
||||||
classifiers: 0
|
classifiers: 0
|
||||||
callables: 5
|
callables: 5
|
||||||
KtFunctionSymbol:
|
KtFunctionSymbol:
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@ scopes:
|
|||||||
|
|
||||||
LocalScope, index = 1, empty
|
LocalScope, index = 1, empty
|
||||||
|
|
||||||
SimpleTypeScope, index = 2
|
TypeScope, index = 2
|
||||||
classifiers: 0
|
classifiers: 0
|
||||||
callables: 5
|
callables: 5
|
||||||
val propertyInY: kotlin.Int
|
val propertyInY: kotlin.Int
|
||||||
|
|||||||
Vendored
+1
-1
@@ -28,7 +28,7 @@ scopes:
|
|||||||
|
|
||||||
LocalScope, index = 1, empty
|
LocalScope, index = 1, empty
|
||||||
|
|
||||||
SimpleTypeScope, index = 2
|
TypeScope, index = 2
|
||||||
classifiers: 0
|
classifiers: 0
|
||||||
callables: 5
|
callables: 5
|
||||||
KtKotlinPropertySymbol:
|
KtKotlinPropertySymbol:
|
||||||
|
|||||||
+3
-3
@@ -10,7 +10,7 @@ implicit receivers:
|
|||||||
owner symbol: KtFirNamedClassOrObjectSymbol
|
owner symbol: KtFirNamedClassOrObjectSymbol
|
||||||
|
|
||||||
scopes:
|
scopes:
|
||||||
SimpleTypeScope, index = 0
|
TypeScope, index = 0
|
||||||
classifiers: 0
|
classifiers: 0
|
||||||
callables: 4
|
callables: 4
|
||||||
fun memberInA()
|
fun memberInA()
|
||||||
@@ -22,7 +22,7 @@ scopes:
|
|||||||
|
|
||||||
LocalScope, index = 2, empty
|
LocalScope, index = 2, empty
|
||||||
|
|
||||||
SimpleTypeScope, index = 3
|
TypeScope, index = 3
|
||||||
classifiers: 0
|
classifiers: 0
|
||||||
callables: 4
|
callables: 4
|
||||||
fun memberInB()
|
fun memberInB()
|
||||||
@@ -58,7 +58,7 @@ scopes:
|
|||||||
T
|
T
|
||||||
callables: 0
|
callables: 0
|
||||||
|
|
||||||
SimpleTypeScope, index = 10
|
TypeScope, index = 10
|
||||||
classifiers: 2
|
classifiers: 2
|
||||||
class NestedInC
|
class NestedInC
|
||||||
class NestedInJavaClass
|
class NestedInJavaClass
|
||||||
|
|||||||
+3
-3
@@ -19,7 +19,7 @@ implicit receivers:
|
|||||||
owner symbol: KtFirNamedClassOrObjectSymbol
|
owner symbol: KtFirNamedClassOrObjectSymbol
|
||||||
|
|
||||||
scopes:
|
scopes:
|
||||||
SimpleTypeScope, index = 0
|
TypeScope, index = 0
|
||||||
classifiers: 0
|
classifiers: 0
|
||||||
callables: 4
|
callables: 4
|
||||||
KtFunctionSymbol:
|
KtFunctionSymbol:
|
||||||
@@ -156,7 +156,7 @@ scopes:
|
|||||||
|
|
||||||
LocalScope, index = 2, empty
|
LocalScope, index = 2, empty
|
||||||
|
|
||||||
SimpleTypeScope, index = 3
|
TypeScope, index = 3
|
||||||
classifiers: 0
|
classifiers: 0
|
||||||
callables: 4
|
callables: 4
|
||||||
KtFunctionSymbol:
|
KtFunctionSymbol:
|
||||||
@@ -416,7 +416,7 @@ scopes:
|
|||||||
variance: INVARIANT
|
variance: INVARIANT
|
||||||
callables: 0
|
callables: 0
|
||||||
|
|
||||||
SimpleTypeScope, index = 10
|
TypeScope, index = 10
|
||||||
classifiers: 2
|
classifiers: 2
|
||||||
KtNamedClassOrObjectSymbol:
|
KtNamedClassOrObjectSymbol:
|
||||||
annotationsList: []
|
annotationsList: []
|
||||||
|
|||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
// FILE: JavaClass.java
|
||||||
|
public class JavaClass {
|
||||||
|
public Integer getValue() {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: main.kt
|
||||||
|
fun JavaClass.test() {
|
||||||
|
<expr>e</expr>
|
||||||
|
}
|
||||||
+37
@@ -0,0 +1,37 @@
|
|||||||
|
element: e
|
||||||
|
implicit receivers:
|
||||||
|
type: JavaClass
|
||||||
|
owner symbol: KtFirFunctionSymbol
|
||||||
|
|
||||||
|
scopes:
|
||||||
|
LocalScope, index = 0, empty
|
||||||
|
|
||||||
|
TypeScope, index = 1
|
||||||
|
classifiers: 0
|
||||||
|
callables: 5
|
||||||
|
fun getValue(): kotlin.Int?
|
||||||
|
fun equals(other: kotlin.Any?): kotlin.Boolean
|
||||||
|
fun hashCode(): kotlin.Int
|
||||||
|
fun toString(): kotlin.String
|
||||||
|
val value: kotlin.Int?
|
||||||
|
get()
|
||||||
|
|
||||||
|
LocalScope, index = 2, empty
|
||||||
|
|
||||||
|
ExplicitSimpleImportingScope, index = 3, empty
|
||||||
|
|
||||||
|
PackageMemberScope, index = 4
|
||||||
|
classifiers: 0
|
||||||
|
callables: 1
|
||||||
|
fun JavaClass.test()
|
||||||
|
|
||||||
|
DefaultSimpleImportingScope, index = 5
|
||||||
|
|
||||||
|
DefaultSimpleImportingScope, index = 6
|
||||||
|
|
||||||
|
ExplicitStarImportingScope, index = 7, empty
|
||||||
|
|
||||||
|
DefaultSimpleImportingScope, index = 8
|
||||||
|
|
||||||
|
DefaultStarImportingScope, index = 9
|
||||||
|
|
||||||
+243
@@ -0,0 +1,243 @@
|
|||||||
|
element: e
|
||||||
|
implicit receivers:
|
||||||
|
type: KtUsualClassType:
|
||||||
|
annotationsList: []
|
||||||
|
ownTypeArguments: []
|
||||||
|
type: JavaClass
|
||||||
|
owner symbol: KtFirFunctionSymbol
|
||||||
|
|
||||||
|
scopes:
|
||||||
|
LocalScope, index = 0, empty
|
||||||
|
|
||||||
|
TypeScope, index = 1
|
||||||
|
classifiers: 0
|
||||||
|
callables: 5
|
||||||
|
KtFunctionSymbol:
|
||||||
|
annotationsList: []
|
||||||
|
callableIdIfNonLocal: /JavaClass.getValue
|
||||||
|
contextReceivers: []
|
||||||
|
contractEffects: []
|
||||||
|
hasStableParameterNames: false
|
||||||
|
isBuiltinFunctionInvoke: false
|
||||||
|
isExtension: false
|
||||||
|
isExternal: false
|
||||||
|
isInfix: false
|
||||||
|
isInline: false
|
||||||
|
isOperator: false
|
||||||
|
isOverride: false
|
||||||
|
isStatic: false
|
||||||
|
isSuspend: false
|
||||||
|
modality: OPEN
|
||||||
|
name: getValue
|
||||||
|
origin: JAVA
|
||||||
|
receiverParameter: null
|
||||||
|
returnType: KtFlexibleType:
|
||||||
|
annotationsList: []
|
||||||
|
type: kotlin/Int!
|
||||||
|
symbolKind: CLASS_MEMBER
|
||||||
|
typeParameters: []
|
||||||
|
valueParameters: []
|
||||||
|
visibility: Public
|
||||||
|
KtFunctionSymbol:
|
||||||
|
annotationsList: []
|
||||||
|
callableIdIfNonLocal: kotlin/Any.equals
|
||||||
|
contextReceivers: []
|
||||||
|
contractEffects: []
|
||||||
|
hasStableParameterNames: true
|
||||||
|
isBuiltinFunctionInvoke: false
|
||||||
|
isExtension: false
|
||||||
|
isExternal: false
|
||||||
|
isInfix: false
|
||||||
|
isInline: false
|
||||||
|
isOperator: true
|
||||||
|
isOverride: false
|
||||||
|
isStatic: false
|
||||||
|
isSuspend: false
|
||||||
|
modality: OPEN
|
||||||
|
name: equals
|
||||||
|
origin: LIBRARY
|
||||||
|
receiverParameter: null
|
||||||
|
returnType: KtUsualClassType:
|
||||||
|
annotationsList: []
|
||||||
|
ownTypeArguments: []
|
||||||
|
type: kotlin/Boolean
|
||||||
|
symbolKind: CLASS_MEMBER
|
||||||
|
typeParameters: []
|
||||||
|
valueParameters: [
|
||||||
|
KtValueParameterSymbol:
|
||||||
|
annotationsList: []
|
||||||
|
callableIdIfNonLocal: null
|
||||||
|
contextReceivers: []
|
||||||
|
generatedPrimaryConstructorProperty: null
|
||||||
|
hasDefaultValue: false
|
||||||
|
isCrossinline: false
|
||||||
|
isExtension: false
|
||||||
|
isImplicitLambdaParameter: false
|
||||||
|
isNoinline: false
|
||||||
|
isVararg: false
|
||||||
|
name: other
|
||||||
|
origin: LIBRARY
|
||||||
|
receiverParameter: null
|
||||||
|
returnType: KtUsualClassType:
|
||||||
|
annotationsList: []
|
||||||
|
ownTypeArguments: []
|
||||||
|
type: kotlin/Any?
|
||||||
|
symbolKind: LOCAL
|
||||||
|
typeParameters: []
|
||||||
|
]
|
||||||
|
visibility: Public
|
||||||
|
KtFunctionSymbol:
|
||||||
|
annotationsList: []
|
||||||
|
callableIdIfNonLocal: kotlin/Any.hashCode
|
||||||
|
contextReceivers: []
|
||||||
|
contractEffects: []
|
||||||
|
hasStableParameterNames: true
|
||||||
|
isBuiltinFunctionInvoke: false
|
||||||
|
isExtension: false
|
||||||
|
isExternal: false
|
||||||
|
isInfix: false
|
||||||
|
isInline: false
|
||||||
|
isOperator: false
|
||||||
|
isOverride: false
|
||||||
|
isStatic: false
|
||||||
|
isSuspend: false
|
||||||
|
modality: OPEN
|
||||||
|
name: hashCode
|
||||||
|
origin: LIBRARY
|
||||||
|
receiverParameter: null
|
||||||
|
returnType: KtUsualClassType:
|
||||||
|
annotationsList: []
|
||||||
|
ownTypeArguments: []
|
||||||
|
type: kotlin/Int
|
||||||
|
symbolKind: CLASS_MEMBER
|
||||||
|
typeParameters: []
|
||||||
|
valueParameters: []
|
||||||
|
visibility: Public
|
||||||
|
KtFunctionSymbol:
|
||||||
|
annotationsList: []
|
||||||
|
callableIdIfNonLocal: kotlin/Any.toString
|
||||||
|
contextReceivers: []
|
||||||
|
contractEffects: []
|
||||||
|
hasStableParameterNames: true
|
||||||
|
isBuiltinFunctionInvoke: false
|
||||||
|
isExtension: false
|
||||||
|
isExternal: false
|
||||||
|
isInfix: false
|
||||||
|
isInline: false
|
||||||
|
isOperator: false
|
||||||
|
isOverride: false
|
||||||
|
isStatic: false
|
||||||
|
isSuspend: false
|
||||||
|
modality: OPEN
|
||||||
|
name: toString
|
||||||
|
origin: LIBRARY
|
||||||
|
receiverParameter: null
|
||||||
|
returnType: KtUsualClassType:
|
||||||
|
annotationsList: []
|
||||||
|
ownTypeArguments: []
|
||||||
|
type: kotlin/String
|
||||||
|
symbolKind: CLASS_MEMBER
|
||||||
|
typeParameters: []
|
||||||
|
valueParameters: []
|
||||||
|
visibility: Public
|
||||||
|
KtSyntheticJavaPropertySymbol:
|
||||||
|
annotationsList: []
|
||||||
|
backingFieldSymbol: null
|
||||||
|
callableIdIfNonLocal: /JavaClass.value
|
||||||
|
contextReceivers: []
|
||||||
|
getter: KtPropertyGetterSymbol:
|
||||||
|
annotationsList: []
|
||||||
|
callableIdIfNonLocal: /JavaClass.getValue
|
||||||
|
contextReceivers: []
|
||||||
|
hasBody: false
|
||||||
|
hasStableParameterNames: true
|
||||||
|
isDefault: false
|
||||||
|
isExtension: false
|
||||||
|
isInline: false
|
||||||
|
isOverride: false
|
||||||
|
modality: OPEN
|
||||||
|
origin: JAVA_SYNTHETIC_PROPERTY
|
||||||
|
receiverParameter: null
|
||||||
|
returnType: KtFlexibleType:
|
||||||
|
annotationsList: []
|
||||||
|
type: kotlin/Int!
|
||||||
|
symbolKind: ACCESSOR
|
||||||
|
typeParameters: []
|
||||||
|
valueParameters: []
|
||||||
|
visibility: Public
|
||||||
|
hasBackingField: true
|
||||||
|
hasGetter: true
|
||||||
|
hasSetter: false
|
||||||
|
initializer: null
|
||||||
|
isDelegatedProperty: false
|
||||||
|
isExtension: false
|
||||||
|
isFromPrimaryConstructor: false
|
||||||
|
isOverride: false
|
||||||
|
isStatic: false
|
||||||
|
isVal: true
|
||||||
|
javaGetterSymbol: KtFunctionSymbol(/JavaClass.getValue)
|
||||||
|
javaSetterSymbol: null
|
||||||
|
modality: OPEN
|
||||||
|
name: value
|
||||||
|
origin: JAVA_SYNTHETIC_PROPERTY
|
||||||
|
receiverParameter: null
|
||||||
|
returnType: KtFlexibleType:
|
||||||
|
annotationsList: []
|
||||||
|
type: kotlin/Int!
|
||||||
|
setter: null
|
||||||
|
symbolKind: CLASS_MEMBER
|
||||||
|
typeParameters: []
|
||||||
|
visibility: Public
|
||||||
|
|
||||||
|
LocalScope, index = 2, empty
|
||||||
|
|
||||||
|
ExplicitSimpleImportingScope, index = 3, empty
|
||||||
|
|
||||||
|
PackageMemberScope, index = 4
|
||||||
|
classifiers: 0
|
||||||
|
callables: 1
|
||||||
|
KtFunctionSymbol:
|
||||||
|
annotationsList: []
|
||||||
|
callableIdIfNonLocal: /test
|
||||||
|
contextReceivers: []
|
||||||
|
contractEffects: []
|
||||||
|
hasStableParameterNames: true
|
||||||
|
isBuiltinFunctionInvoke: false
|
||||||
|
isExtension: true
|
||||||
|
isExternal: false
|
||||||
|
isInfix: false
|
||||||
|
isInline: false
|
||||||
|
isOperator: false
|
||||||
|
isOverride: false
|
||||||
|
isStatic: false
|
||||||
|
isSuspend: false
|
||||||
|
modality: FINAL
|
||||||
|
name: test
|
||||||
|
origin: SOURCE
|
||||||
|
receiverParameter: KtReceiverParameterSymbol:
|
||||||
|
annotationsList: []
|
||||||
|
origin: SOURCE
|
||||||
|
owningCallableSymbol: KtFunctionSymbol(/test)
|
||||||
|
type: KtUsualClassType:
|
||||||
|
annotationsList: []
|
||||||
|
ownTypeArguments: []
|
||||||
|
type: JavaClass
|
||||||
|
returnType: KtUsualClassType:
|
||||||
|
annotationsList: []
|
||||||
|
ownTypeArguments: []
|
||||||
|
type: kotlin/Unit
|
||||||
|
symbolKind: TOP_LEVEL
|
||||||
|
typeParameters: []
|
||||||
|
valueParameters: []
|
||||||
|
visibility: Public
|
||||||
|
|
||||||
|
DefaultSimpleImportingScope, index = 5
|
||||||
|
|
||||||
|
DefaultSimpleImportingScope, index = 6
|
||||||
|
|
||||||
|
ExplicitStarImportingScope, index = 7, empty
|
||||||
|
|
||||||
|
DefaultSimpleImportingScope, index = 8
|
||||||
|
|
||||||
|
DefaultStarImportingScope, index = 9
|
||||||
|
|
||||||
Vendored
+13
@@ -0,0 +1,13 @@
|
|||||||
|
// FILE: JavaClass.java
|
||||||
|
public class JavaClass {
|
||||||
|
public Integer getValue() {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: main.kt
|
||||||
|
class A : JavaClass()
|
||||||
|
|
||||||
|
fun test(a: A) {
|
||||||
|
<expr>a</expr>
|
||||||
|
}
|
||||||
+15
@@ -0,0 +1,15 @@
|
|||||||
|
KtTypeScope:
|
||||||
|
fun getValue(): kotlin.Int!
|
||||||
|
fun equals(other: kotlin.Any?): kotlin.Boolean
|
||||||
|
fun hashCode(): kotlin.Int
|
||||||
|
fun toString(): kotlin.String
|
||||||
|
val value: kotlin.Int!
|
||||||
|
|
||||||
|
|
||||||
|
Declaration Scope:
|
||||||
|
fun getValue(): kotlin.Int?
|
||||||
|
fun equals(other: kotlin.Any?): kotlin.Boolean
|
||||||
|
fun hashCode(): kotlin.Int
|
||||||
|
fun toString(): kotlin.String
|
||||||
|
val value: kotlin.Int?
|
||||||
|
get()
|
||||||
Vendored
+220
@@ -0,0 +1,220 @@
|
|||||||
|
expression: a
|
||||||
|
KtType: A
|
||||||
|
|
||||||
|
KtTypeScope:
|
||||||
|
KtFunctionLikeSignature:
|
||||||
|
receiverType = null
|
||||||
|
returnType = kotlin.Int!
|
||||||
|
symbol = /JavaClass.getValue(<dispatch receiver>: JavaClass): kotlin.Int!
|
||||||
|
valueParameters = []
|
||||||
|
callableIdIfNonLocal = /JavaClass.getValue
|
||||||
|
KtFunctionLikeSignature:
|
||||||
|
receiverType = null
|
||||||
|
returnType = kotlin.Boolean
|
||||||
|
symbol = kotlin/Any.equals(<dispatch receiver>: kotlin.Any, other: kotlin.Any?): kotlin.Boolean
|
||||||
|
valueParameters = [
|
||||||
|
KtVariableLikeSignature:
|
||||||
|
name = other
|
||||||
|
receiverType = null
|
||||||
|
returnType = kotlin.Any?
|
||||||
|
symbol = other: kotlin.Any?
|
||||||
|
callableIdIfNonLocal = null
|
||||||
|
]
|
||||||
|
callableIdIfNonLocal = kotlin/Any.equals
|
||||||
|
KtFunctionLikeSignature:
|
||||||
|
receiverType = null
|
||||||
|
returnType = kotlin.Int
|
||||||
|
symbol = kotlin/Any.hashCode(<dispatch receiver>: kotlin.Any): kotlin.Int
|
||||||
|
valueParameters = []
|
||||||
|
callableIdIfNonLocal = kotlin/Any.hashCode
|
||||||
|
KtFunctionLikeSignature:
|
||||||
|
receiverType = null
|
||||||
|
returnType = kotlin.String
|
||||||
|
symbol = kotlin/Any.toString(<dispatch receiver>: kotlin.Any): kotlin.String
|
||||||
|
valueParameters = []
|
||||||
|
callableIdIfNonLocal = kotlin/Any.toString
|
||||||
|
KtVariableLikeSignature:
|
||||||
|
name = value
|
||||||
|
receiverType = null
|
||||||
|
returnType = kotlin.Int!
|
||||||
|
symbol = val value: kotlin.Int!
|
||||||
|
callableIdIfNonLocal = /JavaClass.value
|
||||||
|
|
||||||
|
|
||||||
|
Declaration Scope:
|
||||||
|
KtFunctionSymbol:
|
||||||
|
annotationsList: []
|
||||||
|
callableIdIfNonLocal: /JavaClass.getValue
|
||||||
|
contextReceivers: []
|
||||||
|
contractEffects: []
|
||||||
|
hasStableParameterNames: false
|
||||||
|
isBuiltinFunctionInvoke: false
|
||||||
|
isExtension: false
|
||||||
|
isExternal: false
|
||||||
|
isInfix: false
|
||||||
|
isInline: false
|
||||||
|
isOperator: false
|
||||||
|
isOverride: false
|
||||||
|
isStatic: false
|
||||||
|
isSuspend: false
|
||||||
|
modality: OPEN
|
||||||
|
name: getValue
|
||||||
|
origin: JAVA
|
||||||
|
receiverParameter: null
|
||||||
|
returnType: KtFlexibleType:
|
||||||
|
annotationsList: []
|
||||||
|
type: kotlin/Int!
|
||||||
|
symbolKind: CLASS_MEMBER
|
||||||
|
typeParameters: []
|
||||||
|
valueParameters: []
|
||||||
|
visibility: Public
|
||||||
|
KtFunctionSymbol:
|
||||||
|
annotationsList: []
|
||||||
|
callableIdIfNonLocal: kotlin/Any.equals
|
||||||
|
contextReceivers: []
|
||||||
|
contractEffects: []
|
||||||
|
hasStableParameterNames: true
|
||||||
|
isBuiltinFunctionInvoke: false
|
||||||
|
isExtension: false
|
||||||
|
isExternal: false
|
||||||
|
isInfix: false
|
||||||
|
isInline: false
|
||||||
|
isOperator: true
|
||||||
|
isOverride: false
|
||||||
|
isStatic: false
|
||||||
|
isSuspend: false
|
||||||
|
modality: OPEN
|
||||||
|
name: equals
|
||||||
|
origin: LIBRARY
|
||||||
|
receiverParameter: null
|
||||||
|
returnType: KtUsualClassType:
|
||||||
|
annotationsList: []
|
||||||
|
ownTypeArguments: []
|
||||||
|
type: kotlin/Boolean
|
||||||
|
symbolKind: CLASS_MEMBER
|
||||||
|
typeParameters: []
|
||||||
|
valueParameters: [
|
||||||
|
KtValueParameterSymbol:
|
||||||
|
annotationsList: []
|
||||||
|
callableIdIfNonLocal: null
|
||||||
|
contextReceivers: []
|
||||||
|
generatedPrimaryConstructorProperty: null
|
||||||
|
hasDefaultValue: false
|
||||||
|
isCrossinline: false
|
||||||
|
isExtension: false
|
||||||
|
isImplicitLambdaParameter: false
|
||||||
|
isNoinline: false
|
||||||
|
isVararg: false
|
||||||
|
name: other
|
||||||
|
origin: LIBRARY
|
||||||
|
receiverParameter: null
|
||||||
|
returnType: KtUsualClassType:
|
||||||
|
annotationsList: []
|
||||||
|
ownTypeArguments: []
|
||||||
|
type: kotlin/Any?
|
||||||
|
symbolKind: LOCAL
|
||||||
|
typeParameters: []
|
||||||
|
]
|
||||||
|
visibility: Public
|
||||||
|
KtFunctionSymbol:
|
||||||
|
annotationsList: []
|
||||||
|
callableIdIfNonLocal: kotlin/Any.hashCode
|
||||||
|
contextReceivers: []
|
||||||
|
contractEffects: []
|
||||||
|
hasStableParameterNames: true
|
||||||
|
isBuiltinFunctionInvoke: false
|
||||||
|
isExtension: false
|
||||||
|
isExternal: false
|
||||||
|
isInfix: false
|
||||||
|
isInline: false
|
||||||
|
isOperator: false
|
||||||
|
isOverride: false
|
||||||
|
isStatic: false
|
||||||
|
isSuspend: false
|
||||||
|
modality: OPEN
|
||||||
|
name: hashCode
|
||||||
|
origin: LIBRARY
|
||||||
|
receiverParameter: null
|
||||||
|
returnType: KtUsualClassType:
|
||||||
|
annotationsList: []
|
||||||
|
ownTypeArguments: []
|
||||||
|
type: kotlin/Int
|
||||||
|
symbolKind: CLASS_MEMBER
|
||||||
|
typeParameters: []
|
||||||
|
valueParameters: []
|
||||||
|
visibility: Public
|
||||||
|
KtFunctionSymbol:
|
||||||
|
annotationsList: []
|
||||||
|
callableIdIfNonLocal: kotlin/Any.toString
|
||||||
|
contextReceivers: []
|
||||||
|
contractEffects: []
|
||||||
|
hasStableParameterNames: true
|
||||||
|
isBuiltinFunctionInvoke: false
|
||||||
|
isExtension: false
|
||||||
|
isExternal: false
|
||||||
|
isInfix: false
|
||||||
|
isInline: false
|
||||||
|
isOperator: false
|
||||||
|
isOverride: false
|
||||||
|
isStatic: false
|
||||||
|
isSuspend: false
|
||||||
|
modality: OPEN
|
||||||
|
name: toString
|
||||||
|
origin: LIBRARY
|
||||||
|
receiverParameter: null
|
||||||
|
returnType: KtUsualClassType:
|
||||||
|
annotationsList: []
|
||||||
|
ownTypeArguments: []
|
||||||
|
type: kotlin/String
|
||||||
|
symbolKind: CLASS_MEMBER
|
||||||
|
typeParameters: []
|
||||||
|
valueParameters: []
|
||||||
|
visibility: Public
|
||||||
|
KtSyntheticJavaPropertySymbol:
|
||||||
|
annotationsList: []
|
||||||
|
backingFieldSymbol: null
|
||||||
|
callableIdIfNonLocal: /JavaClass.value
|
||||||
|
contextReceivers: []
|
||||||
|
getter: KtPropertyGetterSymbol:
|
||||||
|
annotationsList: []
|
||||||
|
callableIdIfNonLocal: /JavaClass.getValue
|
||||||
|
contextReceivers: []
|
||||||
|
hasBody: false
|
||||||
|
hasStableParameterNames: true
|
||||||
|
isDefault: false
|
||||||
|
isExtension: false
|
||||||
|
isInline: false
|
||||||
|
isOverride: false
|
||||||
|
modality: OPEN
|
||||||
|
origin: JAVA_SYNTHETIC_PROPERTY
|
||||||
|
receiverParameter: null
|
||||||
|
returnType: KtFlexibleType:
|
||||||
|
annotationsList: []
|
||||||
|
type: kotlin/Int!
|
||||||
|
symbolKind: ACCESSOR
|
||||||
|
typeParameters: []
|
||||||
|
valueParameters: []
|
||||||
|
visibility: Public
|
||||||
|
hasBackingField: true
|
||||||
|
hasGetter: true
|
||||||
|
hasSetter: false
|
||||||
|
initializer: null
|
||||||
|
isDelegatedProperty: false
|
||||||
|
isExtension: false
|
||||||
|
isFromPrimaryConstructor: false
|
||||||
|
isOverride: false
|
||||||
|
isStatic: false
|
||||||
|
isVal: true
|
||||||
|
javaGetterSymbol: KtFunctionSymbol(/JavaClass.getValue)
|
||||||
|
javaSetterSymbol: null
|
||||||
|
modality: OPEN
|
||||||
|
name: value
|
||||||
|
origin: JAVA_SYNTHETIC_PROPERTY
|
||||||
|
receiverParameter: null
|
||||||
|
returnType: KtFlexibleType:
|
||||||
|
annotationsList: []
|
||||||
|
type: kotlin/Int!
|
||||||
|
setter: null
|
||||||
|
symbolKind: CLASS_MEMBER
|
||||||
|
typeParameters: []
|
||||||
|
visibility: Public
|
||||||
+9
-5
@@ -269,18 +269,22 @@ class FirTowerDataElement(
|
|||||||
*
|
*
|
||||||
* Note that a scope for a companion object is an implicit scope.
|
* Note that a scope for a companion object is an implicit scope.
|
||||||
*/
|
*/
|
||||||
fun getAvailableScopes(): List<FirScope> = when {
|
fun getAvailableScopes(
|
||||||
|
processTypeScope: FirTypeScope.(ConeKotlinType) -> FirTypeScope = { this },
|
||||||
|
): List<FirScope> = when {
|
||||||
scope != null -> listOf(scope)
|
scope != null -> listOf(scope)
|
||||||
implicitReceiver != null -> listOf(implicitReceiver.getImplicitScope())
|
implicitReceiver != null -> listOf(implicitReceiver.getImplicitScope(processTypeScope))
|
||||||
contextReceiverGroup != null -> contextReceiverGroup.map { it.getImplicitScope() }
|
contextReceiverGroup != null -> contextReceiverGroup.map { it.getImplicitScope(processTypeScope) }
|
||||||
else -> error("Tower data element is expected to have either scope or implicit receivers.")
|
else -> error("Tower data element is expected to have either scope or implicit receivers.")
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun ImplicitReceiverValue<*>.getImplicitScope(): FirScope {
|
private fun ImplicitReceiverValue<*>.getImplicitScope(
|
||||||
|
processTypeScope: FirTypeScope.(ConeKotlinType) -> FirTypeScope,
|
||||||
|
): FirScope {
|
||||||
return when (type.fullyExpandedType(useSiteSession)) {
|
return when (type.fullyExpandedType(useSiteSession)) {
|
||||||
is ConeErrorType,
|
is ConeErrorType,
|
||||||
is ConeStubType -> FirTypeScope.Empty
|
is ConeStubType -> FirTypeScope.Empty
|
||||||
else -> implicitScope ?: error("Scope for type ${type::class.simpleName} is null.")
|
else -> implicitScope?.processTypeScope(type) ?: error("Scope for type ${type::class.simpleName} is null.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user