diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2013-12-28 02:25:29 +0300 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2013-12-28 02:25:29 +0300 |
commit | 431e19f9f1a5b62e361579bac6fd321c6c3018d2 (patch) | |
tree | 5e8ca4a9d08ec83b678cfe7abf97134fc1411781 /test/files/neg/t6355a.check | |
parent | 9f0594c57716ed551918e15be6da843982e8ba12 (diff) | |
download | scala-431e19f9f1a5b62e361579bac6fd321c6c3018d2.tar.gz scala-431e19f9f1a5b62e361579bac6fd321c6c3018d2.tar.bz2 scala-431e19f9f1a5b62e361579bac6fd321c6c3018d2.zip |
SI-6355 SI-7059 it is possible to overload applyDynamic
As our discussion at https://issues.scala-lang.org/browse/SI-6355 shows,
it looks like it is possible to overload applyDynamic, even though a
straightforward way is closed. This commit codifies the pattern proposed
by @paulp and makes sure that it doesn’t break in the future.
Diffstat (limited to 'test/files/neg/t6355a.check')
-rw-r--r-- | test/files/neg/t6355a.check | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/files/neg/t6355a.check b/test/files/neg/t6355a.check new file mode 100644 index 0000000000..5768d31f0b --- /dev/null +++ b/test/files/neg/t6355a.check @@ -0,0 +1,7 @@ +t6355a.scala:12: error: implementation restriction: applyDynamic cannot be overloaded except by methods with different numbers of type parameters, e.g. applyDynamic[T1](method: String)(arg: T1) and applyDynamic[T1, T2](method: String)(arg1: T1, arg2: T2) + def applyDynamic(name: String)(x: Int): Int = 2 + ^ +t6355a.scala:18: error: implementation restriction: applyDynamic cannot be overloaded except by methods with different numbers of type parameters, e.g. applyDynamic[T1](method: String)(arg: T1) and applyDynamic[T1, T2](method: String)(arg1: T1, arg2: T2) + def applyDynamic[T1, T2](name: String)(x: String, y: T1, z: T2): Int = 3 + ^ +two errors found |