diff --git a/analysis/analysis-api-fe10/src/org/jetbrains/kotlin/analysis/api/descriptors/symbols/descriptorBased/base/Kt1DescUtils.kt b/analysis/analysis-api-fe10/src/org/jetbrains/kotlin/analysis/api/descriptors/symbols/descriptorBased/base/Kt1DescUtils.kt index a877ae8bce8..998af7ef6e3 100644 --- a/analysis/analysis-api-fe10/src/org/jetbrains/kotlin/analysis/api/descriptors/symbols/descriptorBased/base/Kt1DescUtils.kt +++ b/analysis/analysis-api-fe10/src/org/jetbrains/kotlin/analysis/api/descriptors/symbols/descriptorBased/base/Kt1DescUtils.kt @@ -8,16 +8,14 @@ package org.jetbrains.kotlin.analysis.api.descriptors.symbols.descriptorBased.ba import org.jetbrains.kotlin.analysis.api.* import org.jetbrains.kotlin.analysis.api.annotations.* import org.jetbrains.kotlin.analysis.api.base.KtConstantValue -import org.jetbrains.kotlin.analysis.api.base.KtConstantValueFactory import org.jetbrains.kotlin.analysis.api.components.KtDeclarationRendererOptions import org.jetbrains.kotlin.analysis.api.descriptors.Fe10AnalysisContext import org.jetbrains.kotlin.analysis.api.descriptors.symbols.descriptorBased.* import org.jetbrains.kotlin.analysis.api.descriptors.symbols.psiBased.base.KtFe10PsiSymbol import org.jetbrains.kotlin.analysis.api.descriptors.types.* import org.jetbrains.kotlin.analysis.api.descriptors.utils.KtFe10Renderer -import org.jetbrains.kotlin.analysis.api.descriptors.utils.KtFe10TypeRenderer import org.jetbrains.kotlin.analysis.api.symbols.* -import org.jetbrains.kotlin.analysis.api.symbols.markers.* +import org.jetbrains.kotlin.analysis.api.symbols.markers.KtSymbolKind import org.jetbrains.kotlin.analysis.api.types.KtType import org.jetbrains.kotlin.analysis.api.types.KtTypeNullability import org.jetbrains.kotlin.analysis.utils.printer.prettyPrint @@ -35,7 +33,6 @@ import org.jetbrains.kotlin.load.kotlin.toSourceElement import org.jetbrains.kotlin.name.CallableId import org.jetbrains.kotlin.name.ClassId import org.jetbrains.kotlin.name.FqName -import org.jetbrains.kotlin.psi.KtAnnotationEntry import org.jetbrains.kotlin.psi.KtCallElement import org.jetbrains.kotlin.psi.KtClassOrObject import org.jetbrains.kotlin.psi.KtProperty @@ -128,29 +125,87 @@ internal val CallableMemberDescriptor.ktHasStableParameterNames: Boolean } internal fun CallableDescriptor.toKtCallableSymbol(analysisContext: Fe10AnalysisContext): KtCallableSymbol? { - return when (this) { - is PropertyGetterDescriptor -> KtFe10DescPropertyGetterSymbol(this, analysisContext) - is PropertySetterDescriptor -> KtFe10DescPropertySetterSymbol(this, analysisContext) - is SamConstructorDescriptor -> KtFe10DescSamConstructorSymbol(this, analysisContext) - is ConstructorDescriptor -> toKtConstructorSymbol(analysisContext) + return when (val unwrapped = unwrapFakeOverrideIfNeeded()) { + is PropertyGetterDescriptor -> KtFe10DescPropertyGetterSymbol(unwrapped, analysisContext) + is PropertySetterDescriptor -> KtFe10DescPropertySetterSymbol(unwrapped, analysisContext) + is SamConstructorDescriptor -> KtFe10DescSamConstructorSymbol(unwrapped, analysisContext) + is ConstructorDescriptor -> unwrapped.toKtConstructorSymbol(analysisContext) is FunctionDescriptor -> { - if (DescriptorUtils.isAnonymousFunction(this)) { - KtFe10DescAnonymousFunctionSymbol(this, analysisContext) + if (DescriptorUtils.isAnonymousFunction(unwrapped)) { + KtFe10DescAnonymousFunctionSymbol(unwrapped, analysisContext) } else { - KtFe10DescFunctionSymbol.build(this, analysisContext) + KtFe10DescFunctionSymbol.build(unwrapped, analysisContext) } } - is SyntheticFieldDescriptor -> KtFe10DescSyntheticFieldSymbol(this, analysisContext) - is LocalVariableDescriptor -> KtFe10DescLocalVariableSymbol(this, analysisContext) - is ValueParameterDescriptor -> KtFe10DescValueParameterSymbol(this, analysisContext) - is SyntheticJavaPropertyDescriptor -> KtFe10DescSyntheticJavaPropertySymbol(this, analysisContext) - is JavaForKotlinOverridePropertyDescriptor -> KtFe10DescSyntheticJavaPropertySymbolForOverride(this, analysisContext) - is JavaPropertyDescriptor -> KtFe10DescJavaFieldSymbol(this, analysisContext) - is PropertyDescriptorImpl -> KtFe10DescKotlinPropertySymbol(this, analysisContext) + is SyntheticFieldDescriptor -> KtFe10DescSyntheticFieldSymbol(unwrapped, analysisContext) + is LocalVariableDescriptor -> KtFe10DescLocalVariableSymbol(unwrapped, analysisContext) + is ValueParameterDescriptor -> KtFe10DescValueParameterSymbol(unwrapped, analysisContext) + is SyntheticJavaPropertyDescriptor -> KtFe10DescSyntheticJavaPropertySymbol(unwrapped, analysisContext) + is JavaForKotlinOverridePropertyDescriptor -> KtFe10DescSyntheticJavaPropertySymbolForOverride(unwrapped, analysisContext) + is JavaPropertyDescriptor -> KtFe10DescJavaFieldSymbol(unwrapped, analysisContext) + is PropertyDescriptorImpl -> KtFe10DescKotlinPropertySymbol(unwrapped, analysisContext) else -> null } } +/** + * This logic should be equivalent to + * [org.jetbrains.kotlin.analysis.api.fir.KtSymbolByFirBuilder.unwrapSubstitutionOverrideIfNeeded]. But this method unwrap all fake + * overrides that do not change the signature. + */ +internal fun CallableDescriptor.unwrapFakeOverrideIfNeeded(): CallableDescriptor { + val useSiteUnwrapped = unwrapUseSiteSubstitutionOverride() + if (useSiteUnwrapped !is CallableMemberDescriptor) return useSiteUnwrapped + if (useSiteUnwrapped.kind.isReal) return useSiteUnwrapped + val overriddenDescriptor = useSiteUnwrapped.overriddenDescriptors.singleOrNull()?.unwrapUseSiteSubstitutionOverride() + ?: return useSiteUnwrapped + if (hasTypeReferenceAffectingSignature(useSiteUnwrapped, overriddenDescriptor)) { + return useSiteUnwrapped + } + return overriddenDescriptor.unwrapFakeOverrideIfNeeded() +} + +private fun hasTypeReferenceAffectingSignature( + descriptor: CallableMemberDescriptor, + overriddenDescriptor: CallableMemberDescriptor +): Boolean { + val containingClass = (descriptor.containingDeclaration as? ClassifierDescriptorWithTypeParameters) + val typeParametersFromOuterClass = buildList { containingClass?.let { collectTypeParameters(it) } } + val allowedTypeParameters = (overriddenDescriptor.typeParameters + typeParametersFromOuterClass).toSet() + return overriddenDescriptor.returnType?.hasReferenceOtherThan(allowedTypeParameters) == true || + overriddenDescriptor.extensionReceiverParameter?.type?.hasReferenceOtherThan(allowedTypeParameters) == true || + overriddenDescriptor.valueParameters.any { it.type.hasReferenceOtherThan(allowedTypeParameters) } +} + +private fun MutableList.collectTypeParameters(innerClass: ClassifierDescriptorWithTypeParameters) { + if (!innerClass.isInner) return + val outerClass = innerClass.containingDeclaration as? ClassifierDescriptorWithTypeParameters ?: return + addAll(outerClass.declaredTypeParameters) + collectTypeParameters(outerClass) +} + +private fun KotlinType.hasReferenceOtherThan(allowedTypeParameterDescriptors: Set): Boolean { + return when (this) { + is SimpleType -> { + val declarationDescriptor = constructor.declarationDescriptor + if (declarationDescriptor !is AbstractTypeParameterDescriptor) return false + declarationDescriptor !in allowedTypeParameterDescriptors || + declarationDescriptor.upperBounds.any { it.hasReferenceOtherThan(allowedTypeParameterDescriptors) } + } + else -> arguments.any { it.type.hasReferenceOtherThan(allowedTypeParameterDescriptors) } + } +} + +/** + * Use-site substitution override are tracked through [CallableDescriptor.getOriginal]. Note that overridden symbols are accessed through + * [CallableDescriptor.getOverriddenDescriptors] instead, which is separate from [CallableDescriptor.getOriginal]. + */ +@Suppress("UNCHECKED_CAST") +private fun T.unwrapUseSiteSubstitutionOverride(): T { + if (original == this) return this + return original.unwrapUseSiteSubstitutionOverride() as T +} + internal fun KotlinType.toKtType(analysisContext: Fe10AnalysisContext): KtType { return when (val unwrappedType = unwrap()) { is FlexibleType -> KtFe10FlexibleType(unwrappedType, analysisContext) diff --git a/analysis/analysis-api-fe10/tests/org/jetbrains/kotlin/analysis/api/descriptors/test/scopes/AbstractKtFe10SubstitutionOverridesUnwrappingTest.kt b/analysis/analysis-api-fe10/tests/org/jetbrains/kotlin/analysis/api/descriptors/test/scopes/AbstractKtFe10SubstitutionOverridesUnwrappingTest.kt new file mode 100644 index 00000000000..a6c9a740d83 --- /dev/null +++ b/analysis/analysis-api-fe10/tests/org/jetbrains/kotlin/analysis/api/descriptors/test/scopes/AbstractKtFe10SubstitutionOverridesUnwrappingTest.kt @@ -0,0 +1,19 @@ +package org.jetbrains.kotlin.analysis.api.descriptors.test.scopes + +import org.jetbrains.kotlin.analysis.api.descriptors.test.KtFe10FrontendApiTestConfiguratorService +import org.jetbrains.kotlin.analysis.api.impl.base.test.scopes.AbstractSubstitutionOverridesUnwrappingTest +import org.jetbrains.kotlin.analysis.api.impl.base.test.symbols.SymbolTestDirectives +import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder + +abstract class AbstractKtFe10SubstitutionOverridesUnwrappingTest : + AbstractSubstitutionOverridesUnwrappingTest(KtFe10FrontendApiTestConfiguratorService) { + override fun configureTest(builder: TestConfigurationBuilder) { + super.configureTest(builder) + with(builder) { + defaultDirectives { + // TODO: remove this to enable checking symbol restoration when FE1.0 symbols can be restored correctly + +SymbolTestDirectives.DO_NOT_CHECK_SYMBOL_RESTORE + } + } + } +} diff --git a/analysis/analysis-api-fe10/tests/org/jetbrains/kotlin/analysis/api/descriptors/test/scopes/KtFe10SubstitutionOverridesUnwrappingTestGenerated.java b/analysis/analysis-api-fe10/tests/org/jetbrains/kotlin/analysis/api/descriptors/test/scopes/KtFe10SubstitutionOverridesUnwrappingTestGenerated.java new file mode 100644 index 00000000000..a25b6ba6d11 --- /dev/null +++ b/analysis/analysis-api-fe10/tests/org/jetbrains/kotlin/analysis/api/descriptors/test/scopes/KtFe10SubstitutionOverridesUnwrappingTestGenerated.java @@ -0,0 +1,110 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.analysis.api.descriptors.test.scopes; + +import com.intellij.testFramework.TestDataPath; +import org.jetbrains.kotlin.test.util.KtTestUtil; +import org.jetbrains.kotlin.test.TestMetadata; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; + +import java.io.File; +import java.util.regex.Pattern; + +/** This class is generated by {@link GenerateNewCompilerTests.kt}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping") +@TestDataPath("$PROJECT_ROOT") +public class KtFe10SubstitutionOverridesUnwrappingTestGenerated extends AbstractKtFe10SubstitutionOverridesUnwrappingTest { + @Test + public void testAllFilesPresentInSubstitutionOverridesUnwrapping() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("ClassWithGenericBase1.kt") + public void testClassWithGenericBase1() throws Exception { + runTest("analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/ClassWithGenericBase1.kt"); + } + + @Test + @TestMetadata("ClassWithGenericBase2.kt") + public void testClassWithGenericBase2() throws Exception { + runTest("analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/ClassWithGenericBase2.kt"); + } + + @Test + @TestMetadata("ClassWithGenericBase3.kt") + public void testClassWithGenericBase3() throws Exception { + runTest("analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/ClassWithGenericBase3.kt"); + } + + @Test + @TestMetadata("ClassWithGenericBase4.kt") + public void testClassWithGenericBase4() throws Exception { + runTest("analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/ClassWithGenericBase4.kt"); + } + + @Test + @TestMetadata("GenericFromFunctionInLocalClass1.kt") + public void testGenericFromFunctionInLocalClass1() throws Exception { + runTest("analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromFunctionInLocalClass1.kt"); + } + + @Test + @TestMetadata("GenericFromFunctionInLocalClass2.kt") + public void testGenericFromFunctionInLocalClass2() throws Exception { + runTest("analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromFunctionInLocalClass2.kt"); + } + + @Test + @TestMetadata("GenericFromOuterClassInInnerClass1.kt") + public void testGenericFromOuterClassInInnerClass1() throws Exception { + runTest("analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClass1.kt"); + } + + @Test + @TestMetadata("GenericFromOuterClassInInnerClass2.kt") + public void testGenericFromOuterClassInInnerClass2() throws Exception { + runTest("analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClass2.kt"); + } + + @Test + @TestMetadata("GenericFromOuterClassInInnerClassInInheritor1.kt") + public void testGenericFromOuterClassInInnerClassInInheritor1() throws Exception { + runTest("analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClassInInheritor1.kt"); + } + + @Test + @TestMetadata("GenericFromOuterClassInInnerClassInInheritor2.kt") + public void testGenericFromOuterClassInInnerClassInInheritor2() throws Exception { + runTest("analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClassInInheritor2.kt"); + } + + @Test + @TestMetadata("GenericFromOuterClassInInnerClassInInheritor3.kt") + public void testGenericFromOuterClassInInnerClassInInheritor3() throws Exception { + runTest("analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClassInInheritor3.kt"); + } + + @Test + @TestMetadata("Implement_java_util_Collection.kt") + public void testImplement_java_util_Collection() throws Exception { + runTest("analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/Implement_java_util_Collection.kt"); + } + + @Test + @TestMetadata("MemberFunctionWithOuterTypeParameterBound.kt") + public void testMemberFunctionWithOuterTypeParameterBound() throws Exception { + runTest("analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/MemberFunctionWithOuterTypeParameterBound.kt"); + } + + @Test + @TestMetadata("MemberPropertyWithOuterTypeParameterBound.kt") + public void testMemberPropertyWithOuterTypeParameterBound() throws Exception { + runTest("analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/MemberPropertyWithOuterTypeParameterBound.kt"); + } +} diff --git a/analysis/analysis-api-impl-base/tests/org/jetbrains/kotlin/analysis/api/impl/base/test/symbols/AbstractSymbolTest.kt b/analysis/analysis-api-impl-base/tests/org/jetbrains/kotlin/analysis/api/impl/base/test/symbols/AbstractSymbolTest.kt index a2dd3f4ab72..ec17b026536 100644 --- a/analysis/analysis-api-impl-base/tests/org/jetbrains/kotlin/analysis/api/impl/base/test/symbols/AbstractSymbolTest.kt +++ b/analysis/analysis-api-impl-base/tests/org/jetbrains/kotlin/analysis/api/impl/base/test/symbols/AbstractSymbolTest.kt @@ -116,7 +116,7 @@ abstract class AbstractSymbolTest(configurator: FrontendApiTestConfiguratorServi } } -private object SymbolTestDirectives : SimpleDirectivesContainer() { +object SymbolTestDirectives : SimpleDirectivesContainer() { val DO_NOT_CHECK_SYMBOL_RESTORE by directive( description = "Symbol restoring for some symbols in current test is not supported yet", applicability = DirectiveApplicability.Global diff --git a/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/ClassWithGenericBase1.descriptors.pretty.txt b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/ClassWithGenericBase1.descriptors.pretty.txt new file mode 100644 index 00000000000..70288342acb --- /dev/null +++ b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/ClassWithGenericBase1.descriptors.pretty.txt @@ -0,0 +1,13 @@ +fun noGeneric() + +fun withOuterGeneric(t: test.Foo) + +fun withOwnGeneric(tt: TT) + +fun withOuterAndOwnGeneric(t: test.Foo, tt: TT) + +open operator fun equals(other: kotlin.Any?): kotlin.Boolean + +open fun hashCode(): kotlin.Int + +open fun toString(): kotlin.String \ No newline at end of file diff --git a/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/ClassWithGenericBase1.descriptors.txt b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/ClassWithGenericBase1.descriptors.txt new file mode 100644 index 00000000000..78ed82b506e --- /dev/null +++ b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/ClassWithGenericBase1.descriptors.txt @@ -0,0 +1,41 @@ +KtFunctionSymbol: + callableIdIfNonLocal: test/Base.noGeneric + name: noGeneric + origin: LIBRARY + getDispatchReceiver(): test/Base + +KtFunctionSymbol: + callableIdIfNonLocal: test/ClassWithGenericBase.withOuterGeneric + name: withOuterGeneric + origin: SOURCE + getDispatchReceiver(): test/Base + +KtFunctionSymbol: + callableIdIfNonLocal: test/Base.withOwnGeneric + name: withOwnGeneric + origin: LIBRARY + getDispatchReceiver(): test/Base + +KtFunctionSymbol: + callableIdIfNonLocal: test/ClassWithGenericBase.withOuterAndOwnGeneric + name: withOuterAndOwnGeneric + origin: SOURCE + getDispatchReceiver(): test/Base + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.equals + name: equals + origin: LIBRARY + getDispatchReceiver(): kotlin/Any + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.hashCode + name: hashCode + origin: LIBRARY + getDispatchReceiver(): kotlin/Any + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.toString + name: toString + origin: LIBRARY + getDispatchReceiver(): kotlin/Any \ No newline at end of file diff --git a/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/ClassWithGenericBase2.descriptors.pretty.txt b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/ClassWithGenericBase2.descriptors.pretty.txt new file mode 100644 index 00000000000..f312e3252b7 --- /dev/null +++ b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/ClassWithGenericBase2.descriptors.pretty.txt @@ -0,0 +1,13 @@ +val noGeneric: test.Foo? + +val withOuterGeneric: test.Foo? + +val TT.withOwnGeneric: TT? + +val TT.withOuterAndOwnGeneric: test.Foo? + +open operator fun equals(other: kotlin.Any?): kotlin.Boolean + +open fun hashCode(): kotlin.Int + +open fun toString(): kotlin.String \ No newline at end of file diff --git a/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/ClassWithGenericBase2.descriptors.txt b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/ClassWithGenericBase2.descriptors.txt new file mode 100644 index 00000000000..56f37604f0c --- /dev/null +++ b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/ClassWithGenericBase2.descriptors.txt @@ -0,0 +1,41 @@ +KtKotlinPropertySymbol: + callableIdIfNonLocal: test/Base.noGeneric + name: noGeneric + origin: LIBRARY + getDispatchReceiver(): test/Base + +KtKotlinPropertySymbol: + callableIdIfNonLocal: test/ClassWithGenericBase.withOuterGeneric + name: withOuterGeneric + origin: SOURCE + getDispatchReceiver(): test/Base + +KtKotlinPropertySymbol: + callableIdIfNonLocal: test/Base.withOwnGeneric + name: withOwnGeneric + origin: LIBRARY + getDispatchReceiver(): test/Base + +KtKotlinPropertySymbol: + callableIdIfNonLocal: test/ClassWithGenericBase.withOuterAndOwnGeneric + name: withOuterAndOwnGeneric + origin: SOURCE + getDispatchReceiver(): test/Base + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.equals + name: equals + origin: LIBRARY + getDispatchReceiver(): kotlin/Any + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.hashCode + name: hashCode + origin: LIBRARY + getDispatchReceiver(): kotlin/Any + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.toString + name: toString + origin: LIBRARY + getDispatchReceiver(): kotlin/Any \ No newline at end of file diff --git a/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/ClassWithGenericBase3.descriptors.pretty.txt b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/ClassWithGenericBase3.descriptors.pretty.txt new file mode 100644 index 00000000000..b6f34840fd3 --- /dev/null +++ b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/ClassWithGenericBase3.descriptors.pretty.txt @@ -0,0 +1,15 @@ +fun noGenerics_InterfaceWithFun() + +open fun withOuterGeneric_InterfaceWithFun(): test.SomeClass2 + +fun noGenerics_InterfaceWithFunBase() + +fun withOuterGenericT1_InterfaceWithFunBase(): test.SomeClass1 + +open fun withOuterGenericT2_InterfaceWithFunBase(): test.SomeClass2 + +open operator fun equals(other: kotlin.Any?): kotlin.Boolean + +open fun hashCode(): kotlin.Int + +open fun toString(): kotlin.String \ No newline at end of file diff --git a/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/ClassWithGenericBase3.descriptors.txt b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/ClassWithGenericBase3.descriptors.txt new file mode 100644 index 00000000000..4834a2b2d38 --- /dev/null +++ b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/ClassWithGenericBase3.descriptors.txt @@ -0,0 +1,47 @@ +KtFunctionSymbol: + callableIdIfNonLocal: test/InterfaceWithFun.noGenerics_InterfaceWithFun + name: noGenerics_InterfaceWithFun + origin: LIBRARY + getDispatchReceiver(): test/InterfaceWithFun + +KtFunctionSymbol: + callableIdIfNonLocal: test/ClassWithInterfaceWithFun.withOuterGeneric_InterfaceWithFun + name: withOuterGeneric_InterfaceWithFun + origin: SOURCE + getDispatchReceiver(): test/InterfaceWithFun + +KtFunctionSymbol: + callableIdIfNonLocal: test/InterfaceWithFunBase.noGenerics_InterfaceWithFunBase + name: noGenerics_InterfaceWithFunBase + origin: LIBRARY + getDispatchReceiver(): test/InterfaceWithFunBase + +KtFunctionSymbol: + callableIdIfNonLocal: test/InterfaceWithFun.withOuterGenericT1_InterfaceWithFunBase + name: withOuterGenericT1_InterfaceWithFunBase + origin: SOURCE + getDispatchReceiver(): test/InterfaceWithFunBase + +KtFunctionSymbol: + callableIdIfNonLocal: test/ClassWithInterfaceWithFun.withOuterGenericT2_InterfaceWithFunBase + name: withOuterGenericT2_InterfaceWithFunBase + origin: SOURCE + getDispatchReceiver(): test/InterfaceWithFunBase + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.equals + name: equals + origin: LIBRARY + getDispatchReceiver(): kotlin/Any + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.hashCode + name: hashCode + origin: LIBRARY + getDispatchReceiver(): kotlin/Any + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.toString + name: toString + origin: LIBRARY + getDispatchReceiver(): kotlin/Any \ No newline at end of file diff --git a/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/ClassWithGenericBase4.descriptors.pretty.txt b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/ClassWithGenericBase4.descriptors.pretty.txt new file mode 100644 index 00000000000..8a381d26d4c --- /dev/null +++ b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/ClassWithGenericBase4.descriptors.pretty.txt @@ -0,0 +1,25 @@ +val noGenerics_InterfaceWithVal: test.SomeClass1 + +abstract val withOuterGeneric_InterfaceWithVal: test.SomeClass2 + +val Own.withOwnGeneric_InterfaceWithVal: test.SomeClass1 + +abstract val Own.withOwnAndOuterGeneric_InterfaceWithVal: test.SomeClass2 + +val noGenerics_InterfaceWithValBase: test.SomeClass1 + +val withOuterGenericT1_InterfaceWithValBase: test.SomeClass1 + +abstract val withOuterGenericT2_InterfaceWithValBase: test.SomeClass2 + +val Own.withOwnGeneric_InterfaceWithValBase: test.SomeClass1 + +val Own.withOwnAndOuterGenericT1_InterfaceWithValBase: test.SomeClass1 + +abstract val Own.withOwnAndOuterGenericT2_InterfaceWithValBase: test.SomeClass2 + +open operator fun equals(other: kotlin.Any?): kotlin.Boolean + +open fun hashCode(): kotlin.Int + +open fun toString(): kotlin.String \ No newline at end of file diff --git a/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/ClassWithGenericBase4.descriptors.txt b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/ClassWithGenericBase4.descriptors.txt new file mode 100644 index 00000000000..f407717fd74 --- /dev/null +++ b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/ClassWithGenericBase4.descriptors.txt @@ -0,0 +1,77 @@ +KtKotlinPropertySymbol: + callableIdIfNonLocal: test/InterfaceWithVal.noGenerics_InterfaceWithVal + name: noGenerics_InterfaceWithVal + origin: LIBRARY + getDispatchReceiver(): test/InterfaceWithVal + +KtKotlinPropertySymbol: + callableIdIfNonLocal: test/ClassWithInterfaceWithVal.withOuterGeneric_InterfaceWithVal + name: withOuterGeneric_InterfaceWithVal + origin: SOURCE + getDispatchReceiver(): test/InterfaceWithVal + +KtKotlinPropertySymbol: + callableIdIfNonLocal: test/InterfaceWithVal.withOwnGeneric_InterfaceWithVal + name: withOwnGeneric_InterfaceWithVal + origin: LIBRARY + getDispatchReceiver(): test/InterfaceWithVal + +KtKotlinPropertySymbol: + callableIdIfNonLocal: test/ClassWithInterfaceWithVal.withOwnAndOuterGeneric_InterfaceWithVal + name: withOwnAndOuterGeneric_InterfaceWithVal + origin: SOURCE + getDispatchReceiver(): test/InterfaceWithVal + +KtKotlinPropertySymbol: + callableIdIfNonLocal: test/InterfaceWithValBase.noGenerics_InterfaceWithValBase + name: noGenerics_InterfaceWithValBase + origin: LIBRARY + getDispatchReceiver(): test/InterfaceWithValBase + +KtKotlinPropertySymbol: + callableIdIfNonLocal: test/InterfaceWithVal.withOuterGenericT1_InterfaceWithValBase + name: withOuterGenericT1_InterfaceWithValBase + origin: SOURCE + getDispatchReceiver(): test/InterfaceWithValBase + +KtKotlinPropertySymbol: + callableIdIfNonLocal: test/ClassWithInterfaceWithVal.withOuterGenericT2_InterfaceWithValBase + name: withOuterGenericT2_InterfaceWithValBase + origin: SOURCE + getDispatchReceiver(): test/InterfaceWithValBase + +KtKotlinPropertySymbol: + callableIdIfNonLocal: test/InterfaceWithValBase.withOwnGeneric_InterfaceWithValBase + name: withOwnGeneric_InterfaceWithValBase + origin: LIBRARY + getDispatchReceiver(): test/InterfaceWithValBase + +KtKotlinPropertySymbol: + callableIdIfNonLocal: test/InterfaceWithVal.withOwnAndOuterGenericT1_InterfaceWithValBase + name: withOwnAndOuterGenericT1_InterfaceWithValBase + origin: SOURCE + getDispatchReceiver(): test/InterfaceWithValBase + +KtKotlinPropertySymbol: + callableIdIfNonLocal: test/ClassWithInterfaceWithVal.withOwnAndOuterGenericT2_InterfaceWithValBase + name: withOwnAndOuterGenericT2_InterfaceWithValBase + origin: SOURCE + getDispatchReceiver(): test/InterfaceWithValBase + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.equals + name: equals + origin: LIBRARY + getDispatchReceiver(): kotlin/Any + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.hashCode + name: hashCode + origin: LIBRARY + getDispatchReceiver(): kotlin/Any + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.toString + name: toString + origin: LIBRARY + getDispatchReceiver(): kotlin/Any \ No newline at end of file diff --git a/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromFunctionInLocalClass1.descriptors.pretty.txt b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromFunctionInLocalClass1.descriptors.pretty.txt new file mode 100644 index 00000000000..fcb53bfa229 --- /dev/null +++ b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromFunctionInLocalClass1.descriptors.pretty.txt @@ -0,0 +1,9 @@ +fun noGenerics() + +fun withOuter(): Outer? + +open operator fun equals(other: kotlin.Any?): kotlin.Boolean + +open fun hashCode(): kotlin.Int + +open fun toString(): kotlin.String \ No newline at end of file diff --git a/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromFunctionInLocalClass1.descriptors.txt b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromFunctionInLocalClass1.descriptors.txt new file mode 100644 index 00000000000..b679200f085 --- /dev/null +++ b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromFunctionInLocalClass1.descriptors.txt @@ -0,0 +1,29 @@ +KtFunctionSymbol: + callableIdIfNonLocal: null + name: noGenerics + origin: LIBRARY + getDispatchReceiver(): test/Child + +KtFunctionSymbol: + callableIdIfNonLocal: null + name: withOuter + origin: SOURCE + getDispatchReceiver(): test/Base + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.equals + name: equals + origin: LIBRARY + getDispatchReceiver(): kotlin/Any + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.hashCode + name: hashCode + origin: LIBRARY + getDispatchReceiver(): kotlin/Any + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.toString + name: toString + origin: LIBRARY + getDispatchReceiver(): kotlin/Any \ No newline at end of file diff --git a/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromFunctionInLocalClass2.descriptors.pretty.txt b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromFunctionInLocalClass2.descriptors.pretty.txt new file mode 100644 index 00000000000..0ff18515c4f --- /dev/null +++ b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromFunctionInLocalClass2.descriptors.pretty.txt @@ -0,0 +1,11 @@ +fun noGenerics() + +fun withOuter(): Outer? + +fun withOuterAndOwn(t: test.SomeClass): Outer? + +open operator fun equals(other: kotlin.Any?): kotlin.Boolean + +open fun hashCode(): kotlin.Int + +open fun toString(): kotlin.String \ No newline at end of file diff --git a/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromFunctionInLocalClass2.descriptors.txt b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromFunctionInLocalClass2.descriptors.txt new file mode 100644 index 00000000000..4ca57700338 --- /dev/null +++ b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromFunctionInLocalClass2.descriptors.txt @@ -0,0 +1,35 @@ +KtFunctionSymbol: + callableIdIfNonLocal: null + name: noGenerics + origin: LIBRARY + getDispatchReceiver(): test/Child + +KtFunctionSymbol: + callableIdIfNonLocal: null + name: withOuter + origin: SOURCE + getDispatchReceiver(): test/Base + +KtFunctionSymbol: + callableIdIfNonLocal: null + name: withOuterAndOwn + origin: SOURCE + getDispatchReceiver(): test/Base + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.equals + name: equals + origin: LIBRARY + getDispatchReceiver(): kotlin/Any + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.hashCode + name: hashCode + origin: LIBRARY + getDispatchReceiver(): kotlin/Any + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.toString + name: toString + origin: LIBRARY + getDispatchReceiver(): kotlin/Any \ No newline at end of file diff --git a/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClass1.descriptors.pretty.txt b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClass1.descriptors.pretty.txt new file mode 100644 index 00000000000..847c33086af --- /dev/null +++ b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClass1.descriptors.pretty.txt @@ -0,0 +1,9 @@ +fun noGeneric() + +fun withOuter(): Outer? + +open operator fun equals(other: kotlin.Any?): kotlin.Boolean + +open fun hashCode(): kotlin.Int + +open fun toString(): kotlin.String \ No newline at end of file diff --git a/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClass1.descriptors.txt b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClass1.descriptors.txt new file mode 100644 index 00000000000..f97e3bd14bc --- /dev/null +++ b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClass1.descriptors.txt @@ -0,0 +1,29 @@ +KtFunctionSymbol: + callableIdIfNonLocal: test/TopLevel.Base.noGeneric + name: noGeneric + origin: LIBRARY + getDispatchReceiver(): test/TopLevel.test/TopLevel.Base + +KtFunctionSymbol: + callableIdIfNonLocal: test/TopLevel.Base.withOuter + name: withOuter + origin: LIBRARY + getDispatchReceiver(): test/TopLevel.test/TopLevel.Base + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.equals + name: equals + origin: LIBRARY + getDispatchReceiver(): kotlin/Any + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.hashCode + name: hashCode + origin: LIBRARY + getDispatchReceiver(): kotlin/Any + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.toString + name: toString + origin: LIBRARY + getDispatchReceiver(): kotlin/Any \ No newline at end of file diff --git a/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClass2.descriptors.pretty.txt b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClass2.descriptors.pretty.txt new file mode 100644 index 00000000000..a9bd004072b --- /dev/null +++ b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClass2.descriptors.pretty.txt @@ -0,0 +1,11 @@ +fun noGeneric() + +fun withOuter(): Outer? + +fun withOwnAndOuter(t: test.SomeClass): Outer? + +open operator fun equals(other: kotlin.Any?): kotlin.Boolean + +open fun hashCode(): kotlin.Int + +open fun toString(): kotlin.String \ No newline at end of file diff --git a/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClass2.descriptors.txt b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClass2.descriptors.txt new file mode 100644 index 00000000000..cbc027d3859 --- /dev/null +++ b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClass2.descriptors.txt @@ -0,0 +1,35 @@ +KtFunctionSymbol: + callableIdIfNonLocal: test/TopLevel.Base.noGeneric + name: noGeneric + origin: LIBRARY + getDispatchReceiver(): test/TopLevel.test/TopLevel.Base + +KtFunctionSymbol: + callableIdIfNonLocal: test/TopLevel.Base.withOuter + name: withOuter + origin: LIBRARY + getDispatchReceiver(): test/TopLevel.test/TopLevel.Base + +KtFunctionSymbol: + callableIdIfNonLocal: test/TopLevel.Child.withOwnAndOuter + name: withOwnAndOuter + origin: SOURCE + getDispatchReceiver(): test/TopLevel.test/TopLevel.Base + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.equals + name: equals + origin: LIBRARY + getDispatchReceiver(): kotlin/Any + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.hashCode + name: hashCode + origin: LIBRARY + getDispatchReceiver(): kotlin/Any + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.toString + name: toString + origin: LIBRARY + getDispatchReceiver(): kotlin/Any \ No newline at end of file diff --git a/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClassInInheritor1.descriptors.pretty.txt b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClassInInheritor1.descriptors.pretty.txt new file mode 100644 index 00000000000..661a0d7b926 --- /dev/null +++ b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClassInInheritor1.descriptors.pretty.txt @@ -0,0 +1,9 @@ +fun noGeneric() + +fun withOuter(): test.SomeClass? + +open operator fun equals(other: kotlin.Any?): kotlin.Boolean + +open fun hashCode(): kotlin.Int + +open fun toString(): kotlin.String \ No newline at end of file diff --git a/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClassInInheritor1.descriptors.txt b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClassInInheritor1.descriptors.txt new file mode 100644 index 00000000000..51c3c15b0f2 --- /dev/null +++ b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClassInInheritor1.descriptors.txt @@ -0,0 +1,29 @@ +KtFunctionSymbol: + callableIdIfNonLocal: test/TopLevel.Base.noGeneric + name: noGeneric + origin: LIBRARY + getDispatchReceiver(): test/TopLevel.test/TopLevel.Base + +KtFunctionSymbol: + callableIdIfNonLocal: test/OtherTopLevel.Child.withOuter + name: withOuter + origin: SOURCE + getDispatchReceiver(): test/TopLevel.test/TopLevel.Base + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.equals + name: equals + origin: LIBRARY + getDispatchReceiver(): kotlin/Any + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.hashCode + name: hashCode + origin: LIBRARY + getDispatchReceiver(): kotlin/Any + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.toString + name: toString + origin: LIBRARY + getDispatchReceiver(): kotlin/Any \ No newline at end of file diff --git a/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClassInInheritor2.descriptors.pretty.txt b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClassInInheritor2.descriptors.pretty.txt new file mode 100644 index 00000000000..f6c9cbb1d91 --- /dev/null +++ b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClassInInheritor2.descriptors.pretty.txt @@ -0,0 +1,9 @@ +fun noGeneric() + +fun withOuter(): T? + +open operator fun equals(other: kotlin.Any?): kotlin.Boolean + +open fun hashCode(): kotlin.Int + +open fun toString(): kotlin.String \ No newline at end of file diff --git a/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClassInInheritor2.descriptors.txt b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClassInInheritor2.descriptors.txt new file mode 100644 index 00000000000..ee0d33a1c41 --- /dev/null +++ b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClassInInheritor2.descriptors.txt @@ -0,0 +1,29 @@ +KtFunctionSymbol: + callableIdIfNonLocal: test/TopLevel.Base.noGeneric + name: noGeneric + origin: LIBRARY + getDispatchReceiver(): test/TopLevel.test/TopLevel.Base + +KtFunctionSymbol: + callableIdIfNonLocal: test/OtherTopLevel.Child.withOuter + name: withOuter + origin: SOURCE + getDispatchReceiver(): test/TopLevel.test/TopLevel.Base + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.equals + name: equals + origin: LIBRARY + getDispatchReceiver(): kotlin/Any + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.hashCode + name: hashCode + origin: LIBRARY + getDispatchReceiver(): kotlin/Any + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.toString + name: toString + origin: LIBRARY + getDispatchReceiver(): kotlin/Any \ No newline at end of file diff --git a/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClassInInheritor3.descriptors.pretty.txt b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClassInInheritor3.descriptors.pretty.txt new file mode 100644 index 00000000000..d8dc36a1042 --- /dev/null +++ b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClassInInheritor3.descriptors.pretty.txt @@ -0,0 +1,11 @@ +fun noGeneric() + +fun withOuter(): test.SomeClass? + +fun withOwnAndOuter(t: test.SomeClass): test.SomeClass? + +open operator fun equals(other: kotlin.Any?): kotlin.Boolean + +open fun hashCode(): kotlin.Int + +open fun toString(): kotlin.String \ No newline at end of file diff --git a/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClassInInheritor3.descriptors.txt b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClassInInheritor3.descriptors.txt new file mode 100644 index 00000000000..5e7c17acffa --- /dev/null +++ b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/GenericFromOuterClassInInnerClassInInheritor3.descriptors.txt @@ -0,0 +1,35 @@ +KtFunctionSymbol: + callableIdIfNonLocal: test/TopLevel.Base.noGeneric + name: noGeneric + origin: LIBRARY + getDispatchReceiver(): test/TopLevel.test/TopLevel.Base + +KtFunctionSymbol: + callableIdIfNonLocal: test/OtherTopLevel.Child.withOuter + name: withOuter + origin: SOURCE + getDispatchReceiver(): test/TopLevel.test/TopLevel.Base + +KtFunctionSymbol: + callableIdIfNonLocal: test/OtherTopLevel.Child.withOwnAndOuter + name: withOwnAndOuter + origin: SOURCE + getDispatchReceiver(): test/TopLevel.test/TopLevel.Base + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.equals + name: equals + origin: LIBRARY + getDispatchReceiver(): kotlin/Any + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.hashCode + name: hashCode + origin: LIBRARY + getDispatchReceiver(): kotlin/Any + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.toString + name: toString + origin: LIBRARY + getDispatchReceiver(): kotlin/Any \ No newline at end of file diff --git a/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/Implement_java_util_Collection.descriptors.pretty.txt b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/Implement_java_util_Collection.descriptors.pretty.txt new file mode 100644 index 00000000000..74a9b6d9f94 --- /dev/null +++ b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/Implement_java_util_Collection.descriptors.pretty.txt @@ -0,0 +1,31 @@ +override operator fun iterator(): kotlin.collections.MutableIterator + +open operator fun equals(other: kotlin.Any?): kotlin.Boolean + +open fun hashCode(): kotlin.Int + +open fun toString(): kotlin.String + +fun size(): kotlin.Int + +fun isEmpty(): kotlin.Boolean + +operator fun contains(p0: kotlin.Anykotlin.Any?!): kotlin.Boolean + +fun toArray(): kotlin.Arraykotlin.Array?! + +fun toArray(p0: kotlin.Arraykotlin.Array?!): kotlin.Arraykotlin.Array?! + +fun add(p0: EE?!): kotlin.Boolean + +fun remove(p0: kotlin.Anykotlin.Any?!): kotlin.Boolean + +fun containsAll(p0: kotlin.collections.MutableCollection<*>kotlin.collections.Collection<*>?!): kotlin.Boolean + +fun addAll(p0: kotlin.collections.MutableCollectionkotlin.collections.Collection?!): kotlin.Boolean + +fun removeAll(p0: kotlin.collections.MutableCollection<*>kotlin.collections.Collection<*>?!): kotlin.Boolean + +fun retainAll(p0: kotlin.collections.MutableCollection<*>kotlin.collections.Collection<*>?!): kotlin.Boolean + +fun clear() \ No newline at end of file diff --git a/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/Implement_java_util_Collection.descriptors.txt b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/Implement_java_util_Collection.descriptors.txt new file mode 100644 index 00000000000..d19bc42cd2d --- /dev/null +++ b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/Implement_java_util_Collection.descriptors.txt @@ -0,0 +1,95 @@ +KtFunctionSymbol: + callableIdIfNonLocal: java/util/Collection.iterator + name: iterator + origin: JAVA + getDispatchReceiver(): java/util/Collection + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.equals + name: equals + origin: LIBRARY + getDispatchReceiver(): kotlin/Any + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.hashCode + name: hashCode + origin: LIBRARY + getDispatchReceiver(): kotlin/Any + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.toString + name: toString + origin: LIBRARY + getDispatchReceiver(): kotlin/Any + +KtFunctionSymbol: + callableIdIfNonLocal: java/util/Collection.size + name: size + origin: JAVA + getDispatchReceiver(): java/util/Collection + +KtFunctionSymbol: + callableIdIfNonLocal: java/util/Collection.isEmpty + name: isEmpty + origin: JAVA + getDispatchReceiver(): java/util/Collection + +KtFunctionSymbol: + callableIdIfNonLocal: java/util/Collection.contains + name: contains + origin: JAVA + getDispatchReceiver(): java/util/Collection + +KtFunctionSymbol: + callableIdIfNonLocal: java/util/Collection.toArray + name: toArray + origin: JAVA + getDispatchReceiver(): java/util/Collection + +KtFunctionSymbol: + callableIdIfNonLocal: java/util/Collection.toArray + name: toArray + origin: JAVA + getDispatchReceiver(): java/util/Collection + +KtFunctionSymbol: + callableIdIfNonLocal: java/util/Collection.add + name: add + origin: JAVA + getDispatchReceiver(): java/util/Collection + +KtFunctionSymbol: + callableIdIfNonLocal: java/util/Collection.remove + name: remove + origin: JAVA + getDispatchReceiver(): java/util/Collection + +KtFunctionSymbol: + callableIdIfNonLocal: java/util/Collection.containsAll + name: containsAll + origin: JAVA + getDispatchReceiver(): java/util/Collection + +KtFunctionSymbol: + callableIdIfNonLocal: java/util/Collection.addAll + name: addAll + origin: JAVA + getDispatchReceiver(): java/util/Collection + +KtFunctionSymbol: + callableIdIfNonLocal: java/util/Collection.removeAll + name: removeAll + origin: JAVA + getDispatchReceiver(): java/util/Collection + +KtFunctionSymbol: + callableIdIfNonLocal: java/util/Collection.retainAll + name: retainAll + origin: JAVA + getDispatchReceiver(): java/util/Collection + +KtFunctionSymbol: + callableIdIfNonLocal: java/util/Collection.clear + name: clear + origin: JAVA + getDispatchReceiver(): java/util/Collection \ No newline at end of file diff --git a/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/MemberFunctionWithOuterTypeParameterBound.descriptors.pretty.txt b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/MemberFunctionWithOuterTypeParameterBound.descriptors.pretty.txt new file mode 100644 index 00000000000..947e188684e --- /dev/null +++ b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/MemberFunctionWithOuterTypeParameterBound.descriptors.pretty.txt @@ -0,0 +1,9 @@ +abstract fun funWithOuterAndOwnGenericsAndBounds(tT1: TT1?, tT2: TT2?) + +open val test.TwoParams.propWithOuterAndOwnGenericsAndBounds: test.Foo? + +open operator fun equals(other: kotlin.Any?): kotlin.Boolean + +open fun hashCode(): kotlin.Int + +open fun toString(): kotlin.String \ No newline at end of file diff --git a/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/MemberFunctionWithOuterTypeParameterBound.descriptors.txt b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/MemberFunctionWithOuterTypeParameterBound.descriptors.txt new file mode 100644 index 00000000000..b614c0fca01 --- /dev/null +++ b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/MemberFunctionWithOuterTypeParameterBound.descriptors.txt @@ -0,0 +1,29 @@ +KtFunctionSymbol: + callableIdIfNonLocal: test/MyClass.funWithOuterAndOwnGenericsAndBounds + name: funWithOuterAndOwnGenericsAndBounds + origin: SOURCE + getDispatchReceiver(): test/MyInterface + +KtKotlinPropertySymbol: + callableIdIfNonLocal: test/MyClass.propWithOuterAndOwnGenericsAndBounds + name: propWithOuterAndOwnGenericsAndBounds + origin: SOURCE + getDispatchReceiver(): test/MyInterface + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.equals + name: equals + origin: LIBRARY + getDispatchReceiver(): kotlin/Any + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.hashCode + name: hashCode + origin: LIBRARY + getDispatchReceiver(): kotlin/Any + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.toString + name: toString + origin: LIBRARY + getDispatchReceiver(): kotlin/Any \ No newline at end of file diff --git a/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/MemberPropertyWithOuterTypeParameterBound.descriptors.pretty.txt b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/MemberPropertyWithOuterTypeParameterBound.descriptors.pretty.txt new file mode 100644 index 00000000000..4f946d839ea --- /dev/null +++ b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/MemberPropertyWithOuterTypeParameterBound.descriptors.pretty.txt @@ -0,0 +1,9 @@ +val Own.withOwnGeneric_InterfaceWithValBase: test.ClassA + +abstract val Own.withOwnAndOuterGenericAsTypeBound_InterfaceWithValBase: test.ClassA + +open operator fun equals(other: kotlin.Any?): kotlin.Boolean + +open fun hashCode(): kotlin.Int + +open fun toString(): kotlin.String \ No newline at end of file diff --git a/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/MemberPropertyWithOuterTypeParameterBound.descriptors.txt b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/MemberPropertyWithOuterTypeParameterBound.descriptors.txt new file mode 100644 index 00000000000..35d4fa96e4b --- /dev/null +++ b/analysis/analysis-api/testData/scopes/substitutionOverridesUnwrapping/MemberPropertyWithOuterTypeParameterBound.descriptors.txt @@ -0,0 +1,29 @@ +KtKotlinPropertySymbol: + callableIdIfNonLocal: test/MyInterface.withOwnGeneric_InterfaceWithValBase + name: withOwnGeneric_InterfaceWithValBase + origin: LIBRARY + getDispatchReceiver(): test/MyInterface + +KtKotlinPropertySymbol: + callableIdIfNonLocal: test/Inheritor.withOwnAndOuterGenericAsTypeBound_InterfaceWithValBase + name: withOwnAndOuterGenericAsTypeBound_InterfaceWithValBase + origin: SOURCE + getDispatchReceiver(): test/MyInterface + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.equals + name: equals + origin: LIBRARY + getDispatchReceiver(): kotlin/Any + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.hashCode + name: hashCode + origin: LIBRARY + getDispatchReceiver(): kotlin/Any + +KtFunctionSymbol: + callableIdIfNonLocal: kotlin/Any.toString + name: toString + origin: LIBRARY + getDispatchReceiver(): kotlin/Any \ No newline at end of file diff --git a/analysis/analysis-api/testData/symbols/symbolByReference/genericFromOuterClassInInnerClass.descriptors.txt b/analysis/analysis-api/testData/symbols/symbolByReference/genericFromOuterClassInInnerClass.descriptors.txt index a8853a6ea96..f6b3b0310c9 100644 --- a/analysis/analysis-api/testData/symbols/symbolByReference/genericFromOuterClassInInnerClass.descriptors.txt +++ b/analysis/analysis-api/testData/symbols/symbolByReference/genericFromOuterClassInInnerClass.descriptors.txt @@ -1,6 +1,6 @@ KtFunctionSymbol: annotationsList: [] - callableIdIfNonLocal: test/TopLevel.Child.withOuter + callableIdIfNonLocal: test/TopLevel.Base.withOuter hasStableParameterNames: true isBuiltinFunctionInvoke: false isExtension: false @@ -13,12 +13,12 @@ KtFunctionSymbol: isSuspend: false modality: FINAL name: withOuter - origin: SOURCE + origin: LIBRARY receiverType: null returnType: Outer? symbolKind: CLASS_MEMBER typeParameters: [] valueParameters: [] visibility: Public - getDispatchReceiver(): test/TopLevel.test/TopLevel.Base - deprecationStatus: null + getDispatchReceiver(): test/TopLevel.test/TopLevel.Base + deprecationStatus: null \ No newline at end of file diff --git a/generators/analysis-api-generator/tests/org/jetbrains/kotlin/generators/tests/analysis/api/analysisApi.kt b/generators/analysis-api-generator/tests/org/jetbrains/kotlin/generators/tests/analysis/api/analysisApi.kt index cd9803c0026..0d8d8c6635e 100644 --- a/generators/analysis-api-generator/tests/org/jetbrains/kotlin/generators/tests/analysis/api/analysisApi.kt +++ b/generators/analysis-api-generator/tests/org/jetbrains/kotlin/generators/tests/analysis/api/analysisApi.kt @@ -18,6 +18,7 @@ import org.jetbrains.kotlin.analysis.api.descriptors.test.components.symbolDecla import org.jetbrains.kotlin.analysis.api.descriptors.test.components.typeCreator.AbstractKtFe10TypeParameterTypeTest import org.jetbrains.kotlin.analysis.api.descriptors.test.components.typeProvider.AbstractKtFe10HasCommonSubtypeTest import org.jetbrains.kotlin.analysis.api.descriptors.test.components.expressionTypeProvider.AbstractKtFe10DeclarationReturnTypeTest +import org.jetbrains.kotlin.analysis.api.descriptors.test.scopes.AbstractKtFe10SubstitutionOverridesUnwrappingTest import org.jetbrains.kotlin.analysis.api.descriptors.test.symbols.AbstractKtFe10SymbolByFqNameTest import org.jetbrains.kotlin.analysis.api.descriptors.test.symbols.AbstractKtFe10SymbolByPsiTest import org.jetbrains.kotlin.analysis.api.descriptors.test.symbols.AbstractKtFe10SymbolByReferenceTest @@ -67,7 +68,7 @@ private fun TestGroupSuite.generateAnalysisApiNonComponentsTests() { group("scopes") { test( fir = AbstractFirSubstitutionOverridesUnwrappingTest::class, - fe10 = null, + fe10 = AbstractKtFe10SubstitutionOverridesUnwrappingTest::class, ) { model("substitutionOverridesUnwrapping") }