aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/SymDenotations.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-12-17 23:09:22 +0100
committerMartin Odersky <odersky@gmail.com>2013-12-17 23:27:43 +0100
commit9e8d0709e9f43fbb1dc40baaab4f0891538d8e9c (patch)
tree2aaa37431319ba479fe406a507349511735d2ac9 /src/dotty/tools/dotc/core/SymDenotations.scala
parent9a839d706291fdd57aeb48c3f64654afbd144a83 (diff)
downloaddotty-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.scala7
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