My eclipse (The Eclipse I have is java-edition of eclipse.buildId=4.4.0.I20140606-1215 java.version=1.7.0_45 BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=ru_RU plus Scala IDE for Eclipse 3.0.4.v-2_11-201405200946-c46f499 org.scala-ide.sdt.feature.feature.group scala-ide.org) cannot open .scala files in the editor. I therefore do everything in the worksheets. Particularly, week 3 assignment of progfun contains a pattern
which fails in the worksheet with error
Why did nobody notice it so far?
abstract class T {
def head: String
}
object N extends T {
def head = throw new Exception("head of EmptyList")
}
which fails in the worksheet with error
object creation impossible, since method head in class T of type => String is not defined
Why did nobody notice it so far?
Leave a comment
on 2014-10-11 10:50 *
By valtih1978253762
A workaround was publised in Coursera official forum
object Workaround {
trait TweetList {
def head: String
}
object Nil extends TweetList {
def head = throw new Exception("head of EmptyList")
}
}
No file chosen
You have an empty file field. Please select or remove it.
Name | Size |
---|