Skip to content

Commit

Permalink
Fix #21939: Update names and descriptions for cc and setup phases (#2…
Browse files Browse the repository at this point in the history
…1942)

Fix #21939

```
             preRecheck  preRecheck
                recheck  recheck
                ccSetup  prepare compilation unit for capture checking
                     cc  capture checking
```
  • Loading branch information
noti0na1 authored Nov 14, 2024
2 parents dbd4988 + d2773e8 commit fdb9b71
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 fdb9b71

Please sign in to comment.