diff options
author | Martin Odersky <odersky@gmail.com> | 2013-04-10 15:19:13 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-04-10 15:19:13 +0200 |
commit | 87ae863c3efa7ce41fed81b783855c572d541898 (patch) | |
tree | 590151812be9d41257e7c4b5d5f804853be78d31 /src/dotty/tools/dotc/core/Annotations.scala | |
parent | 1034d4e420c2b0724945486f341c53a07e6a90e0 (diff) | |
download | dotty-87ae863c3efa7ce41fed81b783855c572d541898.tar.gz dotty-87ae863c3efa7ce41fed81b783855c572d541898.tar.bz2 dotty-87ae863c3efa7ce41fed81b783855c572d541898.zip |
Re-organized comparisons of types with classes.
New methods: isClassType, derivesFrom, isArray. Refactored calls to typeSymbol and <:< into these. Made sure to use dealias where needed on remaining typeSymbol calls.
Diffstat (limited to 'src/dotty/tools/dotc/core/Annotations.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Annotations.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/Annotations.scala b/src/dotty/tools/dotc/core/Annotations.scala index 371df9e50..98ce4fffd 100644 --- a/src/dotty/tools/dotc/core/Annotations.scala +++ b/src/dotty/tools/dotc/core/Annotations.scala @@ -7,7 +7,7 @@ object Annotations { abstract class Annotation { def tree: Tree def symbol(implicit ctx: Context): Symbol = tree.tpe.typeSymbol - def matches(cls: Symbol)(implicit ctx: Context): Boolean = symbol.isNonBottomSubClass(cls) + def matches(cls: Symbol)(implicit ctx: Context): Boolean = symbol.derivesFrom(cls) def appliesToModule: Boolean = true // for now; see remark in SymDenotations def derivedAnnotation(tree: Tree) = @@ -51,7 +51,7 @@ object Annotations { new LazyAnnotation(sym)(treeFn) def deferred(atp: Type, args: List[Tree])(implicit ctx: Context): Annotation = - deferred(atp.typeSymbol, New(atp, args)) + deferred(atp.classSymbol, New(atp, args)) def makeAlias(sym: TermSymbol)(implicit ctx: Context) = apply(defn.AliasAnnot, List(Ident(TermRef.withSig(sym.owner.thisType, sym.name, sym.signature).withDenot(sym)))) |