Skip to content

Commit 7c99ecd

Browse files
committed
Improve explain message for abstract decl lacking return type
1 parent af4b7f4 commit 7c99ecd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/dotty/tools/dotc/reporting/diagnostic/messages.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -487,10 +487,10 @@ object messages {
487487
val kind = "Syntax"
488488
val msg = "missing return type"
489489
val explanation =
490-
hl"""The return type is missing and needs to be clarified. For example, `area` returns a ${"Double"}:
490+
hl"""An abstract declaration must have a return type. For example:
491491
|
492492
|trait Shape {
493-
| def area: Double
494-
|}""".stripMargin
493+
| def area: Double // abstract declaration returning a ${"Double"}
494+
|}"""".stripMargin
495495
}
496496
}

0 commit comments

Comments
 (0)