diff options
Diffstat (limited to 'test/files/run/macro-range')
-rw-r--r-- | test/files/run/macro-range/Common_1.scala | 3 | ||||
-rw-r--r-- | test/files/run/macro-range/Expansion_Impossible_2.scala | 10 |
2 files changed, 6 insertions, 7 deletions
diff --git a/test/files/run/macro-range/Common_1.scala b/test/files/run/macro-range/Common_1.scala index bd46e1f529..650257ae16 100644 --- a/test/files/run/macro-range/Common_1.scala +++ b/test/files/run/macro-range/Common_1.scala @@ -1,4 +1,3 @@ -import reflect.api.Modifier import reflect.makro.Context abstract class RangeDefault { @@ -12,7 +11,7 @@ abstract class RangeDefault { /** This class should go into reflect.macro once it is a bit more stable. */ abstract class Utils { val context: Context - import context.mirror._ + import context.universe._ class TreeSubstituter(from: List[Symbol], to: List[Tree]) extends Transformer { override def transform(tree: Tree): Tree = tree match { diff --git a/test/files/run/macro-range/Expansion_Impossible_2.scala b/test/files/run/macro-range/Expansion_Impossible_2.scala index 051afff99c..fecce6bc48 100644 --- a/test/files/run/macro-range/Expansion_Impossible_2.scala +++ b/test/files/run/macro-range/Expansion_Impossible_2.scala @@ -1,4 +1,3 @@ -import reflect.api.Modifier import reflect.makro.Context object Impls { @@ -7,14 +6,15 @@ object Impls { //println("macro-expand, _this = "+ _this) object utils extends Utils { val context: c.type = c } import utils._ - import c.mirror._ + import c.universe._ + import Flag._ - val initName = newTermName("<init>") + val initName = nme.CONSTRUCTOR // Either: // scala"{ var i = $low; val h = $hi; while (i < h) { $f(i); i = i + 1 } } // or: // scala"($_this: RangeDefault).foreach($f)" - Expr(c.prefix.tree match { + c.Expr(c.prefix.tree match { case Apply(Select(New(tpt), initName), List(lo, hi)) if tpt.symbol.fullName == "Range" => val iname = newTermName("$i") val hname = newTermName("$h") @@ -28,7 +28,7 @@ object Impls { val generated = Block( List( - ValDef(Modifiers(Set(Modifier.mutable)), iname, TypeTree(), lo), + ValDef(Modifiers(MUTABLE), iname, TypeTree(), lo), ValDef(Modifiers(), hname, TypeTree(), hi)), makeWhile(labelname, cond, body)) // todo. read the compiler config and print if -Ydebug is set |