summaryrefslogtreecommitdiff
path: root/test/pos/clsrefine.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2003-02-14 14:39:24 +0000
committerMartin Odersky <odersky@gmail.com>2003-02-14 14:39:24 +0000
commit21b147f7caf8b558b00044f493cf9da392c7e30e (patch)
treea964142a10a16e7c9a64b03e44fdde1d9f1b63be /test/pos/clsrefine.scala
parentfd3f10df3cd88fe3b970f8312a479ae63f0803b8 (diff)
downloadscala-21b147f7caf8b558b00044f493cf9da392c7e30e.tar.gz
scala-21b147f7caf8b558b00044f493cf9da392c7e30e.tar.bz2
scala-21b147f7caf8b558b00044f493cf9da392c7e30e.zip
Initial version.
Diffstat (limited to 'test/pos/clsrefine.scala')
-rw-r--r--test/pos/clsrefine.scala33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/pos/clsrefine.scala b/test/pos/clsrefine.scala
new file mode 100644
index 0000000000..cbef0968e0
--- /dev/null
+++ b/test/pos/clsrefine.scala
@@ -0,0 +1,33 @@
+import scala._;
+
+package scalac.util {
+
+trait A {
+ type X1, X2;
+ val x1: X1, x2: X2;
+}
+trait B extends A {
+ type Y;
+ val y1: Y, y2: Y;
+ type X1 = Y, X2 = Y;
+ val x1 = y1, x2 = y2;
+ def f(x: Y, xs: B): Unit = {}
+ def g() = f(y1, this);
+}
+
+module test {
+ val b: B with { type Y = Int } = new B {
+ type Y = Int;
+ val y1 = 1, y2 = 1;
+ }
+ val a: A with { type X1 = Int, X2 = Int } = b;
+ val a1 = new A with {
+ type X1 = Int, X2 = String;
+ val x1 = 1, x2 = "hello"
+ }
+ val b1 = new B with {
+ type Y = Any;
+ val y1 = 1, y2 = "hello";
+ }
+}
+} \ No newline at end of file