diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/reflect/internal/Symbols.scala | 16 |
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 } |