diff options
author | Enno Runne <enno@runne.net> | 2017-03-02 22:17:12 +0100 |
---|---|---|
committer | Enno Runne <enno@runne.net> | 2017-03-02 22:17:12 +0100 |
commit | e1e13e92d276d76aa73aacc764f64166adbe306c (patch) | |
tree | beb95075b7cdcf79142c066fb510380056e9dcde /compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala | |
parent | ce333b1fe852c2a6cb62486f31d336f4ecaac275 (diff) | |
parent | feaa0aeb691b24a407ccc9f371e7a1ae6545b33c (diff) | |
download | dotty-e1e13e92d276d76aa73aacc764f64166adbe306c.tar.gz dotty-e1e13e92d276d76aa73aacc764f64166adbe306c.tar.bz2 dotty-e1e13e92d276d76aa73aacc764f64166adbe306c.zip |
Merge branch 'master' of https://github.com/lampepfl/dotty into ennru_RecursiveNeedsType
Diffstat (limited to 'compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala')
-rw-r--r-- | compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala b/compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala index 8d34d97ed..f2f69b6cc 100644 --- a/compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala +++ b/compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala @@ -1151,7 +1151,9 @@ object messages { val kind = "Syntax" val msg = hl"""overloaded or recursive method ${tree} needs result type""" val explanation = - hl"""""".stripMargin + hl""" + | + """.stripMargin } case class RecursiveValueNeedsResultType(tree: Names.TermName)(implicit ctx: Context) @@ -1172,6 +1174,18 @@ object messages { |""".stripMargin } - - + case class AnnotatedPrimaryConstructorRequiresModifierOrThis(cls: Name)(implicit ctx: Context) + extends Message(AnnotatedPrimaryConstructorRequiresModifierOrThisID) { + val kind = "Syntax" + val msg = hl"""${"private"}, ${"protected"}, or ${"this"} expected for annotated primary constructor""" + val explanation = + hl"""|When using annotations with a primary constructor of a class, + |the annotation must be followed by an access modifier + |(${"private"} or ${"protected"}) or ${"this"}. + | + |For example: + | ${"class Sample @deprecated this(param: Parameter) { ..."} + | ^^^^ + |""".stripMargin + } } |