Aladdin - Scala Bugtracking
[#1189] project: compiler priority: high category: bug
submitter assigned to status date submitted
Stephane Martin fixed 2007-06-20 15:35:07.0
subject type mismatch error
code
object test extends Application {
  case class Cell[T](x: T)
  type U = Cell[T1] forSome { type T1 }
  def f[T](x: Any): U = x match { case y: Cell[T] => y }

  var x: U = Cell(1)
  println(x)
}
what happened
test.scala:6: error: type mismatch;
 found   : Int(1)
 required: >: Nothing <: Any
  var x: U = Cell(1)
                  ^
one error found
what expected compiles silently when using type itself instead of U
[back to overview]
Changes of this bug report
Stephane  edited on  2007-06-20 15:48:08.0
Stephane  edited on  2007-06-26 14:56:06.0
Martin  edited on  2007-07-02 11:56:09.0