Task not serializable: java.io.NotSerializableException when calling function outside closure only on classes not objects

Getting strange behavior when calling function outside of a closure: when function is in a object everything is working when function is in a class get : Task not serializable: java.io.NotSerializableException: testing The problem is I need my code in a class and not an object. Any idea why this is happening? Is a Scala … Read more

Best way to parse command-line parameters? [closed]

Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago. Improve this question What’s the best way to parse command-line parameters in Scala? I personally prefer something lightweight that … Read more

How to use Shapeless in a Quasiquote?

I’m trying to call a Shapeless macro from inside a quasiquote with Scala and I’m not getting what I would like to get. My macro doesn’t return any errors but it doesn’t expand Witness(fieldName) into Witness.Lt[String] val implicits = schema.fields.map { field => val fieldName:String = field.name val fieldType = TypeName(field.valueType.fullName) val in = TermName(“implicitField”+fieldName) … Read more