File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,10 @@ object Deriving {
5757 def fromProduct (p : scala.Product ): T
5858 }
5959
60- class Singleton [T ](val value : T ) extends Generic [T ] {
60+ class Singleton [T ] extends Generic [T ] {
61+ inline def singletonValue = implicit match {
62+ case ev : ValueOf [T ] => ev.value
63+ }
6164 type CaseLabel <: String
6265 }
6366 }
@@ -103,7 +106,7 @@ object Lst {
103106 }
104107
105108 case object Nil extends Lst [Nothing ] {
106- class GenericNil extends Generic .Singleton [Nil .type ]( Nil ) {
109+ class GenericNil extends Generic .Singleton [Nil .type ] {
107110 type CaseLabel = " Nil"
108111 }
109112 implicit def GenericNil : GenericNil = new GenericNil
@@ -310,7 +313,7 @@ object Pickler {
310313 else if (ord == n)
311314 inline g.alternative(n) match {
312315 case g : Generic .Product [p] => unpickleProduct(g)(buf)
313- case g : Generic .Singleton [s] => g.value
316+ case g : Generic .Singleton [s] => g.singletonValue
314317 }
315318 else unpickleCases[T ](g, n + 1 )(buf, ord)
316319
You can’t perform that action at this time.
0 commit comments