memphis
09/20/2018, 2:20 PM@IntDef
annotation as below
companion object {
@Retention(AnnotationRetention.SOURCE)
@IntDef(
TYPE_HEADER.toLong(),
TYPE_FOOTER.toLong()
)
annotation class AdapterItemType
const val TYPE_HEADER = 0
const val TYPE_FOOTER = 2
}
I noticed that values inside @IntDef
must be of type Long
and not Int
.. But in compilation, I get this error :
error: incompatible types: possible lossy conversion from long to int
Any idea? 🙂budibit
09/27/2018, 8:55 AMconst val TYPE_HEADER = 0L
const val TYPE_FOOTER = 2L
and remove the toLong()
calls