Make diagnostic for @MetaSerializable on nested annotation
K2 plugin API has a limitation that meta annotations from plugin predicates can't be used on nested annotations because their resolve process includes supertypes resolve, that can be affected by the plugin itself. Therefore, @MetaSerializable can't be applied to nested annotation classes in K2, which is reflected by this diagnostic. For old FE, diagnostic is lowered to WARNING with deprecation message.
This commit is contained in:
committed by
Space Team
parent
9586bf74e0
commit
f627d81d53
@@ -0,0 +1,21 @@
|
||||
// WITH_STDLIB
|
||||
// SKIP_TXT
|
||||
|
||||
import kotlinx.serialization.*
|
||||
|
||||
@MetaSerializable
|
||||
annotation class TopLevel
|
||||
|
||||
class MetaSerializableNestedTest {
|
||||
<!META_SERIALIZABLE_NOT_APPLICABLE!>@MetaSerializable<!>
|
||||
@Target(AnnotationTarget.PROPERTY, AnnotationTarget.CLASS)
|
||||
annotation class JsonComment(val comment: String)
|
||||
|
||||
object Nested2 {
|
||||
<!META_SERIALIZABLE_NOT_APPLICABLE!>@MetaSerializable<!>
|
||||
annotation class Nested3
|
||||
}
|
||||
|
||||
@JsonComment("class_comment")
|
||||
data class IntDataCommented(val i: Int)
|
||||
}
|
||||
Reference in New Issue
Block a user