aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-04-09 14:42:04 +0200
committerMartin Odersky <odersky@gmail.com>2014-04-09 14:42:04 +0200
commit0cbfc41c686492f37dca3db9672ad6b74a924ba9 (patch)
treee9d80b3215129110f59bca2ce264794557da5ce7 /src/dotty/tools/dotc/core
parent75e30d92d17615c84292c6ebb3df1f15060197db (diff)
downloaddotty-0cbfc41c686492f37dca3db9672ad6b74a924ba9.tar.gz
dotty-0cbfc41c686492f37dca3db9672ad6b74a924ba9.tar.bz2
dotty-0cbfc41c686492f37dca3db9672ad6b74a924ba9.zip
Fixing annotations
Two fixes: 1) Annotation#symbol now returns the correct annotations for classes as well as traits. 2) Typer copies annotations from Modifiers to Symbols
Diffstat (limited to 'src/dotty/tools/dotc/core')
-rw-r--r--src/dotty/tools/dotc/core/Annotations.scala4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/Annotations.scala b/src/dotty/tools/dotc/core/Annotations.scala
index 947593ca4..b4b7ebd24 100644
--- a/src/dotty/tools/dotc/core/Annotations.scala
+++ b/src/dotty/tools/dotc/core/Annotations.scala
@@ -7,7 +7,9 @@ object Annotations {
abstract class Annotation {
def tree(implicit ctx: Context): Tree
- def symbol(implicit ctx: Context): Symbol = tree.tpe.typeSymbol
+ def symbol(implicit ctx: Context): Symbol =
+ if (tree.symbol.isConstructor) tree.symbol.owner
+ else tree.tpe.typeSymbol
def matches(cls: Symbol)(implicit ctx: Context): Boolean = symbol.derivesFrom(cls)
def appliesToModule: Boolean = true // for now; see remark in SymDenotations