diff options
author | Adriaan Moors <adriaan@lightbend.com> | 2016-07-08 17:24:23 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan@lightbend.com> | 2016-08-11 10:59:17 -0700 |
commit | fdc94676928cd9177acfcca8eb7d669e1f4eac48 (patch) | |
tree | c99a021f8c0fc6e691bc63f5c8cc635a38380e78 /test/files | |
parent | 3540ffc1fb81eef75aeff41a0ba9142b1cce8a53 (diff) | |
download | scala-fdc94676928cd9177acfcca8eb7d669e1f4eac48.tar.gz scala-fdc94676928cd9177acfcca8eb7d669e1f4eac48.tar.bz2 scala-fdc94676928cd9177acfcca8eb7d669e1f4eac48.zip |
Drive accessor synthesis from info transformer
Derive/filter/propagate annotations in info transformer,
don't rely on having type checked the derived trees in order
to see the annotations.
Use synthetics mechanism for bean accessors -- the others
will soon follow.
Propagate inferred tpt from valdef to accessors
by setting type in right spot of synthetic tree
during the info completer.
No need to add trees in derivedTrees, and get rid of
some overfactoring in method synthesis, now that we have
joined symbol and tree creation.
Preserve symbol order because tests are sensitive to it.
Drop warning on potentially discarded annotations,
I don't think this warrants a warning.
Motivated by breaking the scala-js compiler, which relied
on annotations appearing when trees are type checked.
Now that ordering constraint is gone in the new encoding,
we may as well finally fix annotation assignment.
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/neg/t6375.check | 27 | ||||
-rw-r--r-- | test/files/neg/t6375.flags | 1 | ||||
-rw-r--r-- | test/files/neg/t6375.scala | 67 | ||||
-rw-r--r-- | test/files/scalacheck/quasiquotes/TypecheckedProps.scala | 2 |
4 files changed, 1 insertions, 96 deletions
diff --git a/test/files/neg/t6375.check b/test/files/neg/t6375.check deleted file mode 100644 index 89d7d8060f..0000000000 --- a/test/files/neg/t6375.check +++ /dev/null @@ -1,27 +0,0 @@ -t6375.scala:6: warning: no valid targets for annotation on value x1 - it is discarded unused. You may specify targets with meta-annotations, e.g. @(Bippy @getter) - @Bippy val x1: Int // warn - ^ -t6375.scala:7: warning: no valid targets for annotation on value x2 - it is discarded unused. You may specify targets with meta-annotations, e.g. @(Bippy @scala.annotation.meta.field @getter) - @(Bippy @field) val x2: Int // warn - ^ -t6375.scala:9: warning: no valid targets for annotation on value x4 - it is discarded unused. You may specify targets with meta-annotations, e.g. @(Bippy @scala.annotation.meta.setter @getter) - @(Bippy @setter) val x4: Int // warn - ^ -t6375.scala:10: warning: no valid targets for annotation on value x5 - it is discarded unused. You may specify targets with meta-annotations, e.g. @(Bippy @scala.annotation.meta.param @getter) - @(Bippy @param) val x5: Int // warn - ^ -t6375.scala:20: warning: no valid targets for annotation on value q1 - it is discarded unused. You may specify targets with meta-annotations, e.g. @(Bippy @scala.annotation.meta.getter @field) - @(Bippy @getter) private[this] val q1: Int = 1 // warn - ^ -t6375.scala:40: warning: no valid targets for annotation on value p2 - it is discarded unused. You may specify targets with meta-annotations, e.g. @(Bippy @scala.annotation.meta.getter @param) - @(Bippy @getter) p2: Int, // warn - ^ -t6375.scala:41: warning: no valid targets for annotation on value p3 - it is discarded unused. You may specify targets with meta-annotations, e.g. @(Bippy @scala.annotation.meta.setter @param) - @(Bippy @setter) p3: Int, // warn - ^ -t6375.scala:42: warning: no valid targets for annotation on value p4 - it is discarded unused. You may specify targets with meta-annotations, e.g. @(Bippy @scala.annotation.meta.field @param) - @(Bippy @field) p4: Int // warn - ^ -error: No warnings can be incurred under -Xfatal-warnings. -8 warnings found -one error found diff --git a/test/files/neg/t6375.flags b/test/files/neg/t6375.flags deleted file mode 100644 index 85d8eb2ba2..0000000000 --- a/test/files/neg/t6375.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/neg/t6375.scala b/test/files/neg/t6375.scala deleted file mode 100644 index 21634df688..0000000000 --- a/test/files/neg/t6375.scala +++ /dev/null @@ -1,67 +0,0 @@ -import scala.annotation.meta._ - -class Bippy extends scala.annotation.StaticAnnotation - -abstract class Foo { - @Bippy val x1: Int // warn - @(Bippy @field) val x2: Int // warn - @(Bippy @getter) val x3: Int // no warn - @(Bippy @setter) val x4: Int // warn - @(Bippy @param) val x5: Int // warn -} - -object Bar extends Foo { - val x1 = 1 - val x2 = 2 - val x3 = 3 - val x4 = 4 - val x5 = 5 - - @(Bippy @getter) private[this] val q1: Int = 1 // warn - @(Bippy @getter) private val q2: Int = 1 // no warn - - def f1(@(Bippy @param) x: Int): Int = 0 // no warn - def f2(@(Bippy @getter) x: Int): Int = 0 // warn - todo - def f3(@(Bippy @setter) x: Int): Int = 0 // warn - todo - def f4(@(Bippy @field) x: Int): Int = 0 // warn - todo - def f5(@Bippy x: Int): Int = 0 // no warn - - @(Bippy @companionClass) def g1(x: Int): Int = 0 // warn - todo - @(Bippy @companionObject) def g2(x: Int): Int = 0 // warn - todo - @(Bippy @companionMethod) def g3(x: Int): Int = 0 // no warn - @Bippy def g4(x: Int): Int = 0 // no warn - - @(Bippy @companionObject @companionMethod) def g5(x: Int): Int = 0 // no warn -} - -class Dingo( - @Bippy p0: Int, // no warn - @(Bippy @param) p1: Int, // no warn - @(Bippy @getter) p2: Int, // warn - @(Bippy @setter) p3: Int, // warn - @(Bippy @field) p4: Int // warn -) - -class ValDingo( - @Bippy val p0: Int, // no warn - @(Bippy @param) val p1: Int, // no warn - @(Bippy @getter) val p2: Int, // no warn - @(Bippy @setter) val p3: Int, // warn - todo - @(Bippy @field) val p4: Int // no warn -) - -class VarDingo( - @Bippy var p0: Int, // no warn - @(Bippy @param) var p1: Int, // no warn - @(Bippy @getter) var p2: Int, // no warn - @(Bippy @setter) var p3: Int, // no warn - @(Bippy @field) var p4: Int // no warn -) - -case class CaseDingo( - @Bippy p0: Int, // no warn - @(Bippy @param) p1: Int, // no warn - @(Bippy @getter) p2: Int, // no warn - @(Bippy @setter) p3: Int, // warn - todo - @(Bippy @field) p4: Int // no warn -) diff --git a/test/files/scalacheck/quasiquotes/TypecheckedProps.scala b/test/files/scalacheck/quasiquotes/TypecheckedProps.scala index 2c4d81f333..fe07893a36 100644 --- a/test/files/scalacheck/quasiquotes/TypecheckedProps.scala +++ b/test/files/scalacheck/quasiquotes/TypecheckedProps.scala @@ -103,7 +103,7 @@ object TypecheckedProps extends QuasiquoteProperties("typechecked") val lazyName = TermName("x") val lazyRhsVal = 42 val lazyRhs = Literal(Constant(lazyRhsVal)) - val q"{lazy val $pname = $rhs}" = typecheck(q"{lazy val $lazyName = $lazyRhsVal}") + val q"{ $_ ; $mods val $pname: $_ = { $_ = $rhs ; $_ } }" = typecheck(q"{lazy val $lazyName = $lazyRhsVal}") assert(pname == lazyName) assert(rhs ≈ lazyRhs) |