Skip to content

Instantly share code, notes, and snippets.

@paulspencerwilliams
Created November 23, 2013 16:48
Show Gist options
  • Save paulspencerwilliams/7616944 to your computer and use it in GitHub Desktop.
Save paulspencerwilliams/7616944 to your computer and use it in GitHub Desktop.
Why do I get a "error: not found: type LineElement" when trying to load this scala file?
abstract class Element {
def contents: Array[String]
def height: Int = contents.length
def width: Int = if (height == 0) 0 else contents(0).length
def beside(that: Element): Element = {
new LineElement("hello")
}
}
class ArrayElement(conts: Array[String]) extends Element {
def contents: Array[String] = conts
}
class LineElement(s:String) extends Element() {
val contents = Array(s)
override def width = s.length
override def height = 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment