Files
kotlin-fork/compiler/testData/diagnostics/tests/ClassObjects.kt
T
Alexander Udalov c4b5577555 Do not report NO_CLASS_OBJECT when namespacesAllowed=true
Now with nested classes the expression "A.something" makes sense even when A
doesn't have a class object ("something" could be a nested class)

Also "A" expression now gets a NamespaceType with the scope of all static
nested classes of A

 #KT-1174 In Progress
2013-01-16 23:11:50 +04:00

32 lines
459 B
Kotlin

package Jet86
class A {
class object {
val x = 1
}
<!MANY_CLASS_OBJECTS!>class object { // error
val x = 1
}<!>
}
class B() {
val x = 12
}
object b {
<!CLASS_OBJECT_NOT_ALLOWED!>class object {
val x = 1
}<!> // error
}
val a = A.x
val c = B.<!UNRESOLVED_REFERENCE!>x<!>
val d = b.<!UNRESOLVED_REFERENCE!>x<!>
val s = <!NO_CLASS_OBJECT!>System<!> // error
fun test() {
System.out.println()
java.lang.System.out.println()
}