Make MISSING_VAL_ON_ANNOTATION_PARAMETER error instead of warning

Annotation with a parameter that is not stored doesn't make any sense
This commit is contained in:
Alexander Udalov
2014-09-12 16:02:59 +04:00
parent f64e633a7e
commit f39c3041d2
14 changed files with 20 additions and 9 deletions
@@ -114,7 +114,7 @@ public interface Errors {
// Annotations
DiagnosticFactory0<JetDelegationSpecifierList> SUPERTYPES_FOR_ANNOTATION_CLASS = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0<JetParameter> MISSING_VAL_ON_ANNOTATION_PARAMETER = DiagnosticFactory0.create(WARNING);
DiagnosticFactory0<JetParameter> MISSING_VAL_ON_ANNOTATION_PARAMETER = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0<JetCallExpression> ANNOTATION_CLASS_CONSTRUCTOR_CALL = DiagnosticFactory0.create(ERROR);
DiagnosticFactory1<JetAnnotationEntry, DeclarationDescriptor> NOT_AN_ANNOTATION_CLASS = DiagnosticFactory1.create(ERROR);
DiagnosticFactory0<PsiElement> ANNOTATION_CLASS_WITH_BODY = DiagnosticFactory0.create(ERROR);
@@ -5,4 +5,4 @@ object SomeObject
val some = SomeObject
annotation class BadAnnotation(s: String)
annotation class BadAnnotation(val s: String)
@@ -5,6 +5,8 @@ internal val some: test.SomeObject
internal final annotation class BadAnnotation : kotlin.Annotation {
/*primary*/ public constructor BadAnnotation(/*0*/ s: kotlin.String)
internal final val s: kotlin.String
internal final fun <get-s>(): kotlin.String
}
test.BadAnnotation(s = IntegerValueType(1): IntegerValueType(1)) internal object SomeObject {
@@ -3,7 +3,7 @@ package test
import java.lang.annotation.ElementType
annotation class Anno(t: ElementType)
annotation class Anno(val t: ElementType)
class Class {
Anno(ElementType.METHOD) fun foo() {}
@@ -2,6 +2,8 @@ package test
internal final annotation class Anno : kotlin.Annotation {
/*primary*/ public constructor Anno(/*0*/ t: java.lang.annotation.ElementType)
internal final val t: java.lang.annotation.ElementType
internal final fun <get-t>(): java.lang.annotation.ElementType
}
internal final class Class {
@@ -3,7 +3,7 @@ package test
import java.lang.annotation.ElementType
annotation class Anno(t: ElementType)
annotation class Anno(val t: ElementType)
Anno(ElementType.METHOD) class Class {
Anno(ElementType.PARAMETER) inner class Inner
@@ -2,6 +2,8 @@ package test
internal final annotation class Anno : kotlin.Annotation {
/*primary*/ public constructor Anno(/*0*/ t: java.lang.annotation.ElementType)
internal final val t: java.lang.annotation.ElementType
internal final fun <get-t>(): java.lang.annotation.ElementType
}
test.Anno(t = ElementType.METHOD: java.lang.annotation.ElementType) internal final class Class {
@@ -3,7 +3,7 @@ package test
import java.lang.annotation.ElementType
annotation class Anno(t: ElementType)
annotation class Anno(val t: ElementType)
Anno(ElementType.METHOD) fun foo() {}
@@ -6,4 +6,6 @@ test.Anno(t = ElementType.METHOD: java.lang.annotation.ElementType) internal fun
internal final annotation class Anno : kotlin.Annotation {
/*primary*/ public constructor Anno(/*0*/ t: java.lang.annotation.ElementType)
internal final val t: java.lang.annotation.ElementType
internal final fun <get-t>(): java.lang.annotation.ElementType
}
@@ -3,7 +3,7 @@ package test
import java.lang.annotation.ElementType
annotation class Anno(vararg t: ElementType)
annotation class Anno(vararg val t: ElementType)
Anno(ElementType.METHOD, ElementType.FIELD) fun foo() {}
@@ -7,4 +7,6 @@ test.Anno(t = {ElementType.METHOD, ElementType.FIELD}: kotlin.Array<java.lang.an
internal final annotation class Anno : kotlin.Annotation {
/*primary*/ public constructor Anno(/*0*/ vararg t: java.lang.annotation.ElementType /*kotlin.Array<java.lang.annotation.ElementType>*/)
internal final val t: kotlin.Array<java.lang.annotation.ElementType>
internal final fun <get-t>(): kotlin.Array<java.lang.annotation.ElementType>
}
@@ -1,7 +1,7 @@
//ALLOW_AST_ACCESS
package test
annotation class Anno(vararg t: String)
annotation class Anno(vararg val t: String)
Anno("live", "long") fun foo() {}
@@ -7,4 +7,6 @@ test.Anno(t = {"live", "long"}: kotlin.Array<kotlin.String>) internal fun foo():
internal final annotation class Anno : kotlin.Annotation {
/*primary*/ public constructor Anno(/*0*/ vararg t: kotlin.String /*kotlin.Array<kotlin.String>*/)
internal final val t: kotlin.Array<kotlin.String>
internal final fun <get-t>(): kotlin.Array<kotlin.String>
}
+1 -2
View File
@@ -1,5 +1,4 @@
package org.junit;
native
public annotation class Test(name : String = "")
public annotation class Test(val name: String = "")