diff options
author | Martin Odersky <odersky@gmail.com> | 2003-05-19 11:12:09 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2003-05-19 11:12:09 +0000 |
commit | f7f15007686e355a2d8668bf890603be90810e29 (patch) | |
tree | bdb8a9a813fd1a8b32bc20b6988eafe16de4a2f8 /test/pos/infer.scala | |
parent | 2300aac76adab6945ca2d2e3cb15320621a76150 (diff) | |
download | scala-f7f15007686e355a2d8668bf890603be90810e29.tar.gz scala-f7f15007686e355a2d8668bf890603be90810e29.tar.bz2 scala-f7f15007686e355a2d8668bf890603be90810e29.zip |
*** empty log message ***
Diffstat (limited to 'test/pos/infer.scala')
-rw-r--r-- | test/pos/infer.scala | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/pos/infer.scala b/test/pos/infer.scala index 7e88585ae7..7ff49ff70f 100644 --- a/test/pos/infer.scala +++ b/test/pos/infer.scala @@ -1,10 +1,10 @@ module test { - class List[a] { - def ::(x: a): List[a] = new Cons(x, this); + class List[+a] { + def ::[b >: a](x: b): List[b] = new Cons(x, this); } - case class Cons[a](x: a, xs: List[a]) extends List[a]; - case class Nil[a] extends List[a]; - def nil[a]: Nil[a] = new Nil[a]; + case class Cons[a, b <: a](x: a, xs: List[b]) extends List[a]; + case object Nil extends List[All]; + def nil[a]: List[a] = Nil; def cons[a](x: a, xs: List[a]): List[a] = null; val x: List[Int] = Nil.::(1); val y: List[Int] = nil.::(1); |