[AA] Add tests for *static* (declared) member scopes
^KT-61900 ^KT-61800
This commit is contained in:
committed by
Space Team
parent
4ba0aef23b
commit
21efd6aff3
+48
@@ -0,0 +1,48 @@
|
|||||||
|
/*
|
||||||
|
* 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.AbstractStaticDeclaredMemberScopeTest;
|
||||||
|
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/staticDeclaredMemberScope")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class FirIdeNormalAnalysisScriptSourceModuleStaticDeclaredMemberScopeTestGenerated extends AbstractStaticDeclaredMemberScopeTest {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public AnalysisApiTestConfigurator getConfigurator() {
|
||||||
|
return AnalysisApiFirTestConfiguratorFactory.INSTANCE.createConfigurator(
|
||||||
|
new AnalysisApiTestConfiguratorFactoryData(
|
||||||
|
FrontendKind.Fir,
|
||||||
|
TestModuleKind.ScriptSource,
|
||||||
|
AnalysisSessionMode.Normal,
|
||||||
|
AnalysisApiMode.Ide
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInStaticDeclaredMemberScope() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/scopeProvider/staticDeclaredMemberScope"), Pattern.compile("^(.+)\\.kts$"), null, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
+48
@@ -0,0 +1,48 @@
|
|||||||
|
/*
|
||||||
|
* 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.AbstractStaticMemberScopeTest;
|
||||||
|
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/staticMemberScope")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class FirIdeNormalAnalysisScriptSourceModuleStaticMemberScopeTestGenerated extends AbstractStaticMemberScopeTest {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public AnalysisApiTestConfigurator getConfigurator() {
|
||||||
|
return AnalysisApiFirTestConfiguratorFactory.INSTANCE.createConfigurator(
|
||||||
|
new AnalysisApiTestConfiguratorFactoryData(
|
||||||
|
FrontendKind.Fir,
|
||||||
|
TestModuleKind.ScriptSource,
|
||||||
|
AnalysisSessionMode.Normal,
|
||||||
|
AnalysisApiMode.Ide
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInStaticMemberScope() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/scopeProvider/staticMemberScope"), Pattern.compile("^(.+)\\.kts$"), null, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
+72
@@ -0,0 +1,72 @@
|
|||||||
|
/*
|
||||||
|
* 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.AbstractStaticDeclaredMemberScopeTest;
|
||||||
|
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/staticDeclaredMemberScope")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class FirIdeNormalAnalysisSourceModuleStaticDeclaredMemberScopeTestGenerated extends AbstractStaticDeclaredMemberScopeTest {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public AnalysisApiTestConfigurator getConfigurator() {
|
||||||
|
return AnalysisApiFirTestConfiguratorFactory.INSTANCE.createConfigurator(
|
||||||
|
new AnalysisApiTestConfiguratorFactoryData(
|
||||||
|
FrontendKind.Fir,
|
||||||
|
TestModuleKind.Source,
|
||||||
|
AnalysisSessionMode.Normal,
|
||||||
|
AnalysisApiMode.Ide
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInStaticDeclaredMemberScope() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/scopeProvider/staticDeclaredMemberScope"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("class.kt")
|
||||||
|
public void testClass() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/scopeProvider/staticDeclaredMemberScope/class.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("classWithJavaSuperclass.kt")
|
||||||
|
public void testClassWithJavaSuperclass() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/scopeProvider/staticDeclaredMemberScope/classWithJavaSuperclass.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("enumClass.kt")
|
||||||
|
public void testEnumClass() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/scopeProvider/staticDeclaredMemberScope/enumClass.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("javaClass.kt")
|
||||||
|
public void testJavaClass() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/scopeProvider/staticDeclaredMemberScope/javaClass.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
+72
@@ -0,0 +1,72 @@
|
|||||||
|
/*
|
||||||
|
* 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.AbstractStaticMemberScopeTest;
|
||||||
|
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/staticMemberScope")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class FirIdeNormalAnalysisSourceModuleStaticMemberScopeTestGenerated extends AbstractStaticMemberScopeTest {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public AnalysisApiTestConfigurator getConfigurator() {
|
||||||
|
return AnalysisApiFirTestConfiguratorFactory.INSTANCE.createConfigurator(
|
||||||
|
new AnalysisApiTestConfiguratorFactoryData(
|
||||||
|
FrontendKind.Fir,
|
||||||
|
TestModuleKind.Source,
|
||||||
|
AnalysisSessionMode.Normal,
|
||||||
|
AnalysisApiMode.Ide
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInStaticMemberScope() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/scopeProvider/staticMemberScope"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("class.kt")
|
||||||
|
public void testClass() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/scopeProvider/staticMemberScope/class.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("classWithJavaSuperclass.kt")
|
||||||
|
public void testClassWithJavaSuperclass() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/scopeProvider/staticMemberScope/classWithJavaSuperclass.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("enumClass.kt")
|
||||||
|
public void testEnumClass() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/scopeProvider/staticMemberScope/enumClass.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("javaClass.kt")
|
||||||
|
public void testJavaClass() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/scopeProvider/staticMemberScope/javaClass.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
+10
@@ -32,11 +32,21 @@ abstract class AbstractMemberScopeByFqNameTest : AbstractMemberScopeTestBase() {
|
|||||||
override fun KtSymbolWithMembers.getSymbolsFromScope(): Sequence<KtDeclarationSymbol> = getMemberScope().getAllSymbols()
|
override fun KtSymbolWithMembers.getSymbolsFromScope(): Sequence<KtDeclarationSymbol> = getMemberScope().getAllSymbols()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
abstract class AbstractStaticMemberScopeTest : AbstractMemberScopeTestBase() {
|
||||||
|
context(KtAnalysisSession)
|
||||||
|
override fun KtSymbolWithMembers.getSymbolsFromScope(): Sequence<KtDeclarationSymbol> = getStaticMemberScope().getAllSymbols()
|
||||||
|
}
|
||||||
|
|
||||||
abstract class AbstractDeclaredMemberScopeTest : AbstractMemberScopeTestBase() {
|
abstract class AbstractDeclaredMemberScopeTest : AbstractMemberScopeTestBase() {
|
||||||
context(KtAnalysisSession)
|
context(KtAnalysisSession)
|
||||||
override fun KtSymbolWithMembers.getSymbolsFromScope(): Sequence<KtDeclarationSymbol> = getDeclaredMemberScope().getAllSymbols()
|
override fun KtSymbolWithMembers.getSymbolsFromScope(): Sequence<KtDeclarationSymbol> = getDeclaredMemberScope().getAllSymbols()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
abstract class AbstractStaticDeclaredMemberScopeTest : AbstractMemberScopeTestBase() {
|
||||||
|
context(KtAnalysisSession)
|
||||||
|
override fun KtSymbolWithMembers.getSymbolsFromScope(): Sequence<KtDeclarationSymbol> = getStaticDeclaredMemberScope().getAllSymbols()
|
||||||
|
}
|
||||||
|
|
||||||
abstract class AbstractDelegateMemberScopeTest : AbstractMemberScopeTestBase() {
|
abstract class AbstractDelegateMemberScopeTest : AbstractMemberScopeTestBase() {
|
||||||
context(KtAnalysisSession)
|
context(KtAnalysisSession)
|
||||||
override fun KtSymbolWithMembers.getSymbolsFromScope(): Sequence<KtDeclarationSymbol> = getDelegatedMemberScope().getCallableSymbols()
|
override fun KtSymbolWithMembers.getSymbolsFromScope(): Sequence<KtDeclarationSymbol> = getDelegatedMemberScope().getCallableSymbols()
|
||||||
|
|||||||
+72
@@ -0,0 +1,72 @@
|
|||||||
|
/*
|
||||||
|
* 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.AbstractStaticDeclaredMemberScopeTest;
|
||||||
|
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/staticDeclaredMemberScope")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class FirStandaloneNormalAnalysisSourceModuleStaticDeclaredMemberScopeTestGenerated extends AbstractStaticDeclaredMemberScopeTest {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public AnalysisApiTestConfigurator getConfigurator() {
|
||||||
|
return AnalysisApiFirStandaloneModeTestConfiguratorFactory.INSTANCE.createConfigurator(
|
||||||
|
new AnalysisApiTestConfiguratorFactoryData(
|
||||||
|
FrontendKind.Fir,
|
||||||
|
TestModuleKind.Source,
|
||||||
|
AnalysisSessionMode.Normal,
|
||||||
|
AnalysisApiMode.Standalone
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInStaticDeclaredMemberScope() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/scopeProvider/staticDeclaredMemberScope"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("class.kt")
|
||||||
|
public void testClass() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/scopeProvider/staticDeclaredMemberScope/class.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("classWithJavaSuperclass.kt")
|
||||||
|
public void testClassWithJavaSuperclass() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/scopeProvider/staticDeclaredMemberScope/classWithJavaSuperclass.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("enumClass.kt")
|
||||||
|
public void testEnumClass() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/scopeProvider/staticDeclaredMemberScope/enumClass.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("javaClass.kt")
|
||||||
|
public void testJavaClass() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/scopeProvider/staticDeclaredMemberScope/javaClass.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
+72
@@ -0,0 +1,72 @@
|
|||||||
|
/*
|
||||||
|
* 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.AbstractStaticMemberScopeTest;
|
||||||
|
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/staticMemberScope")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class FirStandaloneNormalAnalysisSourceModuleStaticMemberScopeTestGenerated extends AbstractStaticMemberScopeTest {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public AnalysisApiTestConfigurator getConfigurator() {
|
||||||
|
return AnalysisApiFirStandaloneModeTestConfiguratorFactory.INSTANCE.createConfigurator(
|
||||||
|
new AnalysisApiTestConfiguratorFactoryData(
|
||||||
|
FrontendKind.Fir,
|
||||||
|
TestModuleKind.Source,
|
||||||
|
AnalysisSessionMode.Normal,
|
||||||
|
AnalysisApiMode.Standalone
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInStaticMemberScope() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/scopeProvider/staticMemberScope"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("class.kt")
|
||||||
|
public void testClass() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/scopeProvider/staticMemberScope/class.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("classWithJavaSuperclass.kt")
|
||||||
|
public void testClassWithJavaSuperclass() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/scopeProvider/staticMemberScope/classWithJavaSuperclass.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("enumClass.kt")
|
||||||
|
public void testEnumClass() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/scopeProvider/staticMemberScope/enumClass.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("javaClass.kt")
|
||||||
|
public void testJavaClass() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/scopeProvider/staticMemberScope/javaClass.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
+31
@@ -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
|
||||||
Vendored
+5
@@ -0,0 +1,5 @@
|
|||||||
|
class C2
|
||||||
|
|
||||||
|
object O2
|
||||||
|
|
||||||
|
companion object
|
||||||
Vendored
+86
@@ -0,0 +1,86 @@
|
|||||||
|
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
|
||||||
+35
@@ -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 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 = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
class C2
|
||||||
|
|
||||||
|
object O2
|
||||||
|
|
||||||
|
companion object
|
||||||
+86
@@ -0,0 +1,86 @@
|
|||||||
|
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
|
||||||
Vendored
+10
@@ -0,0 +1,10 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
enum class E {
|
||||||
|
A {
|
||||||
|
val x: String = ""
|
||||||
|
},
|
||||||
|
B
|
||||||
|
}
|
||||||
|
|
||||||
|
// class: test/E
|
||||||
+9
@@ -0,0 +1,9 @@
|
|||||||
|
A
|
||||||
|
|
||||||
|
B
|
||||||
|
|
||||||
|
fun values(): kotlin.Array<test.E>
|
||||||
|
|
||||||
|
fun valueOf(value: kotlin.String): test.E
|
||||||
|
|
||||||
|
val entries: kotlin.enums.EnumEntries<test.E>
|
||||||
Vendored
+200
@@ -0,0 +1,200 @@
|
|||||||
|
KtEnumEntrySymbol:
|
||||||
|
annotationsList: []
|
||||||
|
callableIdIfNonLocal: test/E.A
|
||||||
|
containingEnumClassIdIfNonLocal: test/E
|
||||||
|
contextReceivers: []
|
||||||
|
enumEntryInitializer: KtAnonymousObjectSymbol(<local>/<no name provided>)
|
||||||
|
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<test/E>
|
||||||
|
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<test/E>
|
||||||
|
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<test/E>
|
||||||
|
setter: null
|
||||||
|
symbolKind: CLASS_MEMBER
|
||||||
|
typeParameters: []
|
||||||
|
visibility: Public
|
||||||
|
getContainingModule: KtSourceModule "Sources of main"
|
||||||
|
deprecationStatus: null
|
||||||
|
getterDeprecationStatus: null
|
||||||
|
javaGetterName: getEntries
|
||||||
|
javaSetterName: null
|
||||||
|
setterDeprecationStatus: null
|
||||||
Vendored
+38
@@ -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");
|
||||||
|
}
|
||||||
|
}
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
open var foo: kotlin.Int
|
||||||
|
|
||||||
|
open fun bar(): kotlin.String!
|
||||||
Vendored
+51
@@ -0,0 +1,51 @@
|
|||||||
|
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
|
||||||
|
|
||||||
|
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
|
||||||
+31
@@ -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
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
class C2
|
||||||
|
|
||||||
|
object O2
|
||||||
|
|
||||||
|
companion object
|
||||||
+86
@@ -0,0 +1,86 @@
|
|||||||
|
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
|
||||||
analysis/analysis-api/testData/components/scopeProvider/staticMemberScope/classWithJavaSuperclass.kt
Vendored
+37
@@ -0,0 +1,37 @@
|
|||||||
|
// 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 class C1 {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: KotlinClass.kt
|
||||||
|
package test
|
||||||
|
|
||||||
|
// When a java class inherits from `JavaClass`, its static member scope contains `hello` and `y`. However, when a Kotlin class inherits from
|
||||||
|
// `JavaClass`, like this class, its static member scope does not contain the Java super-class's static callables.
|
||||||
|
class KotlinClass : JavaClass() {
|
||||||
|
fun foo(): Int = 5
|
||||||
|
|
||||||
|
val bar: String = ""
|
||||||
|
|
||||||
|
class C2
|
||||||
|
|
||||||
|
object O2
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
val baz: String = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
class C2
|
||||||
|
|
||||||
|
object O2
|
||||||
|
|
||||||
|
companion object
|
||||||
+86
@@ -0,0 +1,86 @@
|
|||||||
|
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
|
||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
enum class E {
|
||||||
|
A {
|
||||||
|
val x: String = ""
|
||||||
|
},
|
||||||
|
B
|
||||||
|
}
|
||||||
|
|
||||||
|
// class: test/E
|
||||||
Vendored
+9
@@ -0,0 +1,9 @@
|
|||||||
|
A
|
||||||
|
|
||||||
|
B
|
||||||
|
|
||||||
|
fun values(): kotlin.Array<test.E>
|
||||||
|
|
||||||
|
fun valueOf(value: kotlin.String): test.E
|
||||||
|
|
||||||
|
val entries: kotlin.enums.EnumEntries<test.E>
|
||||||
+200
@@ -0,0 +1,200 @@
|
|||||||
|
KtEnumEntrySymbol:
|
||||||
|
annotationsList: []
|
||||||
|
callableIdIfNonLocal: test/E.A
|
||||||
|
containingEnumClassIdIfNonLocal: test/E
|
||||||
|
contextReceivers: []
|
||||||
|
enumEntryInitializer: KtAnonymousObjectSymbol(<local>/<no name provided>)
|
||||||
|
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<test/E>
|
||||||
|
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<test/E>
|
||||||
|
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<test/E>
|
||||||
|
setter: null
|
||||||
|
symbolKind: CLASS_MEMBER
|
||||||
|
typeParameters: []
|
||||||
|
visibility: Public
|
||||||
|
getContainingModule: KtSourceModule "Sources of main"
|
||||||
|
deprecationStatus: null
|
||||||
|
getterDeprecationStatus: null
|
||||||
|
javaGetterName: getEntries
|
||||||
|
javaSetterName: null
|
||||||
|
setterDeprecationStatus: null
|
||||||
+50
@@ -0,0 +1,50 @@
|
|||||||
|
// class: JavaClass
|
||||||
|
// FILE: main.kt
|
||||||
|
|
||||||
|
// FILE: SuperInterface.java
|
||||||
|
public interface SuperInterface {
|
||||||
|
public int getActualRandomNumber();
|
||||||
|
|
||||||
|
// This static method will not be included in JavaClass's static member scope, because static interface methods are not propagated to
|
||||||
|
// their implementing class's namespaces (i.e., `JavaClass.getRandomNumber()` is an error in Kotlin and Java).
|
||||||
|
public static int getRandomNumber() {
|
||||||
|
return 3; // Decided by a fair dice roll.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: SuperClass.java
|
||||||
|
public abstract class SuperClass implements SuperInterface {
|
||||||
|
// NestedSuperClass will not be included in JavaClass's static member scope, because Kotlin does not propagate static nested classes
|
||||||
|
// defined in super-classes to sub-classes, unlike Java. So `JavaClass.SuperClass` is valid in Java, but an error in Kotlin.
|
||||||
|
class NestedSuperClass {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getActualRandomNumber() {
|
||||||
|
return getRandomNumber();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Both static callables will be included in JavaClass's static member scope, because Kotlin propagates static methods from
|
||||||
|
// super-classes to sub-classes, just like Java. So `JavaClass.superBar()` will be a valid call in Kotlin and Java.
|
||||||
|
public static int superFoo = 5;
|
||||||
|
|
||||||
|
public static String superBar() {
|
||||||
|
return "superBar";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: JavaClass.java
|
||||||
|
public class JavaClass extends SuperClass {
|
||||||
|
class NestedClass {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int foo = 1;
|
||||||
|
|
||||||
|
public static String bar() {
|
||||||
|
return "bar";
|
||||||
|
}
|
||||||
|
|
||||||
|
public void hello() {
|
||||||
|
System.out.println("hello");
|
||||||
|
}
|
||||||
|
}
|
||||||
Vendored
+9
@@ -0,0 +1,9 @@
|
|||||||
|
open fun bar(): kotlin.String!
|
||||||
|
|
||||||
|
open var superFoo: kotlin.Int
|
||||||
|
|
||||||
|
open fun superBar(): kotlin.String!
|
||||||
|
|
||||||
|
open var foo: kotlin.Int
|
||||||
|
|
||||||
|
open inner class NestedClass
|
||||||
+132
@@ -0,0 +1,132 @@
|
|||||||
|
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: /SuperClass.superFoo
|
||||||
|
contextReceivers: []
|
||||||
|
isExtension: false
|
||||||
|
isStatic: true
|
||||||
|
isVal: false
|
||||||
|
modality: OPEN
|
||||||
|
name: superFoo
|
||||||
|
origin: JAVA
|
||||||
|
receiverParameter: null
|
||||||
|
returnType: KtUsualClassType:
|
||||||
|
annotationsList: []
|
||||||
|
ownTypeArguments: []
|
||||||
|
type: kotlin/Int
|
||||||
|
symbolKind: CLASS_MEMBER
|
||||||
|
typeParameters: []
|
||||||
|
visibility: Public
|
||||||
|
getContainingModule: KtSourceModule "Sources of main"
|
||||||
|
deprecationStatus: null
|
||||||
|
|
||||||
|
KtFunctionSymbol:
|
||||||
|
annotationsList: []
|
||||||
|
callableIdIfNonLocal: /SuperClass.superBar
|
||||||
|
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: superBar
|
||||||
|
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: true
|
||||||
|
modality: OPEN
|
||||||
|
name: NestedClass
|
||||||
|
origin: JAVA
|
||||||
|
superTypes: [
|
||||||
|
KtUsualClassType:
|
||||||
|
annotationsList: []
|
||||||
|
ownTypeArguments: []
|
||||||
|
type: kotlin/Any
|
||||||
|
]
|
||||||
|
symbolKind: CLASS_MEMBER
|
||||||
|
typeParameters: []
|
||||||
|
visibility: PackageVisibility
|
||||||
|
getContainingModule: KtSourceModule "Sources of main"
|
||||||
|
annotationApplicableTargets: null
|
||||||
|
deprecationStatus: null
|
||||||
+14
@@ -487,6 +487,13 @@ private fun AnalysisApiTestGroup.generateAnalysisApiComponentsTests() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test(
|
||||||
|
AbstractStaticMemberScopeTest::class,
|
||||||
|
filter = frontendIs(FrontendKind.Fir),
|
||||||
|
) {
|
||||||
|
model(it, "staticMemberScope")
|
||||||
|
}
|
||||||
|
|
||||||
test(AbstractFileScopeTest::class) {
|
test(AbstractFileScopeTest::class) {
|
||||||
model(it, "fileScopeTest")
|
model(it, "fileScopeTest")
|
||||||
}
|
}
|
||||||
@@ -501,6 +508,13 @@ private fun AnalysisApiTestGroup.generateAnalysisApiComponentsTests() {
|
|||||||
) {
|
) {
|
||||||
model(it, "declaredMemberScope")
|
model(it, "declaredMemberScope")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test(
|
||||||
|
AbstractStaticDeclaredMemberScopeTest::class,
|
||||||
|
filter = frontendIs(FrontendKind.Fir),
|
||||||
|
) {
|
||||||
|
model(it, "staticDeclaredMemberScope")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user