In Scala, during type erasure, the generic variable is replaced by 'Object' type wherever the generic variable appears in type position. E.G: val x T ...
In Scala, during type erasure, the generic variable is replaced by 'Object' type wherever the generic variable appears in type position. E.G: val x T ...
I have a map of type Map[_, Any], and I want to extract the values in their native format (without resorting to .asInstanceOf[_]). Something like thi ...
I am trying to define a map with a parameterized class as its key. But when I try to add to it I get a compiler error: I get the following compiler ...
I am working on what should be a trivial piece of code. I want to take a List, and convert it to an equivalent Array: Running this code gives: H ...
I found some snippets as follow: import org.json4s.DefaultFormats import org.json4s.jackson.JsonMethods._ import scala.io.Source import scala.reflec ...
I have a method that writes one of my classes Foo, which is defined as Thrift, in Parquet form. import Foo import org.apache.spark.rdd.RDD impo ...
I have a trait with a type parameter. Inside this trait I want to define a method which checks if an object matches the type parameter. So far, this w ...
Let's say I have a trait Foo, with type parameter T, and I need a ClassTag of T to be used in Foo: I want to achieve that without implementing ct i ...
This might be a silly question but I've been struggling for quite some time. It is indeed similar to this question but I wasn't able to apply it in my ...
sorry for asking a simple question. I want to pass a case class to a function argument and I want to use it further inside the function. Till now I ha ...
With there needs to be an implicit ClassTag[T] available. How are these made available? Is there a list somewhere of ClassTags? I see an implicit v ...
I'm new to scala, sorry for the dumb question. I want to remove the return statements from this Scala code (my real case is much more complicated than ...
I have a method like: and a class when calling the first method from within the SparkBaseRunner class like the compile error is: What can ...
Loading a ficus configuration like fails with: when instead directly specifying a case class instead of T i.e. SomeClass it works just fine. Wha ...
I need to write a generic method to get all fields of an object and it's value, the class of this object may contains ClassTag, so we should find a wa ...
Using scala 2.12.4 I cannot get this code to work since it says [error] .../src/main/scala/effect.scala:32:11: No ClassTag available for A [err ...
In my code, I use classTag[JValue] want to get org.json4s.JsonAST.JValue , but actually it returns org.json4s.JsonAST$JValue, it is strange ! why ther ...
I'm trying to convert a Scala Map[String, Any] to a case class using Scala reflection (Scala 2.11) as follows - this unfortunately results in a com ...