aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-06-08 12:41:06 +0200
committerMartin Odersky <odersky@gmail.com>2015-06-08 12:41:06 +0200
commit8191c86cba985e9edb596fbd1a2190c02cf45e0b (patch)
tree6a73fec576f2b82455ecbcf6b18d505b5b685484 /src
parent674e6bb0ed9ab7a45bf0016585c2c020eb50351b (diff)
downloaddotty-8191c86cba985e9edb596fbd1a2190c02cf45e0b.tar.gz
dotty-8191c86cba985e9edb596fbd1a2190c02cf45e0b.tar.bz2
dotty-8191c86cba985e9edb596fbd1a2190c02cf45e0b.zip
Copy annotations from trait members to their implementations
Implementations inherit all annotations on the implemented trait methods.
Diffstat (limited to 'src')
-rw-r--r--src/dotty/tools/dotc/transform/MixinOps.scala7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/transform/MixinOps.scala b/src/dotty/tools/dotc/transform/MixinOps.scala
index 64f0edfb8..48c6f9bea 100644
--- a/src/dotty/tools/dotc/transform/MixinOps.scala
+++ b/src/dotty/tools/dotc/transform/MixinOps.scala
@@ -13,12 +13,15 @@ class MixinOps(cls: ClassSymbol, thisTransform: DenotTransformer)(implicit ctx:
val superCls: Symbol = cls.superClass
val mixins: List[ClassSymbol] = cls.mixins
- def implementation(member: TermSymbol): TermSymbol =
- member.copy(
+ def implementation(member: TermSymbol): TermSymbol = {
+ val res = member.copy(
owner = cls,
name = member.name.stripScala2LocalSuffix,
flags = member.flags &~ Deferred,
info = cls.thisType.memberInfo(member)).enteredAfter(thisTransform).asTerm
+ res.addAnnotations(member)
+ res
+ }
def superRef(target: Symbol, pos: Position = cls.pos): Tree = {
val sup = if (target.isConstructor && !target.owner.is(Trait))