[#18] | project: compiler | priority: medium | category: feature | |
---|---|---|---|---|
submitter | assigned to | status | date submitted | |
Stephane | won't fix | 2003-05-22 14:21:48.0 | ||
subject | type error in lists ?! | |||
code |
object Main { def main(args: Array[String]) = { val ys = -2 :: 8 :: 6 :: -4 :: Nil[Int]; System.out.println(ys) } } |
|||
what happened | Main.scala:4: method apply of type (scala.Int)scala.All cannot be applied to [scala.Int] val ys = -2 :: 8 :: 6 :: -4 :: Nil[Int]; ^ one error found |
|||
what expected | List(-2,8,6,-4) ---- Matthias: The compiler behaves correctly. Nil is not a generic class, it's a case object of type scala.List[scala.All]. | |||
[back to overview] |