I'm using WartRemover tool to avoid possible errors in my Scala 2.11 code.
Specifically, I want to know how to fix the "Product Type Inferred" error.
Looking at the repo documentation, I can only see the failure example, but I would like to know how I'm suppose to fix that error:
https://github.com/puffnfresh/wartremover#product.
Doing my homework, I end up with this other link that explains how to fix Type Inference Failures errors https://blog.cppcabrera.com/posts/scala-wart-remover.html. And I quote "If you see any of the warnings below, the fix is usually as simple as providing type annotations" but I don't understand what that means. I really need a concrete example.
val name: (String, JsValue) = "name" -> teacher.name.map(JsString(_)).getOrElse(JsNull)
How to I explicitly tell that line I should be an (String, JsValue)? Right now I keep getting the "Inferred type containing Product" error. BTW: JsString and JsNull inherited from JsValue (spray-json lib) – New