aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-12-16 16:08:26 +0100
committerMartin Odersky <odersky@gmail.com>2013-12-16 16:09:25 +0100
commit58059264842fac39a27356d052680a09c2da7571 (patch)
tree5b3ef0642b19cfbbf7bf91ebc7ec016955fa50b7 /tests
parent36476e46815370ca282cbb3179711125444319e9 (diff)
downloaddotty-58059264842fac39a27356d052680a09c2da7571.tar.gz
dotty-58059264842fac39a27356d052680a09c2da7571.tar.bz2
dotty-58059264842fac39a27356d052680a09c2da7571.zip
Checking for double definitions among class definitions.
Also fixes to typedReturn. Adapted tests accordingly.
Diffstat (limited to 'tests')
-rw-r--r--tests/pos/desugar.scala2
-rw-r--r--tests/pos/functions1.scala48
-rw-r--r--tests/pos/typers.scala2
3 files changed, 28 insertions, 24 deletions
diff --git a/tests/pos/desugar.scala b/tests/pos/desugar.scala
index cfd695af6..f0d8645b7 100644
--- a/tests/pos/desugar.scala
+++ b/tests/pos/desugar.scala
@@ -38,7 +38,7 @@ object desugar {
val (cons: Cons[Int]) = xs
- val x, y, z: Int = 1
+ val x1, y1, z1: Int = 1
}
object Binops {
diff --git a/tests/pos/functions1.scala b/tests/pos/functions1.scala
index 52ea3c3f9..93f4fc7b6 100644
--- a/tests/pos/functions1.scala
+++ b/tests/pos/functions1.scala
@@ -4,29 +4,33 @@ class X(val elem: Int) extends Object {
object Functions {
- val x = new X(2)
- val xe = x.elem
- val xf: String => Int = x.foo(_: String)
- val xf2: String => Int = x.foo(_)
- val x2: String => Int = x.foo
- val x3 = x.foo _
-
- abstract class Spore[T, U] {
- def run(x: T): U
- }
-
- trait Spore2[T, U] { self: Spore2[T, U] =>
- def run(x: T): U
+ object simple {
+ val x = new X(2)
+ val xe = x.elem
+ val xf: String => Int = x.foo(_: String)
+ val xf2: String => Int = x.foo(_)
+ val x2: String => Int = x.foo
+ val x3 = x.foo _
}
- val x: String => String = {
- case "abc" => ""
- case x => x
- }
- val y: PartialFunction[String, String] = x => x match {
- case "abc" => ""
- case _ => x
+ object sams {
+ abstract class Spore[T, U] {
+ def run(x: T): U
+ }
+
+ trait Spore2[T, U] { self: Spore2[T, U] =>
+ def run(x: T): U
+ }
+
+ val x: String => String = {
+ case "abc" => ""
+ case x => x
+ }
+ val y: PartialFunction[String, String] = x => x match {
+ case "abc" => ""
+ case _ => x
+ }
+ val z: Spore[String, String] = x => x + x
+ val z2: Spore2[String, String] = x => x + x
}
- val z: Spore[String, String] = x => x + x
- val z2: Spore2[String, String] = x => x + x
}
diff --git a/tests/pos/typers.scala b/tests/pos/typers.scala
index 51692e026..900baef75 100644
--- a/tests/pos/typers.scala
+++ b/tests/pos/typers.scala
@@ -43,8 +43,8 @@ object typers {
}
class C {
-
}
+
class Refinements {
val y: C { type T; val key: T; def process(x: T): Int }
}