diff options
Diffstat (limited to 'test/pos/infer.scala')
-rw-r--r-- | test/pos/infer.scala | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/pos/infer.scala b/test/pos/infer.scala new file mode 100644 index 0000000000..7e88585ae7 --- /dev/null +++ b/test/pos/infer.scala @@ -0,0 +1,11 @@ +module test { + class List[a] { + def ::(x: a): List[a] = 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]; + def cons[a](x: a, xs: List[a]): List[a] = null; + val x: List[Int] = Nil.::(1); + val y: List[Int] = nil.::(1); +}
\ No newline at end of file |