diff options
author | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2012-09-27 03:33:37 -0700 |
---|---|---|
committer | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2012-09-27 03:33:37 -0700 |
commit | 6ec0fe522256e48f8ccc0204d7c4ed63a34d9ede (patch) | |
tree | 8ef2d71c934e4c6a43c12cf23e7cca704c6cde16 /test/pending/pos/overloading-boundaries.scala | |
parent | 78879c4dab79c0da8c31a4f7210c46fc0bd892c7 (diff) | |
parent | 97ede5a64a60c739f03619f9c0d7e2bf88a97207 (diff) | |
download | scala-6ec0fe522256e48f8ccc0204d7c4ed63a34d9ede.tar.gz scala-6ec0fe522256e48f8ccc0204d7c4ed63a34d9ede.tar.bz2 scala-6ec0fe522256e48f8ccc0204d7c4ed63a34d9ede.zip |
Merge pull request #1383 from paulp/issue/5604
Issue/5604
Diffstat (limited to 'test/pending/pos/overloading-boundaries.scala')
-rw-r--r-- | test/pending/pos/overloading-boundaries.scala | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/test/pending/pos/overloading-boundaries.scala b/test/pending/pos/overloading-boundaries.scala new file mode 100644 index 0000000000..d2e9fdbb12 --- /dev/null +++ b/test/pending/pos/overloading-boundaries.scala @@ -0,0 +1,37 @@ +package bar { + object bippy extends (Double => String) { + def apply(x: Double): String = "Double" + } +} + +package object bar { + def bippy(x: Int, y: Int, z: Int) = "(Int, Int, Int)" +} + +object Test { + def main(args: Array[String]): Unit = { + println(bar.bippy(5.5d)) + println(bar.bippy(1, 2, 3)) + } +} + +/**** + +% scalac3 a.scala +a.scala:13: error: not enough arguments for method bippy: (x: Int, y: Int, z: Int)String. +Unspecified value parameters y, z. + println(bar.bippy(5.5d)) + ^ +one error found + +# Comment out the call to bar.bippy(5.5d) - compiles +% scalac3 a.scala + +# Compiles only from pure source though - if classes are present, fails. +% scalac3 a.scala +a.scala:2: error: bippy is already defined as method bippy in package object bar + object bippy extends (Double => String) { + ^ +one error found + +****/ |