diff options
author | Dmitry Petrashko <dark@d-d.me> | 2016-03-03 12:46:11 +0100 |
---|---|---|
committer | Dmitry Petrashko <dark@d-d.me> | 2016-03-03 12:46:11 +0100 |
commit | c1b41411b467ad0a6e97ac5931bf13aa0b2bc750 (patch) | |
tree | 96ec6f5eb3f5de87e4d03165b6c13579215b7c0c /src | |
parent | ae624660d3cc31e9956d7e537c7a5c7925afda68 (diff) | |
parent | 21a53daa8d03f04d165b4ea1edbe46fecee36ea0 (diff) | |
download | dotty-c1b41411b467ad0a6e97ac5931bf13aa0b2bc750.tar.gz dotty-c1b41411b467ad0a6e97ac5931bf13aa0b2bc750.tar.bz2 dotty-c1b41411b467ad0a6e97ac5931bf13aa0b2bc750.zip |
Merge pull request #1139 from dotty-staging/change-needs-companion
Change isCompanionNeeded
Diffstat (limited to 'src')
-rw-r--r-- | src/dotty/tools/dotc/Run.scala | 3 | ||||
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 2 | ||||
-rw-r--r-- | src/dotty/tools/dotc/transform/LazyVals.scala | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/Run.scala b/src/dotty/tools/dotc/Run.scala index 39fd42a64..9972e3e64 100644 --- a/src/dotty/tools/dotc/Run.scala +++ b/src/dotty/tools/dotc/Run.scala @@ -56,12 +56,13 @@ class Run(comp: Compiler)(implicit ctx: Context) { ctx.usePhases(phases) for (phase <- ctx.allPhases) if (!ctx.reporter.hasErrors) { - if (ctx.settings.verbose.value) ctx.println(s"[$phase]") + val start = System.currentTimeMillis units = phase.runOn(units) def foreachUnit(op: Context => Unit)(implicit ctx: Context): Unit = for (unit <- units) op(ctx.fresh.setPhase(phase.next).setCompilationUnit(unit)) if (ctx.settings.Xprint.value.containsPhase(phase)) foreachUnit(printTree) + ctx.informTime(s"$phase ", start) } } diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index 91913b935..dd12a0188 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -609,7 +609,7 @@ object Types { (name, buf) => buf ++= member(name).altsWith(x => !x.is(Method))) } - /** The set of members of this type having at least one of `requiredFlags` but none of `excludedFlags` set */ + /** The set of members of this type having at least one of `requiredFlags` but none of `excludedFlags` set */ final def membersBasedOnFlags(requiredFlags: FlagSet, excludedFlags: FlagSet)(implicit ctx: Context): Seq[SingleDenotation] = track("implicitMembers") { memberDenots(takeAllFilter, (name, buf) => buf ++= memberExcluding(name, excludedFlags).altsWith(x => x.is(requiredFlags))) diff --git a/src/dotty/tools/dotc/transform/LazyVals.scala b/src/dotty/tools/dotc/transform/LazyVals.scala index 2aece0663..0d0ba191e 100644 --- a/src/dotty/tools/dotc/transform/LazyVals.scala +++ b/src/dotty/tools/dotc/transform/LazyVals.scala @@ -48,7 +48,7 @@ class LazyVals extends MiniPhaseTransform with IdentityDenotTransformer with Nee override def runsAfter = Set(classOf[Mixin]) def isCompanionNeeded(cls: ClassSymbol)(implicit ctx: Context): Boolean = { - def hasLazyVal(x: ClassSymbol) = x.classInfo.membersBasedOnFlags(Flags.Lazy, excludedFlags = Flags.EmptyFlags).nonEmpty + def hasLazyVal(cls: ClassSymbol) = cls.info.decls.exists(_.is(Flags.Lazy)) hasLazyVal(cls) || cls.mixins.exists(hasLazyVal) } |