Skip to content

Commit

Permalink
Add ruintime representation of variants
Browse files Browse the repository at this point in the history
  • Loading branch information
Kota Mizushima committed Nov 30, 2016
1 parent 6504443 commit b113b15
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/scala/com/github/klassic/Value.scala
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ case object UnitValue extends Value {
case class ObjectValue(value: AnyRef) extends Value {
override def toString = value.toString
}
case class VariantValue(tag: String, items: List[Value]) extends Value {
override def toString: String = {
s"${tag}(${items.mkString(", ")})"
}
}
object Value {

def classOfValue(value: Value): java.lang.Class[_]= value match {
Expand Down

0 comments on commit b113b15

Please sign in to comment.