Last active
December 28, 2015 19:29
-
-
Save tixxit/7551058 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.reflect.ClassTag | |
sealed trait Value | |
case class ValueArray[A](xs: Array[A])(implicit val ct: ClassTag[A]) extends Value | |
case class Text(value: String) extends Value | |
def doStuff(lit: Value): Unit = lit match { | |
case (al: ValueArray[a]) => | |
implicit val ct = al.ct | |
val yay = new Array[a](2) | |
case _ => | |
} | |
Thanks! That's what I get for trying to change the type names right before gisting!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Shouldn't
case (al: ArrayList[a])
becase (al: ValueArray[a])
anddoStuff(lit: Lit)
bedoStuff(lit: Value)