diff --git a/analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/components/scopeProvider/FirIdeNormalAnalysisSourceModuleDeclaredMemberScopeTestGenerated.java b/analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/components/scopeProvider/FirIdeNormalAnalysisSourceModuleDeclaredMemberScopeTestGenerated.java index eab39180b27..38e5d808ee1 100644 --- a/analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/components/scopeProvider/FirIdeNormalAnalysisSourceModuleDeclaredMemberScopeTestGenerated.java +++ b/analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/components/scopeProvider/FirIdeNormalAnalysisSourceModuleDeclaredMemberScopeTestGenerated.java @@ -46,6 +46,30 @@ public class FirIdeNormalAnalysisSourceModuleDeclaredMemberScopeTestGenerated ex KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope"), Pattern.compile("^(.+)\\.kt$"), null, true); } + @Test + @TestMetadata("class.kt") + public void testClass() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/class.kt"); + } + + @Test + @TestMetadata("enumClass.kt") + public void testEnumClass() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/enumClass.kt"); + } + + @Test + @TestMetadata("enumClassWithAbstractMembers.kt") + public void testEnumClassWithAbstractMembers() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/enumClassWithAbstractMembers.kt"); + } + + @Test + @TestMetadata("enumClassWithFinalMembers.kt") + public void testEnumClassWithFinalMembers() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/enumClassWithFinalMembers.kt"); + } + @Test @TestMetadata("enumEntryInitializer.kt") public void testEnumEntryInitializer() throws Exception { @@ -70,6 +94,12 @@ public class FirIdeNormalAnalysisSourceModuleDeclaredMemberScopeTestGenerated ex runTest("analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/enumEntryInitializerWithOverriddenMember.kt"); } + @Test + @TestMetadata("javaClass.kt") + public void testJavaClass() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/javaClass.kt"); + } + @Test @TestMetadata("javaDeclaredEnhancementScope.kt") public void testJavaDeclaredEnhancementScope() throws Exception { diff --git a/analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/components/scopeProvider/FirIdeNormalAnalysisSourceModuleMemberScopeByFqNameTestGenerated.java b/analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/components/scopeProvider/FirIdeNormalAnalysisSourceModuleMemberScopeByFqNameTestGenerated.java index da72cbfefef..232bc966efe 100644 --- a/analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/components/scopeProvider/FirIdeNormalAnalysisSourceModuleMemberScopeByFqNameTestGenerated.java +++ b/analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/components/scopeProvider/FirIdeNormalAnalysisSourceModuleMemberScopeByFqNameTestGenerated.java @@ -46,6 +46,12 @@ public class FirIdeNormalAnalysisSourceModuleMemberScopeByFqNameTestGenerated ex KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/scopeProvider/memberScopeByFqName"), Pattern.compile("^(.+)\\.kt$"), null, true); } + @Test + @TestMetadata("class.kt") + public void testClass() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/memberScopeByFqName/class.kt"); + } + @Test @TestMetadata("dataClass.kt") public void testDataClass() throws Exception { @@ -94,6 +100,12 @@ public class FirIdeNormalAnalysisSourceModuleMemberScopeByFqNameTestGenerated ex runTest("analysis/analysis-api/testData/components/scopeProvider/memberScopeByFqName/Int.kt"); } + @Test + @TestMetadata("javaClass.kt") + public void testJavaClass() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/memberScopeByFqName/javaClass.kt"); + } + @Test @TestMetadata("javaField.kt") public void testJavaField() throws Exception { diff --git a/analysis/analysis-api-standalone/tests-gen/org/jetbrains/kotlin/analysis/api/standalone/fir/test/cases/generated/cases/components/scopeProvider/FirStandaloneNormalAnalysisSourceModuleDeclaredMemberScopeTestGenerated.java b/analysis/analysis-api-standalone/tests-gen/org/jetbrains/kotlin/analysis/api/standalone/fir/test/cases/generated/cases/components/scopeProvider/FirStandaloneNormalAnalysisSourceModuleDeclaredMemberScopeTestGenerated.java index adbdd5bbe95..a4f727033c3 100644 --- a/analysis/analysis-api-standalone/tests-gen/org/jetbrains/kotlin/analysis/api/standalone/fir/test/cases/generated/cases/components/scopeProvider/FirStandaloneNormalAnalysisSourceModuleDeclaredMemberScopeTestGenerated.java +++ b/analysis/analysis-api-standalone/tests-gen/org/jetbrains/kotlin/analysis/api/standalone/fir/test/cases/generated/cases/components/scopeProvider/FirStandaloneNormalAnalysisSourceModuleDeclaredMemberScopeTestGenerated.java @@ -46,6 +46,30 @@ public class FirStandaloneNormalAnalysisSourceModuleDeclaredMemberScopeTestGener KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope"), Pattern.compile("^(.+)\\.kt$"), null, true); } + @Test + @TestMetadata("class.kt") + public void testClass() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/class.kt"); + } + + @Test + @TestMetadata("enumClass.kt") + public void testEnumClass() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/enumClass.kt"); + } + + @Test + @TestMetadata("enumClassWithAbstractMembers.kt") + public void testEnumClassWithAbstractMembers() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/enumClassWithAbstractMembers.kt"); + } + + @Test + @TestMetadata("enumClassWithFinalMembers.kt") + public void testEnumClassWithFinalMembers() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/enumClassWithFinalMembers.kt"); + } + @Test @TestMetadata("enumEntryInitializer.kt") public void testEnumEntryInitializer() throws Exception { @@ -70,6 +94,12 @@ public class FirStandaloneNormalAnalysisSourceModuleDeclaredMemberScopeTestGener runTest("analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/enumEntryInitializerWithOverriddenMember.kt"); } + @Test + @TestMetadata("javaClass.kt") + public void testJavaClass() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/javaClass.kt"); + } + @Test @TestMetadata("javaDeclaredEnhancementScope.kt") public void testJavaDeclaredEnhancementScope() throws Exception { diff --git a/analysis/analysis-api-standalone/tests-gen/org/jetbrains/kotlin/analysis/api/standalone/fir/test/cases/generated/cases/components/scopeProvider/FirStandaloneNormalAnalysisSourceModuleMemberScopeByFqNameTestGenerated.java b/analysis/analysis-api-standalone/tests-gen/org/jetbrains/kotlin/analysis/api/standalone/fir/test/cases/generated/cases/components/scopeProvider/FirStandaloneNormalAnalysisSourceModuleMemberScopeByFqNameTestGenerated.java index a5330b947fa..3d836870ceb 100644 --- a/analysis/analysis-api-standalone/tests-gen/org/jetbrains/kotlin/analysis/api/standalone/fir/test/cases/generated/cases/components/scopeProvider/FirStandaloneNormalAnalysisSourceModuleMemberScopeByFqNameTestGenerated.java +++ b/analysis/analysis-api-standalone/tests-gen/org/jetbrains/kotlin/analysis/api/standalone/fir/test/cases/generated/cases/components/scopeProvider/FirStandaloneNormalAnalysisSourceModuleMemberScopeByFqNameTestGenerated.java @@ -46,6 +46,12 @@ public class FirStandaloneNormalAnalysisSourceModuleMemberScopeByFqNameTestGener KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/scopeProvider/memberScopeByFqName"), Pattern.compile("^(.+)\\.kt$"), null, true, "withTestCompilerPluginEnabled"); } + @Test + @TestMetadata("class.kt") + public void testClass() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/memberScopeByFqName/class.kt"); + } + @Test @TestMetadata("dataClass.kt") public void testDataClass() throws Exception { @@ -94,6 +100,12 @@ public class FirStandaloneNormalAnalysisSourceModuleMemberScopeByFqNameTestGener runTest("analysis/analysis-api/testData/components/scopeProvider/memberScopeByFqName/Int.kt"); } + @Test + @TestMetadata("javaClass.kt") + public void testJavaClass() throws Exception { + runTest("analysis/analysis-api/testData/components/scopeProvider/memberScopeByFqName/javaClass.kt"); + } + @Test @TestMetadata("javaField.kt") public void testJavaField() throws Exception { diff --git a/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/class.kt b/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/class.kt new file mode 100644 index 00000000000..84cb02bfc49 --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/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/declaredMemberScope/class.pretty.txt b/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/class.pretty.txt new file mode 100644 index 00000000000..15b582ff63a --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/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/declaredMemberScope/class.txt b/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/class.txt new file mode 100644 index 00000000000..8c1dfdd9151 --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/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/declaredMemberScope/enumClass.kt b/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/enumClass.kt new file mode 100644 index 00000000000..441beb5821b --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/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/declaredMemberScope/enumClass.pretty.txt b/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/enumClass.pretty.txt new file mode 100644 index 00000000000..b4d4a6c69f3 --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/enumClass.pretty.txt @@ -0,0 +1 @@ +constructor() diff --git a/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/enumClass.txt b/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/enumClass.txt new file mode 100644 index 00000000000..f79d0b1ea93 --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/enumClass.txt @@ -0,0 +1,22 @@ +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/declaredMemberScope/enumClassWithAbstractMembers.kt b/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/enumClassWithAbstractMembers.kt new file mode 100644 index 00000000000..8a15b38f74c --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/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/declaredMemberScope/enumClassWithAbstractMembers.pretty.txt b/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/enumClassWithAbstractMembers.pretty.txt new file mode 100644 index 00000000000..d31a91202b8 --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/enumClassWithAbstractMembers.pretty.txt @@ -0,0 +1,5 @@ +abstract val foo: kotlin.Int? + +abstract fun bar() + +constructor() diff --git a/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/enumClassWithAbstractMembers.txt b/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/enumClassWithAbstractMembers.txt new file mode 100644 index 00000000000..6b0f90065dc --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/enumClassWithAbstractMembers.txt @@ -0,0 +1,143 @@ +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 + +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/declaredMemberScope/enumClassWithFinalMembers.kt b/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/enumClassWithFinalMembers.kt new file mode 100644 index 00000000000..459d0dd6ebd --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/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/declaredMemberScope/enumClassWithFinalMembers.pretty.txt b/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/enumClassWithFinalMembers.pretty.txt new file mode 100644 index 00000000000..404751947da --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/enumClassWithFinalMembers.pretty.txt @@ -0,0 +1,5 @@ +val foo: kotlin.Int + +fun bar() + +constructor() diff --git a/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/enumClassWithFinalMembers.txt b/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/enumClassWithFinalMembers.txt new file mode 100644 index 00000000000..c3aa2e436a5 --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/enumClassWithFinalMembers.txt @@ -0,0 +1,143 @@ +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 + +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/declaredMemberScope/javaClass.kt b/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/javaClass.kt new file mode 100644 index 00000000000..3e7577c221b --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/javaClass.kt @@ -0,0 +1,38 @@ +// 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 { + @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 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/declaredMemberScope/javaClass.pretty.txt b/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/javaClass.pretty.txt new file mode 100644 index 00000000000..82e128c5a13 --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/javaClass.pretty.txt @@ -0,0 +1,3 @@ +open fun hello() + +constructor() diff --git a/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/javaClass.txt b/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/javaClass.txt new file mode 100644 index 00000000000..17fb6bab7c1 --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/declaredMemberScope/javaClass.txt @@ -0,0 +1,58 @@ +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 diff --git a/analysis/analysis-api/testData/components/scopeProvider/memberScopeByFqName/class.kt b/analysis/analysis-api/testData/components/scopeProvider/memberScopeByFqName/class.kt new file mode 100644 index 00000000000..84cb02bfc49 --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/memberScopeByFqName/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/memberScopeByFqName/class.pretty.txt b/analysis/analysis-api/testData/components/scopeProvider/memberScopeByFqName/class.pretty.txt new file mode 100644 index 00000000000..09022c89791 --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/memberScopeByFqName/class.pretty.txt @@ -0,0 +1,25 @@ +fun foo(): kotlin.Int + +val bar: kotlin.String + +fun perform() + +val x: kotlin.Int + +open operator fun equals(other: kotlin.Any?): kotlin.Boolean + +open fun hashCode(): kotlin.Int + +open fun toString(): kotlin.String + +class C2 + +object O2 + +companion object + +class C1 + +object O1 + +constructor() diff --git a/analysis/analysis-api/testData/components/scopeProvider/memberScopeByFqName/class.txt b/analysis/analysis-api/testData/components/scopeProvider/memberScopeByFqName/class.txt new file mode 100644 index 00000000000..6b29f32e817 --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/memberScopeByFqName/class.txt @@ -0,0 +1,540 @@ +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 + +KtFunctionSymbol: + annotationsList: [] + callableIdIfNonLocal: test/A.perform + 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: perform + origin: SOURCE + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Unit + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [] + visibility: Public + getDispatchReceiver(): KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/A + 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/A.x) + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Int + symbolKind: LOCAL + typeParameters: [] + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + callableIdIfNonLocal: test/A.x + 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/A + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + hasBackingField: true + hasGetter: true + hasSetter: false + initializer: KtConstantInitializerValue(0) + 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/Int + setter: null + symbolKind: CLASS_MEMBER + typeParameters: [] + visibility: Public + getDispatchReceiver(): KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: test/A + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + getterDeprecationStatus: null + javaGetterName: getX + javaSetterName: null + setterDeprecationStatus: null + +KtFunctionSymbol: + annotationsList: [] + callableIdIfNonLocal: kotlin/Any.equals + contextReceivers: [] + contractEffects: [] + hasStableParameterNames: true + 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: equals + origin: LIBRARY + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Boolean + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [ + KtValueParameterSymbol: + annotationsList: [] + callableIdIfNonLocal: null + contextReceivers: [] + generatedPrimaryConstructorProperty: null + hasDefaultValue: false + isCrossinline: false + isExtension: false + isImplicitLambdaParameter: false + isNoinline: false + isVararg: false + name: other + origin: LIBRARY + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Any? + symbolKind: LOCAL + typeParameters: [] + getContainingModule: KtBinaryModule "Builtins for JVM (1.8)" + deprecationStatus: null + ] + visibility: Public + getDispatchReceiver(): KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Any + getContainingModule: KtBinaryModule "Builtins for JVM (1.8)" + deprecationStatus: null + +KtFunctionSymbol: + annotationsList: [] + callableIdIfNonLocal: kotlin/Any.hashCode + 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: OPEN + name: hashCode + origin: LIBRARY + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Int + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [] + visibility: Public + getDispatchReceiver(): KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Any + getContainingModule: KtBinaryModule "Builtins for JVM (1.8)" + deprecationStatus: null + +KtFunctionSymbol: + annotationsList: [] + callableIdIfNonLocal: kotlin/Any.toString + 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: OPEN + name: toString + origin: LIBRARY + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/String + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [] + visibility: Public + getDispatchReceiver(): KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Any + getContainingModule: KtBinaryModule "Builtins for JVM (1.8)" + deprecationStatus: 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 + +KtNamedClassOrObjectSymbol: + annotationsList: [] + classIdIfNonLocal: test/A.C1 + classKind: CLASS + companionObject: null + contextReceivers: [] + isActual: false + isData: false + isExpect: false + isExternal: false + isFun: false + isInline: false + isInner: false + modality: FINAL + name: C1 + 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/A.O1 + classKind: OBJECT + companionObject: null + contextReceivers: [] + isActual: false + isData: false + isExpect: false + isExternal: false + isFun: false + isInline: false + isInner: false + modality: FINAL + name: O1 + 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/memberScopeByFqName/javaClass.kt b/analysis/analysis-api/testData/components/scopeProvider/memberScopeByFqName/javaClass.kt new file mode 100644 index 00000000000..3e7577c221b --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/memberScopeByFqName/javaClass.kt @@ -0,0 +1,38 @@ +// 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 { + @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 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/memberScopeByFqName/javaClass.pretty.txt b/analysis/analysis-api/testData/components/scopeProvider/memberScopeByFqName/javaClass.pretty.txt new file mode 100644 index 00000000000..3184c7af4e7 --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/memberScopeByFqName/javaClass.pretty.txt @@ -0,0 +1,12 @@ +open fun hello() + +@java.lang.Override +open fun getActualRandomNumber(): kotlin.Int + +open operator fun equals(other: kotlin.Any?): kotlin.Boolean + +open fun hashCode(): kotlin.Int + +open fun toString(): kotlin.String + +constructor() diff --git a/analysis/analysis-api/testData/components/scopeProvider/memberScopeByFqName/javaClass.txt b/analysis/analysis-api/testData/components/scopeProvider/memberScopeByFqName/javaClass.txt new file mode 100644 index 00000000000..20fea1af90c --- /dev/null +++ b/analysis/analysis-api/testData/components/scopeProvider/memberScopeByFqName/javaClass.txt @@ -0,0 +1,228 @@ +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 + +KtFunctionSymbol: + annotationsList: [ + java/lang/Override() + psi: null + ] + callableIdIfNonLocal: /SuperClass.getActualRandomNumber + 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: getActualRandomNumber + origin: JAVA + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Int + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [] + visibility: Public + getDispatchReceiver(): KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: SuperClass + getContainingModule: KtSourceModule "Sources of main" + deprecationStatus: null + +KtFunctionSymbol: + annotationsList: [] + callableIdIfNonLocal: kotlin/Any.equals + contextReceivers: [] + contractEffects: [] + hasStableParameterNames: true + 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: equals + origin: LIBRARY + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Boolean + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [ + KtValueParameterSymbol: + annotationsList: [] + callableIdIfNonLocal: null + contextReceivers: [] + generatedPrimaryConstructorProperty: null + hasDefaultValue: false + isCrossinline: false + isExtension: false + isImplicitLambdaParameter: false + isNoinline: false + isVararg: false + name: other + origin: LIBRARY + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Any? + symbolKind: LOCAL + typeParameters: [] + getContainingModule: KtBinaryModule "Builtins for JVM (1.8)" + deprecationStatus: null + ] + visibility: Public + getDispatchReceiver(): KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Any + getContainingModule: KtBinaryModule "Builtins for JVM (1.8)" + deprecationStatus: null + +KtFunctionSymbol: + annotationsList: [] + callableIdIfNonLocal: kotlin/Any.hashCode + 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: OPEN + name: hashCode + origin: LIBRARY + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Int + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [] + visibility: Public + getDispatchReceiver(): KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Any + getContainingModule: KtBinaryModule "Builtins for JVM (1.8)" + deprecationStatus: null + +KtFunctionSymbol: + annotationsList: [] + callableIdIfNonLocal: kotlin/Any.toString + 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: OPEN + name: toString + origin: LIBRARY + receiverParameter: null + returnType: KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/String + symbolKind: CLASS_MEMBER + typeParameters: [] + valueParameters: [] + visibility: Public + getDispatchReceiver(): KtUsualClassType: + annotationsList: [] + ownTypeArguments: [] + type: kotlin/Any + getContainingModule: KtBinaryModule "Builtins for JVM (1.8)" + 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