diff options
author | Martin Odersky <odersky@gmail.com> | 2013-12-16 16:08:26 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-12-16 16:09:25 +0100 |
commit | 58059264842fac39a27356d052680a09c2da7571 (patch) | |
tree | 5b3ef0642b19cfbbf7bf91ebc7ec016955fa50b7 /tests/pos/functions1.scala | |
parent | 36476e46815370ca282cbb3179711125444319e9 (diff) | |
download | dotty-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/pos/functions1.scala')
-rw-r--r-- | tests/pos/functions1.scala | 48 |
1 files changed, 26 insertions, 22 deletions
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 } |