The compiler complains because f.get
method expects an AnyRef
parameter. AFAIK, in Scala everything can be safely cast to AnyRef
- the compiler will force necessary boxing if needed. So I think this should work: f.get(row.asInstanceOf[AnyRef])
EDIT: I just tested this and it works.