Skip to content

Commit 4d01607

Browse files
committed
Move @switch to the correct place
1 parent d82b651 commit 4d01607

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

compiler/src/dotty/tools/dotc/core/StdNames.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ object StdNames {
688688
class ScalaTermNames extends ScalaNames[TermName] {
689689
protected implicit def fromString(s: String): TermName = termName(s)
690690

691-
@switch def syntheticParamName(i: Int): TermName = i match {
691+
def syntheticParamName(i: Int): TermName = (i: @switch) match {
692692
case 0 => x_0
693693
case 1 => x_1
694694
case 2 => x_2
@@ -702,7 +702,7 @@ object StdNames {
702702
case _ => termName("x$" + i)
703703
}
704704

705-
@switch def productAccessorName(j: Int): TermName = j match {
705+
def productAccessorName(j: Int): TermName = (j: @switch) match {
706706
case 1 => nme._1
707707
case 2 => nme._2
708708
case 3 => nme._3

compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ class PlainPrinter(_ctx: Context) extends Printer {
443443

444444
def toText(denot: Denotation): Text = toText(denot.symbol) ~ "/D"
445445

446-
@switch private def escapedChar(ch: Char): String = ch match {
446+
private def escapedChar(ch: Char): String = (ch: @switch) match {
447447
case '\b' => "\\b"
448448
case '\t' => "\\t"
449449
case '\n' => "\\n"

library/src/scala/tasty/util/ShowSourceCode.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
772772
def +=(x: Char): this.type = { sb.append(x); this }
773773
def +=(x: String): this.type = { sb.append(x); this }
774774

775-
@switch private def escapedChar(ch: Char): String = ch match {
775+
private def escapedChar(ch: Char): String = (ch: @switch) match {
776776
case '\b' => "\\b"
777777
case '\t' => "\\t"
778778
case '\n' => "\\n"

0 commit comments

Comments
 (0)