diff options
author | Martin Odersky <odersky@gmail.com> | 2013-12-17 23:09:22 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-12-17 23:27:43 +0100 |
commit | 9e8d0709e9f43fbb1dc40baaab4f0891538d8e9c (patch) | |
tree | 2aaa37431319ba479fe406a507349511735d2ac9 /src/dotty/tools/dotc/core/SymDenotations.scala | |
parent | 9a839d706291fdd57aeb48c3f64654afbd144a83 (diff) | |
download | dotty-9e8d0709e9f43fbb1dc40baaab4f0891538d8e9c.tar.gz dotty-9e8d0709e9f43fbb1dc40baaab4f0891538d8e9c.tar.bz2 dotty-9e8d0709e9f43fbb1dc40baaab4f0891538d8e9c.zip |
Special handling of implicit members.
The previous treatment would force all members, causing cyclic reference errors.
We fix it by filtering early in computeMemberNames itself for implicits.
Diffstat (limited to 'src/dotty/tools/dotc/core/SymDenotations.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/SymDenotations.scala | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala index 0fd8f1acb..a3ce8af6e 100644 --- a/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/src/dotty/tools/dotc/core/SymDenotations.scala @@ -1040,11 +1040,14 @@ object SymDenotations { def memberNames(keepOnly: NameFilter)(implicit ctx: Context): Set[Name] = { def computeMemberNames: Set[Name] = { val inheritedNames = (classParents flatMap (_.memberNames(keepOnly, thisType))).toSet - val ownNames = info.decls.iterator map (_.name) + var ownSyms = info.decls.toList + if (keepOnly == implicitFilter) ownSyms = ownSyms filter (_ is Implicit) + val ownNames = ownSyms.iterator map (_.name) val candidates = inheritedNames ++ ownNames candidates filter (keepOnly(thisType, _)) } - if ((this is PackageClass) || !Config.cacheMemberNames) computeMemberNames // don't cache package member names; they might change + if ((this is PackageClass) || (keepOnly == implicitFilter) || !Config.cacheMemberNames) + computeMemberNames // don't cache package member names; they might change else { val cached = memberNamesCache(keepOnly) if (cached != null) cached |