Regular modifier checker implemented (initial version). A set of tests fixed accordingly.

Most of modifier diagnostic is expressed by REDUNDANT_MODIFIER, INCOMPATIBLE_MODIFIERS, REPEATED_MODIFIER, WRONG_MODIFIER_TARGET, WRONG_MODIFIER_PARENT.
A set of modifier diagnostics is not in use now (but not deleted yet).
This commit is contained in:
Mikhail Glukhikh
2015-06-16 13:08:05 +03:00
parent faac06ff7e
commit 4bd48c4796
67 changed files with 588 additions and 616 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ class B() {
}
object b {
<error descr="[COMPANION_OBJECT_NOT_ALLOWED] A companion object is not allowed here">companion</error> object {
<error descr="[WRONG_MODIFIER_CONTAINING_DECLARATION] Modifier 'companion' is not applicable inside 'object'">companion</error> object {
val x = 1
}
// error
+4 -4
View File
@@ -1,15 +1,15 @@
import kotlin.platform.platformStatic
<error descr="[WRONG_ANNOTATION_TARGET] This annotation is not applicable to target 'classifier'">platformStatic</error>
<error descr="[WRONG_ANNOTATION_TARGET] This annotation is not applicable to target 'class'">platformStatic</error>
class A {
<error descr="[WRONG_ANNOTATION_TARGET] This annotation is not applicable to target 'classifier'">platformStatic</error>
<error descr="[WRONG_ANNOTATION_TARGET] This annotation is not applicable to target 'object'">platformStatic</error>
companion object {
platformStatic fun a1() {
}
}
<error descr="[WRONG_ANNOTATION_TARGET] This annotation is not applicable to target 'classifier'">platformStatic</error>
<error descr="[WRONG_ANNOTATION_TARGET] This annotation is not applicable to target 'object'">platformStatic</error>
object A {
platformStatic fun a2() {
@@ -29,7 +29,7 @@ class A {
}
}
<error descr="[WRONG_ANNOTATION_TARGET] This annotation is not applicable to target 'classifier'">platformStatic</error>
<error descr="[WRONG_ANNOTATION_TARGET] This annotation is not applicable to target 'interface'">platformStatic</error>
interface B {
companion object {
<error descr="[PLATFORM_STATIC_NOT_IN_OBJECT] Only functions in named objects and companion objects of classes can be annotated with 'platformStatic'">platformStatic fun a1()</error> {