aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/reporting
diff options
context:
space:
mode:
authorIgor Mielientiev <igor.melent@gmail.com>2017-03-22 16:24:15 +0200
committerFelix Mulder <felix.mulder@gmail.com>2017-03-22 15:24:15 +0100
commit5fd7a9503e44b8e95c0ca5aa4366270a3cd90155 (patch)
tree3c2f26df17a935c89f8a0238501419c30ed6f793 /compiler/src/dotty/tools/dotc/reporting
parent3af0ebbde81ff6429175ff1661f4ba927dc0d295 (diff)
downloaddotty-5fd7a9503e44b8e95c0ca5aa4366270a3cd90155.tar.gz
dotty-5fd7a9503e44b8e95c0ca5aa4366270a3cd90155.tar.bz2
dotty-5fd7a9503e44b8e95c0ca5aa4366270a3cd90155.zip
Fix varargs in methods and constructors (#2135)
* Fix varargs in methods (Issue: #1625) * Fix minor comments * Change varargs parameter message * Fix failed test, fix case for constructor
Diffstat (limited to 'compiler/src/dotty/tools/dotc/reporting')
-rw-r--r--compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala12
1 files changed, 12 insertions, 0 deletions
diff --git a/compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala b/compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala
index 6fa056646..57365658e 100644
--- a/compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala
+++ b/compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala
@@ -1209,4 +1209,16 @@ object messages {
|${parents.mkString(" - ", "\n - ", "")}
|""".stripMargin
}
+
+ case class VarArgsParamMustComeLast()(implicit ctx: Context)
+ extends Message(IncorrectRepeatedParameterSyntaxID) {
+ override def msg: String = "varargs parameter must come last"
+
+ override def kind: String = "Syntax"
+
+ override def explanation: String =
+ hl"""|The varargs field must be the last field in the method signature.
+ |Attempting to define a field in a method signature after a varargs field is an error.
+ |""".stripMargin
+ }
}