diff options
Diffstat (limited to 'test/files/run/macro-range/Expansion_Impossible_2.scala')
-rw-r--r-- | test/files/run/macro-range/Expansion_Impossible_2.scala | 10 |
1 files changed, 5 insertions, 5 deletions
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 |