summaryrefslogtreecommitdiff
path: root/src/reflect
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2014-10-01 19:06:52 +1000
committerJason Zaugg <jzaugg@gmail.com>2014-10-01 19:06:52 +1000
commite5534f0a3f9543426f129c18e1b3139519108e2f (patch)
treed30900fee05d994e331846fb20282681f7d78533 /src/reflect
parentce7f9f00c2d649f3f9ff3ad11fb2ac91b9094ed3 (diff)
parent6346c6b46d2991def37a9ae81ed5f4f8b90d5efd (diff)
downloadscala-e5534f0a3f9543426f129c18e1b3139519108e2f.tar.gz
scala-e5534f0a3f9543426f129c18e1b3139519108e2f.tar.bz2
scala-e5534f0a3f9543426f129c18e1b3139519108e2f.zip
Merge pull request #4010 from lrytz/t8087
SI-8087 keep annotations on mixed-in private[this] fields
Diffstat (limited to 'src/reflect')
-rw-r--r--src/reflect/scala/reflect/internal/Symbols.scala17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/reflect/scala/reflect/internal/Symbols.scala b/src/reflect/scala/reflect/internal/Symbols.scala
index 44fce2c9ab..b0c23ef45d 100644
--- a/src/reflect/scala/reflect/internal/Symbols.scala
+++ b/src/reflect/scala/reflect/internal/Symbols.scala
@@ -2023,12 +2023,19 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
info.decls.filter(sym => !sym.isMethod && sym.isParamAccessor).toList
/** The symbol accessed by this accessor (getter or setter) function. */
- final def accessed: Symbol = accessed(owner.info)
-
- /** The symbol accessed by this accessor function, but with given owner type. */
- final def accessed(ownerTp: Type): Symbol = {
+ final def accessed: Symbol = {
assert(hasAccessorFlag, this)
- ownerTp decl localName
+ val localField = owner.info decl localName
+
+ if (localField == NoSymbol && this.hasFlag(MIXEDIN)) {
+ // SI-8087: private[this] fields don't have a `localName`. When searching the accessed field
+ // for a mixin accessor of such a field, we need to look for `name` instead.
+ // The phase travel ensures that the field is found (`owner` is the trait class symbol, the
+ // field gets removed from there in later phases).
+ enteringPhase(picklerPhase)(owner.info).decl(name).suchThat(!_.isAccessor)
+ } else {
+ localField
+ }
}
/** The module corresponding to this module class (note that this