Aladdin - Scala Bugtracking
[#19] project: compiler priority: medium category: feature
submitter assigned to status date submitted
Stephane won't fix 2003-05-22 16:36:28.0
subject type error in options ?!
code
object Main {

    def apply[a, b](key: a): Option[b] = None[b];

    def main(args: Array[String]) = {
        val x = apply(3);
        System.out.println(x);
    }

}
what happened
Main.scala:4: object scala.None of type scala.None cannot be applied to [b]
    def apply[a, b](key: a): Option[b] = None[b];
                                             ^
one error found
what expected scala.None$@1bab50a ---- Matthias: The compiler behaves correctly. None is not a generic class, it's a case object of type scala.Option[scala.All].
[back to overview]
Changes of this bug report