From d2773e80cc07ba63300c91c60b7ffc755f789eaa Mon Sep 17 00:00:00 2001 From: noti0na1 Date: Wed, 13 Nov 2024 16:03:46 +0100 Subject: [PATCH] Fix names and description for cc and setup phases --- compiler/src/dotty/tools/dotc/cc/CheckCaptures.scala | 7 ++++++- compiler/src/dotty/tools/dotc/cc/Setup.scala | 7 +++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/compiler/src/dotty/tools/dotc/cc/CheckCaptures.scala b/compiler/src/dotty/tools/dotc/cc/CheckCaptures.scala index 4d905a5df4ab..77d893ad49b9 100644 --- a/compiler/src/dotty/tools/dotc/cc/CheckCaptures.scala +++ b/compiler/src/dotty/tools/dotc/cc/CheckCaptures.scala @@ -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, @@ -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 diff --git a/compiler/src/dotty/tools/dotc/cc/Setup.scala b/compiler/src/dotty/tools/dotc/cc/Setup.scala index 76ae41649517..3147a0f7bd47 100644 --- a/compiler/src/dotty/tools/dotc/cc/Setup.scala +++ b/compiler/src/dotty/tools/dotc/cc/Setup.scala @@ -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 @@ -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