diff options
author | Paul Phillips <paulp@improving.org> | 2012-11-15 07:28:19 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-11-15 07:28:19 -0800 |
commit | 4444369ddf39176dcfae4bcf1901697a6ccdfd42 (patch) | |
tree | 8185867c2809f115325c9589d06a220f8d8c5367 /test | |
parent | bc60605e182d526e4224c804d218e9a0e2952b72 (diff) | |
parent | 6023706458ca14ecd62a0b1b68352662e787020f (diff) | |
download | scala-4444369ddf39176dcfae4bcf1901697a6ccdfd42.tar.gz scala-4444369ddf39176dcfae4bcf1901697a6ccdfd42.tar.bz2 scala-4444369ddf39176dcfae4bcf1901697a6ccdfd42.zip |
Merge pull request #1629 from paulp/issue/6355
Error for SI-6355, overloading of applyDynamic.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/neg/t6355.check | 4 | ||||
-rw-r--r-- | test/files/neg/t6355.scala | 13 |
2 files changed, 17 insertions, 0 deletions
diff --git a/test/files/neg/t6355.check b/test/files/neg/t6355.check new file mode 100644 index 0000000000..c1fa147f52 --- /dev/null +++ b/test/files/neg/t6355.check @@ -0,0 +1,4 @@ +t6355.scala:12: error: implementation restriction: applyDynamic cannot be overloaded + def applyDynamic(name: String)(x: Int): Int = 2 + ^ +one error found diff --git a/test/files/neg/t6355.scala b/test/files/neg/t6355.scala new file mode 100644 index 0000000000..3007dc49f6 --- /dev/null +++ b/test/files/neg/t6355.scala @@ -0,0 +1,13 @@ +package foo + +import scala.language.dynamics + +class DoesntExtendDynamic { + def applyDynamic(name: String)(s: String): Int = 1 + def applyDynamic(name: String)(x: Int): Int = 2 +} + +class A extends Dynamic { + def applyDynamic(name: String)(s: String): Int = 1 + def applyDynamic(name: String)(x: Int): Int = 2 +} |