summaryrefslogtreecommitdiff
path: root/test/files/neg/t8325.check
diff options
context:
space:
mode:
authorSom Snytt <som.snytt@gmail.com>2014-02-23 02:37:09 -0800
committerSom Snytt <som.snytt@gmail.com>2014-05-05 04:45:17 -0700
commitb0fe13505faf7c93093b4e9dc2813259e2f70094 (patch)
tree7186be7ac117d1f6303ebde71a4ed14142057515 /test/files/neg/t8325.check
parent251616a107f4255203e318c9f6342f774d25e66d (diff)
downloadscala-b0fe13505faf7c93093b4e9dc2813259e2f70094.tar.gz
scala-b0fe13505faf7c93093b4e9dc2813259e2f70094.tar.bz2
scala-b0fe13505faf7c93093b4e9dc2813259e2f70094.zip
SI-8325 Accept infix star type outside patterns
This is a follow-up to SI-5702 which enabled use of `*` in infix notation in patterns. Most of the work is in distinguishing infix from a sequence pattern. Also, do not take backticked star as the repeated parameter marker in postfix position. That is, `Int``*``` is not `Int*` -- I hope double-tick renders as tick. There is not a special use case except that backticks mean "I am an identifier, as is, and not a keyword."
Diffstat (limited to 'test/files/neg/t8325.check')
-rw-r--r--test/files/neg/t8325.check15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/files/neg/t8325.check b/test/files/neg/t8325.check
new file mode 100644
index 0000000000..175a0db415
--- /dev/null
+++ b/test/files/neg/t8325.check
@@ -0,0 +1,15 @@
+t8325.scala:5: error: *-parameter must come last
+ def f(is: Int*, s: String) = ???
+ ^
+t8325.scala:7: error: *-parameter must come last
+ def h(is: Int * String *, s: String) = ???
+ ^
+t8325.scala:10: error: type mismatch;
+ found : Int(5)
+ required: Int*
+ def j(is: Int* = 5) = ???
+ ^
+t8325.scala:10: error: a parameter section with a `*'-parameter is not allowed to have default arguments
+ def j(is: Int* = 5) = ???
+ ^
+four errors found