From 814cf34fb00f9ccb001249f4b3445ebc4f9942c9 Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Thu, 12 Apr 2012 01:59:46 +0200 Subject: 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 --- test/files/run/repl-power.check | 64 ++++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 32 deletions(-) (limited to 'test/files/run/repl-power.check') diff --git a/test/files/run/repl-power.check b/test/files/run/repl-power.check index 1e7b6f0cd8..b811a4a8c5 100644 --- a/test/files/run/repl-power.check +++ b/test/files/run/repl-power.check @@ -1,32 +1,32 @@ -Type in expressions to have them evaluated. -Type :help for more information. - -scala> :power -** Power User mode enabled - BEEP WHIR GYVE ** -** :phase has been set to 'typer'. ** -** scala.tools.nsc._ has been imported ** -** global._, definitions._ also imported ** -** Try :help, :vals, power. ** - -scala> // guarding against "error: reference to global is ambiguous" - -scala> global.emptyValDef // "it is imported twice in the same scope by ..." -res0: $r.global.emptyValDef.type = private val _ = _ - -scala> val tp = ArrayClass[scala.util.Random] // magic with manifests -tp: $r.global.Type = Array[scala.util.Random] - -scala> tp.memberType(Array_apply) // evidence -res1: $r.global.Type = (i: Int)scala.util.Random - -scala> val m = LIT(10) MATCH (CASE(LIT(5)) ==> FALSE, DEFAULT ==> TRUE) // treedsl -m: $r.treedsl.global.Match = -10 match { - case 5 => false - case _ => true -} - -scala> typed(m).tpe // typed is in scope -res2: $r.treedsl.global.Type = Boolean - -scala> +Type in expressions to have them evaluated. +Type :help for more information. + +scala> :power +** Power User mode enabled - BEEP WHIR GYVE ** +** :phase has been set to 'typer'. ** +** scala.tools.nsc._ has been imported ** +** global._, definitions._ also imported ** +** Try :help, :vals, power. ** + +scala> // guarding against "error: reference to global is ambiguous" + +scala> global.emptyValDef // "it is imported twice in the same scope by ..." +res0: $r.global.emptyValDef.type = private val _ = _ + +scala> val tp = ArrayClass[scala.util.Random] // magic with manifests +tp: $r.global.Type = Array[scala.util.Random] + +scala> tp.memberType(Array_apply) // evidence +res1: $r.global.Type = (i: Int)scala.util.Random + +scala> val m = LIT(10) MATCH (CASE(LIT(5)) ==> FALSE, DEFAULT ==> TRUE) // treedsl +m: $r.treedsl.global.Match = +10 match { + case 5 => false + case _ => true +} + +scala> typed(m).tpe // typed is in scope +res2: $r.treedsl.global.Type = Boolean + +scala> -- cgit v1.2.3