summaryrefslogtreecommitdiff
path: root/src/compiler/scala/reflect/internal/Symbols.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-01-16 13:52:48 -0800
committerPaul Phillips <paulp@improving.org>2012-01-16 14:08:30 -0800
commite4414c44eca4d2e3ef3a357a997753a8eb851d29 (patch)
tree7614c337c1661ae95b9291e8d2958eb93a6921f2 /src/compiler/scala/reflect/internal/Symbols.scala
parentbf6ce00f2146ae2c3feb5d2c8a2ed5f5d441ba3b (diff)
downloadscala-e4414c44eca4d2e3ef3a357a997753a8eb851d29.tar.gz
scala-e4414c44eca4d2e3ef3a357a997753a8eb851d29.tar.bz2
scala-e4414c44eca4d2e3ef3a357a997753a8eb851d29.zip
Less regressive package object fix.
At least I think so.
Diffstat (limited to 'src/compiler/scala/reflect/internal/Symbols.scala')
-rw-r--r--src/compiler/scala/reflect/internal/Symbols.scala16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/compiler/scala/reflect/internal/Symbols.scala b/src/compiler/scala/reflect/internal/Symbols.scala
index 20e4362ae4..c38bb6394f 100644
--- a/src/compiler/scala/reflect/internal/Symbols.scala
+++ b/src/compiler/scala/reflect/internal/Symbols.scala
@@ -2499,17 +2499,13 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
def implicitMembers: List[Symbol] = {
val tp = info
if ((implicitMembersCacheKey1 ne tp) || (implicitMembersCacheKey2 ne tp.decls.elems)) {
- implicitMembersCacheKey1 = tp
- implicitMembersCacheKey2 = tp.decls.elems
- // When a package object which defines an implicit, it may turn up here in two
- // forms which are not recognized as the same implicit definition, creating a
- // spurious ambiguity (see pos/t3999). Since I haven't figured out package objects
- // well enough to fix this at the root, I am filtering here by applying the
- // property that a member's owner must be unique.
- if (isPackageClass)
- implicitMembersCacheValue = tp.implicitMembers filter (_.owner eq this)
- else
+ // Skip a package object class, because the members are also in
+ // the package and we wish to avoid spurious ambiguities as in pos/t3999.
+ if (!isPackageObjectClass) {
+ implicitMembersCacheKey1 = tp
+ implicitMembersCacheKey2 = tp.decls.elems
implicitMembersCacheValue = tp.implicitMembers
+ }
}
implicitMembersCacheValue
}