Aladdin - Scala Bugtracking
[#407] project: compiler priority: low category: bug
submitter assigned to status date submitted
Iulian Martin _ 2005-03-08 17:11:00.0
subject type checker complains about "viewable" when it shouldn't
code
/* The following code should provide a view from List[A] to List[B], provided A <% B. */

object Main with Application {

  def view[B, A <% B](l: List[A]): List[B] = l match {
    case Nil => Nil;
    case x :: xs => (x: B) :: Main.this.view(xs);
  }
}
what happened
v.scala:16: type instantiation with [B,A] failed since A is not viewable as B
    case x :: xs => (x: B) :: Main.this.view(xs);
                                       ^
what expected No error. A is viewable as B.
[back to overview]
Changes of this bug report
Iulian  edited on  2005-03-08 17:11:41.0