Skip to content

Commit c1b4141

Browse files
committed
Merge pull request #1139 from dotty-staging/change-needs-companion
Change isCompanionNeeded
2 parents ae62466 + 21a53da commit c1b4141

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/dotty/tools/dotc/Run.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,13 @@ class Run(comp: Compiler)(implicit ctx: Context) {
5656
ctx.usePhases(phases)
5757
for (phase <- ctx.allPhases)
5858
if (!ctx.reporter.hasErrors) {
59-
if (ctx.settings.verbose.value) ctx.println(s"[$phase]")
59+
val start = System.currentTimeMillis
6060
units = phase.runOn(units)
6161
def foreachUnit(op: Context => Unit)(implicit ctx: Context): Unit =
6262
for (unit <- units) op(ctx.fresh.setPhase(phase.next).setCompilationUnit(unit))
6363
if (ctx.settings.Xprint.value.containsPhase(phase))
6464
foreachUnit(printTree)
65+
ctx.informTime(s"$phase ", start)
6566
}
6667
}
6768

src/dotty/tools/dotc/core/Types.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ object Types {
609609
(name, buf) => buf ++= member(name).altsWith(x => !x.is(Method)))
610610
}
611611

612-
/** The set of members of this type having at least one of `requiredFlags` but none of `excludedFlags` set */
612+
/** The set of members of this type having at least one of `requiredFlags` but none of `excludedFlags` set */
613613
final def membersBasedOnFlags(requiredFlags: FlagSet, excludedFlags: FlagSet)(implicit ctx: Context): Seq[SingleDenotation] = track("implicitMembers") {
614614
memberDenots(takeAllFilter,
615615
(name, buf) => buf ++= memberExcluding(name, excludedFlags).altsWith(x => x.is(requiredFlags)))

src/dotty/tools/dotc/transform/LazyVals.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class LazyVals extends MiniPhaseTransform with IdentityDenotTransformer with Nee
4848
override def runsAfter = Set(classOf[Mixin])
4949

5050
def isCompanionNeeded(cls: ClassSymbol)(implicit ctx: Context): Boolean = {
51-
def hasLazyVal(x: ClassSymbol) = x.classInfo.membersBasedOnFlags(Flags.Lazy, excludedFlags = Flags.EmptyFlags).nonEmpty
51+
def hasLazyVal(cls: ClassSymbol) = cls.info.decls.exists(_.is(Flags.Lazy))
5252
hasLazyVal(cls) || cls.mixins.exists(hasLazyVal)
5353
}
5454

0 commit comments

Comments
 (0)