diff options
author | Martin Odersky <odersky@gmail.com> | 2005-10-03 13:42:39 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2005-10-03 13:42:39 +0000 |
commit | 2994973970bcba6ff90d7788e79f2042cc11deaf (patch) | |
tree | b90fbfc9d5b12b01f2815edabb2f0eeb17655a94 /test/files/pos/orderedpoints.scala | |
parent | 159a3633b593bf2b0a10f4f4e218489b2bba03bc (diff) | |
download | scala-2994973970bcba6ff90d7788e79f2042cc11deaf.tar.gz scala-2994973970bcba6ff90d7788e79f2042cc11deaf.tar.bz2 scala-2994973970bcba6ff90d7788e79f2042cc11deaf.zip |
*** empty log message ***
Diffstat (limited to 'test/files/pos/orderedpoints.scala')
-rwxr-xr-x | test/files/pos/orderedpoints.scala | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/files/pos/orderedpoints.scala b/test/files/pos/orderedpoints.scala index 466ada1363..7e56a663fe 100755 --- a/test/files/pos/orderedpoints.scala +++ b/test/files/pos/orderedpoints.scala @@ -1,3 +1,5 @@ +package test; + class Point1(x: int) extends Object with Ordered[Point1] { val xCoord = x; def compareTo [b >: Point1 <% Ordered[b]](that: b): int = that match { @@ -5,7 +7,8 @@ class Point1(x: int) extends Object with Ordered[Point1] { case _ => -that.compareTo(this) } } -class Point2(x: int, y: int) extends Point1(x) with Ordered[Point2] { +class Point2(x: int, y: int) extends Point1(x) with Ordered[Point2] {} +/* val yCoord = y; override def compareTo [b >: Point2 <% Ordered[b]](that: b): int = that match { case that1: Point2 => @@ -14,7 +17,7 @@ class Point2(x: int, y: int) extends Point1(x) with Ordered[Point2] { case _ => -that.compareTo(this) } } -object Test with Application { +object Test extends Application { val p1 = new Point1(1); val q1 = new Point1(2); System.out.println(p1 < q1); @@ -24,3 +27,4 @@ object Test with Application { System.out.println(p1 < q2); System.out.println(p2 < q1); } +*/ |