Skip to content

Commit 4ea39aa

Browse files
committed
Decorators syntax
1 parent 6daf060 commit 4ea39aa

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

compiler/src/dotty/tools/dotc/core/Decorators.scala

+11-14
Original file line numberDiff line numberDiff line change
@@ -253,20 +253,17 @@ object Decorators {
253253
*/
254254
extension (names: List[String])
255255
def containsPhase(phase: Phase): Boolean =
256-
names.nonEmpty && {
257-
phase match {
258-
case phase: MegaPhase => phase.miniPhases.exists(names.containsPhase)
259-
case _ =>
260-
names.exists { name =>
261-
name == "all" || {
262-
val strippedName = name.stripSuffix("+")
263-
val logNextPhase = name != strippedName
264-
phase.phaseName.startsWith(strippedName) ||
265-
(logNextPhase && phase.prev.phaseName.startsWith(strippedName))
266-
}
267-
}
268-
}
269-
}
256+
names.nonEmpty &&
257+
phase.match
258+
case phase: MegaPhase => phase.miniPhases.exists(containsPhase)
259+
case _ =>
260+
names.exists:
261+
case "all" => true
262+
case name =>
263+
val strippedName = name.stripSuffix("+")
264+
val logNextPhase = name != strippedName
265+
phase.phaseName.startsWith(strippedName)
266+
|| logNextPhase && phase.prev.phaseName.startsWith(strippedName)
270267

271268
extension [T](x: T)
272269
def showing[U](

0 commit comments

Comments
 (0)