Skip to content

Commit

Permalink
Fix names and description for cc and setup phases
Browse files Browse the repository at this point in the history
  • Loading branch information
noti0na1 committed Nov 13, 2024
1 parent 6f48c39 commit d2773e8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
7 changes: 6 additions & 1 deletion compiler/src/dotty/tools/dotc/cc/CheckCaptures.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ import reporting.{trace, Message, OverrideError}
object CheckCaptures:
import ast.tpd.*

val name: String = "cc"
val description: String = "capture checking"

enum EnvKind:
case Regular // normal case
case NestedInOwner // environment is a temporary one nested in the owner's environment,
Expand Down Expand Up @@ -192,7 +195,9 @@ class CheckCaptures extends Recheck, SymTransformer:
import ast.tpd.*
import CheckCaptures.*

def phaseName: String = "cc"
override def phaseName: String = CheckCaptures.name

override def description: String = CheckCaptures.description

override def isRunnable(using Context) = super.isRunnable && Feature.ccEnabledSomewhere

Expand Down
7 changes: 7 additions & 0 deletions compiler/src/dotty/tools/dotc/cc/Setup.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ trait SetupAPI:

object Setup:

val name: String = "ccSetup"
val description: String = "prepare compilation unit for capture checking"

/** Recognizer for `res $throws exc`, returning `(res, exc)` in case of success */
object throwsAlias:
def unapply(tp: Type)(using Context): Option[(Type, Type)] = tp match
Expand All @@ -53,6 +56,10 @@ import Setup.*
class Setup extends PreRecheck, SymTransformer, SetupAPI:
thisPhase =>

override def phaseName: String = Setup.name

override def description: String = Setup.description

override def isRunnable(using Context) =
super.isRunnable && Feature.ccEnabledSomewhere

Expand Down

0 comments on commit d2773e8

Please sign in to comment.