summaryrefslogtreecommitdiff
path: root/src/main/scala/spray/json/ProductFormats.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/scala/spray/json/ProductFormats.scala')
-rw-r--r--src/main/scala/spray/json/ProductFormats.scala5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/scala/spray/json/ProductFormats.scala b/src/main/scala/spray/json/ProductFormats.scala
index 7d6c63e..81a48af 100644
--- a/src/main/scala/spray/json/ProductFormats.scala
+++ b/src/main/scala/spray/json/ProductFormats.scala
@@ -19,6 +19,7 @@ package spray.json
import java.lang.reflect.Modifier
import scala.annotation.tailrec
import scala.util.control.NonFatal
+import scala.reflect.ClassTag
/**
* Provides the helpers for constructing custom JsonFormat implementations for types implementing the Product trait
@@ -64,8 +65,8 @@ trait ProductFormats extends ProductFormatsInstances {
case _ => deserializationError("Object expected in field '" + fieldName + "'", fieldNames = fieldName :: Nil)
}
- protected def extractFieldNames(classManifest: ClassManifest[_]): Array[String] = {
- val clazz = classManifest.erasure
+ protected def extractFieldNames(tag: ClassTag[_]): Array[String] = {
+ val clazz = tag.runtimeClass
try {
// copy methods have the form copy$default$N(), we need to sort them in order, but must account for the fact
// that lexical sorting of ...8(), ...9(), ...10() is not correct, so we extract N and sort by N.toInt