Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #21939: Update names and descriptions for cc and setup phases #21942

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading