Not sure, it might be something I'm overlooking but I cant get "private def format(e: Expr, enclPrec: Int): Element = e match { case Var(name) => elem(name) case Number(num) => def stripDot(s: String) = if (s endsWith ".0") s.substring(0, s.length - 2) else s elem(stripDot(num.toString))" to compile. Element.scala: package layout object Element { def elem(contents: Array[String]): Element = new ArrayElement(contents)
/Arihmetic.scala:35: error: type mismatch; found : layout.Element required: Element elem(name)
changing the "Element" to Elemnent or using: def format(e: Expr, enclPrec: Int): layout.Element = e match makes it compile. any ideas?