summaryrefslogtreecommitdiff
path: root/test-nsc/files/pos/infer.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test-nsc/files/pos/infer.scala')
-rwxr-xr-xtest-nsc/files/pos/infer.scala11
1 files changed, 11 insertions, 0 deletions
diff --git a/test-nsc/files/pos/infer.scala b/test-nsc/files/pos/infer.scala
new file mode 100755
index 0000000000..24871458b3
--- /dev/null
+++ b/test-nsc/files/pos/infer.scala
@@ -0,0 +1,11 @@
+object test {
+ class List[+a] {
+ def ::[b >: a](x: b): List[b] = new Cons(x, this);
+ }
+ case class Cons[a, b <: a](x: a, xs: List[b]) extends List[a];
+ case object Nil extends List[All];
+ def nil[n]: List[n] = Nil;
+ def cons[a](x: a, xs: List[a]): List[a] = null;
+ val x: List[Int] = Nil.::(1);
+ val y: List[Int] = nil.::(1);
+}