KT-3257 Bad diagnostics when trying to instantiate a private class
#KT-3257 Fixed
This commit is contained in:
committed by
Nikolay Krasko
parent
d645fcaaa7
commit
4b656d8c8d
@@ -0,0 +1,15 @@
|
||||
package foo.bar
|
||||
|
||||
class A {
|
||||
private class B
|
||||
public class C private()
|
||||
|
||||
private fun bar() {}
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
A.B() // ERROR 1: Cannot access 'B': it is 'private' in 'A'
|
||||
A.C() // ERROR 2: Cannot access '' : it is 'private' in 'C'
|
||||
|
||||
A().bar() // ERROR 3: Cannot access 'bar' : it is 'private' in 'A'
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
<!-- invisibleMember1 -->
|
||||
Cannot access 'B': it is 'private' in 'A'
|
||||
@@ -0,0 +1,2 @@
|
||||
<!-- invisibleMember2 -->
|
||||
Cannot access '<init>': it is 'private' in 'C'
|
||||
@@ -0,0 +1,2 @@
|
||||
<!-- invisibleMember3 -->
|
||||
Cannot access 'bar': it is 'private' in 'A'
|
||||
Reference in New Issue
Block a user