I just found the equivalent of this in my code base:
case class Foo(bar: Int) extends {
override def toString = bar.toString
}
Not sure how extends
ever made it in there (probably a refactor leftover), but it does bring up a few questions:
extends
is removed?If valid, I assume Foo
is extending an anonymous class, but classOf[Foo].getSuperclass
just yields Object
.
http://stackoverflow.com/questions/4712468/in-scala-what-is-an-early-initializer
I believe that is an early initializer.
http://stackoverflow.com/questions/4712468/in-scala-what-is-an-early-initializer
--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
The strange syntax is the optional extends: ‘extends’ ClassTemplate | [[‘extends’] TemplateBody]
where AnyRef is understood. So it's optional.