From 75c03046718e0d08beeaba8c9dbdd98dc8a948a5 Mon Sep 17 00:00:00 2001 From: Nikolay Lunyak Date: Tue, 23 May 2023 10:35:16 +0300 Subject: [PATCH] [FIR] KT-58623: Ensure the diagnostics are missing for Native --- ...rontendNativeDiagnosticsTestGenerated.java | 6 +++++ ...rontendNativeDiagnosticsTestGenerated.java | 6 +++++ .../nativeTests/nativeProtectedFunCall.fir.kt | 23 +++++++++++++++++++ .../nativeTests/nativeProtectedFunCall.kt | 23 +++++++++++++++++++ .../DiagnosticsNativeTestGenerated.java | 6 +++++ 5 files changed, 64 insertions(+) create mode 100644 compiler/testData/diagnostics/nativeTests/nativeProtectedFunCall.fir.kt create mode 100644 compiler/testData/diagnostics/nativeTests/nativeProtectedFunCall.kt diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendNativeDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendNativeDiagnosticsTestGenerated.java index 9d50f7f55a4..66f3ab1326c 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendNativeDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendNativeDiagnosticsTestGenerated.java @@ -42,6 +42,12 @@ public class FirLightTreeOldFrontendNativeDiagnosticsTestGenerated extends Abstr runTest("compiler/testData/diagnostics/nativeTests/isInitializedError.kt"); } + @Test + @TestMetadata("nativeProtectedFunCall.kt") + public void testNativeProtectedFunCall() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/nativeProtectedFunCall.kt"); + } + @Test @TestMetadata("objCName.kt") public void testObjCName() throws Exception { diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendNativeDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendNativeDiagnosticsTestGenerated.java index c08278fb224..48e8ebd5b15 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendNativeDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendNativeDiagnosticsTestGenerated.java @@ -42,6 +42,12 @@ public class FirPsiOldFrontendNativeDiagnosticsTestGenerated extends AbstractFir runTest("compiler/testData/diagnostics/nativeTests/isInitializedError.kt"); } + @Test + @TestMetadata("nativeProtectedFunCall.kt") + public void testNativeProtectedFunCall() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/nativeProtectedFunCall.kt"); + } + @Test @TestMetadata("objCName.kt") public void testObjCName() throws Exception { diff --git a/compiler/testData/diagnostics/nativeTests/nativeProtectedFunCall.fir.kt b/compiler/testData/diagnostics/nativeTests/nativeProtectedFunCall.fir.kt new file mode 100644 index 00000000000..2cc2f946d5e --- /dev/null +++ b/compiler/testData/diagnostics/nativeTests/nativeProtectedFunCall.fir.kt @@ -0,0 +1,23 @@ +// ISSUE: KT-58623 + +package pack + +open class ProtectedInsideInlineParent { + protected var protectedParentVar = 0 + protected fun protectedParentFun() = 0 +} + +open class ProtectedInsideInlineError : ProtectedInsideInlineParent() { + protected var protectedVar = 0 + protected fun protectedFun() = 0 + + inline fun publicInlineUserFun() { + println(protectedVar + protectedParentVar) + protectedFun() + protectedParentFun() + } + + inline var publicInlineUserVal: Int + get() = protectedVar + protectedFun() + protectedParentVar + protectedParentFun() + set(value) { protectedVar + protectedFun() + protectedParentVar + protectedParentFun() } +} diff --git a/compiler/testData/diagnostics/nativeTests/nativeProtectedFunCall.kt b/compiler/testData/diagnostics/nativeTests/nativeProtectedFunCall.kt new file mode 100644 index 00000000000..5b181ed32e9 --- /dev/null +++ b/compiler/testData/diagnostics/nativeTests/nativeProtectedFunCall.kt @@ -0,0 +1,23 @@ +// ISSUE: KT-58623 + +package pack + +open class ProtectedInsideInlineParent { + protected var protectedParentVar = 0 + protected fun protectedParentFun() = 0 +} + +open class ProtectedInsideInlineError : ProtectedInsideInlineParent() { + protected var protectedVar = 0 + protected fun protectedFun() = 0 + + inline fun publicInlineUserFun() { + println(protectedVar + protectedParentVar) + protectedFun() + protectedParentFun() + } + + inline var publicInlineUserVal: Int + get() = protectedVar + protectedFun() + protectedParentVar + protectedParentFun() + set(value) { protectedVar + protectedFun() + protectedParentVar + protectedParentFun() } +} diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticsNativeTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticsNativeTestGenerated.java index 482e4b0948e..95ad738d9f2 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticsNativeTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticsNativeTestGenerated.java @@ -42,6 +42,12 @@ public class DiagnosticsNativeTestGenerated extends AbstractDiagnosticsNativeTes runTest("compiler/testData/diagnostics/nativeTests/isInitializedError.kt"); } + @Test + @TestMetadata("nativeProtectedFunCall.kt") + public void testNativeProtectedFunCall() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/nativeProtectedFunCall.kt"); + } + @Test @TestMetadata("objCName.kt") public void testObjCName() throws Exception {