aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Annotations.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-02-18 09:41:11 +0100
committerMartin Odersky <odersky@gmail.com>2013-02-18 09:41:11 +0100
commit2b4a19e80a643dfdf8eea5fa40811f76edb27be3 (patch)
tree564455c04aba5c2da721a188e85163e5240957c5 /src/dotty/tools/dotc/core/Annotations.scala
parent6bd453e8f3b50e7c48b6969bd4aaf6638b0455f8 (diff)
downloaddotty-2b4a19e80a643dfdf8eea5fa40811f76edb27be3.tar.gz
dotty-2b4a19e80a643dfdf8eea5fa40811f76edb27be3.tar.bz2
dotty-2b4a19e80a643dfdf8eea5fa40811f76edb27be3.zip
Fleshed out TypeTreeGen.
All base cases now supported. Still missing: Intelligent treatment of positions.
Diffstat (limited to 'src/dotty/tools/dotc/core/Annotations.scala')
-rw-r--r--src/dotty/tools/dotc/core/Annotations.scala12
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