Do not report "invalid type of annotation member" on error types

In case the referred type is actually an enum that is not found in
dependencies due to a configuration problem, this usage could be valid.
So we can avoid reporting an error here, to reduce the number of
diagnostics.

Also do not report "default value of annotation parameter must be a
compile-time constant" in the same case for the same reason
This commit is contained in:
Alexander Udalov
2017-12-05 17:11:09 +01:00
parent c251386fc3
commit e2def0c60e
4 changed files with 26 additions and 11 deletions
@@ -33,6 +33,10 @@ annotation class Ann8(val p1: Array<String>,
val p3: Array<MyEnum>,
val p4: Array<Ann1>)
annotation class Ann9(
val error: <!UNRESOLVED_REFERENCE!>Unresolved<!> = <!UNRESOLVED_REFERENCE!>Unresolved<!>.<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>VALUE<!>
)
// INCORRECT
annotation class InAnn1(val p1: <!NULLABLE_TYPE_OF_ANNOTATION_MEMBER!>Int?<!>,
@@ -83,6 +83,14 @@ package test {
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final annotation class Ann9 : kotlin.Annotation {
public constructor Ann9(/*0*/ error: [ERROR : Unresolved] = ...)
public final val error: [ERROR : Unresolved]
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final annotation class InAnn1 : kotlin.Annotation {
public constructor InAnn1(/*0*/ p1: kotlin.Int?, /*1*/ p3: kotlin.Short?, /*2*/ p4: kotlin.Long?, /*3*/ p5: kotlin.Double?, /*4*/ p6: kotlin.Float?, /*5*/ p7: kotlin.Char?, /*6*/ p8: kotlin.Boolean?)
public final val p1: kotlin.Int?