diff --git a/analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/components/scopeProvider/FirIdeNormalAnalysisScriptSourceModuleCombinedDeclaredMemberScopeTestGenerated.java b/analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/components/scopeProvider/FirIdeNormalAnalysisScriptSourceModuleCombinedDeclaredMemberScopeTestGenerated.java new file mode 100644 index 00000000000..66222c1b9c2 --- /dev/null +++ b/analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/components/scopeProvider/FirIdeNormalAnalysisScriptSourceModuleCombinedDeclaredMemberScopeTestGenerated.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010-2023 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.fir.test.cases.generated.cases.components.scopeProvider; + +import com.intellij.testFramework.TestDataPath; +import org.jetbrains.kotlin.test.util.KtTestUtil; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.kotlin.analysis.api.fir.test.configurators.AnalysisApiFirTestConfiguratorFactory; +import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfiguratorFactoryData; +import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfigurator; +import org.jetbrains.kotlin.analysis.test.framework.test.configurators.TestModuleKind; +import org.jetbrains.kotlin.analysis.test.framework.test.configurators.FrontendKind; +import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisSessionMode; +import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiMode; +import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.components.scopeProvider.AbstractCombinedDeclaredMemberScopeTest; +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 org.jetbrains.kotlin.generators.tests.analysis.api.GenerateAnalysisApiTestsKt}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope") +@TestDataPath("$PROJECT_ROOT") +public class FirIdeNormalAnalysisScriptSourceModuleCombinedDeclaredMemberScopeTestGenerated extends AbstractCombinedDeclaredMemberScopeTest { + @NotNull + @Override + public AnalysisApiTestConfigurator getConfigurator() { + return AnalysisApiFirTestConfiguratorFactory.INSTANCE.createConfigurator( + new AnalysisApiTestConfiguratorFactoryData( + FrontendKind.Fir, + TestModuleKind.ScriptSource, + AnalysisSessionMode.Normal, + AnalysisApiMode.Ide + ) + ); + } + + @Test + public void testAllFilesPresentInCombinedDeclaredMemberScope() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope"), Pattern.compile("^(.+)\\.kts$"), null, true); + } + + @Test + @TestMetadata("scriptWithClassDeclaration.kts") + public void testScriptWithClassDeclaration() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/scriptWithClassDeclaration.kts"); + } +} diff --git a/analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/components/scopeProvider/FirIdeNormalAnalysisScriptSourceModuleDeclaredMemberScopeTestGenerated.java b/analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/components/scopeProvider/FirIdeNormalAnalysisScriptSourceModuleDeclaredMemberScopeTestGenerated.java index 0c79feb12ec..47ea32f82ed 100644 --- a/analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/components/scopeProvider/FirIdeNormalAnalysisScriptSourceModuleDeclaredMemberScopeTestGenerated.java +++ b/analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/components/scopeProvider/FirIdeNormalAnalysisScriptSourceModuleDeclaredMemberScopeTestGenerated.java @@ -46,6 +46,12 @@ public class FirIdeNormalAnalysisScriptSourceModuleDeclaredMemberScopeTestGenera KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope"), Pattern.compile("^(.+)\\.kts$"), null, true); } + @Test + @TestMetadata("scriptWithClassDeclaration.kts") + public void testScriptWithClassDeclaration() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/scriptWithClassDeclaration.kts"); + } + @Test @TestMetadata("simpleScriptWithResultDeclaration.kts") public void testSimpleScriptWithResultDeclaration() throws Exception { diff --git a/analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/components/scopeProvider/FirIdeNormalAnalysisScriptSourceModuleStaticDeclaredMemberScopeTestGenerated.java b/analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/components/scopeProvider/FirIdeNormalAnalysisScriptSourceModuleStaticDeclaredMemberScopeTestGenerated.java index 890bcacfddb..b732458642d 100644 --- a/analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/components/scopeProvider/FirIdeNormalAnalysisScriptSourceModuleStaticDeclaredMemberScopeTestGenerated.java +++ b/analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/components/scopeProvider/FirIdeNormalAnalysisScriptSourceModuleStaticDeclaredMemberScopeTestGenerated.java @@ -45,4 +45,10 @@ public class FirIdeNormalAnalysisScriptSourceModuleStaticDeclaredMemberScopeTest public void testAllFilesPresentInStaticDeclaredMemberScope() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/scopeProvider/staticDeclaredMemberScope"), Pattern.compile("^(.+)\\.kts$"), null, true); } + + @Test + @TestMetadata("scriptWithClassDeclaration.kts") + public void testScriptWithClassDeclaration() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/staticDeclaredMemberScope/scriptWithClassDeclaration.kts"); + } } diff --git a/analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/components/scopeProvider/FirIdeNormalAnalysisSourceModuleCombinedDeclaredMemberScopeTestGenerated.java b/analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/components/scopeProvider/FirIdeNormalAnalysisSourceModuleCombinedDeclaredMemberScopeTestGenerated.java new file mode 100644 index 00000000000..5205a9a505f --- /dev/null +++ b/analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/components/scopeProvider/FirIdeNormalAnalysisSourceModuleCombinedDeclaredMemberScopeTestGenerated.java @@ -0,0 +1,126 @@ +/* + * Copyright 2010-2023 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.fir.test.cases.generated.cases.components.scopeProvider; + +import com.intellij.testFramework.TestDataPath; +import org.jetbrains.kotlin.test.util.KtTestUtil; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.kotlin.analysis.api.fir.test.configurators.AnalysisApiFirTestConfiguratorFactory; +import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfiguratorFactoryData; +import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfigurator; +import org.jetbrains.kotlin.analysis.test.framework.test.configurators.TestModuleKind; +import org.jetbrains.kotlin.analysis.test.framework.test.configurators.FrontendKind; +import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisSessionMode; +import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiMode; +import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.components.scopeProvider.AbstractCombinedDeclaredMemberScopeTest; +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 org.jetbrains.kotlin.generators.tests.analysis.api.GenerateAnalysisApiTestsKt}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope") +@TestDataPath("$PROJECT_ROOT") +public class FirIdeNormalAnalysisSourceModuleCombinedDeclaredMemberScopeTestGenerated extends AbstractCombinedDeclaredMemberScopeTest { + @NotNull + @Override + public AnalysisApiTestConfigurator getConfigurator() { + return AnalysisApiFirTestConfiguratorFactory.INSTANCE.createConfigurator( + new AnalysisApiTestConfiguratorFactoryData( + FrontendKind.Fir, + TestModuleKind.Source, + AnalysisSessionMode.Normal, + AnalysisApiMode.Ide + ) + ); + } + + @Test + public void testAllFilesPresentInCombinedDeclaredMemberScope() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("class.kt") + public void testClass() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/class.kt"); + } + + @Test + @TestMetadata("classWithJavaSuperclass.kt") + public void testClassWithJavaSuperclass() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/classWithJavaSuperclass.kt"); + } + + @Test + @TestMetadata("enumClass.kt") + public void testEnumClass() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumClass.kt"); + } + + @Test + @TestMetadata("enumClassWithAbstractMembers.kt") + public void testEnumClassWithAbstractMembers() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumClassWithAbstractMembers.kt"); + } + + @Test + @TestMetadata("enumClassWithFinalMembers.kt") + public void testEnumClassWithFinalMembers() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumClassWithFinalMembers.kt"); + } + + @Test + @TestMetadata("enumEntryInitializer.kt") + public void testEnumEntryInitializer() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializer.kt"); + } + + @Test + @TestMetadata("enumEntryInitializerWithEmptyBody.kt") + public void testEnumEntryInitializerWithEmptyBody() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializerWithEmptyBody.kt"); + } + + @Test + @TestMetadata("enumEntryInitializerWithFinalEnumMember.kt") + public void testEnumEntryInitializerWithFinalEnumMember() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializerWithFinalEnumMember.kt"); + } + + @Test + @TestMetadata("enumEntryInitializerWithOverriddenMember.kt") + public void testEnumEntryInitializerWithOverriddenMember() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializerWithOverriddenMember.kt"); + } + + @Test + @TestMetadata("javaClass.kt") + public void testJavaClass() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaClass.kt"); + } + + @Test + @TestMetadata("javaDeclaredEnhancementScope.kt") + public void testJavaDeclaredEnhancementScope() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaDeclaredEnhancementScope.kt"); + } + + @Test + @TestMetadata("javaDeclaredInheritList.kt") + public void testJavaDeclaredInheritList() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaDeclaredInheritList.kt"); + } + + @Test + @TestMetadata("javaInnerClassConstructor.kt") + public void testJavaInnerClassConstructor() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaInnerClassConstructor.kt"); + } +} diff --git a/analysis/analysis-api-impl-base/tests/org/jetbrains/kotlin/analysis/api/impl/base/test/cases/components/scopeProvider/AbstractMemberScopeTests.kt b/analysis/analysis-api-impl-base/tests/org/jetbrains/kotlin/analysis/api/impl/base/test/cases/components/scopeProvider/AbstractMemberScopeTests.kt index 00e9cf90d53..2c4dd34c943 100644 --- a/analysis/analysis-api-impl-base/tests/org/jetbrains/kotlin/analysis/api/impl/base/test/cases/components/scopeProvider/AbstractMemberScopeTests.kt +++ b/analysis/analysis-api-impl-base/tests/org/jetbrains/kotlin/analysis/api/impl/base/test/cases/components/scopeProvider/AbstractMemberScopeTests.kt @@ -47,6 +47,11 @@ abstract class AbstractStaticDeclaredMemberScopeTest : AbstractMemberScopeTestBa override fun KtSymbolWithMembers.getSymbolsFromScope(): Sequence = getStaticDeclaredMemberScope().getAllSymbols() } +abstract class AbstractCombinedDeclaredMemberScopeTest : AbstractMemberScopeTestBase() { + context(KtAnalysisSession) + override fun KtSymbolWithMembers.getSymbolsFromScope(): Sequence = getCombinedDeclaredMemberScope().getAllSymbols() +} + abstract class AbstractDelegateMemberScopeTest : AbstractMemberScopeTestBase() { context(KtAnalysisSession) override fun KtSymbolWithMembers.getSymbolsFromScope(): Sequence = getDelegatedMemberScope().getCallableSymbols() diff --git a/analysis/analysis-api-standalone/tests-gen/org/jetbrains/kotlin/analysis/api/standalone/fir/test/cases/generated/cases/components/scopeProvider/FirStandaloneNormalAnalysisSourceModuleCombinedDeclaredMemberScopeTestGenerated.java b/analysis/analysis-api-standalone/tests-gen/org/jetbrains/kotlin/analysis/api/standalone/fir/test/cases/generated/cases/components/scopeProvider/FirStandaloneNormalAnalysisSourceModuleCombinedDeclaredMemberScopeTestGenerated.java new file mode 100644 index 00000000000..ac30eb2a74c --- /dev/null +++ b/analysis/analysis-api-standalone/tests-gen/org/jetbrains/kotlin/analysis/api/standalone/fir/test/cases/generated/cases/components/scopeProvider/FirStandaloneNormalAnalysisSourceModuleCombinedDeclaredMemberScopeTestGenerated.java @@ -0,0 +1,126 @@ +/* + * Copyright 2010-2023 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.standalone.fir.test.cases.generated.cases.components.scopeProvider; + +import com.intellij.testFramework.TestDataPath; +import org.jetbrains.kotlin.test.util.KtTestUtil; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.kotlin.analysis.api.standalone.fir.test.AnalysisApiFirStandaloneModeTestConfiguratorFactory; +import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfiguratorFactoryData; +import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfigurator; +import org.jetbrains.kotlin.analysis.test.framework.test.configurators.TestModuleKind; +import org.jetbrains.kotlin.analysis.test.framework.test.configurators.FrontendKind; +import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisSessionMode; +import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiMode; +import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.components.scopeProvider.AbstractCombinedDeclaredMemberScopeTest; +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 org.jetbrains.kotlin.generators.tests.analysis.api.GenerateAnalysisApiTestsKt}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope") +@TestDataPath("$PROJECT_ROOT") +public class FirStandaloneNormalAnalysisSourceModuleCombinedDeclaredMemberScopeTestGenerated extends AbstractCombinedDeclaredMemberScopeTest { + @NotNull + @Override + public AnalysisApiTestConfigurator getConfigurator() { + return AnalysisApiFirStandaloneModeTestConfiguratorFactory.INSTANCE.createConfigurator( + new AnalysisApiTestConfiguratorFactoryData( + FrontendKind.Fir, + TestModuleKind.Source, + AnalysisSessionMode.Normal, + AnalysisApiMode.Standalone + ) + ); + } + + @Test + public void testAllFilesPresentInCombinedDeclaredMemberScope() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("class.kt") + public void testClass() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/class.kt"); + } + + @Test + @TestMetadata("classWithJavaSuperclass.kt") + public void testClassWithJavaSuperclass() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/classWithJavaSuperclass.kt"); + } + + @Test + @TestMetadata("enumClass.kt") + public void testEnumClass() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumClass.kt"); + } + + @Test + @TestMetadata("enumClassWithAbstractMembers.kt") + public void testEnumClassWithAbstractMembers() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumClassWithAbstractMembers.kt"); + } + + @Test + @TestMetadata("enumClassWithFinalMembers.kt") + public void testEnumClassWithFinalMembers() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumClassWithFinalMembers.kt"); + } + + @Test + @TestMetadata("enumEntryInitializer.kt") + public void testEnumEntryInitializer() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializer.kt"); + } + + @Test + @TestMetadata("enumEntryInitializerWithEmptyBody.kt") + public void testEnumEntryInitializerWithEmptyBody() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializerWithEmptyBody.kt"); + } + + @Test + @TestMetadata("enumEntryInitializerWithFinalEnumMember.kt") + public void testEnumEntryInitializerWithFinalEnumMember() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializerWithFinalEnumMember.kt"); + } + + @Test + @TestMetadata("enumEntryInitializerWithOverriddenMember.kt") + public void testEnumEntryInitializerWithOverriddenMember() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializerWithOverriddenMember.kt"); + } + + @Test + @TestMetadata("javaClass.kt") + public void testJavaClass() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaClass.kt"); + } + + @Test + @TestMetadata("javaDeclaredEnhancementScope.kt") + public void testJavaDeclaredEnhancementScope() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaDeclaredEnhancementScope.kt"); + } + + @Test + @TestMetadata("javaDeclaredInheritList.kt") + public void testJavaDeclaredInheritList() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaDeclaredInheritList.kt"); + } + + @Test + @TestMetadata("javaInnerClassConstructor.kt") + public void testJavaInnerClassConstructor() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaInnerClassConstructor.kt"); + } +} diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/class.kt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/class.kt new file mode 100644 index 00000000000..84cb02bfc49 --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/class.kt @@ -0,0 +1,31 @@ +package test + +abstract class A { + fun perform() { } + + val x: Int = 0 + + class C1 + + object O1 + + companion object { + val y: Int = 0 + } +} + +class C : A() { + fun foo(): Int = 5 + + val bar: String = "" + + class C2 + + object O2 + + companion object { + val baz: String = "" + } +} + +// class: test/C diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/class.pretty.txt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/class.pretty.txt new file mode 100644 index 00000000000..15b582ff63a --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/class.pretty.txt @@ -0,0 +1,11 @@ +fun foo(): kotlin.Int + +val bar: kotlin.String + +class C2 + +object O2 + +companion object + +constructor() diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/class.txt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/class.txt new file mode 100644 index 00000000000..8c1dfdd9151 --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/class.txt @@ -0,0 +1,230 @@ +KtFunctionSymbol: + annotationsList: [] + callableIdIfNonLocal: test/C.foo + contextReceivers: [] + contractEffects: [] + hasStableParameterNames: true + isActual: false + isBuiltinFunctionInvoke: false + isExpect: false + isExtension: false + isExternal: false + isInfix: false + isInline: false + isOperator: false + isOverride: false + isStatic: false + isSuspend: false + modality: FINAL + name: foo + origin: SOURCE + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Int + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [] + visibility: Public + getDispatchReceiver(): KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/C + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + +KtKotlinPropertySymbol: + annotationsList: [] + backingFieldSymbol: KtBackingFieldSymbol: + annotationsList: [] + callableIdIfNonLocal: null + contextReceivers: [] + isExtension: false + name: field + origin: PROPERTY_BACKING_FIELD + owningProperty: KtKotlinPropertySymbol(test/C.bar) + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/String + symbolKind: LOCAL + typeParameters: [] + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + callableIdIfNonLocal: test/C.bar + contextReceivers: [] + getter: KtPropertyGetterSymbol: + annotationsList: [] + callableIdIfNonLocal: null + contextReceivers: [] + hasBody: false + hasStableParameterNames: true + isDefault: true + isExtension: false + isInline: false + isOverride: false + modality: FINAL + origin: SOURCE + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/String + symbolKind: ACCESSOR + typeParameters: [] + valueParameters: [] + visibility: Public + getDispatchReceiver(): KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/C + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + hasBackingField: true + hasGetter: true + hasSetter: false + initializer: KtConstantInitializerValue("") + isActual: false + isConst: false + isDelegatedProperty: false + isExpect: false + isExtension: false + isFromPrimaryConstructor: false + isLateInit: false + isOverride: false + isStatic: false + isVal: true + modality: FINAL + name: bar + origin: SOURCE + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/String + setter: null + symbolKind: CLASS_MEMBER + typeParameters: [] + visibility: Public + getDispatchReceiver(): KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/C + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + getterDeprecationStatus: null + javaGetterName: getBar + javaSetterName: null + setterDeprecationStatus: null + +KtNamedClassOrObjectSymbol: + annotationsList: [] + classIdIfNonLocal: test/C.C2 + classKind: CLASS + companionObject: null + contextReceivers: [] + isActual: false + isData: false + isExpect: false + isExternal: false + isFun: false + isInline: false + isInner: false + modality: FINAL + name: C2 + origin: SOURCE + superTypes: [ + KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Any + ] + symbolKind: CLASS_MEMBER + typeParameters: [] + visibility: Public + getContainingModule: KtSourceModule "Sources of main" + annotationApplicableTargets: null + deprecationStatus: null + +KtNamedClassOrObjectSymbol: + annotationsList: [] + classIdIfNonLocal: test/C.O2 + classKind: OBJECT + companionObject: null + contextReceivers: [] + isActual: false + isData: false + isExpect: false + isExternal: false + isFun: false + isInline: false + isInner: false + modality: FINAL + name: O2 + origin: SOURCE + superTypes: [ + KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Any + ] + symbolKind: CLASS_MEMBER + typeParameters: [] + visibility: Public + getContainingModule: KtSourceModule "Sources of main" + annotationApplicableTargets: null + deprecationStatus: null + +KtNamedClassOrObjectSymbol: + annotationsList: [] + classIdIfNonLocal: test/C.Companion + classKind: COMPANION_OBJECT + companionObject: null + contextReceivers: [] + isActual: false + isData: false + isExpect: false + isExternal: false + isFun: false + isInline: false + isInner: false + modality: FINAL + name: Companion + origin: SOURCE + superTypes: [ + KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Any + ] + symbolKind: CLASS_MEMBER + typeParameters: [] + visibility: Public + getContainingModule: KtSourceModule "Sources of main" + annotationApplicableTargets: null + deprecationStatus: null + +KtConstructorSymbol: + annotationsList: [] + callableIdIfNonLocal: null + containingClassIdIfNonLocal: test/C + contextReceivers: [] + hasStableParameterNames: true + isActual: false + isExpect: false + isExtension: false + isPrimary: true + origin: SOURCE_MEMBER_GENERATED + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/C + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [] + visibility: Public + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/classWithJavaSuperclass.kt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/classWithJavaSuperclass.kt new file mode 100644 index 00000000000..ab423329f25 --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/classWithJavaSuperclass.kt @@ -0,0 +1,35 @@ +// class: test/KotlinClass +// FILE: JavaClass.java +package test + +public abstract class JavaClass { + public void perform() { + } + + public int x = 0; + + public static void hello() { + } + + public static int y = 1; + + public static class C1 { + } +} + +// FILE: KotlinClass.kt +package test + +class KotlinClass : JavaClass() { + fun foo(): Int = 5 + + val bar: String = "" + + class C2 + + object O2 + + companion object { + val baz: String = "" + } +} diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/classWithJavaSuperclass.pretty.txt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/classWithJavaSuperclass.pretty.txt new file mode 100644 index 00000000000..15b582ff63a --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/classWithJavaSuperclass.pretty.txt @@ -0,0 +1,11 @@ +fun foo(): kotlin.Int + +val bar: kotlin.String + +class C2 + +object O2 + +companion object + +constructor() diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/classWithJavaSuperclass.txt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/classWithJavaSuperclass.txt new file mode 100644 index 00000000000..5b2b4578c9e --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/classWithJavaSuperclass.txt @@ -0,0 +1,230 @@ +KtFunctionSymbol: + annotationsList: [] + callableIdIfNonLocal: test/KotlinClass.foo + contextReceivers: [] + contractEffects: [] + hasStableParameterNames: true + isActual: false + isBuiltinFunctionInvoke: false + isExpect: false + isExtension: false + isExternal: false + isInfix: false + isInline: false + isOperator: false + isOverride: false + isStatic: false + isSuspend: false + modality: FINAL + name: foo + origin: SOURCE + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Int + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [] + visibility: Public + getDispatchReceiver(): KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/KotlinClass + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + +KtKotlinPropertySymbol: + annotationsList: [] + backingFieldSymbol: KtBackingFieldSymbol: + annotationsList: [] + callableIdIfNonLocal: null + contextReceivers: [] + isExtension: false + name: field + origin: PROPERTY_BACKING_FIELD + owningProperty: KtKotlinPropertySymbol(test/KotlinClass.bar) + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/String + symbolKind: LOCAL + typeParameters: [] + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + callableIdIfNonLocal: test/KotlinClass.bar + contextReceivers: [] + getter: KtPropertyGetterSymbol: + annotationsList: [] + callableIdIfNonLocal: null + contextReceivers: [] + hasBody: false + hasStableParameterNames: true + isDefault: true + isExtension: false + isInline: false + isOverride: false + modality: FINAL + origin: SOURCE + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/String + symbolKind: ACCESSOR + typeParameters: [] + valueParameters: [] + visibility: Public + getDispatchReceiver(): KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/KotlinClass + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + hasBackingField: true + hasGetter: true + hasSetter: false + initializer: KtConstantInitializerValue("") + isActual: false + isConst: false + isDelegatedProperty: false + isExpect: false + isExtension: false + isFromPrimaryConstructor: false + isLateInit: false + isOverride: false + isStatic: false + isVal: true + modality: FINAL + name: bar + origin: SOURCE + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/String + setter: null + symbolKind: CLASS_MEMBER + typeParameters: [] + visibility: Public + getDispatchReceiver(): KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/KotlinClass + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + getterDeprecationStatus: null + javaGetterName: getBar + javaSetterName: null + setterDeprecationStatus: null + +KtNamedClassOrObjectSymbol: + annotationsList: [] + classIdIfNonLocal: test/KotlinClass.C2 + classKind: CLASS + companionObject: null + contextReceivers: [] + isActual: false + isData: false + isExpect: false + isExternal: false + isFun: false + isInline: false + isInner: false + modality: FINAL + name: C2 + origin: SOURCE + superTypes: [ + KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Any + ] + symbolKind: CLASS_MEMBER + typeParameters: [] + visibility: Public + getContainingModule: KtSourceModule "Sources of main" + annotationApplicableTargets: null + deprecationStatus: null + +KtNamedClassOrObjectSymbol: + annotationsList: [] + classIdIfNonLocal: test/KotlinClass.O2 + classKind: OBJECT + companionObject: null + contextReceivers: [] + isActual: false + isData: false + isExpect: false + isExternal: false + isFun: false + isInline: false + isInner: false + modality: FINAL + name: O2 + origin: SOURCE + superTypes: [ + KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Any + ] + symbolKind: CLASS_MEMBER + typeParameters: [] + visibility: Public + getContainingModule: KtSourceModule "Sources of main" + annotationApplicableTargets: null + deprecationStatus: null + +KtNamedClassOrObjectSymbol: + annotationsList: [] + classIdIfNonLocal: test/KotlinClass.Companion + classKind: COMPANION_OBJECT + companionObject: null + contextReceivers: [] + isActual: false + isData: false + isExpect: false + isExternal: false + isFun: false + isInline: false + isInner: false + modality: FINAL + name: Companion + origin: SOURCE + superTypes: [ + KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Any + ] + symbolKind: CLASS_MEMBER + typeParameters: [] + visibility: Public + getContainingModule: KtSourceModule "Sources of main" + annotationApplicableTargets: null + deprecationStatus: null + +KtConstructorSymbol: + annotationsList: [] + callableIdIfNonLocal: null + containingClassIdIfNonLocal: test/KotlinClass + contextReceivers: [] + hasStableParameterNames: true + isActual: false + isExpect: false + isExtension: false + isPrimary: true + origin: SOURCE_MEMBER_GENERATED + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/KotlinClass + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [] + visibility: Public + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumClass.kt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumClass.kt new file mode 100644 index 00000000000..441beb5821b --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumClass.kt @@ -0,0 +1,10 @@ +package test + +enum class E { + A { + val x: String = "" + }, + B +} + +// class: test/E diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumClass.pretty.txt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumClass.pretty.txt new file mode 100644 index 00000000000..c9d0876452d --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumClass.pretty.txt @@ -0,0 +1,11 @@ +A + +B + +fun values(): kotlin.Array + +fun valueOf(value: kotlin.String): test.E + +val entries: kotlin.enums.EnumEntries + +constructor() diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumClass.txt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumClass.txt new file mode 100644 index 00000000000..9a329111a0f --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumClass.txt @@ -0,0 +1,223 @@ +KtEnumEntrySymbol: + annotationsList: [] + callableIdIfNonLocal: test/E.A + containingEnumClassIdIfNonLocal: test/E + contextReceivers: [] + enumEntryInitializer: KtAnonymousObjectSymbol(/) + isExtension: false + name: A + origin: SOURCE + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/E + symbolKind: CLASS_MEMBER + typeParameters: [] + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + +KtEnumEntrySymbol: + annotationsList: [] + callableIdIfNonLocal: test/E.B + containingEnumClassIdIfNonLocal: test/E + contextReceivers: [] + enumEntryInitializer: null + isExtension: false + name: B + origin: SOURCE + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/E + symbolKind: CLASS_MEMBER + typeParameters: [] + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + +KtFunctionSymbol: + annotationsList: [] + callableIdIfNonLocal: test/E.values + contextReceivers: [] + contractEffects: [] + hasStableParameterNames: true + isActual: false + isBuiltinFunctionInvoke: false + isExpect: false + isExtension: false + isExternal: false + isInfix: false + isInline: false + isOperator: false + isOverride: false + isStatic: true + isSuspend: false + modality: FINAL + name: values + origin: SOURCE_MEMBER_GENERATED + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [ + KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/E + ] + type: kotlin/Array + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [] + visibility: Public + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + +KtFunctionSymbol: + annotationsList: [] + callableIdIfNonLocal: test/E.valueOf + contextReceivers: [] + contractEffects: [] + hasStableParameterNames: true + isActual: false + isBuiltinFunctionInvoke: false + isExpect: false + isExtension: false + isExternal: false + isInfix: false + isInline: false + isOperator: false + isOverride: false + isStatic: true + isSuspend: false + modality: FINAL + name: valueOf + origin: SOURCE_MEMBER_GENERATED + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/E + 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: value + origin: SOURCE_MEMBER_GENERATED + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/String + symbolKind: LOCAL + typeParameters: [] + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + ] + visibility: Public + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + +KtKotlinPropertySymbol: + annotationsList: [] + backingFieldSymbol: null + callableIdIfNonLocal: test/E.entries + contextReceivers: [] + getter: KtPropertyGetterSymbol: + annotationsList: [] + callableIdIfNonLocal: null + contextReceivers: [] + hasBody: false + hasStableParameterNames: true + isDefault: true + isExtension: false + isInline: false + isOverride: false + modality: FINAL + origin: SOURCE_MEMBER_GENERATED + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [ + KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/E + ] + type: kotlin/enums/EnumEntries + symbolKind: ACCESSOR + typeParameters: [] + valueParameters: [] + visibility: Public + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + hasBackingField: false + hasGetter: true + hasSetter: false + initializer: null + isActual: false + isConst: false + isDelegatedProperty: false + isExpect: false + isExtension: false + isFromPrimaryConstructor: false + isLateInit: false + isOverride: false + isStatic: true + isVal: true + modality: FINAL + name: entries + origin: SOURCE_MEMBER_GENERATED + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [ + KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/E + ] + type: kotlin/enums/EnumEntries + setter: null + symbolKind: CLASS_MEMBER + typeParameters: [] + visibility: Public + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + getterDeprecationStatus: null + javaGetterName: getEntries + javaSetterName: null + setterDeprecationStatus: null + +KtConstructorSymbol: + annotationsList: [] + callableIdIfNonLocal: null + containingClassIdIfNonLocal: test/E + contextReceivers: [] + hasStableParameterNames: true + isActual: false + isExpect: false + isExtension: false + isPrimary: true + origin: SOURCE_MEMBER_GENERATED + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/E + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [] + visibility: Private + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumClassWithAbstractMembers.kt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumClassWithAbstractMembers.kt new file mode 100644 index 00000000000..8a15b38f74c --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumClassWithAbstractMembers.kt @@ -0,0 +1,24 @@ +package test + +enum class E { + A { + override val foo: Int = 65 + + override fun bar() { + println(foo) + } + }, + B { + override val foo: Int? = null + + override fun bar() { + println("Nothing to see here!") + } + }; + + abstract val foo: Int? + + abstract fun bar() +} + +// class: test/E diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumClassWithAbstractMembers.pretty.txt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumClassWithAbstractMembers.pretty.txt new file mode 100644 index 00000000000..026ef95ea6d --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumClassWithAbstractMembers.pretty.txt @@ -0,0 +1,15 @@ +A + +B + +abstract val foo: kotlin.Int? + +abstract fun bar() + +fun values(): kotlin.Array + +fun valueOf(value: kotlin.String): test.E + +val entries: kotlin.enums.EnumEntries + +constructor() diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumClassWithAbstractMembers.txt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumClassWithAbstractMembers.txt new file mode 100644 index 00000000000..24db3a68f1c --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumClassWithAbstractMembers.txt @@ -0,0 +1,344 @@ +KtEnumEntrySymbol: + annotationsList: [] + callableIdIfNonLocal: test/E.A + containingEnumClassIdIfNonLocal: test/E + contextReceivers: [] + enumEntryInitializer: KtAnonymousObjectSymbol(/) + isExtension: false + name: A + origin: SOURCE + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/E + symbolKind: CLASS_MEMBER + typeParameters: [] + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + +KtEnumEntrySymbol: + annotationsList: [] + callableIdIfNonLocal: test/E.B + containingEnumClassIdIfNonLocal: test/E + contextReceivers: [] + enumEntryInitializer: KtAnonymousObjectSymbol(/) + isExtension: false + name: B + origin: SOURCE + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/E + symbolKind: CLASS_MEMBER + typeParameters: [] + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + +KtKotlinPropertySymbol: + annotationsList: [] + backingFieldSymbol: KtBackingFieldSymbol: + annotationsList: [] + callableIdIfNonLocal: null + contextReceivers: [] + isExtension: false + name: field + origin: PROPERTY_BACKING_FIELD + owningProperty: KtKotlinPropertySymbol(test/E.foo) + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Int? + symbolKind: LOCAL + typeParameters: [] + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + callableIdIfNonLocal: test/E.foo + contextReceivers: [] + getter: KtPropertyGetterSymbol: + annotationsList: [] + callableIdIfNonLocal: null + contextReceivers: [] + hasBody: false + hasStableParameterNames: true + isDefault: true + isExtension: false + isInline: false + isOverride: false + modality: FINAL + origin: SOURCE + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Int? + symbolKind: ACCESSOR + typeParameters: [] + valueParameters: [] + visibility: Public + getDispatchReceiver(): KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/E + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + hasBackingField: false + hasGetter: true + hasSetter: false + initializer: null + isActual: false + isConst: false + isDelegatedProperty: false + isExpect: false + isExtension: false + isFromPrimaryConstructor: false + isLateInit: false + isOverride: false + isStatic: false + isVal: true + modality: ABSTRACT + name: foo + origin: SOURCE + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Int? + setter: null + symbolKind: CLASS_MEMBER + typeParameters: [] + visibility: Public + getDispatchReceiver(): KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/E + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + getterDeprecationStatus: null + javaGetterName: getFoo + javaSetterName: null + setterDeprecationStatus: null + +KtFunctionSymbol: + annotationsList: [] + callableIdIfNonLocal: test/E.bar + contextReceivers: [] + contractEffects: [] + hasStableParameterNames: true + isActual: false + isBuiltinFunctionInvoke: false + isExpect: false + isExtension: false + isExternal: false + isInfix: false + isInline: false + isOperator: false + isOverride: false + isStatic: false + isSuspend: false + modality: ABSTRACT + name: bar + origin: SOURCE + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Unit + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [] + visibility: Public + getDispatchReceiver(): KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/E + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + +KtFunctionSymbol: + annotationsList: [] + callableIdIfNonLocal: test/E.values + contextReceivers: [] + contractEffects: [] + hasStableParameterNames: true + isActual: false + isBuiltinFunctionInvoke: false + isExpect: false + isExtension: false + isExternal: false + isInfix: false + isInline: false + isOperator: false + isOverride: false + isStatic: true + isSuspend: false + modality: FINAL + name: values + origin: SOURCE_MEMBER_GENERATED + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [ + KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/E + ] + type: kotlin/Array + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [] + visibility: Public + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + +KtFunctionSymbol: + annotationsList: [] + callableIdIfNonLocal: test/E.valueOf + contextReceivers: [] + contractEffects: [] + hasStableParameterNames: true + isActual: false + isBuiltinFunctionInvoke: false + isExpect: false + isExtension: false + isExternal: false + isInfix: false + isInline: false + isOperator: false + isOverride: false + isStatic: true + isSuspend: false + modality: FINAL + name: valueOf + origin: SOURCE_MEMBER_GENERATED + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/E + 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: value + origin: SOURCE_MEMBER_GENERATED + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/String + symbolKind: LOCAL + typeParameters: [] + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + ] + visibility: Public + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + +KtKotlinPropertySymbol: + annotationsList: [] + backingFieldSymbol: null + callableIdIfNonLocal: test/E.entries + contextReceivers: [] + getter: KtPropertyGetterSymbol: + annotationsList: [] + callableIdIfNonLocal: null + contextReceivers: [] + hasBody: false + hasStableParameterNames: true + isDefault: true + isExtension: false + isInline: false + isOverride: false + modality: FINAL + origin: SOURCE_MEMBER_GENERATED + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [ + KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/E + ] + type: kotlin/enums/EnumEntries + symbolKind: ACCESSOR + typeParameters: [] + valueParameters: [] + visibility: Public + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + hasBackingField: false + hasGetter: true + hasSetter: false + initializer: null + isActual: false + isConst: false + isDelegatedProperty: false + isExpect: false + isExtension: false + isFromPrimaryConstructor: false + isLateInit: false + isOverride: false + isStatic: true + isVal: true + modality: FINAL + name: entries + origin: SOURCE_MEMBER_GENERATED + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [ + KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/E + ] + type: kotlin/enums/EnumEntries + setter: null + symbolKind: CLASS_MEMBER + typeParameters: [] + visibility: Public + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + getterDeprecationStatus: null + javaGetterName: getEntries + javaSetterName: null + setterDeprecationStatus: null + +KtConstructorSymbol: + annotationsList: [] + callableIdIfNonLocal: null + containingClassIdIfNonLocal: test/E + contextReceivers: [] + hasStableParameterNames: true + isActual: false + isExpect: false + isExtension: false + isPrimary: true + origin: SOURCE_MEMBER_GENERATED + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/E + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [] + visibility: Private + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumClassWithFinalMembers.kt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumClassWithFinalMembers.kt new file mode 100644 index 00000000000..459d0dd6ebd --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumClassWithFinalMembers.kt @@ -0,0 +1,16 @@ +package test + +enum class E { + A { + val x: String = "" + }, + B; + + val foo: Int = 5 + + fun bar() { + println(foo) + } +} + +// class: test/E diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumClassWithFinalMembers.pretty.txt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumClassWithFinalMembers.pretty.txt new file mode 100644 index 00000000000..dcdd4f07209 --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumClassWithFinalMembers.pretty.txt @@ -0,0 +1,15 @@ +A + +B + +val foo: kotlin.Int + +fun bar() + +fun values(): kotlin.Array + +fun valueOf(value: kotlin.String): test.E + +val entries: kotlin.enums.EnumEntries + +constructor() diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumClassWithFinalMembers.txt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumClassWithFinalMembers.txt new file mode 100644 index 00000000000..0486773d812 --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumClassWithFinalMembers.txt @@ -0,0 +1,344 @@ +KtEnumEntrySymbol: + annotationsList: [] + callableIdIfNonLocal: test/E.A + containingEnumClassIdIfNonLocal: test/E + contextReceivers: [] + enumEntryInitializer: KtAnonymousObjectSymbol(/) + isExtension: false + name: A + origin: SOURCE + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/E + symbolKind: CLASS_MEMBER + typeParameters: [] + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + +KtEnumEntrySymbol: + annotationsList: [] + callableIdIfNonLocal: test/E.B + containingEnumClassIdIfNonLocal: test/E + contextReceivers: [] + enumEntryInitializer: null + isExtension: false + name: B + origin: SOURCE + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/E + symbolKind: CLASS_MEMBER + typeParameters: [] + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + +KtKotlinPropertySymbol: + annotationsList: [] + backingFieldSymbol: KtBackingFieldSymbol: + annotationsList: [] + callableIdIfNonLocal: null + contextReceivers: [] + isExtension: false + name: field + origin: PROPERTY_BACKING_FIELD + owningProperty: KtKotlinPropertySymbol(test/E.foo) + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Int + symbolKind: LOCAL + typeParameters: [] + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + callableIdIfNonLocal: test/E.foo + contextReceivers: [] + getter: KtPropertyGetterSymbol: + annotationsList: [] + callableIdIfNonLocal: null + contextReceivers: [] + hasBody: false + hasStableParameterNames: true + isDefault: true + isExtension: false + isInline: false + isOverride: false + modality: FINAL + origin: SOURCE + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Int + symbolKind: ACCESSOR + typeParameters: [] + valueParameters: [] + visibility: Public + getDispatchReceiver(): KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/E + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + hasBackingField: true + hasGetter: true + hasSetter: false + initializer: KtConstantInitializerValue(5) + isActual: false + isConst: false + isDelegatedProperty: false + isExpect: false + isExtension: false + isFromPrimaryConstructor: false + isLateInit: false + isOverride: false + isStatic: false + isVal: true + modality: FINAL + name: foo + origin: SOURCE + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Int + setter: null + symbolKind: CLASS_MEMBER + typeParameters: [] + visibility: Public + getDispatchReceiver(): KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/E + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + getterDeprecationStatus: null + javaGetterName: getFoo + javaSetterName: null + setterDeprecationStatus: null + +KtFunctionSymbol: + annotationsList: [] + callableIdIfNonLocal: test/E.bar + contextReceivers: [] + contractEffects: [] + hasStableParameterNames: true + isActual: false + isBuiltinFunctionInvoke: false + isExpect: false + isExtension: false + isExternal: false + isInfix: false + isInline: false + isOperator: false + isOverride: false + isStatic: false + isSuspend: false + modality: FINAL + name: bar + origin: SOURCE + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Unit + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [] + visibility: Public + getDispatchReceiver(): KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/E + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + +KtFunctionSymbol: + annotationsList: [] + callableIdIfNonLocal: test/E.values + contextReceivers: [] + contractEffects: [] + hasStableParameterNames: true + isActual: false + isBuiltinFunctionInvoke: false + isExpect: false + isExtension: false + isExternal: false + isInfix: false + isInline: false + isOperator: false + isOverride: false + isStatic: true + isSuspend: false + modality: FINAL + name: values + origin: SOURCE_MEMBER_GENERATED + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [ + KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/E + ] + type: kotlin/Array + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [] + visibility: Public + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + +KtFunctionSymbol: + annotationsList: [] + callableIdIfNonLocal: test/E.valueOf + contextReceivers: [] + contractEffects: [] + hasStableParameterNames: true + isActual: false + isBuiltinFunctionInvoke: false + isExpect: false + isExtension: false + isExternal: false + isInfix: false + isInline: false + isOperator: false + isOverride: false + isStatic: true + isSuspend: false + modality: FINAL + name: valueOf + origin: SOURCE_MEMBER_GENERATED + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/E + 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: value + origin: SOURCE_MEMBER_GENERATED + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/String + symbolKind: LOCAL + typeParameters: [] + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + ] + visibility: Public + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + +KtKotlinPropertySymbol: + annotationsList: [] + backingFieldSymbol: null + callableIdIfNonLocal: test/E.entries + contextReceivers: [] + getter: KtPropertyGetterSymbol: + annotationsList: [] + callableIdIfNonLocal: null + contextReceivers: [] + hasBody: false + hasStableParameterNames: true + isDefault: true + isExtension: false + isInline: false + isOverride: false + modality: FINAL + origin: SOURCE_MEMBER_GENERATED + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [ + KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/E + ] + type: kotlin/enums/EnumEntries + symbolKind: ACCESSOR + typeParameters: [] + valueParameters: [] + visibility: Public + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + hasBackingField: false + hasGetter: true + hasSetter: false + initializer: null + isActual: false + isConst: false + isDelegatedProperty: false + isExpect: false + isExtension: false + isFromPrimaryConstructor: false + isLateInit: false + isOverride: false + isStatic: true + isVal: true + modality: FINAL + name: entries + origin: SOURCE_MEMBER_GENERATED + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [ + KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/E + ] + type: kotlin/enums/EnumEntries + setter: null + symbolKind: CLASS_MEMBER + typeParameters: [] + visibility: Public + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + getterDeprecationStatus: null + javaGetterName: getEntries + javaSetterName: null + setterDeprecationStatus: null + +KtConstructorSymbol: + annotationsList: [] + callableIdIfNonLocal: null + containingClassIdIfNonLocal: test/E + contextReceivers: [] + hasStableParameterNames: true + isActual: false + isExpect: false + isExtension: false + isPrimary: true + origin: SOURCE_MEMBER_GENERATED + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/E + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [] + visibility: Private + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializer.kt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializer.kt new file mode 100644 index 00000000000..e9c9e39de8e --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializer.kt @@ -0,0 +1,10 @@ +// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K1 +package test + +enum class E { + A { + val x: String = "" + } +} + +// enum_entry_initializer: test/E.A diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializer.pretty.txt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializer.pretty.txt new file mode 100644 index 00000000000..a33af77ee4b --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializer.pretty.txt @@ -0,0 +1,3 @@ +val x: kotlin.String + +private constructor() diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializer.txt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializer.txt new file mode 100644 index 00000000000..5aaa48aa192 --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializer.txt @@ -0,0 +1,107 @@ +KtKotlinPropertySymbol: + annotationsList: [] + backingFieldSymbol: KtBackingFieldSymbol: + annotationsList: [] + callableIdIfNonLocal: null + contextReceivers: [] + isExtension: false + name: field + origin: PROPERTY_BACKING_FIELD + owningProperty: KtKotlinPropertySymbol(/x) + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/String + symbolKind: LOCAL + typeParameters: [] + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + callableIdIfNonLocal: null + contextReceivers: [] + getter: KtPropertyGetterSymbol: + annotationsList: [] + callableIdIfNonLocal: null + contextReceivers: [] + hasBody: false + hasStableParameterNames: true + isDefault: true + isExtension: false + isInline: false + isOverride: false + modality: FINAL + origin: SOURCE + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/String + symbolKind: ACCESSOR + typeParameters: [] + valueParameters: [] + visibility: Public + getDispatchReceiver(): KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/ + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + hasBackingField: true + hasGetter: true + hasSetter: false + initializer: KtConstantInitializerValue("") + isActual: false + isConst: false + isDelegatedProperty: false + isExpect: false + isExtension: false + isFromPrimaryConstructor: false + isLateInit: false + isOverride: false + isStatic: false + isVal: true + modality: FINAL + name: x + origin: SOURCE + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/String + setter: null + symbolKind: CLASS_MEMBER + typeParameters: [] + visibility: Public + getDispatchReceiver(): KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/ + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + getterDeprecationStatus: null + javaGetterName: getX + javaSetterName: null + setterDeprecationStatus: null + +KtConstructorSymbol: + annotationsList: [] + callableIdIfNonLocal: null + containingClassIdIfNonLocal: null + contextReceivers: [] + hasStableParameterNames: true + isActual: false + isExpect: false + isExtension: false + isPrimary: true + origin: SOURCE_MEMBER_GENERATED + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/ + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [] + visibility: Private + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializerWithEmptyBody.kt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializerWithEmptyBody.kt new file mode 100644 index 00000000000..537dfca7b58 --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializerWithEmptyBody.kt @@ -0,0 +1,8 @@ +// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K1 +package test + +enum class E { + A {} +} + +// enum_entry_initializer: test/E.A diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializerWithEmptyBody.pretty.txt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializerWithEmptyBody.pretty.txt new file mode 100644 index 00000000000..54fe4283354 --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializerWithEmptyBody.pretty.txt @@ -0,0 +1 @@ +private constructor() diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializerWithEmptyBody.txt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializerWithEmptyBody.txt new file mode 100644 index 00000000000..d93e3bf5ece --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializerWithEmptyBody.txt @@ -0,0 +1,22 @@ +KtConstructorSymbol: + annotationsList: [] + callableIdIfNonLocal: null + containingClassIdIfNonLocal: null + contextReceivers: [] + hasStableParameterNames: true + isActual: false + isExpect: false + isExtension: false + isPrimary: true + origin: SOURCE_MEMBER_GENERATED + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/ + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [] + visibility: Private + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializerWithFinalEnumMember.kt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializerWithFinalEnumMember.kt new file mode 100644 index 00000000000..45ab1aeb37f --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializerWithFinalEnumMember.kt @@ -0,0 +1,12 @@ +// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K1 +package test + +enum class E { + A { + val x: String = "" + }; + + val foo: Int = 5 +} + +// enum_entry_initializer: test/E.A diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializerWithFinalEnumMember.pretty.txt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializerWithFinalEnumMember.pretty.txt new file mode 100644 index 00000000000..a33af77ee4b --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializerWithFinalEnumMember.pretty.txt @@ -0,0 +1,3 @@ +val x: kotlin.String + +private constructor() diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializerWithFinalEnumMember.txt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializerWithFinalEnumMember.txt new file mode 100644 index 00000000000..5aaa48aa192 --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializerWithFinalEnumMember.txt @@ -0,0 +1,107 @@ +KtKotlinPropertySymbol: + annotationsList: [] + backingFieldSymbol: KtBackingFieldSymbol: + annotationsList: [] + callableIdIfNonLocal: null + contextReceivers: [] + isExtension: false + name: field + origin: PROPERTY_BACKING_FIELD + owningProperty: KtKotlinPropertySymbol(/x) + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/String + symbolKind: LOCAL + typeParameters: [] + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + callableIdIfNonLocal: null + contextReceivers: [] + getter: KtPropertyGetterSymbol: + annotationsList: [] + callableIdIfNonLocal: null + contextReceivers: [] + hasBody: false + hasStableParameterNames: true + isDefault: true + isExtension: false + isInline: false + isOverride: false + modality: FINAL + origin: SOURCE + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/String + symbolKind: ACCESSOR + typeParameters: [] + valueParameters: [] + visibility: Public + getDispatchReceiver(): KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/ + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + hasBackingField: true + hasGetter: true + hasSetter: false + initializer: KtConstantInitializerValue("") + isActual: false + isConst: false + isDelegatedProperty: false + isExpect: false + isExtension: false + isFromPrimaryConstructor: false + isLateInit: false + isOverride: false + isStatic: false + isVal: true + modality: FINAL + name: x + origin: SOURCE + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/String + setter: null + symbolKind: CLASS_MEMBER + typeParameters: [] + visibility: Public + getDispatchReceiver(): KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/ + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + getterDeprecationStatus: null + javaGetterName: getX + javaSetterName: null + setterDeprecationStatus: null + +KtConstructorSymbol: + annotationsList: [] + callableIdIfNonLocal: null + containingClassIdIfNonLocal: null + contextReceivers: [] + hasStableParameterNames: true + isActual: false + isExpect: false + isExtension: false + isPrimary: true + origin: SOURCE_MEMBER_GENERATED + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/ + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [] + visibility: Private + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializerWithOverriddenMember.kt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializerWithOverriddenMember.kt new file mode 100644 index 00000000000..c42f477e227 --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializerWithOverriddenMember.kt @@ -0,0 +1,12 @@ +// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K1 +package test + +enum class E { + A { + override val foo: Int = 65 + }; + + abstract val foo: Int? +} + +// enum_entry_initializer: test/E.A diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializerWithOverriddenMember.pretty.txt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializerWithOverriddenMember.pretty.txt new file mode 100644 index 00000000000..f0e6f4477eb --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializerWithOverriddenMember.pretty.txt @@ -0,0 +1,3 @@ +override val foo: kotlin.Int + +private constructor() diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializerWithOverriddenMember.txt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializerWithOverriddenMember.txt new file mode 100644 index 00000000000..ac4f54cc329 --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/enumEntryInitializerWithOverriddenMember.txt @@ -0,0 +1,107 @@ +KtKotlinPropertySymbol: + annotationsList: [] + backingFieldSymbol: KtBackingFieldSymbol: + annotationsList: [] + callableIdIfNonLocal: null + contextReceivers: [] + isExtension: false + name: field + origin: PROPERTY_BACKING_FIELD + owningProperty: KtKotlinPropertySymbol(/foo) + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Int + symbolKind: LOCAL + typeParameters: [] + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + callableIdIfNonLocal: null + contextReceivers: [] + getter: KtPropertyGetterSymbol: + annotationsList: [] + callableIdIfNonLocal: null + contextReceivers: [] + hasBody: false + hasStableParameterNames: true + isDefault: true + isExtension: false + isInline: false + isOverride: true + modality: FINAL + origin: SOURCE + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Int + symbolKind: ACCESSOR + typeParameters: [] + valueParameters: [] + visibility: Public + getDispatchReceiver(): KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/ + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + hasBackingField: true + hasGetter: true + hasSetter: false + initializer: KtConstantInitializerValue(65) + isActual: false + isConst: false + isDelegatedProperty: false + isExpect: false + isExtension: false + isFromPrimaryConstructor: false + isLateInit: false + isOverride: true + isStatic: false + isVal: true + modality: OPEN + name: foo + origin: SOURCE + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Int + setter: null + symbolKind: CLASS_MEMBER + typeParameters: [] + visibility: Public + getDispatchReceiver(): KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/ + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + getterDeprecationStatus: null + javaGetterName: getFoo + javaSetterName: null + setterDeprecationStatus: null + +KtConstructorSymbol: + annotationsList: [] + callableIdIfNonLocal: null + containingClassIdIfNonLocal: null + contextReceivers: [] + hasStableParameterNames: true + isActual: false + isExpect: false + isExtension: false + isPrimary: true + origin: SOURCE_MEMBER_GENERATED + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/ + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [] + visibility: Private + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaClass.kt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaClass.kt new file mode 100644 index 00000000000..bfceda40fd6 --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaClass.kt @@ -0,0 +1,42 @@ +// class: JavaClass +// FILE: main.kt + +// FILE: SuperInterface.java +public interface SuperInterface { + public int getActualRandomNumber(); + + public static int getRandomNumber() { + return 3; // Decided by a fair dice roll. + } +} + +// FILE: SuperClass.java +public abstract class SuperClass implements SuperInterface { + public static class NestedSuperClass { } + + @Override + public int getActualRandomNumber() { + return getRandomNumber(); + } + + public static int superFoo = 5; + + public static String superBar() { + return "superBar"; + } +} + +// FILE: JavaClass.java +public class JavaClass extends SuperClass { + public static class NestedClass { } + + public static int foo = 1; + + public static String bar() { + return "bar"; + } + + public void hello() { + System.out.println("hello"); + } +} diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaClass.pretty.txt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaClass.pretty.txt new file mode 100644 index 00000000000..b1dac59df6d --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaClass.pretty.txt @@ -0,0 +1,9 @@ +open fun hello() + +constructor() + +open fun bar(): kotlin.String! + +open var foo: kotlin.Int + +open class NestedClass diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaClass.txt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaClass.txt new file mode 100644 index 00000000000..23da575016c --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaClass.txt @@ -0,0 +1,139 @@ +KtFunctionSymbol: + annotationsList: [] + callableIdIfNonLocal: /JavaClass.hello + contextReceivers: [] + contractEffects: [] + hasStableParameterNames: false + isActual: false + isBuiltinFunctionInvoke: false + isExpect: false + isExtension: false + isExternal: false + isInfix: false + isInline: false + isOperator: false + isOverride: false + isStatic: false + isSuspend: false + modality: OPEN + name: hello + origin: JAVA + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Unit + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [] + visibility: Public + getDispatchReceiver(): KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: JavaClass + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + +KtConstructorSymbol: + annotationsList: [] + callableIdIfNonLocal: null + containingClassIdIfNonLocal: JavaClass + contextReceivers: [] + hasStableParameterNames: false + isActual: false + isExpect: false + isExtension: false + isPrimary: true + origin: JAVA + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: JavaClass + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [] + visibility: Public + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + +KtFunctionSymbol: + annotationsList: [] + callableIdIfNonLocal: /JavaClass.bar + contextReceivers: [] + contractEffects: [] + hasStableParameterNames: false + isActual: false + isBuiltinFunctionInvoke: false + isExpect: false + isExtension: false + isExternal: false + isInfix: false + isInline: false + isOperator: false + isOverride: false + isStatic: true + isSuspend: false + modality: OPEN + name: bar + origin: JAVA + receiverParameter: null + returnType: KtFlexibleType: + annotationsList: [] + type: kotlin/String! + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [] + visibility: Public + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + +KtJavaFieldSymbol: + annotationsList: [] + callableIdIfNonLocal: /JavaClass.foo + contextReceivers: [] + isExtension: false + isStatic: true + isVal: false + modality: OPEN + name: foo + origin: JAVA + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Int + symbolKind: CLASS_MEMBER + typeParameters: [] + visibility: Public + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + +KtNamedClassOrObjectSymbol: + annotationsList: [] + classIdIfNonLocal: JavaClass.NestedClass + classKind: CLASS + companionObject: null + contextReceivers: [] + isActual: false + isData: false + isExpect: false + isExternal: false + isFun: false + isInline: false + isInner: false + modality: OPEN + name: NestedClass + origin: JAVA + superTypes: [ + KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Any + ] + symbolKind: CLASS_MEMBER + typeParameters: [] + visibility: Public + getContainingModule: KtSourceModule "Sources of main" + annotationApplicableTargets: null + deprecationStatus: null diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaDeclaredEnhancementScope.kt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaDeclaredEnhancementScope.kt new file mode 100644 index 00000000000..face41aff24 --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaDeclaredEnhancementScope.kt @@ -0,0 +1,11 @@ +// class: JavaClass +// FILE: main.kt + +// FILE: JavaClass.java +public class JavaClass { + public int field = 1; + public String field2 = "S"; + public String foo() { + return "foo"; + } +} diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaDeclaredEnhancementScope.pretty.txt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaDeclaredEnhancementScope.pretty.txt new file mode 100644 index 00000000000..095c95a5a27 --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaDeclaredEnhancementScope.pretty.txt @@ -0,0 +1,7 @@ +open var field: kotlin.Int + +open var field2: kotlin.String! + +open fun foo(): kotlin.String! + +constructor() diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaDeclaredEnhancementScope.txt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaDeclaredEnhancementScope.txt new file mode 100644 index 00000000000..29dfe036772 --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaDeclaredEnhancementScope.txt @@ -0,0 +1,106 @@ +KtJavaFieldSymbol: + annotationsList: [] + callableIdIfNonLocal: /JavaClass.field + contextReceivers: [] + isExtension: false + isStatic: false + isVal: false + modality: OPEN + name: field + origin: JAVA + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Int + symbolKind: CLASS_MEMBER + typeParameters: [] + visibility: Public + getDispatchReceiver(): KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: JavaClass + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + +KtJavaFieldSymbol: + annotationsList: [] + callableIdIfNonLocal: /JavaClass.field2 + contextReceivers: [] + isExtension: false + isStatic: false + isVal: false + modality: OPEN + name: field2 + origin: JAVA + receiverParameter: null + returnType: KtFlexibleType: + annotationsList: [] + type: kotlin/String! + symbolKind: CLASS_MEMBER + typeParameters: [] + visibility: Public + getDispatchReceiver(): KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: JavaClass + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + +KtFunctionSymbol: + annotationsList: [] + callableIdIfNonLocal: /JavaClass.foo + contextReceivers: [] + contractEffects: [] + hasStableParameterNames: false + isActual: false + isBuiltinFunctionInvoke: false + isExpect: false + isExtension: false + isExternal: false + isInfix: false + isInline: false + isOperator: false + isOverride: false + isStatic: false + isSuspend: false + modality: OPEN + name: foo + origin: JAVA + receiverParameter: null + returnType: KtFlexibleType: + annotationsList: [] + type: kotlin/String! + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [] + visibility: Public + getDispatchReceiver(): KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: JavaClass + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + +KtConstructorSymbol: + annotationsList: [] + callableIdIfNonLocal: null + containingClassIdIfNonLocal: JavaClass + contextReceivers: [] + hasStableParameterNames: false + isActual: false + isExpect: false + isExtension: false + isPrimary: true + origin: JAVA + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: JavaClass + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [] + visibility: Public + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaDeclaredInheritList.kt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaDeclaredInheritList.kt new file mode 100644 index 00000000000..f511183e07b --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaDeclaredInheritList.kt @@ -0,0 +1,18 @@ +// RUNTIME +// class: JavaClass +// FILE: main.kt + +// FILE: JavaClass.java +import java.util.ArrayList; +public class JavaClass extends ArrayList { + JavaClass() { + } + + public String remove(int index) { + return ""; + } + + public int add(String s) { + return 1; + } +} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaDeclaredInheritList.pretty.txt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaDeclaredInheritList.pretty.txt new file mode 100644 index 00000000000..a3664e5e213 --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaDeclaredInheritList.pretty.txt @@ -0,0 +1,5 @@ +open fun add(s: kotlin.String!): kotlin.Int + +open operator fun removeAt(index: kotlin.Int): kotlin.String! + +constructor() diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaDeclaredInheritList.txt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaDeclaredInheritList.txt new file mode 100644 index 00000000000..82300d68ec3 --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaDeclaredInheritList.txt @@ -0,0 +1,138 @@ +KtFunctionSymbol: + annotationsList: [] + callableIdIfNonLocal: /JavaClass.add + contextReceivers: [] + contractEffects: [] + hasStableParameterNames: false + isActual: false + isBuiltinFunctionInvoke: false + isExpect: false + isExtension: false + isExternal: false + isInfix: false + isInline: false + isOperator: false + isOverride: false + isStatic: false + isSuspend: false + modality: OPEN + name: add + origin: JAVA + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Int + 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: s + origin: JAVA + receiverParameter: null + returnType: KtFlexibleType: + annotationsList: [] + type: kotlin/String! + symbolKind: LOCAL + typeParameters: [] + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + ] + visibility: Public + getDispatchReceiver(): KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: JavaClass + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + +KtFunctionSymbol: + annotationsList: [] + callableIdIfNonLocal: /JavaClass.removeAt + contextReceivers: [] + contractEffects: [] + hasStableParameterNames: false + isActual: false + isBuiltinFunctionInvoke: false + isExpect: false + isExtension: false + isExternal: false + isInfix: false + isInline: false + isOperator: true + isOverride: false + isStatic: false + isSuspend: false + modality: OPEN + name: removeAt + origin: JAVA + receiverParameter: null + returnType: KtFlexibleType: + annotationsList: [] + type: kotlin/String! + 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: index + origin: JAVA + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Int + symbolKind: LOCAL + typeParameters: [] + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + ] + visibility: Public + getDispatchReceiver(): KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: JavaClass + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + +KtConstructorSymbol: + annotationsList: [] + callableIdIfNonLocal: null + containingClassIdIfNonLocal: JavaClass + contextReceivers: [] + hasStableParameterNames: false + isActual: false + isExpect: false + isExtension: false + isPrimary: false + origin: JAVA + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: JavaClass + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [] + visibility: PackageVisibility + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaInnerClassConstructor.kt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaInnerClassConstructor.kt new file mode 100644 index 00000000000..b8b0ef56e16 --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaInnerClassConstructor.kt @@ -0,0 +1,10 @@ +// RUNTIME +// class: JavaClass.InnerClass +// FILE: main.kt + +// FILE: JavaClass.java +public class JavaClass { + class InnerClass { + InnerClass(JavaClass other) {} + } +} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaInnerClassConstructor.pretty.txt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaInnerClassConstructor.pretty.txt new file mode 100644 index 00000000000..3a13a6ee6cd --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaInnerClassConstructor.pretty.txt @@ -0,0 +1 @@ +constructor(other: JavaClass!) diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaInnerClassConstructor.txt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaInnerClassConstructor.txt new file mode 100644 index 00000000000..eb91f1b960a --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/javaInnerClassConstructor.txt @@ -0,0 +1,48 @@ +KtConstructorSymbol: + annotationsList: [] + callableIdIfNonLocal: null + containingClassIdIfNonLocal: JavaClass.InnerClass + contextReceivers: [] + hasStableParameterNames: false + isActual: false + isExpect: false + isExtension: false + isPrimary: false + origin: JAVA + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: JavaClass.InnerClass + 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: JAVA + receiverParameter: null + returnType: KtFlexibleType: + annotationsList: [] + type: JavaClass! + symbolKind: LOCAL + typeParameters: [] + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + ] + visibility: PackageVisibility + getDispatchReceiver(): KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: JavaClass + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/scriptWithClassDeclaration.kts b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/scriptWithClassDeclaration.kts new file mode 100644 index 00000000000..67e96c159d6 --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/scriptWithClassDeclaration.kts @@ -0,0 +1,13 @@ +// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE +// script +abstract class Person { + abstract val name: String +} + +fun foo(action: () -> Int) { + action() +} + +foo { + 42 + 42 +} diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/scriptWithClassDeclaration.pretty.txt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/scriptWithClassDeclaration.pretty.txt new file mode 100644 index 00000000000..d06658a3bf5 --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/scriptWithClassDeclaration.pretty.txt @@ -0,0 +1,5 @@ +fun foo(action: () -> kotlin.Int) + +val `$$result`: kotlin.Unit + +abstract class Person diff --git a/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/scriptWithClassDeclaration.txt b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/scriptWithClassDeclaration.txt new file mode 100644 index 00000000000..2c2ead4e480 --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/combinedDeclaredMemberScope/scriptWithClassDeclaration.txt @@ -0,0 +1,149 @@ +KtFunctionSymbol: + annotationsList: [] + callableIdIfNonLocal: /foo + contextReceivers: [] + contractEffects: [] + hasStableParameterNames: true + isActual: false + isBuiltinFunctionInvoke: false + isExpect: false + isExtension: false + isExternal: false + isInfix: false + isInline: false + isOperator: false + isOverride: false + isStatic: false + isSuspend: false + modality: FINAL + name: foo + origin: SOURCE + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Unit + symbolKind: TOP_LEVEL + typeParameters: [] + valueParameters: [ + KtValueParameterSymbol: + annotationsList: [] + callableIdIfNonLocal: null + contextReceivers: [] + generatedPrimaryConstructorProperty: null + hasDefaultValue: false + isCrossinline: false + isExtension: false + isImplicitLambdaParameter: false + isNoinline: false + isVararg: false + name: action + origin: SOURCE + receiverParameter: null + returnType: KtFunctionalType: + annotationsList: [] + ownTypeArguments: [ + KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Int + ] + type: kotlin/Function0 + symbolKind: LOCAL + typeParameters: [] + getContainingModule: KtScriptModule "Script scriptWithClassDeclaration.kts" + deprecationStatus: null + ] + visibility: Public + getContainingModule: KtScriptModule "Script scriptWithClassDeclaration.kts" + deprecationStatus: null + +KtKotlinPropertySymbol: + annotationsList: [] + backingFieldSymbol: null + callableIdIfNonLocal: null + contextReceivers: [] + getter: KtPropertyGetterSymbol: + annotationsList: [] + callableIdIfNonLocal: null + contextReceivers: [] + hasBody: false + hasStableParameterNames: true + isDefault: true + isExtension: false + isInline: false + isOverride: false + modality: FINAL + origin: PLUGIN + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Unit + symbolKind: ACCESSOR + typeParameters: [] + valueParameters: [] + visibility: Public + getContainingModule: KtScriptModule "Script scriptWithClassDeclaration.kts" + deprecationStatus: null + hasBackingField: true + hasGetter: true + hasSetter: false + initializer: KtNonConstantInitializerValue(foo { ...) + isActual: false + isConst: false + isDelegatedProperty: false + isExpect: false + isExtension: false + isFromPrimaryConstructor: false + isLateInit: false + isOverride: false + isStatic: false + isVal: true + modality: FINAL + name: $$result + origin: PLUGIN + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Unit + setter: null + symbolKind: TOP_LEVEL + typeParameters: [] + visibility: Public + getContainingModule: KtScriptModule "Script scriptWithClassDeclaration.kts" + deprecationStatus: null + getterDeprecationStatus: null + javaGetterName: get$$result + javaSetterName: null + setterDeprecationStatus: null + +KtNamedClassOrObjectSymbol: + annotationsList: [] + classIdIfNonLocal: Person + classKind: CLASS + companionObject: null + contextReceivers: [] + isActual: false + isData: false + isExpect: false + isExternal: false + isFun: false + isInline: false + isInner: false + modality: ABSTRACT + name: Person + origin: SOURCE + superTypes: [ + KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Any + ] + symbolKind: TOP_LEVEL + typeParameters: [] + visibility: Public + getContainingModule: KtScriptModule "Script scriptWithClassDeclaration.kts" + annotationApplicableTargets: null + deprecationStatus: null diff --git a/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/scriptWithClassDeclaration.kts b/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/scriptWithClassDeclaration.kts new file mode 100644 index 00000000000..67e96c159d6 --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/scriptWithClassDeclaration.kts @@ -0,0 +1,13 @@ +// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE +// script +abstract class Person { + abstract val name: String +} + +fun foo(action: () -> Int) { + action() +} + +foo { + 42 + 42 +} diff --git a/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/scriptWithClassDeclaration.pretty.txt b/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/scriptWithClassDeclaration.pretty.txt new file mode 100644 index 00000000000..64b2813378e --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/scriptWithClassDeclaration.pretty.txt @@ -0,0 +1,3 @@ +fun foo(action: () -> kotlin.Int) + +val `$$result`: kotlin.Unit diff --git a/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/scriptWithClassDeclaration.txt b/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/scriptWithClassDeclaration.txt new file mode 100644 index 00000000000..7941d1346ac --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/scriptWithClassDeclaration.txt @@ -0,0 +1,120 @@ +KtFunctionSymbol: + annotationsList: [] + callableIdIfNonLocal: /foo + contextReceivers: [] + contractEffects: [] + hasStableParameterNames: true + isActual: false + isBuiltinFunctionInvoke: false + isExpect: false + isExtension: false + isExternal: false + isInfix: false + isInline: false + isOperator: false + isOverride: false + isStatic: false + isSuspend: false + modality: FINAL + name: foo + origin: SOURCE + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Unit + symbolKind: TOP_LEVEL + typeParameters: [] + valueParameters: [ + KtValueParameterSymbol: + annotationsList: [] + callableIdIfNonLocal: null + contextReceivers: [] + generatedPrimaryConstructorProperty: null + hasDefaultValue: false + isCrossinline: false + isExtension: false + isImplicitLambdaParameter: false + isNoinline: false + isVararg: false + name: action + origin: SOURCE + receiverParameter: null + returnType: KtFunctionalType: + annotationsList: [] + ownTypeArguments: [ + KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Int + ] + type: kotlin/Function0 + symbolKind: LOCAL + typeParameters: [] + getContainingModule: KtScriptModule "Script scriptWithClassDeclaration.kts" + deprecationStatus: null + ] + visibility: Public + getContainingModule: KtScriptModule "Script scriptWithClassDeclaration.kts" + deprecationStatus: null + +KtKotlinPropertySymbol: + annotationsList: [] + backingFieldSymbol: null + callableIdIfNonLocal: null + contextReceivers: [] + getter: KtPropertyGetterSymbol: + annotationsList: [] + callableIdIfNonLocal: null + contextReceivers: [] + hasBody: false + hasStableParameterNames: true + isDefault: true + isExtension: false + isInline: false + isOverride: false + modality: FINAL + origin: PLUGIN + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Unit + symbolKind: ACCESSOR + typeParameters: [] + valueParameters: [] + visibility: Public + getContainingModule: KtScriptModule "Script scriptWithClassDeclaration.kts" + deprecationStatus: null + hasBackingField: true + hasGetter: true + hasSetter: false + initializer: KtNonConstantInitializerValue(foo { ...) + isActual: false + isConst: false + isDelegatedProperty: false + isExpect: false + isExtension: false + isFromPrimaryConstructor: false + isLateInit: false + isOverride: false + isStatic: false + isVal: true + modality: FINAL + name: $$result + origin: PLUGIN + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Unit + setter: null + symbolKind: TOP_LEVEL + typeParameters: [] + visibility: Public + getContainingModule: KtScriptModule "Script scriptWithClassDeclaration.kts" + deprecationStatus: null + getterDeprecationStatus: null + javaGetterName: get$$result + javaSetterName: null + setterDeprecationStatus: null diff --git a/analysis/analysis-api/testData/components/scopeProvider/staticDeclaredMemberScope/scriptWithClassDeclaration.kts b/analysis/analysis-api/testData/components/scopeProvider/staticDeclaredMemberScope/scriptWithClassDeclaration.kts new file mode 100644 index 00000000000..a473bd1d386 --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/staticDeclaredMemberScope/scriptWithClassDeclaration.kts @@ -0,0 +1,12 @@ +// script +abstract class Person { + abstract val name: String +} + +fun foo(action: () -> Int) { + action() +} + +foo { + 42 + 42 +} diff --git a/analysis/analysis-api/testData/components/scopeProvider/staticDeclaredMemberScope/scriptWithClassDeclaration.pretty.txt b/analysis/analysis-api/testData/components/scopeProvider/staticDeclaredMemberScope/scriptWithClassDeclaration.pretty.txt new file mode 100644 index 00000000000..4522ff71f02 --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/staticDeclaredMemberScope/scriptWithClassDeclaration.pretty.txt @@ -0,0 +1 @@ +abstract class Person diff --git a/analysis/analysis-api/testData/components/scopeProvider/staticDeclaredMemberScope/scriptWithClassDeclaration.txt b/analysis/analysis-api/testData/components/scopeProvider/staticDeclaredMemberScope/scriptWithClassDeclaration.txt new file mode 100644 index 00000000000..904ed4bf6d2 --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/staticDeclaredMemberScope/scriptWithClassDeclaration.txt @@ -0,0 +1,28 @@ +KtNamedClassOrObjectSymbol: + annotationsList: [] + classIdIfNonLocal: Person + classKind: CLASS + companionObject: null + contextReceivers: [] + isActual: false + isData: false + isExpect: false + isExternal: false + isFun: false + isInline: false + isInner: false + modality: ABSTRACT + name: Person + origin: SOURCE + superTypes: [ + KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Any + ] + symbolKind: TOP_LEVEL + typeParameters: [] + visibility: Public + getContainingModule: KtScriptModule "Script scriptWithClassDeclaration.kts" + annotationApplicableTargets: null + deprecationStatus: null 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 3a6f83c3644..540d476ae72 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 @@ -515,6 +515,13 @@ private fun AnalysisApiTestGroup.generateAnalysisApiComponentsTests() { ) { model(it, "staticDeclaredMemberScope") } + + test( + AbstractCombinedDeclaredMemberScopeTest::class, + filter = frontendIs(FrontendKind.Fir), + ) { + model(it, "combinedDeclaredMemberScope") + } } } }