jeudi 20 août 2015

Field not generated for an `implicit val` class constructor parameter

I have a class defined as follows:

case class JNI_GetPrimitiveFieldValue[A, T](fid: Rep[JNIFieldID], tup: Rep[JNIType[T]])(implicit val eA: Elem[A], val eT: Elem[T]) extends BaseDef[A] {
  ...
}

To my surprise, getDeclaredFields does not include eA:

> println("JNI_GetPrimitiveFieldValue fields: " + classOf[JNI_GetPrimitiveFieldValue[_, _]].getDeclaredFields.mkString("\n"))

JNI_GetPrimitiveFieldValue fields: private final scalan.staged.BaseExp$Exp scalan.JNIExtractorOpsExp$JNI_GetPrimitiveFieldValue.fid
private final scalan.staged.BaseExp$Exp scalan.JNIExtractorOpsExp$JNI_GetPrimitiveFieldValue.tup
private final scalan.Elems$Element scalan.JNIExtractorOpsExp$JNI_GetPrimitiveFieldValue.eT
public final scalan.JNIExtractorOpsExp scalan.JNIExtractorOpsExp$JNI_GetPrimitiveFieldValue.$outer

Is there an explanation for this or is this a known bug (Scala version is 2.11.7)? I can access eA from outside the class.





Aucun commentaire:

Enregistrer un commentaire