Outer's superclass' method is now inaccessible from nested
Also the diagnostic error message reported the wrong nested class name: it should be the nested class in the hierarchy which is static, not the class of the scope where we're checking the accessibility
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
class A {
|
||||
class B {
|
||||
val r = object {
|
||||
fun bar() = this@A
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
<!-- inaccessibleOuterClassExpression1 -->
|
||||
Expression is inaccessible from a nested class 'B', use 'inner' keyword to make the class inner
|
||||
@@ -98,4 +98,8 @@ public class DiagnosticMessageTest extends JetLiteFixture {
|
||||
public void testRenderCollectionOfTypes() throws Exception {
|
||||
doTest("renderCollectionOfTypes", 1, Errors.EXPECTED_PARAMETERS_NUMBER_MISMATCH);
|
||||
}
|
||||
|
||||
public void testInaccessibleOuterClassExpression() throws Exception {
|
||||
doTest("inaccessibleOuterClassExpression", 1, Errors.INACCESSIBLE_OUTER_CLASS_EXPRESSION);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user