aboutsummaryrefslogtreecommitdiff
path: root/tests/untried/pos/clsrefine.scala
diff options
context:
space:
mode:
authorSamuel Gruetter <samuel.gruetter@epfl.ch>2014-03-12 22:44:33 +0100
committerSamuel Gruetter <samuel.gruetter@epfl.ch>2014-03-12 22:44:33 +0100
commit9ef5f6817688f814a3450126aa7383b0928e80a0 (patch)
tree5727a2f7f7fd665cefdb312af2785c692f04377c /tests/untried/pos/clsrefine.scala
parent194be919664447631ba55446eb4874979c908d27 (diff)
downloaddotty-9ef5f6817688f814a3450126aa7383b0928e80a0.tar.gz
dotty-9ef5f6817688f814a3450126aa7383b0928e80a0.tar.bz2
dotty-9ef5f6817688f814a3450126aa7383b0928e80a0.zip
add tests from scala/test/files/{pos,neg}
with explicit Unit return type
Diffstat (limited to 'tests/untried/pos/clsrefine.scala')
-rw-r--r--tests/untried/pos/clsrefine.scala40
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/untried/pos/clsrefine.scala b/tests/untried/pos/clsrefine.scala
new file mode 100644
index 000000000..0a016dec0
--- /dev/null
+++ b/tests/untried/pos/clsrefine.scala
@@ -0,0 +1,40 @@
+import scala._;
+
+package scalac.util {
+
+trait A {
+ type X1;
+ type X2;
+ val x1: X1;
+ val x2: X2;
+}
+trait B extends A {
+ type Y;
+ val y1, y2: Y;
+ type X1 = Y;
+ type X2 = Y;
+ val x1 = y1;
+ val x2 = y2;
+ def f(x: Y, xs: B): Unit = {}
+ def g() = f(y1, this);
+}
+
+object test {
+ val b: B { type Y = Int } = new B {
+ type Y = Int;
+ val y1, y2 = 1;
+ }
+ val a: A { type X1 = Int; type X2 = Int } = b;
+ val a1 = new A {
+ type X1 = Int;
+ type X2 = String;
+ val x1 = 1;
+ val x2 = "hello"
+ }
+ val b1 = new B {
+ type Y = Any;
+ val y1 = 1;
+ val y2 = "hello";
+ }
+}
+}