Skip to content

Commit 5bd7a30

Browse files
committed
Cleanup Tailrec
1 parent 3cfbb6d commit 5bd7a30

File tree

19 files changed

+234
-283
lines changed

19 files changed

+234
-283
lines changed

compiler/src/dotty/tools/dotc/config/Printers.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ object Printers {
3232
val plugins: Printer = noPrinter
3333
val simplify: Printer = noPrinter
3434
val subtyping: Printer = noPrinter
35+
val tailrec: Printer = noPrinter
3536
val transforms: Printer = noPrinter
3637
val typr: Printer = noPrinter
3738
val unapp: Printer = noPrinter

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1801,12 +1801,11 @@ object messages {
18011801
case class TailrecNotApplicable(symbol: Symbol)(implicit ctx: Context)
18021802
extends Message(TailrecNotApplicableID) {
18031803
val kind: String = "Syntax"
1804-
val symbolKind: String = symbol.showKind
18051804
val msg: String =
18061805
if (symbol.is(Method))
1807-
hl"TailRec optimisation not applicable, $symbol is neither ${"private"} nor ${"final"}."
1806+
"TailRec optimisation not applicable, method not tail recursive"
18081807
else
1809-
hl"TailRec optimisation not applicable, ${symbolKind} isn't a method."
1808+
hl"TailRec optimisation not applicable, ${symbol.showKind} isn't a method."
18101809
val explanation: String =
18111810
hl"A method annotated ${"@tailrec"} must be declared ${"private"} or ${"final"} so it can't be overridden."
18121811
}

0 commit comments

Comments
 (0)