diff options
author | Lukas Rytz <lukas.rytz@epfl.ch> | 2012-05-23 03:48:50 -0700 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@epfl.ch> | 2012-05-23 03:48:50 -0700 |
commit | 94e5d76fb8632de1b6c34df63cb2bf3f1cd46fe3 (patch) | |
tree | 435af93e0b56b6cf17e8d22b9fdc28b5cc23ccaa /test/files/run | |
parent | 0f198a63d2f1a141b43f40f639d5fff8697510d0 (diff) | |
parent | 8de2caa560d2c820269fd30207fdd22dd7e48c6b (diff) | |
download | scala-94e5d76fb8632de1b6c34df63cb2bf3f1cd46fe3.tar.gz scala-94e5d76fb8632de1b6c34df63cb2bf3f1cd46fe3.tar.bz2 scala-94e5d76fb8632de1b6c34df63cb2bf3f1cd46fe3.zip |
Merge pull request #595 from som-snytt/ticket/3761-overload-byname-only
SI-3761: Overload resolution fails on by-name parameter
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/t3761-overload-byname.check | 6 | ||||
-rw-r--r-- | test/files/run/t3761-overload-byname.scala | 23 |
2 files changed, 29 insertions, 0 deletions
diff --git a/test/files/run/t3761-overload-byname.check b/test/files/run/t3761-overload-byname.check new file mode 100644 index 0000000000..3a0a273e64 --- /dev/null +++ b/test/files/run/t3761-overload-byname.check @@ -0,0 +1,6 @@ +hello! +hello working world +goodnight! +goodnight moon, nobody, noises everywhere +0 +1 diff --git a/test/files/run/t3761-overload-byname.scala b/test/files/run/t3761-overload-byname.scala new file mode 100644 index 0000000000..b1656c97ba --- /dev/null +++ b/test/files/run/t3761-overload-byname.scala @@ -0,0 +1,23 @@ + +class OverTheTop { + def info0(m: String) = m + "!" + def info0(m: String, args: Any*) = m +" "+ args.mkString(" ") + + // as reported + def info1(m: =>String) = m + "!" + def info1(m: =>String, args: Any*) = m +" "+ args.mkString(", ") + + // @lrytz + def m[A](x: => Int) = 0; def m[A](x: => Int, xs: Int*) = 1 +} +object Test { + def main(args: Array[String]) { + val top = new OverTheTop + println(top.info0("hello")) + println(top.info0("hello","working","world")) + println(top.info1("goodnight")) + println(top.info1("goodnight", "moon", "nobody", "noises everywhere")) + println(top.m(17)) + println(top.m(17,19)) + } +} |