diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/pos/partialfun.scala | 2 | ||||
-rw-r--r-- | test/files/pos/patterns.scala | 4 | ||||
-rw-r--r-- | test/files/run/Course-2002-03.scala | 24 | ||||
-rw-r--r-- | test/pos/partialfun.scala | 2 | ||||
-rw-r--r-- | test/pos/patterns.scala | 4 |
5 files changed, 18 insertions, 18 deletions
diff --git a/test/files/pos/partialfun.scala b/test/files/pos/partialfun.scala index 57efb1d2ea..1f27d099e4 100644 --- a/test/files/pos/partialfun.scala +++ b/test/files/pos/partialfun.scala @@ -5,6 +5,6 @@ module partialfun { applyPartial { case Some(x) => x - } (None()); + } (None); }
\ No newline at end of file diff --git a/test/files/pos/patterns.scala b/test/files/pos/patterns.scala index 671ba096e3..18ffec5025 100644 --- a/test/files/pos/patterns.scala +++ b/test/files/pos/patterns.scala @@ -1,6 +1,6 @@ trait Option[a] {} case class Some[a](x: a) extends Option[a]; -case class None[a]() extends Option[a]; +case class None[a] extends Option[a]; module test { @@ -8,6 +8,6 @@ module test { def print(opt: Option[String]) = opt match { case Some(x) => println(x); - case None() => println("nothing"); + case None => println("nothing"); } }
\ No newline at end of file diff --git a/test/files/run/Course-2002-03.scala b/test/files/run/Course-2002-03.scala index 86f5453111..a4efd7ffa6 100644 --- a/test/files/run/Course-2002-03.scala +++ b/test/files/run/Course-2002-03.scala @@ -153,9 +153,9 @@ module M5 { def contains(x: Int): Boolean; } - class Empty() extends IntSet { + class Empty extends IntSet { def contains(x: Int): Boolean = false; - def incl(x: Int): IntSet = new NonEmpty(x, new Empty(), new Empty()); + def incl(x: Int): IntSet = new NonEmpty(x, new Empty, new Empty); } class NonEmpty(elem: Int, left: IntSet, right: IntSet) extends IntSet { @@ -169,7 +169,7 @@ module M5 { else this; } - val x = new Empty() incl 1 incl 2; + val x = new Empty incl 1 incl 2; System.out.println(x contains 0); System.out.println(x contains 1); System.out.println(x contains 2); @@ -226,9 +226,9 @@ module M8 { def intersect0(that: IntSet, accu: IntSet): IntSet; def filter0(f: Int => Boolean, accu: IntSet): IntSet; - def intersect(that: IntSet): IntSet = intersect0(that, new Empty()); + def intersect(that: IntSet): IntSet = intersect0(that, new Empty); def intersect2(that: IntSet): IntSet = filter(x => that.contains(x)); - def filter(f: Int => Boolean): IntSet = filter0(f, new Empty()); + def filter(f: Int => Boolean): IntSet = filter0(f, new Empty); def printOn(out: java.io.PrintStream) = foreach(out.println); @@ -244,9 +244,9 @@ module M8 { } } - class Empty() extends IntSet { // !!! class Empty() -> module Empty + class Empty extends IntSet { // !!! class Empty() -> module Empty def contains(x: Int): Boolean = false; - def incl(x: Int): IntSet = new NonEmpty(x, new Empty(), new Empty()); + def incl(x: Int): IntSet = new NonEmpty(x, new Empty, new Empty); def map(f: Int => Int): IntSet = this; def foreach(f: Int => Unit): Unit = (); @@ -288,11 +288,11 @@ module M8 { } def test = { - val set0: IntSet = new Empty(); - val set1: IntSet = new Empty() incl 1; - val set2: IntSet = new Empty() incl 1 incl 2; - val set3: IntSet = new Empty() incl 1 incl 2 incl 3; - val set4: IntSet = new Empty() incl 1 incl 2 incl 3 incl 4; + val set0: IntSet = new Empty; + val set1: IntSet = new Empty incl 1; + val set2: IntSet = new Empty incl 1 incl 2; + val set3: IntSet = new Empty incl 1 incl 2 incl 3; + val set4: IntSet = new Empty incl 1 incl 2 incl 3 incl 4; val setx: IntSet = set0 incl -10 incl 5 incl 21 incl -1 incl 0 incl 3; val sety: IntSet = set0 incl 3 incl 7 incl -5 incl 0 incl-9 incl 8 incl-1; diff --git a/test/pos/partialfun.scala b/test/pos/partialfun.scala index 57efb1d2ea..1f27d099e4 100644 --- a/test/pos/partialfun.scala +++ b/test/pos/partialfun.scala @@ -5,6 +5,6 @@ module partialfun { applyPartial { case Some(x) => x - } (None()); + } (None); }
\ No newline at end of file diff --git a/test/pos/patterns.scala b/test/pos/patterns.scala index 671ba096e3..18ffec5025 100644 --- a/test/pos/patterns.scala +++ b/test/pos/patterns.scala @@ -1,6 +1,6 @@ trait Option[a] {} case class Some[a](x: a) extends Option[a]; -case class None[a]() extends Option[a]; +case class None[a] extends Option[a]; module test { @@ -8,6 +8,6 @@ module test { def print(opt: Option[String]) = opt match { case Some(x) => println(x); - case None() => println("nothing"); + case None => println("nothing"); } }
\ No newline at end of file |