File tree Expand file tree Collapse file tree 1 file changed +14
-11
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -151,18 +151,21 @@ object Decorators {
151
151
* exact meaning of "contains" here.
152
152
*/
153
153
implicit class PhaseListDecorator (val names : List [String ]) extends AnyVal {
154
- def containsPhase (phase : Phase ): Boolean = phase match {
155
- case phase : MegaPhase => phase.miniPhases.exists(containsPhase)
156
- case _ =>
157
- names exists { name =>
158
- name == " all" || {
159
- val strippedName = name.stripSuffix(" +" )
160
- val logNextPhase = name != strippedName
161
- phase.phaseName.startsWith(strippedName) ||
162
- (logNextPhase && phase.prev.phaseName.startsWith(strippedName))
163
- }
154
+ def containsPhase (phase : Phase ): Boolean =
155
+ names.nonEmpty && {
156
+ phase match {
157
+ case phase : MegaPhase => phase.miniPhases.exists(containsPhase)
158
+ case _ =>
159
+ names exists { name =>
160
+ name == " all" || {
161
+ val strippedName = name.stripSuffix(" +" )
162
+ val logNextPhase = name != strippedName
163
+ phase.phaseName.startsWith(strippedName) ||
164
+ (logNextPhase && phase.prev.phaseName.startsWith(strippedName))
165
+ }
166
+ }
164
167
}
165
- }
168
+ }
166
169
}
167
170
168
171
implicit class genericDeco [T ](val x : T ) extends AnyVal {
You can’t perform that action at this time.
0 commit comments