Report default object specific diagnostics on 'default' modifier

This commit is contained in:
Pavel V. Talanov
2015-03-06 16:21:58 +03:00
parent 012d25dbca
commit 5540f09751
10 changed files with 31 additions and 22 deletions
+2 -2
View File
@@ -4,7 +4,7 @@ class A {
default object {
val x = 1
}
default <error descr="[MANY_DEFAULT_OBJECTS] Only one default object is allowed per class">object Another</error> { // error
<error descr="[MANY_DEFAULT_OBJECTS] Only one default object is allowed per class">default</error> object Another { // error
val x = 1
}
}
@@ -14,7 +14,7 @@ class B() {
}
object b {
default <error descr="[DEFAULT_OBJECT_NOT_ALLOWED] A default object is not allowed here">object</error> {
<error descr="[DEFAULT_OBJECT_NOT_ALLOWED] A default object is not allowed here">default</error> object {
val x = 1
}
// error