diff options
Diffstat (limited to 'src/dotty/tools/dotc/core/Annotations.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Annotations.scala | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/dotty/tools/dotc/core/Annotations.scala b/src/dotty/tools/dotc/core/Annotations.scala index fae8082bd..9cbf5c8e4 100644 --- a/src/dotty/tools/dotc/core/Annotations.scala +++ b/src/dotty/tools/dotc/core/Annotations.scala @@ -1,6 +1,6 @@ package dotty.tools.dotc.core -import Symbols._, Trees._, Types._, Positions._, Contexts._, Constants._ +import Symbols._, Trees._, Types._, Positions._, Contexts._, Constants._, TypedTrees._ object Annotations { @@ -15,6 +15,8 @@ object Annotations { object Annotation { + def apply(tree: TypedTree) = ConcreteAnnotation(tree) + def apply(cls: ClassSymbol, arg: TypedTree)(implicit ctx: Context): Annotation = apply(cls, arg :: Nil) @@ -31,13 +33,13 @@ object Annotations { apply(atp, arg1 :: arg2 :: Nil) def apply(atp: Type, args: List[TypedTree])(implicit ctx: Context): Annotation = - ConcreteAnnotation(makeTypedTree.New(atp, args)) + apply(tpd.New(atp, args)) def makeAlias(sym: TermSymbol)(implicit ctx: Context) = - apply(defn.AliasAnnot, List(makeTypedTree.Ident(TermRef(sym.owner.thisType, sym.name, sym.signature)))) + apply(defn.AliasAnnot, List(tpd.Ident(TermRef(sym.owner.thisType, sym.name, sym.signature)))) def makeChild(sym: Symbol)(implicit ctx: Context) = - apply(defn.ChildAnnot, List(makeTypedTree.Ident(NamedType(sym.owner.thisType, sym.name)))) + apply(defn.ChildAnnot, List(tpd.Ident(NamedType(sym.owner.thisType, sym.name)))) } def makeLiteralAnnotArg(const: Constant): TypedTree = ??? @@ -47,5 +49,5 @@ object Annotations { def makeNestedAnnotArg(annot: Annotation): TypedTree = annot.tree def ThrowsAnnotation(cls: ClassSymbol)(implicit ctx: Context) = - Annotation(defn.ThrowsAnnot, makeTypedTree.Ident(TypeRef(cls.owner.thisType, cls.name))) + Annotation(defn.ThrowsAnnot, tpd.Ident(TypeRef(cls.owner.thisType, cls.name))) }
\ No newline at end of file |