diff options
author | amin <nada.amin@epfl.ch> | 2012-09-18 17:14:30 +0200 |
---|---|---|
committer | amin <nada.amin@epfl.ch> | 2012-09-19 11:43:40 +0200 |
commit | 08e5fd23e73bd2bcccc5f380c0a197d3bb900c02 (patch) | |
tree | ef0f01c94fd2b64e71c8c1c39d33acc8af94a885 /test/files/neg/applydynamic_sip.scala | |
parent | b0a4d536482c6582bafb383a30f553862aceb00f (diff) | |
download | scala-08e5fd23e73bd2bcccc5f380c0a197d3bb900c02.tar.gz scala-08e5fd23e73bd2bcccc5f380c0a197d3bb900c02.tar.bz2 scala-08e5fd23e73bd2bcccc5f380c0a197d3bb900c02.zip |
Fixes SI-6354: improved error messages for Dynamic signature mismatches.
If an error occurs afer a Dynamic rewriting, augment the error message
with the rewritten tree and a hint to check the Dynamic method
signature.
Diffstat (limited to 'test/files/neg/applydynamic_sip.scala')
-rw-r--r-- | test/files/neg/applydynamic_sip.scala | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/test/files/neg/applydynamic_sip.scala b/test/files/neg/applydynamic_sip.scala index 362461577b..ee4432ebe6 100644 --- a/test/files/neg/applydynamic_sip.scala +++ b/test/files/neg/applydynamic_sip.scala @@ -7,4 +7,27 @@ object Test extends App { qual.sel(a, a2: _*) qual.sel(arg = a, a2: _*) qual.sel(arg, arg2 = "a2", a2: _*) -}
\ No newline at end of file + + val bad1 = new Dynamic { + def selectDynamic(n: Int) = n + def applyDynamic(n: Int) = n + def applyDynamicNamed(n: Int) = n + def updateDynamic(n: Int) = n + + } + bad1.sel + bad1.sel(1) + bad1.sel(a = 1) + bad1.sel = 1 + + val bad2 = new Dynamic { + def selectDynamic = 1 + def applyDynamic = 1 + def applyDynamicNamed = 1 + def updateDynamic = 1 + } + bad2.sel + bad2.sel(1) + bad2.sel(a = 1) + bad2.sel = 1 +} |