[FIR] KT-58623: Ensure the diagnostics are missing for Native

This commit is contained in:
Nikolay Lunyak
2023-05-23 10:35:16 +03:00
committed by Space Team
parent 699366f178
commit 75c0304671
5 changed files with 64 additions and 0 deletions
@@ -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 {
@@ -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 {
@@ -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() {
<!UNRESOLVED_REFERENCE!>println<!>(protectedVar + protectedParentVar)
protectedFun()
protectedParentFun()
}
inline var publicInlineUserVal: Int
get() = protectedVar + protectedFun() + protectedParentVar + protectedParentFun()
set(value) { protectedVar + protectedFun() + protectedParentVar + protectedParentFun() }
}
@@ -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() {
<!UNRESOLVED_REFERENCE!>println<!>(<!PROTECTED_CALL_FROM_PUBLIC_INLINE_ERROR!>protectedVar<!> + <!PROTECTED_CALL_FROM_PUBLIC_INLINE_ERROR!>protectedParentVar<!>)
<!PROTECTED_CALL_FROM_PUBLIC_INLINE_ERROR!>protectedFun<!>()
<!PROTECTED_CALL_FROM_PUBLIC_INLINE_ERROR!>protectedParentFun<!>()
}
inline var publicInlineUserVal: Int
get() = <!PROTECTED_CALL_FROM_PUBLIC_INLINE_ERROR!>protectedVar<!> + <!PROTECTED_CALL_FROM_PUBLIC_INLINE_ERROR!>protectedFun<!>() + <!PROTECTED_CALL_FROM_PUBLIC_INLINE_ERROR!>protectedParentVar<!> + <!PROTECTED_CALL_FROM_PUBLIC_INLINE_ERROR!>protectedParentFun<!>()
set(<!UNUSED_PARAMETER!>value<!>) { <!PROTECTED_CALL_FROM_PUBLIC_INLINE_ERROR!>protectedVar<!> + <!PROTECTED_CALL_FROM_PUBLIC_INLINE_ERROR!>protectedFun<!>() + <!PROTECTED_CALL_FROM_PUBLIC_INLINE_ERROR!>protectedParentVar<!> + <!PROTECTED_CALL_FROM_PUBLIC_INLINE_ERROR!>protectedParentFun<!>() }
}
@@ -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 {