Prohibit accessing nested classes/objects of class object using class literal

The fqname of class should be clear from code
Example: can't shorten A.Default.B.Default.C to A.B.C
Also fixes problem when nested class of enum class could be accessed via enum entry
This commit is contained in:
Pavel V. Talanov
2015-02-18 19:22:25 +03:00
parent 86bbb117ef
commit ffabe19229
25 changed files with 480 additions and 44 deletions
@@ -0,0 +1,27 @@
class A {
class Nested
inner class Inner
class object {
class Nested2
val c: Int = 1
object Obj2
fun foo() {
}
}
object Obj
}
fun some() {
A.<caret>
}
// EXIST: Nested
// EXIST: Default
// EXIST: c
// EXIST: foo
// EXIST: Obj
// ABSENT: Nested2
// ABSENT: Obj2
@@ -0,0 +1,27 @@
class A {
class Nested
inner class Inner
class object Named {
class Nested2
val c: Int = 1
object Obj2
fun foo() {
}
}
object Obj
}
fun some() {
A.<caret>
}
// EXIST: Nested
// EXIST: Named
// EXIST: c
// EXIST: foo
// EXIST: Obj
// ABSENT: Nested2
// ABSENT: Obj2
@@ -0,0 +1,27 @@
class A {
class Nested
inner class Inner
class object Named {
class Nested2
val c: Int = 1
object Obj2
fun foo() {
}
}
object Obj
}
fun some() {
A.Named.<caret>
}
// EXIST: Nested2
// EXIST: c
// EXIST: foo
// EXIST: Obj2
// ABSENT: Nested
// ABSENT: Named
// ABSENT: Obj
@@ -5,5 +5,5 @@ class Test {
}
fun test() {
Test.S<caret>
Test.Default.S<caret>
}
@@ -5,5 +5,5 @@ class Test {
}
fun test() {
Test.Some<caret>
Test.Default.Some
}
@@ -7,5 +7,5 @@ class Test {
}
fun test() {
a.Test.S<caret>
a.Test.Default.S<caret>
}
@@ -7,5 +7,5 @@ class Test {
}
fun test() {
a.Test.Some<caret>
a.Test.Default.Some<caret>
}