From a85ece1d8335b2d5c5b557bbf64770adf578475f Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Mon, 18 Nov 2019 17:53:38 +0300 Subject: [PATCH] [FIR-TEST] Add test with problem of invisible static members of supertype --- .../resolve/problems/superTypeStaticScope.kt | 23 +++++++++++++++++++ .../resolve/problems/superTypeStaticScope.txt | 5 ++++ .../fir/FirDiagnosticsTestGenerated.java | 5 ++++ 3 files changed, 33 insertions(+) create mode 100644 compiler/fir/resolve/testData/resolve/problems/superTypeStaticScope.kt create mode 100644 compiler/fir/resolve/testData/resolve/problems/superTypeStaticScope.txt diff --git a/compiler/fir/resolve/testData/resolve/problems/superTypeStaticScope.kt b/compiler/fir/resolve/testData/resolve/problems/superTypeStaticScope.kt new file mode 100644 index 00000000000..e5ef8f6e99b --- /dev/null +++ b/compiler/fir/resolve/testData/resolve/problems/superTypeStaticScope.kt @@ -0,0 +1,23 @@ +/* + * See org/jetbrains/kotlin/fir/java/scopes/JavaClassUseSiteMemberScope.kt:93 + */ + +// FILE: CommonDataKeys.java + +public class CommonDataKeys { + public static final String PROJECT = "project"; + public final String MEMBER = "member" +} + +// FILE: PlatformDataKeys.java + +public class PlatformDataKeys extends CommonDataKeys { + +} + +// FILE: main.kt + +fun test() { + val project = PlatformDataKeys.PROJECT + val member = PlatformDataKeys().MEMBER +} \ No newline at end of file diff --git a/compiler/fir/resolve/testData/resolve/problems/superTypeStaticScope.txt b/compiler/fir/resolve/testData/resolve/problems/superTypeStaticScope.txt new file mode 100644 index 00000000000..1bc631fff8b --- /dev/null +++ b/compiler/fir/resolve/testData/resolve/problems/superTypeStaticScope.txt @@ -0,0 +1,5 @@ +FILE: main.kt + public final fun test(): R|kotlin/Unit| { + lval project: = Q|PlatformDataKeys|.# + lval member: R|ft!| = R|/PlatformDataKeys.PlatformDataKeys|().R|/CommonDataKeys.MEMBER| + } diff --git a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsTestGenerated.java b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsTestGenerated.java index 33410f5f0e1..ade0fd9cd12 100644 --- a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsTestGenerated.java +++ b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsTestGenerated.java @@ -833,6 +833,11 @@ public class FirDiagnosticsTestGenerated extends AbstractFirDiagnosticsTest { runTest("compiler/fir/resolve/testData/resolve/problems/propertyFromJavaPlusAssign.kt"); } + @TestMetadata("superTypeStaticScope.kt") + public void testSuperTypeStaticScope() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/problems/superTypeStaticScope.kt"); + } + @TestMetadata("syntheticsVsNormalProperties.kt") public void testSyntheticsVsNormalProperties() throws Exception { runTest("compiler/fir/resolve/testData/resolve/problems/syntheticsVsNormalProperties.kt");