summaryrefslogtreecommitdiff
path: root/test/files/run
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@epfl.ch>2012-05-23 12:45:30 +0200
committerLukas Rytz <lukas.rytz@epfl.ch>2012-05-23 12:49:41 +0200
commit1952b9c5cde55aa619ba5b6c714d79db56e1986e (patch)
treed39bbe2ce0697357dcec1f63497c4c0aaf7b0aab /test/files/run
parent94e5d76fb8632de1b6c34df63cb2bf3f1cd46fe3 (diff)
downloadscala-1952b9c5cde55aa619ba5b6c714d79db56e1986e.tar.gz
scala-1952b9c5cde55aa619ba5b6c714d79db56e1986e.tar.bz2
scala-1952b9c5cde55aa619ba5b6c714d79db56e1986e.zip
more tests for SI-3761
Diffstat (limited to 'test/files/run')
-rw-r--r--test/files/run/t3761-overload-byname.check6
-rw-r--r--test/files/run/t3761-overload-byname.scala18
2 files changed, 23 insertions, 1 deletions
diff --git a/test/files/run/t3761-overload-byname.check b/test/files/run/t3761-overload-byname.check
index 3a0a273e64..ab7eff0d8a 100644
--- a/test/files/run/t3761-overload-byname.check
+++ b/test/files/run/t3761-overload-byname.check
@@ -4,3 +4,9 @@ goodnight!
goodnight moon, nobody, noises everywhere
0
1
+0
+1
+0
+1
+0
+1
diff --git a/test/files/run/t3761-overload-byname.scala b/test/files/run/t3761-overload-byname.scala
index b1656c97ba..a52d866097 100644
--- a/test/files/run/t3761-overload-byname.scala
+++ b/test/files/run/t3761-overload-byname.scala
@@ -8,8 +8,18 @@ class OverTheTop {
def info1(m: =>String, args: Any*) = m +" "+ args.mkString(", ")
// @lrytz
- def m[A](x: => Int) = 0; def m[A](x: => Int, xs: Int*) = 1
+ def m[A](x: => Int) = 0; def m[A](x: => Int, xs: Int*) = 1
+
+ def m1(x: => Int, s: String) = 0
+ def m1(x: => Int, s: Object) = 1
+
+ def m2(x: => Int, s: String) = 0
+ def m2(x: => AnyVal, s: Object) = 1
+
+ def m3(x: => Int, s: String) = 0
+ def m3(x: => Any, s: Object) = 1
}
+
object Test {
def main(args: Array[String]) {
val top = new OverTheTop
@@ -19,5 +29,11 @@ object Test {
println(top.info1("goodnight", "moon", "nobody", "noises everywhere"))
println(top.m(17))
println(top.m(17,19))
+ println(top.m1(1, "two"))
+ println(top.m1(1, new Object()))
+ println(top.m2(1, ""))
+ println(top.m2(1d, ""))
+ println(top.m3(1, ""))
+ println(top.m3("", ""))
}
}