Scala compiler throws annotation argument needs to be a constant error on constant argument -
i'm using following annotation parameter shipped spark-sql:
@sqluserdefinedtype(udt = actionudt.clazz) trait action extends actionlike { ...implementation }
where actionudt.clazz
defined constant val:
object actionudt extends actionudt { final val clazz: class[_ <: actionudt] = this.getclass }
but got following compiler error:
error:(25, 37) annotation argument needs constant; found: actionudt.clazz @sqluserdefinedtype(udt = actionudt.clazz) ^
why produce such false alarm? bug? i'm using scala 2.10.5
a class
not constant object defined here. constant .. .. constant in numeric or string literal.
Comments
Post a Comment