summaryrefslogtreecommitdiff
path: root/test/files/neg/macro-invalidusage-badargs.check
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2015-02-24 16:25:06 +0100
committerEugene Burmako <xeno.by@gmail.com>2015-02-24 16:40:45 +0100
commitbb7f2b8d98243c2d67ff1835fcfb1df5dbea9bb6 (patch)
treef760a1a54597db28a398c66ad228588cad128927 /test/files/neg/macro-invalidusage-badargs.check
parentdff479907919f59f35c4efa75e46950d8a239b5b (diff)
downloadscala-bb7f2b8d98243c2d67ff1835fcfb1df5dbea9bb6.tar.gz
scala-bb7f2b8d98243c2d67ff1835fcfb1df5dbea9bb6.tar.bz2
scala-bb7f2b8d98243c2d67ff1835fcfb1df5dbea9bb6.zip
better errors for macro applications with wrong number of arguments
The tryNamesDefaults branch of application typechecking contains the checkNotMacro check, which errors out when we try to do named/default arguments for macros (that's not supported yet, see SI-5920 for discussion). Unfortunately, the check activates too early, because it turns out that we can also enter tryNamesDefaults when the user just provides insufficient number of arguments to a method by mistake, without expecting any default arguments at all. This leads to really confusing errors, which can luckily be fixed in a very simple way by moving the checkNotMacro check down the happy path of named/default typechecking.
Diffstat (limited to 'test/files/neg/macro-invalidusage-badargs.check')
-rw-r--r--test/files/neg/macro-invalidusage-badargs.check3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/files/neg/macro-invalidusage-badargs.check b/test/files/neg/macro-invalidusage-badargs.check
index 4c1115418b..19ac6528d3 100644
--- a/test/files/neg/macro-invalidusage-badargs.check
+++ b/test/files/neg/macro-invalidusage-badargs.check
@@ -9,7 +9,8 @@ Macros_Test_2.scala:6: error: too few argument lists for macro invocation
Macros_Test_2.scala:7: error: Int does not take parameters
foo(4)(2)
^
-Macros_Test_2.scala:8: error: macro applications do not support named and/or default arguments
+Macros_Test_2.scala:8: error: not enough arguments for macro method foo: (x: Int)Int.
+Unspecified value parameter x.
foo()
^
Macros_Test_2.scala:9: error: too many arguments for macro method foo: (x: Int)Int