diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2016-01-23 22:22:58 +0100 |
---|---|---|
committer | Guillaume Martres <smarter@ubuntu.com> | 2016-01-23 22:22:58 +0100 |
commit | 8ceaba796346d40a1be156d38b02de91854634cd (patch) | |
tree | 9d5eef45ba965a8e8e709bd1524ea239ab6da71b /src | |
parent | ab1d30d7d430eb472a97dcdd0af81e4cb3cfabb4 (diff) | |
parent | 2042adc79cff35cdafef4130b74ed90d0d5841bf (diff) | |
download | dotty-8ceaba796346d40a1be156d38b02de91854634cd.tar.gz dotty-8ceaba796346d40a1be156d38b02de91854634cd.tar.bz2 dotty-8ceaba796346d40a1be156d38b02de91854634cd.zip |
Merge pull request #1038 from dotty-staging/fix-#1037
Fix #1037
Diffstat (limited to 'src')
-rw-r--r-- | src/dotty/tools/dotc/config/Config.scala | 2 | ||||
-rw-r--r-- | src/dotty/tools/dotc/core/SymDenotations.scala | 4 | ||||
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 7 | ||||
-rw-r--r-- | src/dotty/tools/dotc/transform/MixinOps.scala | 11 |
4 files changed, 16 insertions, 8 deletions
diff --git a/src/dotty/tools/dotc/config/Config.scala b/src/dotty/tools/dotc/config/Config.scala index cf43d277e..212defbbf 100644 --- a/src/dotty/tools/dotc/config/Config.scala +++ b/src/dotty/tools/dotc/config/Config.scala @@ -4,7 +4,7 @@ object Config { final val cacheMembersNamed = true final val cacheAsSeenFrom = true - final val useFingerPrints = true + final val useFingerPrints = true // note: it currently seems to be slightly faster not to use them! my junit test: 548s without, 560s with. final val cacheMemberNames = true final val cacheImplicitScopes = true diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala index d384bd5c4..ac4c870a6 100644 --- a/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/src/dotty/tools/dotc/core/SymDenotations.scala @@ -1250,8 +1250,8 @@ object SymDenotations { if (parentIsYounger) { incremental.println(s"parents of $this are invalid; symbol id = ${symbol.id}, copying ...\n") invalidateInheritedInfo() - firstRunId = ctx.runId } + firstRunId = ctx.runId this } @@ -1384,7 +1384,7 @@ object SymDenotations { var fp = FingerPrint() var e = info.decls.lastEntry while (e != null) { - fp.include(e.sym.name) + fp.include(e.name) e = e.prev } var ps = classParents diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index cc81b9558..e266bab6f 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -406,14 +406,17 @@ object Types { /** The member of this type with the given name */ final def member(name: Name)(implicit ctx: Context): Denotation = /*>|>*/ track("member") /*<|<*/ { - findMember(name, widenIfUnstable, EmptyFlags) + memberExcluding(name, EmptyFlags) } /** The non-private member of this type with the given name. */ final def nonPrivateMember(name: Name)(implicit ctx: Context): Denotation = track("nonPrivateMember") { - findMember(name, widenIfUnstable, Flags.Private) + memberExcluding(name, Flags.Private) } + final def memberExcluding(name: Name, excluding: FlagSet)(implicit ctx: Context): Denotation = + findMember(name, widenIfUnstable, excluding) + /** Find member of this type with given name and * produce a denotation that contains the type of the member * as seen from given prefix `pre`. Exclude all members that have diff --git a/src/dotty/tools/dotc/transform/MixinOps.scala b/src/dotty/tools/dotc/transform/MixinOps.scala index f56c83f96..db89f939b 100644 --- a/src/dotty/tools/dotc/transform/MixinOps.scala +++ b/src/dotty/tools/dotc/transform/MixinOps.scala @@ -34,9 +34,14 @@ class MixinOps(cls: ClassSymbol, thisTransform: DenotTransformer)(implicit ctx: //sup.select(target) } - /** Is `sym` a member of implementing class `cls`? */ - def isCurrent(sym: Symbol) = cls.info.member(sym.name).hasAltWith(_.symbol == sym) - + /** Is `sym` a member of implementing class `cls`? + * The test is performed at phase `thisTransform`. + */ + def isCurrent(sym: Symbol) = + ctx.atPhase(thisTransform) { implicit ctx => + cls.info.member(sym.name).hasAltWith(_.symbol == sym) + } + def needsForwarder(meth: Symbol): Boolean = { lazy val overridenSymbols = meth.allOverriddenSymbols def needsDisambiguation = !overridenSymbols.forall(_ is Deferred) |