Aladdin - Scala Bugtracking
[#478] project: nsc priority: medium category: bug
submitter assigned to status date submitted
Iulian Martin fixed 2005-11-09 10:46:45.0
subject trait inheritance forgets concrete methods
code
trait _Iter {
  def hasNext: Boolean;

  def map(f: Int => Int) = ();

  def filter(f: Int => Boolean): _Iter = new _BufferedIter {
    def head = 0;
    def hasNext = true;
    // here we should inherit map and filter, as concrete methods
  }
}


trait _BufferedIter extends _Iter {
  def head: Int;
}
what happened
the anonymous class created in filter will not have an implementation for map or filter.
what expected see above.
[back to overview]
Changes of this bug report
Iulian  edited on  2005-11-10 10:49:54.0
Martin  edited on  2005-11-15 13:07:08.0