diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2012-04-12 01:59:46 +0200 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2012-04-12 02:04:14 +0200 |
commit | 814cf34fb00f9ccb001249f4b3445ebc4f9942c9 (patch) | |
tree | 24dd54da571d27f10b0c482a6e08932c318fd7b2 /test/files/pos | |
parent | db3056f11730da19e4e56f09f12e300bda62f57c (diff) | |
download | scala-814cf34fb00f9ccb001249f4b3445ebc4f9942c9.tar.gz scala-814cf34fb00f9ccb001249f4b3445ebc4f9942c9.tar.bz2 scala-814cf34fb00f9ccb001249f4b3445ebc4f9942c9.zip |
Next generation of macros
Implements SIP 16: Self-cleaning macros: http://bit.ly/wjjXTZ
Features:
* Macro defs
* Reification
* Type tags
* Manifests aliased to type tags
* Extended reflection API
* Several hundred tests
* 1111 changed files
Not yet implemented:
* Reification of refined types
* Expr.value splicing
* Named and default macro expansions
* Intricacies of interaction between macros and implicits
* Emission of debug information for macros (compliant with JSR-45)
Dedicated to Yuri Alekseyevich Gagarin
Diffstat (limited to 'test/files/pos')
-rw-r--r-- | test/files/pos/implicits.scala.temporarily.disabled (renamed from test/files/pos/implicits.scala) | 0 | ||||
-rw-r--r-- | test/files/pos/liftcode_polymorphic.scala | 4 | ||||
-rw-r--r-- | test/files/pos/macros.flags | 1 | ||||
-rw-r--r-- | test/files/pos/macros.scala | 8 | ||||
-rw-r--r-- | test/files/pos/manifest1.scala.temporarily.disabled (renamed from test/files/pos/manifest1.scala) | 0 | ||||
-rw-r--r-- | test/files/pos/t5223.scala | 6 | ||||
-rw-r--r-- | test/files/pos/t531.scala | 5 | ||||
-rw-r--r-- | test/files/pos/t532.scala | 5 |
8 files changed, 12 insertions, 17 deletions
diff --git a/test/files/pos/implicits.scala b/test/files/pos/implicits.scala.temporarily.disabled index 2c01dd0ba8..2c01dd0ba8 100644 --- a/test/files/pos/implicits.scala +++ b/test/files/pos/implicits.scala.temporarily.disabled diff --git a/test/files/pos/liftcode_polymorphic.scala b/test/files/pos/liftcode_polymorphic.scala index 3d4b159c83..9c59b34bee 100644 --- a/test/files/pos/liftcode_polymorphic.scala +++ b/test/files/pos/liftcode_polymorphic.scala @@ -1,3 +1,5 @@ +import scala.reflect.mirror._
+
object Append extends Application {
def append[A](l1: List[A], l2: List[A]):List[A] =
@@ -6,6 +8,6 @@ object Append extends Application { case x::xs => x :: append(xs, l2)
}
- println(scala.reflect.Code.lift(append _).tree)
+ println(reify(append _).tree)
}
diff --git a/test/files/pos/macros.flags b/test/files/pos/macros.flags deleted file mode 100644 index 7fea2ff901..0000000000 --- a/test/files/pos/macros.flags +++ /dev/null @@ -1 +0,0 @@ --Xmacros
\ No newline at end of file diff --git a/test/files/pos/macros.scala b/test/files/pos/macros.scala deleted file mode 100644 index 303610d464..0000000000 --- a/test/files/pos/macros.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Test { - - class C { - def macro foo[T](xs: List[T]): T = (T, xs) match { - case (t1: Type, t2: Tree) => t2 - } - } -} diff --git a/test/files/pos/manifest1.scala b/test/files/pos/manifest1.scala.temporarily.disabled index 8901aa7437..8901aa7437 100644 --- a/test/files/pos/manifest1.scala +++ b/test/files/pos/manifest1.scala.temporarily.disabled diff --git a/test/files/pos/t5223.scala b/test/files/pos/t5223.scala index 51682e9254..398630dc61 100644 --- a/test/files/pos/t5223.scala +++ b/test/files/pos/t5223.scala @@ -1,6 +1,6 @@ -import scala.reflect._ +import scala.reflect.mirror._ object Foo extends App { - Code.lift{def printf(format: String, args: Any*): String = null } - Code.lift{def printf(format: String, args: Any*): String = ("abc": @cloneable)} + reify{def printf(format: String, args: Any*): String = null } + reify{def printf(format: String, args: Any*): String = ("abc": @cloneable)} } diff --git a/test/files/pos/t531.scala b/test/files/pos/t531.scala index 856926de4f..5176912ef0 100644 --- a/test/files/pos/t531.scala +++ b/test/files/pos/t531.scala @@ -1,8 +1,9 @@ +import scala.reflect.mirror._ + object Test extends App { - import scala.reflect._; def titi = { var truc = 0 - val tata = Code.lift{() => { + val tata = reify{() => { truc = 6 }} () diff --git a/test/files/pos/t532.scala b/test/files/pos/t532.scala index f864bbf45e..a319fdfa27 100644 --- a/test/files/pos/t532.scala +++ b/test/files/pos/t532.scala @@ -1,8 +1,9 @@ +import scala.reflect.mirror._ + object Test extends App { - import scala.reflect._; def titi: Unit = { var truc = 0 - val tata = Code.lift{() => { + val tata = reify{() => { truc = truc + 6 }} () |