aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDmitry Petrashko <dmitry.petrashko@gmail.com>2016-03-08 14:14:00 +0100
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2016-03-08 14:14:00 +0100
commita068498201e7223f35e8801055645bd5b339ce67 (patch)
treebbede8dac232b6c585d70e32d10f079747d904ad /src
parentead309423796f1a6ef59330112044b69ce719a58 (diff)
downloaddotty-a068498201e7223f35e8801055645bd5b339ce67.tar.gz
dotty-a068498201e7223f35e8801055645bd5b339ce67.tar.bz2
dotty-a068498201e7223f35e8801055645bd5b339ce67.zip
Replace addAnnotation(annotation) by addAnnotation(Annotation(annotation))
as asked in https://github.com/lampepfl/dotty/pull/1155/files#r55355664
Diffstat (limited to 'src')
-rw-r--r--src/dotty/tools/dotc/core/Annotations.scala3
-rw-r--r--src/dotty/tools/dotc/core/SymDenotations.scala4
-rw-r--r--src/dotty/tools/dotc/transform/LazyVals.scala7
3 files changed, 7 insertions, 7 deletions
diff --git a/src/dotty/tools/dotc/core/Annotations.scala b/src/dotty/tools/dotc/core/Annotations.scala
index b9c0eca43..2b27b5e01 100644
--- a/src/dotty/tools/dotc/core/Annotations.scala
+++ b/src/dotty/tools/dotc/core/Annotations.scala
@@ -47,6 +47,9 @@ object Annotations {
def apply(tree: Tree) = ConcreteAnnotation(tree)
+ def apply(cls: ClassSymbol)(implicit ctx: Context): Annotation =
+ apply(cls, Nil)
+
def apply(cls: ClassSymbol, arg: Tree)(implicit ctx: Context): Annotation =
apply(cls, arg :: Nil)
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala
index cc36ddcfa..bde8cc10a 100644
--- a/src/dotty/tools/dotc/core/SymDenotations.scala
+++ b/src/dotty/tools/dotc/core/SymDenotations.scala
@@ -285,10 +285,6 @@ object SymDenotations {
final def addAnnotation(annot: Annotation): Unit =
annotations = annot :: myAnnotations
- /** Add given annotation to the annotations of this denotation */
- final def addAnnotation(annot: ClassSymbol)(implicit ctx: Context): Unit =
- addAnnotation(ConcreteAnnotation(tpd.ref(annot)))
-
/** Remove annotation with given class from this denotation */
final def removeAnnotation(cls: Symbol)(implicit ctx: Context): Unit =
annotations = myAnnotations.filterNot(_ matches cls)
diff --git a/src/dotty/tools/dotc/transform/LazyVals.scala b/src/dotty/tools/dotc/transform/LazyVals.scala
index 694cb2b0e..25b9afa68 100644
--- a/src/dotty/tools/dotc/transform/LazyVals.scala
+++ b/src/dotty/tools/dotc/transform/LazyVals.scala
@@ -1,6 +1,7 @@
package dotty.tools.dotc
package transform
+import dotty.tools.dotc.core.Annotations.Annotation
import dotty.tools.dotc.core.Phases.NeedsCompanions
import dotty.tools.dotc.typer.Mode
@@ -91,7 +92,7 @@ class LazyVals extends MiniPhaseTransform with IdentityDenotTransformer with Nee
appendOffsetDefs.get(cls) match {
case None => template
case Some(data) =>
- data.defs.foreach(_.symbol.addAnnotation(defn.ScalaStaticAnnot))
+ data.defs.foreach(_.symbol.addAnnotation(Annotation(defn.ScalaStaticAnnot)))
cpy.Template(template)(body = addInFront(data.defs, template.body))
}
@@ -358,7 +359,7 @@ class LazyVals extends MiniPhaseTransform with IdentityDenotTransformer with Nee
.symbol.asTerm
} else { // need to create a new flag
offsetSymbol = ctx.newSymbol(companion.moduleClass, (StdNames.nme.LAZY_FIELD_OFFSET + id.toString).toTermName, Flags.Synthetic, defn.LongType).enteredAfter(this)
- offsetSymbol.addAnnotation(defn.ScalaStaticAnnot)
+ offsetSymbol.addAnnotation(Annotation(defn.ScalaStaticAnnot))
val flagName = (StdNames.nme.BITMAP_PREFIX + id.toString).toTermName
val flagSymbol = ctx.newSymbol(claz, flagName, containerFlags, defn.LongType).enteredAfter(this)
flag = ValDef(flagSymbol, Literal(Constants.Constant(0L)))
@@ -368,7 +369,7 @@ class LazyVals extends MiniPhaseTransform with IdentityDenotTransformer with Nee
case None =>
offsetSymbol = ctx.newSymbol(companion.moduleClass, (StdNames.nme.LAZY_FIELD_OFFSET + "0").toTermName, Flags.Synthetic, defn.LongType).enteredAfter(this)
- offsetSymbol.addAnnotation(defn.ScalaStaticAnnot)
+ offsetSymbol.addAnnotation(Annotation(defn.ScalaStaticAnnot))
val flagName = (StdNames.nme.BITMAP_PREFIX + "0").toTermName
val flagSymbol = ctx.newSymbol(claz, flagName, containerFlags, defn.LongType).enteredAfter(this)
flag = ValDef(flagSymbol, Literal(Constants.Constant(0L)))