Skip to content

Commit ad36307

Browse files
committed
Fix phase name & description. Add to same megaphase as CheckUnused
1 parent 662d54e commit ad36307

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

compiler/src/dotty/tools/dotc/Compiler.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ class Compiler {
3535
protected def frontendPhases: List[List[Phase]] =
3636
List(new Parser) :: // Compiler frontend: scanner, parser
3737
List(new TyperPhase) :: // Compiler frontend: namer, typer
38-
List(new CheckUnused.PostTyper) :: // Check for unused elements
39-
List(new CheckDollarInIdentifier) :: // Warn if identifier contains a dollar sign $
38+
List(new CheckUnused.PostTyper, // Check for unused elements
39+
new CheckDollarInIdentifier) :: // Warn if identifier contains a dollar sign $
4040
List(new CheckShadowing) :: // Check shadowing elements
4141
List(new YCheckPositions) :: // YCheck positions
4242
List(new sbt.ExtractDependencies) :: // Sends information on classes' dependencies to sbt via callbacks

compiler/src/dotty/tools/dotc/transform/CheckDollarInIdentifier.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@ import dotty.tools.dotc.transform.MegaPhase.MiniPhase
77
import dotty.tools.dotc.core.Contexts.*
88
import dotty.tools.dotc.core.StdNames.nme
99
import dotty.tools.dotc.report
10-
import dotty.tools.dotc.reporting.*
11-
import dotty.tools.dotc.util.SourcePosition
1210

1311

1412
class CheckDollarInIdentifier extends MiniPhase:
1513
import CheckDollarInIdentifier.ShouldNotContainDollarSignError
1614

17-
override def phaseName: String = CheckUnused.phaseNamePrefix
15+
override def phaseName: String = CheckDollarInIdentifier.phaseName
1816

19-
override def description: String = CheckUnused.description
17+
override def description: String = CheckDollarInIdentifier.description
2018

2119
override def isRunnable(using Context): Boolean =
22-
super.isRunnable && ctx.settings.WdollarCheck.value
20+
super.isRunnable &&
21+
ctx.settings.WdollarCheck.value &&
22+
!ctx.isJava
2323

2424
override def transformValDef(tree: tpd.ValDef)(using Context): tpd.Tree =
2525
reportDollarInIdentifier(tree)
@@ -81,7 +81,7 @@ class CheckDollarInIdentifier extends MiniPhase:
8181

8282

8383
object CheckDollarInIdentifier:
84-
val name: String = "dollarWarn"
84+
val phaseName: String = "checkDollarInIdentifier"
8585
val description: String = "warns if identifiers contain dollar sign, $"
8686

8787
private val ShouldNotContainDollarSignError = s"identifiers should not include dollar sign"

0 commit comments

Comments
 (0)