看起来Android文档中有个错误。这个
Annotations - Kotlin Programming Language
Kotlin参考资料中的页面告诉我们:
如果注释用作另一个注释的参数,则其名称的前缀不会为
@
人物:
annotation class ReplaceWith(val expression: String)
annotation class Deprecated(
val message: String,
val replaceWith: ReplaceWith = ReplaceWith(""))
@Deprecated("This function is deprecated, use === instead", ReplaceWith("this === other"))
所以你的代码应该是:
data class FileEntryWithTags(
@Embedded val fileEntry: FileEntry,
@Relation(
parentColumn = FileEntry.COLUMN_UUID,
entityColumn = Tag.COLUMN_ID,
associateBy = Junction(FileEntryTagCrossRef::class)
)
val tags: List<Tag>
)