Skip additional visibility check for java classes in debug mode

This commit is contained in:
Natalia Ukhorskaya
2016-03-14 19:44:44 +03:00
parent b79aa13242
commit 589d7007fc
4 changed files with 14 additions and 0 deletions
@@ -40,6 +40,8 @@ class JavaTypeAccessibilityChecker : AdditionalTypeChecker {
// To avoid superfluous diagnostics in case of invisible member class and so on, // To avoid superfluous diagnostics in case of invisible member class and so on,
// we consider only Java classes as possibly inaccessible. // we consider only Java classes as possibly inaccessible.
if (c.isDebuggerContext) return
val inaccessibleTypes = findInaccessibleJavaTypes(expressionType, c) val inaccessibleTypes = findInaccessibleJavaTypes(expressionType, c)
if (inaccessibleTypes.isNotEmpty()) { if (inaccessibleTypes.isNotEmpty()) {
c.trace.report(Errors.INACCESSIBLE_TYPE.on(expression, expressionType, inaccessibleTypes)) c.trace.report(Errors.INACCESSIBLE_TYPE.on(expression, expressionType, inaccessibleTypes))
+2
View File
@@ -6,6 +6,8 @@ Compile bytecode for A.PrivateClass()
Compile bytecode for A.PrivateClass().prop Compile bytecode for A.PrivateClass().prop
Compile bytecode for A().PrivateInnerClass() Compile bytecode for A().PrivateInnerClass()
Compile bytecode for A().PrivateInnerClass().prop Compile bytecode for A().PrivateInnerClass().prop
Compile bytecode for forTests.MyJavaClass.PrivateJavaClass()
Compile bytecode for forTests.MyJavaClass.PrivateJavaClass().prop
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
Process finished with exit code 0 Process finished with exit code 0
@@ -26,3 +26,9 @@ class A {
// EXPRESSION: A().PrivateInnerClass().prop // EXPRESSION: A().PrivateInnerClass().prop
// RESULT: 1: I // RESULT: 1: I
// EXPRESSION: forTests.MyJavaClass.PrivateJavaClass()
// RESULT: instance of forTests.MyJavaClass$PrivateJavaClass(id=ID): LforTests/MyJavaClass$PrivateJavaClass;
// EXPRESSION: forTests.MyJavaClass.PrivateJavaClass().prop
// RESULT: 1: I
@@ -19,4 +19,8 @@ public class MyJavaClass {
public static <T> T runReadAction(@NotNull Computable<T> computation) { public static <T> T runReadAction(@NotNull Computable<T> computation) {
return computation.compute(); return computation.compute();
} }
private static class PrivateJavaClass {
public final int prop = 1;
}
} }