From 506a5e334d57084322fa89119d72fa96beb824b6 Mon Sep 17 00:00:00 2001 From: Dmitry Petrashko Date: Mon, 15 Jun 2015 17:50:04 +0200 Subject: Enable tests that succeed. --- tests/pending/run/Course-2002-01.check | 37 - tests/pending/run/Course-2002-01.scala | 239 ------ tests/pending/run/arrays.check | 7 - tests/pending/run/arrays.scala | 937 ----------------------- tests/pending/run/classtags_contextbound.check | 1 - tests/pending/run/classtags_contextbound.scala | 7 - tests/pending/run/collection-stacks.check | 15 - tests/pending/run/collection-stacks.scala | 38 - tests/pending/run/contrib674.check | 3 - tests/pending/run/contrib674.scala | 19 - tests/pending/run/emptypf.check | 3 - tests/pending/run/emptypf.scala | 14 - tests/pending/run/hashCodeBoxesRunTime.scala | 28 - tests/pending/run/lazy-exprs.check | 21 - tests/pending/run/lazy-exprs.scala | 95 --- tests/pending/run/nothingTypeNoFramesNoDce.check | 1 - tests/pending/run/nothingTypeNoFramesNoDce.flags | 1 - tests/pending/run/nothingTypeNoFramesNoDce.scala | 61 -- tests/pending/run/origins.check | 6 - tests/pending/run/origins.flags | 1 - tests/pending/run/origins.scala | 21 - tests/pending/run/spec-self.check | 2 - tests/pending/run/spec-self.scala | 14 - tests/pending/run/t0807.check | 1 - tests/pending/run/t0807.scala | 5 - tests/pending/run/t2087-and-2400.scala | 20 - tests/pending/run/t2857.check | 1 - tests/pending/run/t2857.scala | 9 - tests/pending/run/t3038.check | 19 - tests/pending/run/t3038.scala | 68 -- tests/pending/run/t3038b.check | 6 - tests/pending/run/t3038b.flags | 1 - tests/pending/run/t3038b.scala | 20 - tests/pending/run/t3038c.check | 2 - tests/pending/run/t3038c/A_1.scala | 83 -- tests/pending/run/t3038c/B_2.scala | 24 - tests/pending/run/t3126.scala | 9 - tests/pending/run/t3452.check | 1 - tests/pending/run/t3452.scala | 21 - tests/pending/run/t3452c.check | 8 - tests/pending/run/t3452c.scala | 113 --- tests/pending/run/t3452f.scala | 19 - tests/pending/run/t3502.scala | 24 - tests/pending/run/t3651.scala | 10 - tests/pending/run/t3670.check | 5 - tests/pending/run/t3670.scala | 31 - tests/pending/run/t3895.check | 2 - tests/pending/run/t3895.flags | 1 - tests/pending/run/t3895.scala | 36 - tests/pending/run/t3980.check | 3 - tests/pending/run/t3980.scala | 19 - tests/pending/run/t4742.flags | 1 - tests/pending/run/t4742.scala | 7 - tests/pending/run/t5045.check | 6 - tests/pending/run/t5045.scala | 49 -- tests/pending/run/t5300.scala | 7 - tests/pending/run/t5328.check | 3 - tests/pending/run/t5328.scala | 5 - tests/pending/run/t603.check | 5 - tests/pending/run/t603.scala | 35 - tests/pending/run/t6853.scala | 18 - tests/pending/run/t751.scala | 6 - tests/pending/run/t7584.check | 6 - tests/pending/run/t7584.flags | 1 - tests/pending/run/t7584.scala | 14 - tests/pending/run/t7859/A_1.scala | 11 - tests/pending/run/t7859/B_2.scala | 47 -- tests/pending/run/t8280.check | 9 - tests/pending/run/t8280.scala | 82 -- tests/pending/run/t8570.flags | 1 - tests/pending/run/t8570.scala | 10 - tests/pending/run/t8570a.check | 1 - tests/pending/run/t8570a.flags | 1 - tests/pending/run/t8570a.scala | 14 - tests/pending/run/t8823.scala | 10 - tests/pending/run/t949.scala | 14 - tests/pending/run/t978.scala | 38 - tests/pending/run/weakconform.scala | 4 - 78 files changed, 2537 deletions(-) delete mode 100644 tests/pending/run/Course-2002-01.check delete mode 100644 tests/pending/run/Course-2002-01.scala delete mode 100644 tests/pending/run/arrays.check delete mode 100644 tests/pending/run/arrays.scala delete mode 100644 tests/pending/run/classtags_contextbound.check delete mode 100644 tests/pending/run/classtags_contextbound.scala delete mode 100644 tests/pending/run/collection-stacks.check delete mode 100644 tests/pending/run/collection-stacks.scala delete mode 100644 tests/pending/run/contrib674.check delete mode 100644 tests/pending/run/contrib674.scala delete mode 100644 tests/pending/run/emptypf.check delete mode 100644 tests/pending/run/emptypf.scala delete mode 100644 tests/pending/run/hashCodeBoxesRunTime.scala delete mode 100644 tests/pending/run/lazy-exprs.check delete mode 100644 tests/pending/run/lazy-exprs.scala delete mode 100644 tests/pending/run/nothingTypeNoFramesNoDce.check delete mode 100644 tests/pending/run/nothingTypeNoFramesNoDce.flags delete mode 100644 tests/pending/run/nothingTypeNoFramesNoDce.scala delete mode 100644 tests/pending/run/origins.check delete mode 100644 tests/pending/run/origins.flags delete mode 100644 tests/pending/run/origins.scala delete mode 100644 tests/pending/run/spec-self.check delete mode 100644 tests/pending/run/spec-self.scala delete mode 100644 tests/pending/run/t0807.check delete mode 100644 tests/pending/run/t0807.scala delete mode 100644 tests/pending/run/t2087-and-2400.scala delete mode 100644 tests/pending/run/t2857.check delete mode 100644 tests/pending/run/t2857.scala delete mode 100644 tests/pending/run/t3038.check delete mode 100644 tests/pending/run/t3038.scala delete mode 100644 tests/pending/run/t3038b.check delete mode 100644 tests/pending/run/t3038b.flags delete mode 100644 tests/pending/run/t3038b.scala delete mode 100644 tests/pending/run/t3038c.check delete mode 100644 tests/pending/run/t3038c/A_1.scala delete mode 100644 tests/pending/run/t3038c/B_2.scala delete mode 100644 tests/pending/run/t3126.scala delete mode 100644 tests/pending/run/t3452.check delete mode 100644 tests/pending/run/t3452.scala delete mode 100644 tests/pending/run/t3452c.check delete mode 100644 tests/pending/run/t3452c.scala delete mode 100644 tests/pending/run/t3452f.scala delete mode 100644 tests/pending/run/t3502.scala delete mode 100644 tests/pending/run/t3651.scala delete mode 100644 tests/pending/run/t3670.check delete mode 100644 tests/pending/run/t3670.scala delete mode 100644 tests/pending/run/t3895.check delete mode 100644 tests/pending/run/t3895.flags delete mode 100644 tests/pending/run/t3895.scala delete mode 100644 tests/pending/run/t3980.check delete mode 100644 tests/pending/run/t3980.scala delete mode 100644 tests/pending/run/t4742.flags delete mode 100644 tests/pending/run/t4742.scala delete mode 100644 tests/pending/run/t5045.check delete mode 100644 tests/pending/run/t5045.scala delete mode 100644 tests/pending/run/t5300.scala delete mode 100644 tests/pending/run/t5328.check delete mode 100644 tests/pending/run/t5328.scala delete mode 100644 tests/pending/run/t603.check delete mode 100644 tests/pending/run/t603.scala delete mode 100644 tests/pending/run/t6853.scala delete mode 100644 tests/pending/run/t751.scala delete mode 100644 tests/pending/run/t7584.check delete mode 100644 tests/pending/run/t7584.flags delete mode 100644 tests/pending/run/t7584.scala delete mode 100644 tests/pending/run/t7859/A_1.scala delete mode 100644 tests/pending/run/t7859/B_2.scala delete mode 100644 tests/pending/run/t8280.check delete mode 100644 tests/pending/run/t8280.scala delete mode 100644 tests/pending/run/t8570.flags delete mode 100644 tests/pending/run/t8570.scala delete mode 100644 tests/pending/run/t8570a.check delete mode 100644 tests/pending/run/t8570a.flags delete mode 100644 tests/pending/run/t8570a.scala delete mode 100644 tests/pending/run/t8823.scala delete mode 100644 tests/pending/run/t949.scala delete mode 100644 tests/pending/run/t978.scala delete mode 100755 tests/pending/run/weakconform.scala (limited to 'tests/pending') diff --git a/tests/pending/run/Course-2002-01.check b/tests/pending/run/Course-2002-01.check deleted file mode 100644 index 16b491d6e..000000000 --- a/tests/pending/run/Course-2002-01.check +++ /dev/null @@ -1,37 +0,0 @@ -Course-2002-01.scala:41: warning: method loop in object M0 does nothing other than call itself recursively - def loop: Int = loop; - ^ -232 -667 -11 -10 -62.8318 -62.8318 -62.8318 -4.0 -81.0 -256.0 -25.0 -1 -737.0 -1.0 -0.0 -1.0 -76.0 -1.4142156862745097 -1.7321428571428572 -2.0000000929222947 -1.4142156862745097 -1.7321428571428572 -2.0000000929222947 -1.4142156862745097 -1.7321428571428572 -2.0000000929222947 -sqrt(2) = 1.4142135623746899 -sqrt(2) = 1.4142135623746899 -cbrt(2) = 1.2599210500177698 -1 -1 1 -1 2 1 -1 3 3 1 -1 4 6 4 1 diff --git a/tests/pending/run/Course-2002-01.scala b/tests/pending/run/Course-2002-01.scala deleted file mode 100644 index 3426f26ee..000000000 --- a/tests/pending/run/Course-2002-01.scala +++ /dev/null @@ -1,239 +0,0 @@ -//############################################################################ -// Programmation IV - 2002 - Week 01 -//############################################################################ - -object M0 { - - //########################################################################## - - Console.println(87 + 145); - Console.println(1000 - 333); - Console.println(5 + 2 * 3); - - //########################################################################## - - def size = 2; - def pi = 3.14159; - def radius = 10; - def circumference = 2 * pi * radius; - - Console.println(5 * size); - Console.println(2 * pi * radius); - Console.println(circumference); - Console.println((2 * pi) * radius); - - //########################################################################## - - def square(x: Double) = x * x; - - Console.println(square(2)); - Console.println(square(5 + 4)); - Console.println(square(square(4))); - - //########################################################################## - - def sumOfSquares(x: Double, y: Double) = square(x) + square(y); - - Console.println(sumOfSquares(3, 2+2)); - - //########################################################################## - - def loop: Int = loop; - def first(x: Int, y: Int) = x; - def constOne(x: Int, y: => Int) = 1; - - Console.println(constOne(1, loop)); - - //########################################################################## - - def abs(x: Double) = if (x >= 0) x else -x; - - Console.println(abs(737)); - Console.println(abs(1)); - Console.println(abs(0)); - Console.println(abs(-1)); - Console.println(abs(-76)); - - //########################################################################## - - def sqrtIter0(guess: Double, x: Double): Double = - if (isGoodEnough0(guess, x)) guess - else sqrtIter0(improve0(guess, x), x); - - def improve0(guess: Double, x: Double) = - (guess + x / guess) / 2; - - def isGoodEnough0(guess: Double, x: Double) = - abs(square(guess) - x) < 0.001; - - def sqrt0(x: Double) = sqrtIter0(1.0, x); - - Console.println(sqrt0(2)); - Console.println(sqrt0(3)); - Console.println(sqrt0(4)); - - //########################################################################## - - def sqrt1(x: Double) = { - def sqrtIter1(guess: Double, x: Double): Double = - if (isGoodEnough1(guess, x)) guess - else sqrtIter1(improve1(guess, x), x); - - def improve1(guess: Double, x: Double) = - (guess + x / guess) / 2; - - def isGoodEnough1(guess: Double, x: Double) = - abs(square(guess) - x) < 0.001; - - sqrtIter1(1.0, x) - } - - Console.println(sqrt1(2)); - Console.println(sqrt1(3)); - Console.println(sqrt1(4)); - - //########################################################################## - - def sqrt2(x: Double) = { - def sqrtIter2(guess: Double): Double = - if (isGoodEnough2(guess)) guess - else sqrtIter2(improve2(guess)); - - def improve2(guess: Double) = - (guess + x / guess) / 2; - - def isGoodEnough2(guess: Double) = - abs(square(guess) - x) < 0.001; - - sqrtIter2(1.0) - } - - Console.println(sqrt2(2)); - Console.println(sqrt2(3)); - Console.println(sqrt2(4)); - - //########################################################################## -} - -//############################################################################ - -object M1 { - def abs(x: Double) = if (x >= 0) x else -x; - - def sqrt(x: Double): Double = { - def sqrtIter(prev: Double, guess: Double): Double = - if (isGoodEnough(prev, guess)) guess - else sqrtIter(guess, improve(guess)); - - def improve(guess: Double) = (guess + x / guess) / 2; - - def isGoodEnough(prev: Double, guess: Double) = - abs(prev - guess) / guess < 0.001; - - sqrtIter(1.0, improve(1.0)) - } - - Console.println("sqrt(2) = " + sqrt(2)); -} - -//############################################################################ - -object M2 { - def abs(x: Double) = if (x >= 0) x else -x; - - def sqrt(x:Double):Double = { - def sqrtIter(guess:Double):Double = { - val next = improve(guess); - if (isGoodEnough(guess,next)) next - else sqrtIter(next) - } - - def improve(guess:Double) = (guess+x/guess)/2; - - def isGoodEnough(prev:Double,guess:Double) = abs(prev-guess)/guess<0.001; - - sqrtIter(1.0) - } - - Console.println("sqrt(2) = " + sqrt(2)); -} - -//############################################################################ - -object M3 { - def abs(x: Double) = if (x >= 0) x else -x; - - def cbrt(x:Double):Double = { - def cbrtIter(guess:Double):Double = { - val next = improve(guess); - if (isGoodEnough(guess,next)) next - else cbrtIter(next) - } - - def improve(y:Double) = (x/(y*y)+2*y)/3; - - def isGoodEnough(prev:Double,guess:Double) = abs(prev-guess)/guess<0.001; - - cbrtIter(1.0) - } - - Console.println("cbrt(2) = " + cbrt(2)); -} - -//############################################################################ - -object M4 { - def pascal(c: Int, l: Int): Int = - if (c <= 0 || c >= l) 1 - else pascal(c - 1, l - 1) + pascal(c, l - 1); - - Console.print(pascal(0,0)); - Console.println; - - Console.print(pascal(0,1)); - Console.print(' '); - Console.print(pascal(1,1)); - Console.println; - - Console.print(pascal(0,2)); - Console.print(' '); - Console.print(pascal(1,2)); - Console.print(' '); - Console.print(pascal(2,2)); - Console.println; - - Console.print(pascal(0,3)); - Console.print(' '); - Console.print(pascal(1,3)); - Console.print(' '); - Console.print(pascal(2,3)); - Console.print(' '); - Console.print(pascal(3,3)); - Console.println; - - Console.print(pascal(0,4)); - Console.print(' '); - Console.print(pascal(1,4)); - Console.print(' '); - Console.print(pascal(2,4)); - Console.print(' '); - Console.print(pascal(3,4)); - Console.print(' '); - Console.print(pascal(4,4)); - Console.println; -} - -//############################################################################ - -object Test { - def main(args: Array[String]): Unit = { - M0; - M1; - M2; - M3; - M4; - () - } -} - -//############################################################################ diff --git a/tests/pending/run/arrays.check b/tests/pending/run/arrays.check deleted file mode 100644 index c9a3a8726..000000000 --- a/tests/pending/run/arrays.check +++ /dev/null @@ -1,7 +0,0 @@ -arrays.scala:248: warning: comparing values of types Unit and Unit using `==' will always yield true - check(xs(0) == u0, xs(0), u0); - ^ -arrays.scala:249: warning: comparing values of types Unit and Unit using `==' will always yield true - check(xs(1) == u1, xs(1), u1); - ^ -checks: 2302 diff --git a/tests/pending/run/arrays.scala b/tests/pending/run/arrays.scala deleted file mode 100644 index 1a77a191c..000000000 --- a/tests/pending/run/arrays.scala +++ /dev/null @@ -1,937 +0,0 @@ -//############################################################################ -// Arrays -//############################################################################ - -//############################################################################ - -object Test { - - //########################################################################## - // Types - - type Strings = List[String] - type Map = scala.collection.Map[Int, Any] - type HashMap = scala.collection.mutable.HashMap[Int, Any] - type TreeMap = scala.collection.immutable.TreeMap[Int, Any] - - //########################################################################## - // Identity Functions - - def id_Ta_T[T <: Any ](x: T): T = x; - def id_Tr_T[T <: AnyRef ](x: T): T = x; - def id_To_T[T <: Object ](x: T): T = x; - - def id_Ta_a[T <: Any ](x: T): Any = x; - def id_Tr_a[T <: AnyRef ](x: T): Any = x; - def id_To_a[T <: Object ](x: T): Any = x; - - def id_Tr_r[T <: AnyRef ](x: T): AnyRef = x; - def id_To_r[T <: Object ](x: T): AnyRef = x; - - def id_To_o[T <: Object ](x: T): Object = x; - - def id_TSa_T [S <: Any , T <: Array[S]](x: T): T = x; - def id_TSv_T [S <: AnyVal , T <: Array[S]](x: T): T = x; - def id_TSr_T [S <: AnyRef , T <: Array[S]](x: T): T = x; - def id_TSo_T [S <: Object , T <: Array[S]](x: T): T = x; - def id_TSm_T [S <: Map , T <: Array[S]](x: T): T = x; - def id_TSn_T [S <: Strings, T <: Array[S]](x: T): T = x; - - def id_TSa_Ss[S <: Any , T <: Array[S]](x: T): Array[S] = x; - def id_TSv_Ss[S <: AnyVal , T <: Array[S]](x: T): Array[S] = x; - def id_TSr_Ss[S <: AnyRef , T <: Array[S]](x: T): Array[S] = x; - def id_TSo_Ss[S <: Object , T <: Array[S]](x: T): Array[S] = x; - def id_TSm_Ss[S <: Map , T <: Array[S]](x: T): Array[S] = x; - def id_TSn_Ss[S <: Strings, T <: Array[S]](x: T): Array[S] = x; - - def id_TSa_a [S <: Any , T <: Array[S]](x: T): Any = x; - def id_TSv_a [S <: AnyVal , T <: Array[S]](x: T): Any = x; - def id_TSr_a [S <: AnyRef , T <: Array[S]](x: T): Any = x; - def id_TSo_a [S <: Object , T <: Array[S]](x: T): Any = x; - def id_TSm_a [S <: Map , T <: Array[S]](x: T): Any = x; - def id_TSn_a [S <: Strings, T <: Array[S]](x: T): Any = x; - - def id_TSa_r [S <: Any , T <: Array[S]](x: T): AnyRef = x; - def id_TSv_r [S <: AnyVal , T <: Array[S]](x: T): AnyRef = x; - def id_TSr_r [S <: AnyRef , T <: Array[S]](x: T): AnyRef = x; - def id_TSo_r [S <: Object , T <: Array[S]](x: T): AnyRef = x; - def id_TSm_r [S <: Map , T <: Array[S]](x: T): AnyRef = x; - def id_TSn_r [S <: Strings, T <: Array[S]](x: T): AnyRef = x; - - def id_TSa_o [S <: Any , T <: Array[S]](x: T): Object = x; - def id_TSv_o [S <: AnyVal , T <: Array[S]](x: T): Object = x; - def id_TSr_o [S <: AnyRef , T <: Array[S]](x: T): Object = x; - def id_TSo_o [S <: Object , T <: Array[S]](x: T): Object = x; - def id_TSm_o [S <: Map , T <: Array[S]](x: T): Object = x; - def id_TSn_o [S <: Strings, T <: Array[S]](x: T): Object = x; - - def id_Sas_Ss[S <: Any ](xs: Array[S]): Array[S] = xs; - def id_Svs_Ss[S <: AnyVal ](xs: Array[S]): Array[S] = xs; - def id_Srs_Ss[S <: AnyRef ](xs: Array[S]): Array[S] = xs; - def id_Sos_Ss[S <: Object ](xs: Array[S]): Array[S] = xs; - def id_Sms_Ss[S <: Map ](xs: Array[S]): Array[S] = xs; - def id_Sns_Ss[S <: Strings](xs: Array[S]): Array[S] = xs; - - def id_Sas_a [S <: Any ](xs: Array[S]): Any = xs; - def id_Svs_a [S <: AnyVal ](xs: Array[S]): Any = xs; - def id_Srs_a [S <: AnyRef ](xs: Array[S]): Any = xs; - def id_Sos_a [S <: Object ](xs: Array[S]): Any = xs; - def id_Sms_a [S <: Map ](xs: Array[S]): Any = xs; - def id_Sns_a [S <: Strings](xs: Array[S]): Any = xs; - - def id_Sas_r [S <: Any ](xs: Array[S]): AnyRef = xs; - def id_Svs_r [S <: AnyVal ](xs: Array[S]): AnyRef = xs; - def id_Srs_r [S <: AnyRef ](xs: Array[S]): AnyRef = xs; - def id_Sos_r [S <: Object ](xs: Array[S]): AnyRef = xs; - def id_Sms_r [S <: Map ](xs: Array[S]): AnyRef = xs; - def id_Sns_r [S <: Strings](xs: Array[S]): AnyRef = xs; - - def id_Sas_o [S <: Any ](xs: Array[S]): Object = xs; - def id_Svs_o [S <: AnyVal ](xs: Array[S]): Object = xs; - def id_Srs_o [S <: AnyRef ](xs: Array[S]): Object = xs; - def id_Sos_o [S <: Object ](xs: Array[S]): Object = xs; - def id_Sms_o [S <: Map ](xs: Array[S]): Object = xs; - def id_Sns_o [S <: Strings](xs: Array[S]): Object = xs; - - //########################################################################## - // Generic Checks - - type Check[T] = Array[T] => Unit; - - var checks: Int = 0; - - def check(test0: Boolean, actual: Any, expected: Any): Unit = { - val test1: Boolean = actual == expected; - if (!test0 || !test1) { - val s0 = if (test0) "ok" else "KO"; - val s1 = if (test1) "ok" else "KO"; - val s2 = actual.toString(); - val s3 = expected.toString(); - sys.error(s0 + " - " + s1 + ": " + s2 + " != " + s3); - } - checks += 1 - } - - def check_Ta[T <: Any ](xs: Array[T], l: Int, x0: T, c: Check[T]): Unit = { - check(xs.length == l, xs.length, l); - check(xs(0) == x0, xs(0), x0); - c(xs); - } - - def check_Tv[T <: AnyVal ](xs: Array[T], l: Int, x0: T, c: Check[T]): Unit = { - check(xs.length == l, xs.length, l); - check(xs(0) == x0, xs(0), x0); - check_Ta(xs, l, x0, c); - c(xs); - } - - def check_Tr[T <: AnyRef ](xs: Array[T], l: Int, x0: T, c: Check[T]): Unit = { - check(xs.length == l, xs.length, l); - check(xs(0) == x0, xs(0), x0); - check_Ta(xs, l, x0, c); - c(xs); - } - - def check_To[T <: Object ](xs: Array[T], l: Int, x0: T, c: Check[T]): Unit = { - check(xs.length == l, xs.length, l); - check(xs(0) == x0, xs(0), x0); - check_Ta(xs, l, x0, c); - check_Tr(xs, l, x0, c); - c(xs); - } - - def check_Tm[T <: Map ](xs: Array[T], l: Int, x0: T, c: Check[T]): Unit = { - check(xs.length == l, xs.length, l) - check(xs(0) == x0, xs(0), x0) - check_Ta(xs, l, x0, c) - check_Tr(xs, l, x0, c) - check_To(xs, l, x0, c) - c(xs) - } - - def check_Tn[T <: Strings](xs: Array[T], l: Int, x0: T, c: Check[T]): Unit = { - check(xs.length == l, xs.length, l) - check(xs(0) == x0, xs(0), x0) - check_Ta(xs, l, x0, c) - check_Tr(xs, l, x0, c) - check_To(xs, l, x0, c) - c(xs) - } - - def checkT2368(): Unit = { - val arr = Array(1, 2, 3) - arr(0) += 1 - assert(arr(0) == 2) - } - - //########################################################################## - // Values - - val u0: Unit = (); - val u1: Unit = (); - - val z0: Boolean = false; - val z1: Boolean = true; - - val b0: Byte = Byte.MinValue; - val b1: Byte = 1; - val b2: Byte = Byte.MaxValue; - - val s0: Short = Short.MinValue; - val s1: Short = 2; - val s2: Short = Short.MaxValue; - - val c0: Char = Char.MinValue; - val c1: Char = '3'; - val c2: Char = Char.MaxValue; - - val i0: Int = Int.MinValue; - val i1: Int = 4; - val i2: Int = Int.MinValue; - - val l0: Long = Long.MinValue; - val l1: Int = 5; - val l2: Long = Long.MaxValue; - - val f0: Float = Float.MinValue; - val f1: Int = 6; - val f2: Float = Float.MaxValue; - - val d0: Double = Double.MinValue; - val d1: Int = 7; - val d2: Double = Double.MaxValue; - - val a0: Unit = (); - val a1: Boolean = false; - val a2: Int = 0; - val a3: Null = null; - val a4: String = "a-z"; - val a5: Symbol = 'token; - val a6: HashMap = new HashMap(); - val a7: TreeMap = scala.collection.immutable.TreeMap.empty[Int, Any]; - val a8: Strings = List("a", "z"); - - val v0: Unit = (); - val v1: Boolean = false; - val v2: Int = 0; - val v3: Long = l2; - val v4: Float = f2; - val v5: Double = d2; - - val r0: Null = a3; - val r1: String = a4; - val r2: Symbol = a5; - val r3: HashMap = a6; - val r4: TreeMap = a7; - val r5: Strings = a8; - - val o0: Null = r0; - val o1: String = r1; - val o2: Symbol = r2; - val o3: HashMap = r3; - val o4: TreeMap = r4; - val o5: Strings = r5; - - val m0: Null = r0; - val m1: HashMap = r3; - val m2: TreeMap = r4; - - val n0: Null = r0; - val n1: Strings = r5; - val n2: Nil.type= Nil; - - //########################################################################## - // Specific Checks - - def ucheck(xs: Array[Unit ]): Unit = { - check(xs.length == 2, xs.length, 2); - check(xs(0) == u0, xs(0), u0); - check(xs(1) == u1, xs(1), u1); - } - - def zcheck(xs: Array[Boolean]): Unit = { - check(xs.length == 2, xs.length, 2); - check(xs(0) == z0, xs(0), z0); - check(xs(1) == z1, xs(1), z1); - } - - def bcheck(xs: Array[Byte ]): Unit = { - check(xs.length == 3, xs.length, 3); - check(xs(0) == b0, xs(0), b0); - check(xs(1) == b1, xs(1), b1); - check(xs(2) == b2, xs(2), b2); - } - - def scheck(xs: Array[Short ]): Unit = { - check(xs.length == 3, xs.length, 3); - check(xs(0) == s0, xs(0), s0); - check(xs(1) == s1, xs(1), s1); - check(xs(2) == s2, xs(2), s2); - } - - def ccheck(xs: Array[Char ]): Unit = { - check(xs.length == 3, xs.length, 3); - check(xs(0) == c0, xs(0), c0); - check(xs(1) == c1, xs(1), c1); - check(xs(2) == c2, xs(2), c2); - } - - def icheck(xs: Array[Int ]): Unit = { - check(xs.length == 3, xs.length, 3); - check(xs(0) == i0, xs(0), i0); - check(xs(1) == i1, xs(1), i1); - check(xs(2) == i2, xs(2), i2); - } - - def lcheck(xs: Array[Long ]): Unit = { - check(xs.length == 3, xs.length, 3); - check(xs(0) == l0, xs(0), l0); - check(xs(1) == l1, xs(1), l1: Long); // !!! : Long - check(xs(2) == l2, xs(2), l2); - } - - def fcheck(xs: Array[Float ]): Unit = { - check(xs.length == 3, xs.length, 3); - check(xs(0) == f0, xs(0), f0); - check(xs(1) == f1, xs(1), f1: Float); // !!! : Float - check(xs(2) == f2, xs(2), f2); - } - - def dcheck(xs: Array[Double ]): Unit = { - check(xs.length == 3, xs.length, 3); - check(xs(0) == d0, xs(0), d0); - check(xs(1) == d1, xs(1), d1: Double); // !!! : Double - check(xs(2) == d2, xs(2), d2); - } - - def rcheck(xs: Array[AnyRef ]): Unit = { - check(xs.length == 6, xs.length, 6); - check(xs(0) == r0, xs(0), r0); - check(xs(1) == r1, xs(1), r1); - check(xs(2) == r2, xs(2), r2); - check(xs(3) == r3, xs(3), r3); - check(xs(4) == r4, xs(4), r4); - check(xs(5) == r5, xs(5), r5); - } - - def ocheck(xs: Array[Object ]): Unit = { - check(xs.length == 6, xs.length, 6); - check(xs(0) == o0, xs(0), o0); - check(xs(1) == o1, xs(1), o1); - check(xs(2) == o2, xs(2), o2); - check(xs(3) == o3, xs(3), o3); - check(xs(4) == o4, xs(4), o4); - check(xs(5) == o5, xs(5), o5); - } - - def mcheck(xs: Array[Map ]): Unit = { - check(xs.length == 3, xs.length, 3); - check(xs(0) == m0, xs(0), m0); - check(xs(1) == m1, xs(1), m1); - check(xs(2) == m2, xs(2), m2); - } - - def ncheck(xs: Array[Strings]): Unit = { - check(xs.length == 3, xs.length, 3) - check(xs(0) == n0, xs(0), n0) - check(xs(1) == n1, xs(1), n1) - check(xs(2) == n2, xs(2), n2) - } - - //########################################################################## - // Miscellaneous checks - - def checkZip: Unit = { - val zipped = Array("a", "b", "c").zip(Array(1, 2)) - val expected = Array(("a",1), ("b",2)) - check(zipped sameElements expected, zipped.toList, expected.toList) - } - - def checkConcat: Unit = { // ticket #713 - val x1 = Array.concat(Array(1, 2), Array(3, 4)) - val y1 = Array(1, 2, 3, 4) - check(x1 sameElements y1, x1.toList, y1.toList) - } - - //########################################################################## - // Arrays - - val uarray: Array[Unit ] = Array(u0, u1); - val zarray: Array[Boolean] = Array(z0, z1); - val barray: Array[Byte ] = Array(b0, b1, b2); - val sarray: Array[Short ] = Array(s0, s1, s2); - val carray: Array[Char ] = Array(c0, c1, c2); - val iarray: Array[Int ] = Array(i0, i1, i2); - val larray: Array[Long ] = Array(l0, l1, l2); - val farray: Array[Float ] = Array(f0, f1, f2); - val darray: Array[Double ] = Array(d0, d1, d2); - val rarray: Array[AnyRef ] = Array(r0, r1, r2, r4, r4, r5); - val oarray: Array[Object ] = Array(o0, o1, o2, o4, o4, o5); - val marray: Array[Map ] = Array(m0, m1, m2); - val narray: Array[Strings] = Array(n0, n1, n2); - - //########################################################################## - // Main - - def main(args: Array[String]): Unit = { - - //###################################################################### - - ucheck(uarray); - zcheck(zarray); - bcheck(barray); - scheck(sarray); - ccheck(carray); - icheck(iarray); - lcheck(larray); - fcheck(farray); - dcheck(darray); - rcheck(rarray); - ocheck(oarray); - mcheck(marray); - ncheck(narray); - - //###################################################################### - - ucheck(id_Ta_T(uarray)); - zcheck(id_Ta_T(zarray)); - bcheck(id_Ta_T(barray)); - scheck(id_Ta_T(sarray)); - ccheck(id_Ta_T(carray)); - icheck(id_Ta_T(iarray)); - lcheck(id_Ta_T(larray)); - fcheck(id_Ta_T(farray)); - dcheck(id_Ta_T(darray)); - rcheck(id_Ta_T(rarray)); - ocheck(id_Ta_T(oarray)); - mcheck(id_Ta_T(marray)); - ncheck(id_Ta_T(narray)); - - ucheck(id_Tr_T(uarray)); - zcheck(id_Tr_T(zarray)); - bcheck(id_Tr_T(barray)); - scheck(id_Tr_T(sarray)); - ccheck(id_Tr_T(carray)); - icheck(id_Tr_T(iarray)); - lcheck(id_Tr_T(larray)); - fcheck(id_Tr_T(farray)); - dcheck(id_Tr_T(darray)); - rcheck(id_Tr_T(rarray)); - ocheck(id_Tr_T(oarray)); - mcheck(id_Tr_T(marray)); - ncheck(id_Tr_T(narray)); - - ucheck(id_To_T(uarray)); - zcheck(id_To_T(zarray)); - bcheck(id_To_T(barray)); - scheck(id_To_T(sarray)); - ccheck(id_To_T(carray)); - icheck(id_To_T(iarray)); - lcheck(id_To_T(larray)); - fcheck(id_To_T(farray)); - dcheck(id_To_T(darray)); - rcheck(id_To_T(rarray)); - ocheck(id_To_T(oarray)); - mcheck(id_To_T(marray)); - ncheck(id_To_T(narray)); - - ucheck(id_Ta_a(uarray).asInstanceOf[Array[Unit ]]); - zcheck(id_Ta_a(zarray).asInstanceOf[Array[Boolean]]); - bcheck(id_Ta_a(barray).asInstanceOf[Array[Byte ]]); - scheck(id_Ta_a(sarray).asInstanceOf[Array[Short ]]); - ccheck(id_Ta_a(carray).asInstanceOf[Array[Char ]]); - icheck(id_Ta_a(iarray).asInstanceOf[Array[Int ]]); - lcheck(id_Ta_a(larray).asInstanceOf[Array[Long ]]); - fcheck(id_Ta_a(farray).asInstanceOf[Array[Float ]]); - dcheck(id_Ta_a(darray).asInstanceOf[Array[Double ]]); - rcheck(id_Ta_a(rarray).asInstanceOf[Array[AnyRef ]]); - ocheck(id_Ta_a(oarray).asInstanceOf[Array[Object ]]); - mcheck(id_Ta_a(marray).asInstanceOf[Array[Map ]]); - ncheck(id_Ta_a(narray).asInstanceOf[Array[Strings]]); - - ucheck(id_Tr_a(uarray).asInstanceOf[Array[Unit ]]); - zcheck(id_Tr_a(zarray).asInstanceOf[Array[Boolean]]); - bcheck(id_Tr_a(barray).asInstanceOf[Array[Byte ]]); - scheck(id_Tr_a(sarray).asInstanceOf[Array[Short ]]); - ccheck(id_Tr_a(carray).asInstanceOf[Array[Char ]]); - icheck(id_Tr_a(iarray).asInstanceOf[Array[Int ]]); - lcheck(id_Tr_a(larray).asInstanceOf[Array[Long ]]); - fcheck(id_Tr_a(farray).asInstanceOf[Array[Float ]]); - dcheck(id_Tr_a(darray).asInstanceOf[Array[Double ]]); - rcheck(id_Tr_a(rarray).asInstanceOf[Array[AnyRef ]]); - ocheck(id_Tr_a(oarray).asInstanceOf[Array[Object ]]); - mcheck(id_Tr_a(marray).asInstanceOf[Array[Map ]]); - ncheck(id_Tr_a(narray).asInstanceOf[Array[Strings]]); - - ucheck(id_To_a(uarray).asInstanceOf[Array[Unit ]]); - zcheck(id_To_a(zarray).asInstanceOf[Array[Boolean]]); - bcheck(id_To_a(barray).asInstanceOf[Array[Byte ]]); - scheck(id_To_a(sarray).asInstanceOf[Array[Short ]]); - ccheck(id_To_a(carray).asInstanceOf[Array[Char ]]); - icheck(id_To_a(iarray).asInstanceOf[Array[Int ]]); - lcheck(id_To_a(larray).asInstanceOf[Array[Long ]]); - fcheck(id_To_a(farray).asInstanceOf[Array[Float ]]); - dcheck(id_To_a(darray).asInstanceOf[Array[Double ]]); - rcheck(id_To_a(rarray).asInstanceOf[Array[AnyRef ]]); - ocheck(id_To_a(oarray).asInstanceOf[Array[Object ]]); - mcheck(id_To_a(marray).asInstanceOf[Array[Map ]]); - ncheck(id_To_a(narray).asInstanceOf[Array[Strings]]); - - ucheck(id_Tr_r(uarray).asInstanceOf[Array[Unit ]]); - zcheck(id_Tr_r(zarray).asInstanceOf[Array[Boolean]]); - bcheck(id_Tr_r(barray).asInstanceOf[Array[Byte ]]); - scheck(id_Tr_r(sarray).asInstanceOf[Array[Short ]]); - ccheck(id_Tr_r(carray).asInstanceOf[Array[Char ]]); - icheck(id_Tr_r(iarray).asInstanceOf[Array[Int ]]); - lcheck(id_Tr_r(larray).asInstanceOf[Array[Long ]]); - fcheck(id_Tr_r(farray).asInstanceOf[Array[Float ]]); - dcheck(id_Tr_r(darray).asInstanceOf[Array[Double ]]); - rcheck(id_Tr_r(rarray).asInstanceOf[Array[AnyRef ]]); - ocheck(id_Tr_r(oarray).asInstanceOf[Array[Object ]]); - mcheck(id_Tr_r(marray).asInstanceOf[Array[Map ]]); - ncheck(id_Tr_r(narray).asInstanceOf[Array[Strings]]); - - ucheck(id_To_r(uarray).asInstanceOf[Array[Unit ]]); - zcheck(id_To_r(zarray).asInstanceOf[Array[Boolean]]); - bcheck(id_To_r(barray).asInstanceOf[Array[Byte ]]); - scheck(id_To_r(sarray).asInstanceOf[Array[Short ]]); - ccheck(id_To_r(carray).asInstanceOf[Array[Char ]]); - icheck(id_To_r(iarray).asInstanceOf[Array[Int ]]); - lcheck(id_To_r(larray).asInstanceOf[Array[Long ]]); - fcheck(id_To_r(farray).asInstanceOf[Array[Float ]]); - dcheck(id_To_r(darray).asInstanceOf[Array[Double ]]); - rcheck(id_To_r(rarray).asInstanceOf[Array[AnyRef ]]); - ocheck(id_To_r(oarray).asInstanceOf[Array[Object ]]); - mcheck(id_To_r(marray).asInstanceOf[Array[Map ]]); - ncheck(id_To_r(narray).asInstanceOf[Array[Strings]]); - - ucheck(id_To_o(uarray).asInstanceOf[Array[Unit ]]); - zcheck(id_To_o(zarray).asInstanceOf[Array[Boolean]]); - bcheck(id_To_o(barray).asInstanceOf[Array[Byte ]]); - scheck(id_To_o(sarray).asInstanceOf[Array[Short ]]); - ccheck(id_To_o(carray).asInstanceOf[Array[Char ]]); - icheck(id_To_o(iarray).asInstanceOf[Array[Int ]]); - lcheck(id_To_o(larray).asInstanceOf[Array[Long ]]); - fcheck(id_To_o(farray).asInstanceOf[Array[Float ]]); - dcheck(id_To_o(darray).asInstanceOf[Array[Double ]]); - rcheck(id_To_o(rarray).asInstanceOf[Array[AnyRef ]]); - ocheck(id_To_o(oarray).asInstanceOf[Array[Object ]]); - mcheck(id_To_o(marray).asInstanceOf[Array[Map ]]); - ncheck(id_To_o(narray).asInstanceOf[Array[Strings]]); - - //###################################################################### - - ucheck(id_TSa_T [Unit , Array[Unit ]](uarray)); - zcheck(id_TSa_T [Boolean, Array[Boolean]](zarray)); - bcheck(id_TSa_T [Byte , Array[Byte ]](barray)); - scheck(id_TSa_T [Short , Array[Short ]](sarray)); - ccheck(id_TSa_T [Char , Array[Char ]](carray)); - icheck(id_TSa_T [Int , Array[Int ]](iarray)); - lcheck(id_TSa_T [Long , Array[Long ]](larray)); - fcheck(id_TSa_T [Float , Array[Float ]](farray)); - dcheck(id_TSa_T [Double , Array[Double ]](darray)); - rcheck(id_TSa_T [AnyRef , Array[AnyRef ]](rarray)); - ocheck(id_TSa_T [Object , Array[Object ]](oarray)); - mcheck(id_TSa_T [Map , Array[Map ]](marray)); - ncheck(id_TSa_T [Strings, Array[Strings]](narray)); - - ucheck(id_TSv_T [Unit , Array[Unit ]](uarray)); - zcheck(id_TSv_T [Boolean, Array[Boolean]](zarray)); - bcheck(id_TSv_T [Byte , Array[Byte ]](barray)); - scheck(id_TSv_T [Short , Array[Short ]](sarray)); - ccheck(id_TSv_T [Char , Array[Char ]](carray)); - icheck(id_TSv_T [Int , Array[Int ]](iarray)); - lcheck(id_TSv_T [Long , Array[Long ]](larray)); - fcheck(id_TSv_T [Float , Array[Float ]](farray)); - dcheck(id_TSv_T [Double , Array[Double ]](darray)); - - rcheck(id_TSr_T [AnyRef , Array[AnyRef ]](rarray)); - ocheck(id_TSr_T [Object , Array[Object ]](oarray)); - mcheck(id_TSr_T [Map , Array[Map ]](marray)); - ncheck(id_TSr_T [Strings, Array[Strings]](narray)); - - rcheck(id_TSo_T [AnyRef , Array[AnyRef ]](rarray)); - ocheck(id_TSo_T [Object , Array[Object ]](oarray)); - mcheck(id_TSo_T [Map , Array[Map ]](marray)); - ncheck(id_TSo_T [Strings, Array[Strings]](narray)); - - mcheck(id_TSm_T [Map , Array[Map ]](marray)); - - ncheck(id_TSn_T [Strings, Array[Strings]](narray)); - - //###################################################################### - - ucheck(id_TSa_Ss[Unit , Array[Unit ]](uarray)); - zcheck(id_TSa_Ss[Boolean, Array[Boolean]](zarray)); - bcheck(id_TSa_Ss[Byte , Array[Byte ]](barray)); - scheck(id_TSa_Ss[Short , Array[Short ]](sarray)); - ccheck(id_TSa_Ss[Char , Array[Char ]](carray)); - icheck(id_TSa_Ss[Int , Array[Int ]](iarray)); - lcheck(id_TSa_Ss[Long , Array[Long ]](larray)); - fcheck(id_TSa_Ss[Float , Array[Float ]](farray)); - dcheck(id_TSa_Ss[Double , Array[Double ]](darray)); - rcheck(id_TSa_Ss[AnyRef , Array[AnyRef ]](rarray)); - ocheck(id_TSa_Ss[Object , Array[Object ]](oarray)); - mcheck(id_TSa_Ss[Map , Array[Map ]](marray)); - ncheck(id_TSa_Ss[Strings, Array[Strings]](narray)); - - ucheck(id_TSv_Ss[Unit , Array[Unit ]](uarray)); - zcheck(id_TSv_Ss[Boolean, Array[Boolean]](zarray)); - bcheck(id_TSv_Ss[Byte , Array[Byte ]](barray)); - scheck(id_TSv_Ss[Short , Array[Short ]](sarray)); - ccheck(id_TSv_Ss[Char , Array[Char ]](carray)); - icheck(id_TSv_Ss[Int , Array[Int ]](iarray)); - lcheck(id_TSv_Ss[Long , Array[Long ]](larray)); - fcheck(id_TSv_Ss[Float , Array[Float ]](farray)); - dcheck(id_TSv_Ss[Double , Array[Double ]](darray)); - - rcheck(id_TSr_Ss[AnyRef , Array[AnyRef ]](rarray)); - ocheck(id_TSr_Ss[Object , Array[Object ]](oarray)); - mcheck(id_TSr_Ss[Map , Array[Map ]](marray)); - ncheck(id_TSr_Ss[Strings, Array[Strings]](narray)); - - rcheck(id_TSo_Ss[AnyRef , Array[AnyRef ]](rarray)); - ocheck(id_TSo_Ss[Object , Array[Object ]](oarray)); - mcheck(id_TSo_Ss[Map , Array[Map ]](marray)); - ncheck(id_TSo_Ss[Strings, Array[Strings]](narray)); - - mcheck(id_TSm_Ss[Map , Array[Map ]](marray)); - - ncheck(id_TSn_Ss[Strings, Array[Strings]](narray)); - - //###################################################################### - - ucheck(id_TSa_a [Unit , Array[Unit ]](uarray).asInstanceOf[Array[Unit ]]); - zcheck(id_TSa_a [Boolean, Array[Boolean]](zarray).asInstanceOf[Array[Boolean]]); - bcheck(id_TSa_a [Byte , Array[Byte ]](barray).asInstanceOf[Array[Byte ]]); - scheck(id_TSa_a [Short , Array[Short ]](sarray).asInstanceOf[Array[Short ]]); - ccheck(id_TSa_a [Char , Array[Char ]](carray).asInstanceOf[Array[Char ]]); - icheck(id_TSa_a [Int , Array[Int ]](iarray).asInstanceOf[Array[Int ]]); - lcheck(id_TSa_a [Long , Array[Long ]](larray).asInstanceOf[Array[Long ]]); - fcheck(id_TSa_a [Float , Array[Float ]](farray).asInstanceOf[Array[Float ]]); - dcheck(id_TSa_a [Double , Array[Double ]](darray).asInstanceOf[Array[Double ]]); - rcheck(id_TSa_a [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]); - ocheck(id_TSa_a [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]); - mcheck(id_TSa_a [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); - ncheck(id_TSa_a [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); - - ucheck(id_TSv_a [Unit , Array[Unit ]](uarray).asInstanceOf[Array[Unit ]]); - zcheck(id_TSv_a [Boolean, Array[Boolean]](zarray).asInstanceOf[Array[Boolean]]); - bcheck(id_TSv_a [Byte , Array[Byte ]](barray).asInstanceOf[Array[Byte ]]); - scheck(id_TSv_a [Short , Array[Short ]](sarray).asInstanceOf[Array[Short ]]); - ccheck(id_TSv_a [Char , Array[Char ]](carray).asInstanceOf[Array[Char ]]); - icheck(id_TSv_a [Int , Array[Int ]](iarray).asInstanceOf[Array[Int ]]); - lcheck(id_TSv_a [Long , Array[Long ]](larray).asInstanceOf[Array[Long ]]); - fcheck(id_TSv_a [Float , Array[Float ]](farray).asInstanceOf[Array[Float ]]); - dcheck(id_TSv_a [Double , Array[Double ]](darray).asInstanceOf[Array[Double ]]); - - rcheck(id_TSr_a [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]); - ocheck(id_TSr_a [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]); - mcheck(id_TSr_a [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); - ncheck(id_TSr_a [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); - - rcheck(id_TSo_a [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]); - ocheck(id_TSo_a [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]); - mcheck(id_TSo_a [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); - ncheck(id_TSo_a [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); - - mcheck(id_TSm_a [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); - - ncheck(id_TSn_a [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); - - //###################################################################### - - ucheck(id_TSa_r [Unit , Array[Unit ]](uarray).asInstanceOf[Array[Unit ]]); - zcheck(id_TSa_r [Boolean, Array[Boolean]](zarray).asInstanceOf[Array[Boolean]]); - bcheck(id_TSa_r [Byte , Array[Byte ]](barray).asInstanceOf[Array[Byte ]]); - scheck(id_TSa_r [Short , Array[Short ]](sarray).asInstanceOf[Array[Short ]]); - ccheck(id_TSa_r [Char , Array[Char ]](carray).asInstanceOf[Array[Char ]]); - icheck(id_TSa_r [Int , Array[Int ]](iarray).asInstanceOf[Array[Int ]]); - lcheck(id_TSa_r [Long , Array[Long ]](larray).asInstanceOf[Array[Long ]]); - fcheck(id_TSa_r [Float , Array[Float ]](farray).asInstanceOf[Array[Float ]]); - dcheck(id_TSa_r [Double , Array[Double ]](darray).asInstanceOf[Array[Double ]]); - rcheck(id_TSa_r [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]); - ocheck(id_TSa_r [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]); - mcheck(id_TSa_r [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); - ncheck(id_TSa_r [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); - - ucheck(id_TSv_r [Unit , Array[Unit ]](uarray).asInstanceOf[Array[Unit ]]); - zcheck(id_TSv_r [Boolean, Array[Boolean]](zarray).asInstanceOf[Array[Boolean]]); - bcheck(id_TSv_r [Byte , Array[Byte ]](barray).asInstanceOf[Array[Byte ]]); - scheck(id_TSv_r [Short , Array[Short ]](sarray).asInstanceOf[Array[Short ]]); - ccheck(id_TSv_r [Char , Array[Char ]](carray).asInstanceOf[Array[Char ]]); - icheck(id_TSv_r [Int , Array[Int ]](iarray).asInstanceOf[Array[Int ]]); - lcheck(id_TSv_r [Long , Array[Long ]](larray).asInstanceOf[Array[Long ]]); - fcheck(id_TSv_r [Float , Array[Float ]](farray).asInstanceOf[Array[Float ]]); - dcheck(id_TSv_r [Double , Array[Double ]](darray).asInstanceOf[Array[Double ]]); - - rcheck(id_TSr_r [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]); - ocheck(id_TSr_r [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]); - mcheck(id_TSr_r [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); - ncheck(id_TSr_r [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); - - rcheck(id_TSo_r [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]); - ocheck(id_TSo_r [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]); - mcheck(id_TSo_r [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); - ncheck(id_TSo_r [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); - - mcheck(id_TSm_r [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); - - ncheck(id_TSn_r [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); - - //###################################################################### - - ucheck(id_TSa_o [Unit , Array[Unit ]](uarray).asInstanceOf[Array[Unit ]]); - zcheck(id_TSa_o [Boolean, Array[Boolean]](zarray).asInstanceOf[Array[Boolean]]); - bcheck(id_TSa_o [Byte , Array[Byte ]](barray).asInstanceOf[Array[Byte ]]); - scheck(id_TSa_o [Short , Array[Short ]](sarray).asInstanceOf[Array[Short ]]); - ccheck(id_TSa_o [Char , Array[Char ]](carray).asInstanceOf[Array[Char ]]); - icheck(id_TSa_o [Int , Array[Int ]](iarray).asInstanceOf[Array[Int ]]); - lcheck(id_TSa_o [Long , Array[Long ]](larray).asInstanceOf[Array[Long ]]); - fcheck(id_TSa_o [Float , Array[Float ]](farray).asInstanceOf[Array[Float ]]); - dcheck(id_TSa_o [Double , Array[Double ]](darray).asInstanceOf[Array[Double ]]); - rcheck(id_TSa_o [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]); - ocheck(id_TSa_o [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]); - mcheck(id_TSa_o [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); - ncheck(id_TSa_o [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); - - ucheck(id_TSv_o [Unit , Array[Unit ]](uarray).asInstanceOf[Array[Unit ]]); - zcheck(id_TSv_o [Boolean, Array[Boolean]](zarray).asInstanceOf[Array[Boolean]]); - bcheck(id_TSv_o [Byte , Array[Byte ]](barray).asInstanceOf[Array[Byte ]]); - scheck(id_TSv_o [Short , Array[Short ]](sarray).asInstanceOf[Array[Short ]]); - ccheck(id_TSv_o [Char , Array[Char ]](carray).asInstanceOf[Array[Char ]]); - icheck(id_TSv_o [Int , Array[Int ]](iarray).asInstanceOf[Array[Int ]]); - lcheck(id_TSv_o [Long , Array[Long ]](larray).asInstanceOf[Array[Long ]]); - fcheck(id_TSv_o [Float , Array[Float ]](farray).asInstanceOf[Array[Float ]]); - dcheck(id_TSv_o [Double , Array[Double ]](darray).asInstanceOf[Array[Double ]]); - - rcheck(id_TSr_o [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]); - ocheck(id_TSr_o [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]); - mcheck(id_TSr_o [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); - ncheck(id_TSr_o [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); - - rcheck(id_TSo_o [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]); - ocheck(id_TSo_o [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]); - mcheck(id_TSo_o [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); - ncheck(id_TSo_o [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); - - mcheck(id_TSm_o [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); - - ncheck(id_TSn_o [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); - - //###################################################################### - - ucheck(id_Sas_Ss[Unit ](uarray)); - zcheck(id_Sas_Ss[Boolean](zarray)); - bcheck(id_Sas_Ss[Byte ](barray)); - scheck(id_Sas_Ss[Short ](sarray)); - ccheck(id_Sas_Ss[Char ](carray)); - icheck(id_Sas_Ss[Int ](iarray)); - lcheck(id_Sas_Ss[Long ](larray)); - fcheck(id_Sas_Ss[Float ](farray)); - dcheck(id_Sas_Ss[Double ](darray)); - rcheck(id_Sas_Ss[AnyRef ](rarray)); - ocheck(id_Sas_Ss[Object ](oarray)); - mcheck(id_Sas_Ss[Map ](marray)); - ncheck(id_Sas_Ss[Strings](narray)); - - ucheck(id_Svs_Ss[Unit ](uarray)); - zcheck(id_Svs_Ss[Boolean](zarray)); - bcheck(id_Svs_Ss[Byte ](barray)); - scheck(id_Svs_Ss[Short ](sarray)); - ccheck(id_Svs_Ss[Char ](carray)); - icheck(id_Svs_Ss[Int ](iarray)); - lcheck(id_Svs_Ss[Long ](larray)); - fcheck(id_Svs_Ss[Float ](farray)); - dcheck(id_Svs_Ss[Double ](darray)); - - rcheck(id_Srs_Ss[AnyRef ](rarray)); - ocheck(id_Srs_Ss[Object ](oarray)); - mcheck(id_Srs_Ss[Map ](marray)); - ncheck(id_Srs_Ss[Strings](narray)); - - rcheck(id_Sos_Ss[AnyRef ](rarray)); - ocheck(id_Sos_Ss[Object ](oarray)); - mcheck(id_Sos_Ss[Map ](marray)); - ncheck(id_Sos_Ss[Strings](narray)); - - mcheck(id_Sms_Ss[Map ](marray)); - - ncheck(id_Sns_Ss[Strings](narray)); - - //###################################################################### - - ucheck(id_TSa_a [Unit , Array[Unit ]](uarray).asInstanceOf[Array[Unit ]]); - zcheck(id_TSa_a [Boolean, Array[Boolean]](zarray).asInstanceOf[Array[Boolean]]); - bcheck(id_TSa_a [Byte , Array[Byte ]](barray).asInstanceOf[Array[Byte ]]); - scheck(id_TSa_a [Short , Array[Short ]](sarray).asInstanceOf[Array[Short ]]); - ccheck(id_TSa_a [Char , Array[Char ]](carray).asInstanceOf[Array[Char ]]); - icheck(id_TSa_a [Int , Array[Int ]](iarray).asInstanceOf[Array[Int ]]); - lcheck(id_TSa_a [Long , Array[Long ]](larray).asInstanceOf[Array[Long ]]); - fcheck(id_TSa_a [Float , Array[Float ]](farray).asInstanceOf[Array[Float ]]); - dcheck(id_TSa_a [Double , Array[Double ]](darray).asInstanceOf[Array[Double ]]); - rcheck(id_TSa_a [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]); - ocheck(id_TSa_a [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]); - mcheck(id_TSa_a [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); - ncheck(id_TSa_a [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); - - ucheck(id_TSv_a [Unit , Array[Unit ]](uarray).asInstanceOf[Array[Unit ]]); - zcheck(id_TSv_a [Boolean, Array[Boolean]](zarray).asInstanceOf[Array[Boolean]]); - bcheck(id_TSv_a [Byte , Array[Byte ]](barray).asInstanceOf[Array[Byte ]]); - scheck(id_TSv_a [Short , Array[Short ]](sarray).asInstanceOf[Array[Short ]]); - ccheck(id_TSv_a [Char , Array[Char ]](carray).asInstanceOf[Array[Char ]]); - icheck(id_TSv_a [Int , Array[Int ]](iarray).asInstanceOf[Array[Int ]]); - lcheck(id_TSv_a [Long , Array[Long ]](larray).asInstanceOf[Array[Long ]]); - fcheck(id_TSv_a [Float , Array[Float ]](farray).asInstanceOf[Array[Float ]]); - dcheck(id_TSv_a [Double , Array[Double ]](darray).asInstanceOf[Array[Double ]]); - - rcheck(id_TSr_a [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]); - ocheck(id_TSr_a [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]); - mcheck(id_TSr_a [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); - ncheck(id_TSr_a [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); - - rcheck(id_TSo_a [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]); - ocheck(id_TSo_a [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]); - mcheck(id_TSo_a [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); - ncheck(id_TSo_a [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); - - mcheck(id_TSm_a [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); - - ncheck(id_TSn_a [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); - - //###################################################################### - - ucheck(id_TSa_r [Unit , Array[Unit ]](uarray).asInstanceOf[Array[Unit ]]); - zcheck(id_TSa_r [Boolean, Array[Boolean]](zarray).asInstanceOf[Array[Boolean]]); - bcheck(id_TSa_r [Byte , Array[Byte ]](barray).asInstanceOf[Array[Byte ]]); - scheck(id_TSa_r [Short , Array[Short ]](sarray).asInstanceOf[Array[Short ]]); - ccheck(id_TSa_r [Char , Array[Char ]](carray).asInstanceOf[Array[Char ]]); - icheck(id_TSa_r [Int , Array[Int ]](iarray).asInstanceOf[Array[Int ]]); - lcheck(id_TSa_r [Long , Array[Long ]](larray).asInstanceOf[Array[Long ]]); - fcheck(id_TSa_r [Float , Array[Float ]](farray).asInstanceOf[Array[Float ]]); - dcheck(id_TSa_r [Double , Array[Double ]](darray).asInstanceOf[Array[Double ]]); - rcheck(id_TSa_r [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]); - ocheck(id_TSa_r [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]); - mcheck(id_TSa_r [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); - ncheck(id_TSa_r [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); - - ucheck(id_TSv_r [Unit , Array[Unit ]](uarray).asInstanceOf[Array[Unit ]]); - zcheck(id_TSv_r [Boolean, Array[Boolean]](zarray).asInstanceOf[Array[Boolean]]); - bcheck(id_TSv_r [Byte , Array[Byte ]](barray).asInstanceOf[Array[Byte ]]); - scheck(id_TSv_r [Short , Array[Short ]](sarray).asInstanceOf[Array[Short ]]); - ccheck(id_TSv_r [Char , Array[Char ]](carray).asInstanceOf[Array[Char ]]); - icheck(id_TSv_r [Int , Array[Int ]](iarray).asInstanceOf[Array[Int ]]); - lcheck(id_TSv_r [Long , Array[Long ]](larray).asInstanceOf[Array[Long ]]); - fcheck(id_TSv_r [Float , Array[Float ]](farray).asInstanceOf[Array[Float ]]); - dcheck(id_TSv_r [Double , Array[Double ]](darray).asInstanceOf[Array[Double ]]); - - rcheck(id_TSr_r [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]); - ocheck(id_TSr_r [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]); - mcheck(id_TSr_r [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); - ncheck(id_TSr_r [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); - - rcheck(id_TSo_r [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]); - ocheck(id_TSo_r [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]); - mcheck(id_TSo_r [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); - ncheck(id_TSo_r [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); - - mcheck(id_TSm_r [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); - - ncheck(id_TSn_r [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); - - //###################################################################### - - ucheck(id_TSa_o [Unit , Array[Unit ]](uarray).asInstanceOf[Array[Unit ]]); - zcheck(id_TSa_o [Boolean, Array[Boolean]](zarray).asInstanceOf[Array[Boolean]]); - bcheck(id_TSa_o [Byte , Array[Byte ]](barray).asInstanceOf[Array[Byte ]]); - scheck(id_TSa_o [Short , Array[Short ]](sarray).asInstanceOf[Array[Short ]]); - ccheck(id_TSa_o [Char , Array[Char ]](carray).asInstanceOf[Array[Char ]]); - icheck(id_TSa_o [Int , Array[Int ]](iarray).asInstanceOf[Array[Int ]]); - lcheck(id_TSa_o [Long , Array[Long ]](larray).asInstanceOf[Array[Long ]]); - fcheck(id_TSa_o [Float , Array[Float ]](farray).asInstanceOf[Array[Float ]]); - dcheck(id_TSa_o [Double , Array[Double ]](darray).asInstanceOf[Array[Double ]]); - rcheck(id_TSa_o [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]); - ocheck(id_TSa_o [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]); - mcheck(id_TSa_o [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); - ncheck(id_TSa_o [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); - - ucheck(id_TSv_o [Unit , Array[Unit ]](uarray).asInstanceOf[Array[Unit ]]); - zcheck(id_TSv_o [Boolean, Array[Boolean]](zarray).asInstanceOf[Array[Boolean]]); - bcheck(id_TSv_o [Byte , Array[Byte ]](barray).asInstanceOf[Array[Byte ]]); - scheck(id_TSv_o [Short , Array[Short ]](sarray).asInstanceOf[Array[Short ]]); - ccheck(id_TSv_o [Char , Array[Char ]](carray).asInstanceOf[Array[Char ]]); - icheck(id_TSv_o [Int , Array[Int ]](iarray).asInstanceOf[Array[Int ]]); - lcheck(id_TSv_o [Long , Array[Long ]](larray).asInstanceOf[Array[Long ]]); - fcheck(id_TSv_o [Float , Array[Float ]](farray).asInstanceOf[Array[Float ]]); - dcheck(id_TSv_o [Double , Array[Double ]](darray).asInstanceOf[Array[Double ]]); - - rcheck(id_TSr_o [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]); - ocheck(id_TSr_o [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]); - mcheck(id_TSr_o [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); - ncheck(id_TSr_o [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); - - rcheck(id_TSo_o [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]); - ocheck(id_TSo_o [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]); - mcheck(id_TSo_o [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); - ncheck(id_TSo_o [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); - - mcheck(id_TSm_o [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); - - ncheck(id_TSn_o [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); - - //###################################################################### - - check_Ta(uarray, 2, u0, ucheck) - check_Ta(zarray, 2, z0, zcheck) - check_Ta(barray, 3, b0, bcheck) - check_Ta(sarray, 3, s0, scheck) - check_Ta(carray, 3, c0, ccheck) - check_Ta(iarray, 3, i0, icheck) - check_Ta(larray, 3, l0, lcheck) - check_Ta(farray, 3, f0, fcheck) - check_Ta(darray, 3, d0, dcheck) - check_Ta(rarray, 6, r0, rcheck) - check_Ta(oarray, 6, o0, ocheck) - check_Ta(marray, 3, m0, mcheck) - check_Ta(narray, 3, n0, ncheck) - - check_Tv(uarray, 2, u0, ucheck) - check_Tv(zarray, 2, z0, zcheck) - check_Tv(barray, 3, b0, bcheck) - check_Tv(sarray, 3, s0, scheck) - check_Tv(carray, 3, c0, ccheck) - check_Tv(iarray, 3, i0, icheck) - check_Tv(larray, 3, l0, lcheck) - check_Tv(farray, 3, f0, fcheck) - check_Tv(darray, 3, d0, dcheck) - - check_Tr(rarray, 6, r0, rcheck) - check_Tr(oarray, 6, o0, ocheck) - check_Tr(marray, 3, m0, mcheck) - check_Tr(narray, 3, n0, ncheck) - - check_To(rarray, 6, r0, rcheck) - check_To(oarray, 6, o0, ocheck) - check_To(marray, 3, m0, mcheck) - check_To(narray, 3, n0, ncheck) - - check_Tm(marray, 3, m0, mcheck) - - check_Tn(narray, 3, n0, ncheck) - - //###################################################################### - - checkZip - checkConcat - checkT2368() - - //###################################################################### - - println("checks: " + checks) - - //###################################################################### - } - - //########################################################################## -} - diff --git a/tests/pending/run/classtags_contextbound.check b/tests/pending/run/classtags_contextbound.check deleted file mode 100644 index 604122846..000000000 --- a/tests/pending/run/classtags_contextbound.check +++ /dev/null @@ -1 +0,0 @@ -class [I diff --git a/tests/pending/run/classtags_contextbound.scala b/tests/pending/run/classtags_contextbound.scala deleted file mode 100644 index 1edce82a2..000000000 --- a/tests/pending/run/classtags_contextbound.scala +++ /dev/null @@ -1,7 +0,0 @@ -import scala.reflect.{ClassTag, classTag} - -object Test extends dotty.runtime.LegacyApp { - def mkArray[T: ClassTag] = Array[T]() - def foo[T: ClassTag] = mkArray[T] - println(foo[Int].getClass) -} diff --git a/tests/pending/run/collection-stacks.check b/tests/pending/run/collection-stacks.check deleted file mode 100644 index 3a366bfcd..000000000 --- a/tests/pending/run/collection-stacks.check +++ /dev/null @@ -1,15 +0,0 @@ -warning: there was one deprecation warning; re-run with -deprecation for details -3-2-1: true -3-2-1: true -apply -3: true -3: true -1: true -1: true -top -3: true -3: true -pop -2-1: true -3: true -2-1: true diff --git a/tests/pending/run/collection-stacks.scala b/tests/pending/run/collection-stacks.scala deleted file mode 100644 index a41bef37c..000000000 --- a/tests/pending/run/collection-stacks.scala +++ /dev/null @@ -1,38 +0,0 @@ -import scala.collection.{ immutable, mutable } - -object Test extends dotty.runtime.LegacyApp { - def mutableStack[T](xs: T*): mutable.Stack[T] = { - val s = new mutable.Stack[T] - s.pushAll(xs) - s - } - - def immutableStack[T](xs: T*): immutable.Stack[T] = { - immutable.Stack.empty[T] pushAll xs - } - - def check[T](expected: T, got: T): Unit = { - println(got + ": " + (expected == got)) - } - - // check #957 - check("3-2-1", immutableStack(1, 2, 3).iterator.mkString("-")) - check("3-2-1", mutableStack(1, 2, 3).iterator.mkString("-")) - - println("apply") - check(3, immutableStack(1, 2, 3).apply(0)) - check(3, mutableStack(1, 2, 3).apply(0)) - check(1, immutableStack(1, 2, 3).apply(2)) - check(1, mutableStack(1, 2, 3).apply(2)) - - println("top") - check(3, immutableStack(1, 2, 3).top) - check(3, mutableStack(1, 2, 3).top) - - println("pop") - check("2-1", immutableStack(1, 2, 3).pop.mkString("-")) - check(3, mutableStack(1, 2, 3).pop()) - check("2-1", { val s = mutableStack(1, 2, 3); s.pop(); s.toList.mkString("-") }) -} - -// vim: set ts=2 sw=2 et: diff --git a/tests/pending/run/contrib674.check b/tests/pending/run/contrib674.check deleted file mode 100644 index 78325c181..000000000 --- a/tests/pending/run/contrib674.check +++ /dev/null @@ -1,3 +0,0 @@ -contrib674.scala:15: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses - 1 - ^ diff --git a/tests/pending/run/contrib674.scala b/tests/pending/run/contrib674.scala deleted file mode 100644 index fe7ebcccd..000000000 --- a/tests/pending/run/contrib674.scala +++ /dev/null @@ -1,19 +0,0 @@ -// causes VerifyError with scala-2.5.1 - -object Test extends dotty.runtime.LegacyApp { - def bad(): Unit = { - try { - 1 - } catch { - case e: Throwable => - } finally { - try { - } catch { - case e: Throwable => - } - } - 1 - } - - bad -} diff --git a/tests/pending/run/emptypf.check b/tests/pending/run/emptypf.check deleted file mode 100644 index f6c39921b..000000000 --- a/tests/pending/run/emptypf.check +++ /dev/null @@ -1,3 +0,0 @@ -100 -3 -false diff --git a/tests/pending/run/emptypf.scala b/tests/pending/run/emptypf.scala deleted file mode 100644 index eb3e3e638..000000000 --- a/tests/pending/run/emptypf.scala +++ /dev/null @@ -1,14 +0,0 @@ -object Test { - val f: PartialFunction[String, Int] = { - PartialFunction.empty[String, Int] orElse { - case "abc" => 100 - case s => s.length - } - } - - def main(args: Array[String]): Unit = { - println(f("abc")) - println(f("def")) - println(PartialFunction.empty[String, Int] isDefinedAt "abc") - } -} diff --git a/tests/pending/run/hashCodeBoxesRunTime.scala b/tests/pending/run/hashCodeBoxesRunTime.scala deleted file mode 100644 index ba1a30f5f..000000000 --- a/tests/pending/run/hashCodeBoxesRunTime.scala +++ /dev/null @@ -1,28 +0,0 @@ -// This only tests direct access to the methods in BoxesRunTime, -// not the whole scheme. -object Test -{ - import java.{ lang => jl } - import scala.runtime.BoxesRunTime.{ hashFromNumber, hashFromObject } - - def allSame[T](xs: List[T]) = assert(xs.distinct.size == 1, "failed: " + xs) - - def mkNumbers(x: Int): List[Number] = - List(x.toByte, x.toShort, x, x.toLong, x.toFloat, x.toDouble) - - def testLDF(x: Long) = allSame(List[Number](x, x.toDouble, x.toFloat) map hashFromNumber) - - def main(args: Array[String]): Unit = { - List(Byte.MinValue, -1, 0, 1, Byte.MaxValue) foreach { n => - val hashes = mkNumbers(n) map hashFromNumber - allSame(hashes) - if (n >= 0) { - val charCode = hashFromObject(n.toChar: Character) - assert(charCode == hashes.head) - } - } - - testLDF(Short.MaxValue.toLong) - testLDF(Short.MinValue.toLong) - } -} diff --git a/tests/pending/run/lazy-exprs.check b/tests/pending/run/lazy-exprs.check deleted file mode 100644 index 2efb8ceb4..000000000 --- a/tests/pending/run/lazy-exprs.check +++ /dev/null @@ -1,21 +0,0 @@ -lazy-exprs.scala:38: warning: match may not be exhaustive. -It would fail on the following input: Some((x: String forSome x not in Z1)) - t match { - ^ -lazy-exprs.scala:62: warning: match may not be exhaustive. -It would fail on the following input: Some((x: String forSome x not in LazyField)) - t match { - ^ -forced -lazy val in scrutinee: ok -forced -lazy val in case: ok -lazy val in case: forced -ok -lazy val in if condition: forced -ok -lazy val in pattern: forced LazyField -ok -lazy val with patterns: -x and y: xy(x, y) -x1 and y1: x1y1(x1, y1) diff --git a/tests/pending/run/lazy-exprs.scala b/tests/pending/run/lazy-exprs.scala deleted file mode 100644 index 3ba6b46ab..000000000 --- a/tests/pending/run/lazy-exprs.scala +++ /dev/null @@ -1,95 +0,0 @@ -object TestExpressions { - - def patmatchScrut: Unit = { - lazy val z1: Option[String] = { println("forced "); Some("lazy z1") } - - val res = z1 match { - case Some(msg) => msg - case None => "failed" - } - print("lazy val in scrutinee: ") - if (res == "lazy z1") - println("ok") - else - println("failed") - } - - def patmatchCase: Unit = { - val t: Option[String] = Some("test") - val res = t match { - case Some(msg) => - lazy val z1 = { println("forced "); "lazy z1" } - z1 - - case None => "failed" - } - print("lazy val in case: ") - if (res == "lazy z1") - println("ok") - else - println("failed") - } - - - def patmatchPat: Unit = { - lazy val Z1 = { println("forced "); "lazy Z1" } - print("lazy val in case: ") - val t: Option[String] = Some("lazy Z1") - t match { - case Some(Z1) => - println("ok") - - case None => - println("failed") - } - } - - def ifcond: Unit = { - lazy val z1 = { println("forced "); "lazy z1" } - print("lazy val in if condition: ") - if (z1 == "lazy z1") - println("ok") - else - println("failed") - } - - - lazy val LazyField = { println("forced LazyField"); "LazyField" } - - def testPatMatchField: Unit = { - print("lazy val in pattern: ") - val t: Option[String] = Some("LazyField") - t match { - case Some(LazyField) => - println("ok") - - case None => - println("failed") - } - } - - lazy val (x, y) = ({print("x"); "x"}, {print("y"); "y"}) - def testPatLazyVal: Unit = { - println("lazy val with patterns:") - print("x and y: ") - println("(" + x + ", " + y + ")") - lazy val (x1, y1) = ({print("x1"); "x1"}, {print("y1"); "y1"}) - print("x1 and y1: ") - println("(" + x1 + ", " + y1 + ")") - } - - def test: Unit = { - patmatchScrut - patmatchCase - patmatchPat - ifcond - testPatMatchField - testPatLazyVal - } -} - - -object Test extends dotty.runtime.LegacyApp { - - TestExpressions.test -} diff --git a/tests/pending/run/nothingTypeNoFramesNoDce.check b/tests/pending/run/nothingTypeNoFramesNoDce.check deleted file mode 100644 index b1d08b45f..000000000 --- a/tests/pending/run/nothingTypeNoFramesNoDce.check +++ /dev/null @@ -1 +0,0 @@ -warning: -target:jvm-1.5 is deprecated: use target for Java 1.6 or above. diff --git a/tests/pending/run/nothingTypeNoFramesNoDce.flags b/tests/pending/run/nothingTypeNoFramesNoDce.flags deleted file mode 100644 index a035c8617..000000000 --- a/tests/pending/run/nothingTypeNoFramesNoDce.flags +++ /dev/null @@ -1 +0,0 @@ --target:jvm-1.5 -Ybackend:GenBCode -Yopt:l:none -deprecation diff --git a/tests/pending/run/nothingTypeNoFramesNoDce.scala b/tests/pending/run/nothingTypeNoFramesNoDce.scala deleted file mode 100644 index 13c1617dd..000000000 --- a/tests/pending/run/nothingTypeNoFramesNoDce.scala +++ /dev/null @@ -1,61 +0,0 @@ -// See comment in BCodeBodyBuilder - -// -target:jvm-1.5 -Ybackend:GenBCode -Yopt:l:none -// target disables stack map frame generation. in this mode, the ClssWriter just emits dead code as is. - -class C { - // can't just emit a call to ???, that returns value of type Nothing$ (not Int). - def f1: Int = ??? - - def f2: Int = throw new Error("") - - def f3(x: Boolean) = { - var y = 0 - // cannot assign an object of type Nothing$ to Int - if (x) y = ??? - else y = 1 - y - } - - def f4(x: Boolean) = { - var y = 0 - // tests that whatever is emitted after the throw is valid (what? depends on opts, presence of stack map frames) - if (x) y = throw new Error("") - else y = 1 - y - } - - def f5(x: Boolean) = { - // stack heights need to be the smae. ??? looks to the jvm like returning a value of - // type Nothing$, need to drop or throw it. - println( - if (x) { ???; 10 } - else 20 - ) - } - - def f6(x: Boolean) = { - println( - if (x) { throw new Error(""); 10 } - else 20 - ) - } - - def f7(x: Boolean) = { - println( - if (x) throw new Error("") - else 20 - ) - } - - def f8(x: Boolean) = { - println( - if (x) throw new Error("") - else 20 - ) - } -} - -object Test extends dotty.runtime.LegacyApp { - new C() -} diff --git a/tests/pending/run/origins.check b/tests/pending/run/origins.check deleted file mode 100644 index b12cb6e38..000000000 --- a/tests/pending/run/origins.check +++ /dev/null @@ -1,6 +0,0 @@ - ->> Origins tag 'boop' logged 65 calls from 3 distinguished sources. - - 50 Test$$anonfun$f3$1.apply(origins.scala:16) - 10 Test$$anonfun$f2$1.apply(origins.scala:15) - 5 Test$$anonfun$f1$1.apply(origins.scala:14) diff --git a/tests/pending/run/origins.flags b/tests/pending/run/origins.flags deleted file mode 100644 index 690753d80..000000000 --- a/tests/pending/run/origins.flags +++ /dev/null @@ -1 +0,0 @@ --no-specialization -Ydelambdafy:inline \ No newline at end of file diff --git a/tests/pending/run/origins.scala b/tests/pending/run/origins.scala deleted file mode 100644 index 6529351d3..000000000 --- a/tests/pending/run/origins.scala +++ /dev/null @@ -1,21 +0,0 @@ -import scala.reflect.internal.util.Origins - -package goxbox { - object Socks { - val origins = Origins("boop") - - def boop(x: Int): Int = origins { 5 } - } -} - -object Test { - import goxbox.Socks.boop - - def f1() = 1 to 5 map boop - def f2() = 1 to 10 map boop - def f3() = 1 to 50 map boop - - def main(args: Array[String]): Unit = { - f1() ; f2() ; f3() - } -} diff --git a/tests/pending/run/spec-self.check b/tests/pending/run/spec-self.check deleted file mode 100644 index e981f45c9..000000000 --- a/tests/pending/run/spec-self.check +++ /dev/null @@ -1,2 +0,0 @@ -5.0 -5.0 diff --git a/tests/pending/run/spec-self.scala b/tests/pending/run/spec-self.scala deleted file mode 100644 index 1c95e0a82..000000000 --- a/tests/pending/run/spec-self.scala +++ /dev/null @@ -1,14 +0,0 @@ -class Foo0 extends (() => Double) { - def apply() = 5.0d -} - -class Foo1 extends (Double => Double) { - def apply(x: Double) = x -} - -object Test { - def main(args: Array[String]): Unit = { - println((new Foo0)()) - println((new Foo1)(5.0d)) - } -} diff --git a/tests/pending/run/t0807.check b/tests/pending/run/t0807.check deleted file mode 100644 index c862cba6b..000000000 --- a/tests/pending/run/t0807.check +++ /dev/null @@ -1 +0,0 @@ -early diff --git a/tests/pending/run/t0807.scala b/tests/pending/run/t0807.scala deleted file mode 100644 index 1b5bc91c5..000000000 --- a/tests/pending/run/t0807.scala +++ /dev/null @@ -1,5 +0,0 @@ -trait A -trait B extends A { val x = println("early") } -object Test extends dotty.runtime.LegacyApp { - new B {} -} diff --git a/tests/pending/run/t2087-and-2400.scala b/tests/pending/run/t2087-and-2400.scala deleted file mode 100644 index 19a5df26e..000000000 --- a/tests/pending/run/t2087-and-2400.scala +++ /dev/null @@ -1,20 +0,0 @@ -object Test -{ - def negativeCharMaker = new (Short => Char) { def apply(x: Short) = x.toChar } - def main(args: Array[String]): Unit = { - // throws exception if -100 gets to Character.valueOf - val x = negativeCharMaker(-100) - - // chars are unsigned, they should never be equal to negative values - assert((-100).toShort != (-100).toChar) - assert((-100).toChar != (-100).toShort) - assert((-100).toChar != (-100).toByte) - assert((-100).toByte != (-100).toChar) - - // BoxesRunTime must agree as well - assert(((-100).toShort: Any) != (-100).toChar) - assert(((-100).toChar: Any) != (-100).toShort) - assert(((-100).toChar: Any) != (-100).toByte) - assert(((-100).toByte: Any) != (-100).toChar) - } -} diff --git a/tests/pending/run/t2857.check b/tests/pending/run/t2857.check deleted file mode 100644 index c508d5366..000000000 --- a/tests/pending/run/t2857.check +++ /dev/null @@ -1 +0,0 @@ -false diff --git a/tests/pending/run/t2857.scala b/tests/pending/run/t2857.scala deleted file mode 100644 index 5df2d440e..000000000 --- a/tests/pending/run/t2857.scala +++ /dev/null @@ -1,9 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - import collection.mutable._ - val m = new HashMap[Int, Set[String]] with MultiMap[Int, String] - m.addBinding(6, "Foo") - m.removeBinding(6, "Foo") - println(m.contains(6)) -} - - diff --git a/tests/pending/run/t3038.check b/tests/pending/run/t3038.check deleted file mode 100644 index 9a325c4c1..000000000 --- a/tests/pending/run/t3038.check +++ /dev/null @@ -1,19 +0,0 @@ -a1 -a2 -a3 -a4 -a5 -a6 -a7 -a8 -a9 -c1 -c2 -c3 -c4 -c5 -c6 -c7 -c8 -c9 -c10 diff --git a/tests/pending/run/t3038.scala b/tests/pending/run/t3038.scala deleted file mode 100644 index 6c9888c78..000000000 --- a/tests/pending/run/t3038.scala +++ /dev/null @@ -1,68 +0,0 @@ -class A { - private lazy val a1 = "a1" - object B - private lazy val a2 = "a2" - - - @transient lazy val a3 = "a3" - @transient private lazy val a4 = "a4" - @transient lazy val a5 = "a5" - @transient private lazy val a6 = "a6" - - final val a7 = "a7" - private final val a8 = "a8" - @transient final val a9 = "a9" - - - - - def run = { - println(a1) - B - println(a2) - println(a3) - println(a4) - println(a5) - println(a6) - println(a7) - println(a8) - println(a9) - } -} - -class C extends A { - private lazy val c1 = "c1" - lazy val c2 = "c2" - - private lazy val c3 = "c3" - - @transient lazy val c4 = "c4" - @transient private lazy val c5 = "c5" - @transient lazy val c6 = "c6" - @transient private lazy val c7 = "c7" - lazy val c8 = "c8" - - final val c9 = "c9" - private final val c10 = "c10" - - - - override def run = { - super.run - println(c1) - println(c2) - println(c3) - println(c4) - println(c5) - println(c6) - println(c7) - println(c8) - println(c9) - println(c10) - } -} - -object Test extends dotty.runtime.LegacyApp { - (new C).run -} - diff --git a/tests/pending/run/t3038b.check b/tests/pending/run/t3038b.check deleted file mode 100644 index cf0389a5a..000000000 --- a/tests/pending/run/t3038b.check +++ /dev/null @@ -1,6 +0,0 @@ -1 -2 -3 -4 -5 -6 \ No newline at end of file diff --git a/tests/pending/run/t3038b.flags b/tests/pending/run/t3038b.flags deleted file mode 100644 index ae0844605..000000000 --- a/tests/pending/run/t3038b.flags +++ /dev/null @@ -1 +0,0 @@ --Xcheckinit \ No newline at end of file diff --git a/tests/pending/run/t3038b.scala b/tests/pending/run/t3038b.scala deleted file mode 100644 index 559f754aa..000000000 --- a/tests/pending/run/t3038b.scala +++ /dev/null @@ -1,20 +0,0 @@ -class A { - val a1 = 1 - val a2 = 2 - private val b1 = 3 - private val b2 = 4 - @transient val c1 = 5 - @transient val c2 = 6 - def run = { - println(a1) - println(a2) - println(b1) - println(b2) - println(c1) - println(c2) - } -} - -object Test extends dotty.runtime.LegacyApp { - new A().run -} diff --git a/tests/pending/run/t3038c.check b/tests/pending/run/t3038c.check deleted file mode 100644 index a7e7ae9bd..000000000 --- a/tests/pending/run/t3038c.check +++ /dev/null @@ -1,2 +0,0 @@ -List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70) -List(71, 72, 73, 74, 75, 76, 77, 78, 79, 80) diff --git a/tests/pending/run/t3038c/A_1.scala b/tests/pending/run/t3038c/A_1.scala deleted file mode 100644 index 91564e302..000000000 --- a/tests/pending/run/t3038c/A_1.scala +++ /dev/null @@ -1,83 +0,0 @@ -class A { - lazy val a0 = 1 - lazy val a1 = 2 - lazy val a2 = 3 - lazy val a3 = 4 - lazy val a4 = 5 - lazy val a5 = 6 - lazy val a6 = 7 - lazy val a7 = 8 - lazy val a8 = 9 - lazy val a9 = 10 - lazy val a10 = 11 - lazy val a11 = 12 - lazy val a12 = 13 - lazy val a13 = 14 - lazy val a14 = 15 - lazy val a15 = 16 - lazy val a16 = 17 - lazy val a17 = 18 - lazy val a18 = 19 - lazy val a19 = 20 - lazy val a20 = 21 - lazy val a21 = 22 - lazy val a22 = 23 - lazy val a23 = 24 - lazy val a24 = 25 - lazy val a25 = 26 - lazy val a26 = 27 - lazy val a27 = 28 - lazy val a28 = 29 - lazy val a29 = 30 - lazy val a30 = 31 - lazy val a31 = 32 - lazy val a32 = 33 - lazy val a33 = 34 - lazy val a34 = 35 - lazy val a35 = 36 - lazy val a36 = 37 - lazy val a37 = 38 - lazy val a38 = 39 - lazy val a39 = 40 - lazy val a40 = 41 - lazy val a41 = 42 - lazy val a42 = 43 - lazy val a43 = 44 - lazy val a44 = 45 - lazy val a45 = 46 - lazy val a46 = 47 - lazy val a47 = 48 - lazy val a48 = 49 - lazy val a49 = 50 - lazy val a50 = 51 - lazy val a51 = 52 - lazy val a52 = 53 - lazy val a53 = 54 - lazy val a54 = 55 - lazy val a55 = 56 - lazy val a56 = 57 - lazy val a57 = 58 - lazy val a58 = 59 - lazy val a59 = 60 - private lazy val a60 = 61 - private lazy val a61 = 62 - private lazy val a62 = 63 - private lazy val a63 = 64 - private lazy val a64 = 65 - private lazy val a65 = 66 - private lazy val a66 = 67 - private lazy val a67 = 68 - private lazy val a68 = 69 - private lazy val a69 = 70 - - def run = { - println(List(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, - a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, - a20, a21, a22, a23, a24, a25, a26, a27, a28, a29, - a30, a31, a32, a33, a34, a35, a36, a37, a38, a39, - a40, a41, a42, a43, a44, a45, a46, a47, a48, a49, - a50, a51, a52, a53, a54, a55, a56, a57, a58, a59, - a60, a61, a62, a63, a64, a65, a66, a67, a68, a69)) - } - -} diff --git a/tests/pending/run/t3038c/B_2.scala b/tests/pending/run/t3038c/B_2.scala deleted file mode 100644 index d5b7baa1c..000000000 --- a/tests/pending/run/t3038c/B_2.scala +++ /dev/null @@ -1,24 +0,0 @@ - -class B extends A { - lazy val b0 = 71 - lazy val b1 = 72 - lazy val b2 = 73 - lazy val b3 = 74 - lazy val b4 = 75 - lazy val b5 = 76 - lazy val b6 = 77 - lazy val b7 = 78 - lazy val b8 = 79 - lazy val b9 = 80 - override def run = { - super.run - println(List(b0, b1, b2, b3, b4, b5, b6, b7, b8, b9)) - } - -} - -object Test { - def main(args: Array[String]): Unit = { - new B().run - } -} diff --git a/tests/pending/run/t3126.scala b/tests/pending/run/t3126.scala deleted file mode 100644 index 36322bf89..000000000 --- a/tests/pending/run/t3126.scala +++ /dev/null @@ -1,9 +0,0 @@ -object Test { - case class C(x: Int) - val v: Some[Int] = null - - def main(args: Array[String]): Unit = { - try C.unapply(null) catch { case _: MatchError => } - try v match { case Some(1) => } catch { case _: MatchError => } - } -} diff --git a/tests/pending/run/t3452.check b/tests/pending/run/t3452.check deleted file mode 100644 index b8626c4cf..000000000 --- a/tests/pending/run/t3452.check +++ /dev/null @@ -1 +0,0 @@ -4 diff --git a/tests/pending/run/t3452.scala b/tests/pending/run/t3452.scala deleted file mode 100644 index 253fc93cf..000000000 --- a/tests/pending/run/t3452.scala +++ /dev/null @@ -1,21 +0,0 @@ -trait IStringPair[T] { - def a : String - def b : String - def build(a : String, b : String) : T - def cat(that : IStringPair[T]) = build(this.a + that.a, this.b + that.b) - override def toString = a + b -} - -class StringPair(val a : String, val b : String) extends IStringPair[StringPair] { - def build(a : String, b : String) = new StringPair(a, b) - def len = a.length + b.length -} - -object Test { - def main(args: Array[String]): Unit = { - val a = new StringPair("A", "B") - val b = new StringPair("1", "2") - val c = a cat b - println(c.len) - } -} diff --git a/tests/pending/run/t3452c.check b/tests/pending/run/t3452c.check deleted file mode 100644 index ab4718119..000000000 --- a/tests/pending/run/t3452c.check +++ /dev/null @@ -1,8 +0,0 @@ -3 -3 -3 -3 -3 -3 -3 -3 diff --git a/tests/pending/run/t3452c.scala b/tests/pending/run/t3452c.scala deleted file mode 100644 index 2c55767ab..000000000 --- a/tests/pending/run/t3452c.scala +++ /dev/null @@ -1,113 +0,0 @@ -trait Base[A, B, C] { - def f(x: A, y: B, z: C): Unit - def g(x: A, y: B, z: C) = f(x, y, z) - def h(x: A, y: B, z: C) = g(x, y, z) -} - -trait D1[B, C] extends Base[String, B, C] -trait D2[A, B] extends Base[A, B, String] -trait D3[A, C] extends Base[A, String, C] -trait D4[A] extends Base[A, String, String] -trait D5[B] extends Base[String, B, String] -trait D6[C] extends Base[String, String, C] -trait D7 extends Base[String, String, String] - -trait E1[B, C] extends Base[String, B, C] { def f(x: String, y: B, z: C): Unit ; override def h(x: String, y: B, z: C) = g(x, y, z) } -trait E2[A, B] extends Base[A, B, String] { def f(x: A, y: B, z: String): Unit ; override def h(x: A, y: B, z: String) = g(x, y, z) } -trait E3[A, C] extends Base[A, String, C] { def f(x: A, y: String, z: C): Unit ; override def h(x: A, y: String, z: C) = g(x, y, z) } -trait E4[A] extends Base[A, String, String] { def f(x: A, y: String, z: String): Unit ; override def h(x: A, y: String, z: String) = g(x, y, z) } -trait E5[B] extends Base[String, B, String] { def f(x: String, y: B, z: String): Unit ; override def h(x: String, y: B, z: String) = g(x, y, z) } -trait E6[C] extends Base[String, String, C] { def f(x: String, y: String, z: C): Unit ; override def h(x: String, y: String, z: C) = g(x, y, z) } -trait E7 extends Base[String, String, String] { def f(x: String, y: String, z: String): Unit ; override def h(x: String, y: String, z: String) = g(x, y, z) } - -trait F1[B, C] extends Base[String, B, C] { def f(x: String, y: B, z: C): Unit = println(x.length) } -trait F2[A, B] extends Base[A, B, String] { def f(x: A, y: B, z: String): Unit = println(z.length) } -trait F3[A, C] extends Base[A, String, C] { def f(x: A, y: String, z: C): Unit = println(y.length) } -trait F4[A] extends Base[A, String, String] { def f(x: A, y: String, z: String): Unit = println(y.length) } -trait F5[B] extends Base[String, B, String] { def f(x: String, y: B, z: String): Unit = println(x.length) } -trait F6[C] extends Base[String, String, C] { def f(x: String, y: String, z: C): Unit = println(x.length) } -trait F7 extends Base[String, String, String] { def f(x: String, y: String, z: String): Unit = println(x.length) } - -abstract class DBag extends D1[String, String] with D2[String, String] with D3[String, String] with D4[String] with D5[String] with D6[String] with D7 { - def f(x: String, y: String, z: String) = println(x.length + y.length + z.length) -} -abstract class EBag extends E1[String, String] with E2[String, String] with E3[String, String] with E4[String] with E5[String] with E6[String] with E7 { - def f(x: String, y: String, z: String) = println(x.length + y.length + z.length) -} -abstract class FBag extends F1[String, String] with F2[String, String] with F3[String, String] with F4[String] with F5[String] with F6[String] with F7 { - override def f(x: String, y: String, z: String) = println(x.length + y.length + z.length) -} - -abstract class GBag1[A, B] extends Base[A, B, String] with D2[A, B] { - def f(x: A, y: B, z: String) = println(z.length) -} -abstract class GBag2[A] extends GBag1[A, String] with D4[A] { - override def f(x: A, y: String, z: String) = println(z.length) -} -abstract class GBag3 extends GBag2[String] with D7 { - override def f(x: String, y: String, z: String) = println(z.length) -} -class GBag extends GBag3 with D2[String, String] with D3[String, String] with D4[String] with D5[String] with D6[String] with D7 { -} - -object Test { - def f0(x: Base[String, String, String]) = x.f("a", "b", "c") - def f1(x: D1[String, String]) = x.f("a", "b", "c") - def f2(x: D2[String, String]) = x.f("a", "b", "c") - def f3(x: D3[String, String]) = x.f("a", "b", "c") - def f4(x: D4[String]) = x.f("a", "b", "c") - def f5(x: D5[String]) = x.f("a", "b", "c") - def f6(x: D6[String]) = x.f("a", "b", "c") - def f7(x: D7) = x.f("a", "b", "c") - - def main(args: Array[String]): Unit = { - val x = new DBag { } - f0(x) - f1(x) - f2(x) - f3(x) - f4(x) - f5(x) - f6(x) - f7(x) - } -} - -object TestE { - def f0(x: Base[String, String, String]) = { x.f("a", "b", "c") ; x.g("a", "b", "c") ; x.h("a", "b", "c") } - def f1(x: E1[String, String]) = { x.f("a", "b", "c") ; x.g("a", "b", "c") ; x.h("a", "b", "c") } - def f2(x: E2[String, String]) = { x.f("a", "b", "c") ; x.g("a", "b", "c") ; x.h("a", "b", "c") } - def f3(x: E3[String, String]) = { x.f("a", "b", "c") ; x.g("a", "b", "c") ; x.h("a", "b", "c") } - def f4(x: E4[String]) = { x.f("a", "b", "c") ; x.g("a", "b", "c") ; x.h("a", "b", "c") } - def f5(x: E5[String]) = { x.f("a", "b", "c") ; x.g("a", "b", "c") ; x.h("a", "b", "c") } - def f6(x: E6[String]) = { x.f("a", "b", "c") ; x.g("a", "b", "c") ; x.h("a", "b", "c") } - def f7(x: E7) = { x.f("a", "b", "c") ; x.g("a", "b", "c") ; x.h("a", "b", "c") } - - def main(args: Array[String]): Unit = { - val x = new EBag { } - f0(x) - f1(x) - f2(x) - f3(x) - f4(x) - f5(x) - f6(x) - f7(x) - } -} - - -object TestG { - def f0(x: Base[String, String, String]) = { x.f("a", "b", "c") ; x.g("a", "b", "c") ; x.h("a", "b", "c") } - def f1(x: GBag1[String, String]) = { x.f("a", "b", "c") ; x.g("a", "b", "c") ; x.h("a", "b", "c") } - def f2(x: GBag2[String]) = { x.f("a", "b", "c") ; x.g("a", "b", "c") ; x.h("a", "b", "c") } - def f3(x: GBag3) = { x.f("a", "b", "c") ; x.g("a", "b", "c") ; x.h("a", "b", "c") } - - def main(args: Array[String]): Unit = { - val x = new GBag { } - f0(x) - f1(x) - f2(x) - f3(x) - } -} diff --git a/tests/pending/run/t3452f.scala b/tests/pending/run/t3452f.scala deleted file mode 100644 index af64f5c04..000000000 --- a/tests/pending/run/t3452f.scala +++ /dev/null @@ -1,19 +0,0 @@ -import language.higherKinds - -trait GenSet[A] - -trait GenSetTemplate[A, +CC[X] <: GenSet[X]] { - def empty: CC[A] = ??? -} - -trait SetLike[A, +This <: SetLike[A, This] with Set[A]] { - def empty: This -} - -abstract class Set[A] extends GenSet[A] with SetLike[A,Set[A]] with GenSetTemplate[A,Set] - -object Test { - def main(args: Array[String]): Unit = { - locally(classOf[Set[_]]) // trigger classloading to verify class - } -} diff --git a/tests/pending/run/t3502.scala b/tests/pending/run/t3502.scala deleted file mode 100644 index 2f432e486..000000000 --- a/tests/pending/run/t3502.scala +++ /dev/null @@ -1,24 +0,0 @@ - - - - - -// ticket #3502 -object Test { - - object GeneratePrimeFactorsLazy extends (Int => List[Int]) { - override def apply(n:Int) = { - val s = Stream.range(2, n / 2).filter(n % _ == 0) - //val s = for (i <- Stream.range(2, n / 2); if n % i == 0) yield i - s.headOption.map(x => x :: apply(n / x)).getOrElse(List(n)) - } - } - - def main(args:Array[String]): Unit = { - // a prime number - //val num = 623456789 - val num = 2796203 - assert(GeneratePrimeFactorsLazy(num) == List(num)) - } - -} diff --git a/tests/pending/run/t3651.scala b/tests/pending/run/t3651.scala deleted file mode 100644 index c4c5c2ed6..000000000 --- a/tests/pending/run/t3651.scala +++ /dev/null @@ -1,10 +0,0 @@ -class Klass[@specialized(Long) A]( val a: A ) - -class LongKlass( override val a: Long ) extends Klass[Long](a) - -object Test { - def main(args: Array[String]): Unit = { - val lk = new LongKlass(10) - val a = lk.a - } -} diff --git a/tests/pending/run/t3670.check b/tests/pending/run/t3670.check deleted file mode 100644 index bc49bb643..000000000 --- a/tests/pending/run/t3670.check +++ /dev/null @@ -1,5 +0,0 @@ -a -b -1 -2 -42 diff --git a/tests/pending/run/t3670.scala b/tests/pending/run/t3670.scala deleted file mode 100644 index b9cee847b..000000000 --- a/tests/pending/run/t3670.scala +++ /dev/null @@ -1,31 +0,0 @@ -class C { - val things = List("abcs") - - if (things.length < 30) { - lazy val a = "a" - println(a) - } - if (things.length < 30) { - lazy val b = "b" - println(b) - } -} - -class M extends dotty.runtime.LegacyApp { - def foo: Unit = { - lazy val a = { - lazy val b = 1 - lazy val c = 2 - println(b) - println(c) - } - a - lazy val d = 42 - println(d) - } -} - -object Test extends dotty.runtime.LegacyApp { - new C() - new M().foo -} diff --git a/tests/pending/run/t3895.check b/tests/pending/run/t3895.check deleted file mode 100644 index 3045ebf01..000000000 --- a/tests/pending/run/t3895.check +++ /dev/null @@ -1,2 +0,0 @@ -17 -17 \ No newline at end of file diff --git a/tests/pending/run/t3895.flags b/tests/pending/run/t3895.flags deleted file mode 100644 index ae0844605..000000000 --- a/tests/pending/run/t3895.flags +++ /dev/null @@ -1 +0,0 @@ --Xcheckinit \ No newline at end of file diff --git a/tests/pending/run/t3895.scala b/tests/pending/run/t3895.scala deleted file mode 100644 index 5f83235de..000000000 --- a/tests/pending/run/t3895.scala +++ /dev/null @@ -1,36 +0,0 @@ -class C extends A{ - - val a = 10 - //object bb - lazy val bb = 17 - val b = 12 -} - -abstract class A{ - val a: Int - val b: Int - val c: Int = 12 -} - -class B extends A{ - - val a = 10 - //object bb - lazy val bb = 17 - val b = 12 -} - -trait T { - private final val a = false -} - -class Impl extends T - - -object Test { - def main(args: Array[String]): Unit = { - println(new B().bb) - println(new C().bb) - } -} - diff --git a/tests/pending/run/t3980.check b/tests/pending/run/t3980.check deleted file mode 100644 index 8bb03f18b..000000000 --- a/tests/pending/run/t3980.check +++ /dev/null @@ -1,3 +0,0 @@ -once -2 -2 diff --git a/tests/pending/run/t3980.scala b/tests/pending/run/t3980.scala deleted file mode 100644 index dbe9644ea..000000000 --- a/tests/pending/run/t3980.scala +++ /dev/null @@ -1,19 +0,0 @@ -object A { - def run1: Unit = { - lazy val x: Unit = {(); println("once")} - x - x - } - def run2: Unit = { - lazy val y: Int = 2 - println(y) - println(y) - } -} - -object Test { - def main(args: Array[String]) = { - A.run1 - A.run2 - } -} diff --git a/tests/pending/run/t4742.flags b/tests/pending/run/t4742.flags deleted file mode 100644 index ae0844605..000000000 --- a/tests/pending/run/t4742.flags +++ /dev/null @@ -1 +0,0 @@ --Xcheckinit \ No newline at end of file diff --git a/tests/pending/run/t4742.scala b/tests/pending/run/t4742.scala deleted file mode 100644 index 47656049b..000000000 --- a/tests/pending/run/t4742.scala +++ /dev/null @@ -1,7 +0,0 @@ -trait T { val x: Int = 0 } -object O extends T { override final val x = 1 } - -object Test extends dotty.runtime.LegacyApp { - // was throwing an UnitializedFieldError as constant 1 is folded into the accessor - assert((O: T).x == 1) -} diff --git a/tests/pending/run/t5045.check b/tests/pending/run/t5045.check deleted file mode 100644 index 7e9c1961b..000000000 --- a/tests/pending/run/t5045.check +++ /dev/null @@ -1,6 +0,0 @@ - extract an exact match 2011-07-15 2011-07-15 - extract from middle of string 2011-07-15 2011-07-15 - extract from middle of string (P2) 2011-07-15 2011-07-15 - extract from middle of string (P3) 2011-07-15 2011-07-15 - copyright example has date Copyright 2011 Copyright 2011 - copyright example missing date No copyright No copyright diff --git a/tests/pending/run/t5045.scala b/tests/pending/run/t5045.scala deleted file mode 100644 index 3778339aa..000000000 --- a/tests/pending/run/t5045.scala +++ /dev/null @@ -1,49 +0,0 @@ - -import scala.language.postfixOps - -object Test extends dotty.runtime.LegacyApp { - - import scala.util.matching.{ Regex, UnanchoredRegex } - - val dateP1 = """(\d\d\d\d)-(\d\d)-(\d\d)""".r.unanchored - val dateP2 = """(\d\d\d\d)-(\d\d)-(\d\d)""" r ("year", "month", "day") unanchored - val dateP3 = new Regex("""(\d\d\d\d)-(\d\d)-(\d\d)""", "year", "month", "day") with UnanchoredRegex - - val yearStr = "2011" - val dateStr = List(yearStr,"07","15").mkString("-") - - def test(msg: String)(strs: Seq[String]): Unit = println("%40s %s".format(msg, strs mkString " ")) - - test("extract an exact match") { - val dateP1(y,m,d) = dateStr - Seq(List(y,m,d).mkString("-"), dateStr) - } - - test("extract from middle of string") { - val dateP1(y,m,d) = "Tested on "+dateStr+"." - Seq(List(y,m,d).mkString("-"), dateStr) - } - - test("extract from middle of string (P2)") { - val dateP2(y,m,d) = "Tested on "+dateStr+"." - Seq(List(y,m,d).mkString("-"), dateStr) - } - - test("extract from middle of string (P3)") { - val dateP2(y,m,d) = "Tested on "+dateStr+"." - Seq(List(y,m,d).mkString("-"), dateStr) - } - - def copyright(in: String): String = in match { - case dateP1(year, month, day) => "Copyright "+year - case _ => "No copyright" - } - - test("copyright example has date") { - Seq(copyright("Date of this document: "+dateStr), "Copyright "+yearStr) - } - - test("copyright example missing date") { - Seq(copyright("Date of this document: unknown"), "No copyright") - } -} diff --git a/tests/pending/run/t5300.scala b/tests/pending/run/t5300.scala deleted file mode 100644 index 0f1c80717..000000000 --- a/tests/pending/run/t5300.scala +++ /dev/null @@ -1,7 +0,0 @@ -object Test { - val pf: PartialFunction[Any, Unit] = { case _ => () } - - def main(args: Array[String]): Unit = { - pf orElse pf - } -} diff --git a/tests/pending/run/t5328.check b/tests/pending/run/t5328.check deleted file mode 100644 index 77a43968c..000000000 --- a/tests/pending/run/t5328.check +++ /dev/null @@ -1,3 +0,0 @@ -2 -1,2,8 -1,8,3 diff --git a/tests/pending/run/t5328.scala b/tests/pending/run/t5328.scala deleted file mode 100644 index 74c8ace89..000000000 --- a/tests/pending/run/t5328.scala +++ /dev/null @@ -1,5 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - println(Vector(1).view.updated(0,2).toList mkString ",") - println(Seq(1,2,3).view.updated(2,8).toList mkString ",") - println(List(1,2,3).view.updated(1,8).toList mkString ",") -} diff --git a/tests/pending/run/t603.check b/tests/pending/run/t603.check deleted file mode 100644 index 1f4082502..000000000 --- a/tests/pending/run/t603.check +++ /dev/null @@ -1,5 +0,0 @@ -s = Susp(?) -evaluating... -s() = 3 -s = Susp(3) -2 + s = 5 diff --git a/tests/pending/run/t603.scala b/tests/pending/run/t603.scala deleted file mode 100644 index 84a224a40..000000000 --- a/tests/pending/run/t603.scala +++ /dev/null @@ -1,35 +0,0 @@ -object forceDelay { - import scala.language.implicitConversions - - class Susp[+A](lazyValue: => A) extends Function0[A] { - private var func: () => Any = () => lazyValue - private var value: Any = null - - override def apply() = { - if (func != null) { - value = func().asInstanceOf[A] - func = null - } - value.asInstanceOf[A] - } - - override def toString() = - if (func == null) "Susp(" + value + ")" - else "Susp(?)" - } - - def delay[A](value: => A) = new Susp[A](value) - implicit def force[A](s: Susp[A]): A = s() -} - -object Test { - import forceDelay._ - - def main(args: Array[String]) = { - val s: Susp[Int] = delay { Console.println("evaluating..."); 3 } - Console.println("s = " + s) - Console.println("s() = " + s()) - Console.println("s = " + s) - Console.println("2 + s = " + (2 + s)) - } -} diff --git a/tests/pending/run/t6853.scala b/tests/pending/run/t6853.scala deleted file mode 100644 index 352375c99..000000000 --- a/tests/pending/run/t6853.scala +++ /dev/null @@ -1,18 +0,0 @@ -// Test cases: the only place we can cut and paste without crying -// ourself to sleep. -object Test { - - def main(args: Array[String]): Unit = { - // First testing the basic operations - val m = collection.mutable.ListMap[String, Int]() - var i = 0 - while(i < 2) { m += ("foo" + i) -> i; i = i+1} - assert(m == Map("foo1"->1,"foo0"->0)) - m-= "foo0" - assert(m == Map("foo1"->1)) - // Now checking if it scales as described in SI-6853 - i = 0 - while(i < 80000) { m += ("foo" + i) -> i; i = i+1} - assert(m.size == 80000) - } -} diff --git a/tests/pending/run/t751.scala b/tests/pending/run/t751.scala deleted file mode 100644 index 294d3af5c..000000000 --- a/tests/pending/run/t751.scala +++ /dev/null @@ -1,6 +0,0 @@ -object Test { - def main(args: Array[String]): Unit = { - val map = Map(1 -> "a", 2 -> "b", 3 -> "c") - assert(map.filterKeys(_ % 2 == 0).isInstanceOf[scala.collection.immutable.Map[_,_]]) - } -} diff --git a/tests/pending/run/t7584.check b/tests/pending/run/t7584.check deleted file mode 100644 index 9f53e5dde..000000000 --- a/tests/pending/run/t7584.check +++ /dev/null @@ -1,6 +0,0 @@ -no calls -call A -a -call B twice -b -b diff --git a/tests/pending/run/t7584.flags b/tests/pending/run/t7584.flags deleted file mode 100644 index e8fb65d50..000000000 --- a/tests/pending/run/t7584.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/tests/pending/run/t7584.scala b/tests/pending/run/t7584.scala deleted file mode 100644 index f134b04a5..000000000 --- a/tests/pending/run/t7584.scala +++ /dev/null @@ -1,14 +0,0 @@ -// Test case added to show the behaviour of functions with -// by-name parameters. The evaluation behaviour was already correct. -// -// We did flush out a spurious "pure expression does nothing in statement position" -// warning, hence -Xfatal-warnings in the flags file. -object Test extends dotty.runtime.LegacyApp { - def foo(f: (=> Int, => Int) => Unit) = f({println("a"); 0}, {println("b"); 1}) - println("no calls") - foo((a, b) => ()) - println("call A") - foo((a, b) => a) - println("call B twice") - foo((a, b) => {b; b}) -} diff --git a/tests/pending/run/t7859/A_1.scala b/tests/pending/run/t7859/A_1.scala deleted file mode 100644 index 74f0709d4..000000000 --- a/tests/pending/run/t7859/A_1.scala +++ /dev/null @@ -1,11 +0,0 @@ -class A(private val x: Int) extends AnyVal - -object A { - val Const = new A(0) -} - -class A1(protected val x: Int) extends AnyVal - -package p { - class A2(private[p] val x: Int) extends AnyVal -} diff --git a/tests/pending/run/t7859/B_2.scala b/tests/pending/run/t7859/B_2.scala deleted file mode 100644 index 052322ef6..000000000 --- a/tests/pending/run/t7859/B_2.scala +++ /dev/null @@ -1,47 +0,0 @@ -class B private (private val b: Int) extends AnyVal -object B { - val Const = new B(0) -} - -// These tests will require erasure to unbox the value class. -// We need to test under joint and separate compilation to check -// that the 'notPRIVATE' flag on the param accessor is pickled. -// -// See also SI-6601. -object Test { - def main(args: Array[String]): Unit = { - unboxA - unboxA1 - unboxA2 - unboxB - } - - def unboxA: Unit = { - val o: Some[A] = Some(A.Const) - val a = o.get - def id(a: A): A = a - id(a) - } - - def unboxA1: Unit = { - val o: Some[A1] = Some(new A1(0)) - val a = o.get - def id(a: A1): A1 = a - id(a) - } - - def unboxA2: Unit = { - import p.A2 - val o: Some[A2] = Some(new A2(0)) - val a = o.get - def id(a: A2): A2 = a - id(a) - } - - def unboxB: Unit = { - val o: Some[B] = Some(B.Const) - val b = o.get - def id(b: B): B = b - id(b) - } -} diff --git a/tests/pending/run/t8280.check b/tests/pending/run/t8280.check deleted file mode 100644 index ed392841c..000000000 --- a/tests/pending/run/t8280.check +++ /dev/null @@ -1,9 +0,0 @@ -Int -Int -Int -Int -Int -Int -Int -Int -Int diff --git a/tests/pending/run/t8280.scala b/tests/pending/run/t8280.scala deleted file mode 100644 index 0734d63b6..000000000 --- a/tests/pending/run/t8280.scala +++ /dev/null @@ -1,82 +0,0 @@ -import scala.language.implicitConversions - -object Test { - def main(args: Array[String]): Unit = { - Moop1.ob1 - Moop1.ob2 - Moop1.ob3 - Moop2.ob1 - Moop2.ob2 - Moop2.ob3 - Moop3.ob1 - Moop3.ob2 - Moop3.ob3 - } -} - -// int object vs. -object Moop1 { - object ob1 { - implicit object f1 extends (Int => String) { def apply(x: Int): String = "Int" } - implicit object f2 extends (Long => String) { def apply(x: Long): String = "Long" } - - println(5: String) - } - object ob2 { - implicit object f1 extends (Int => String) { def apply(x: Int): String = "Int" } - implicit def f2(x: Long): String = "Long" - - println(5: String) - } - object ob3 { - implicit object f1 extends (Int => String) { def apply(x: Int): String = "Int" } - implicit val f2: Long => String = _ => "Long" - - println(5: String) - } -} - -// int def vs. -object Moop2 { - object ob1 { - implicit def f1(x: Int): String = "Int" - implicit object f2 extends (Long => String) { def apply(x: Long): String = "Long" } - - println(5: String) - } - object ob2 { - implicit def f1(x: Int): String = "Int" - implicit def f2(x: Long): String = "Long" - - println(5: String) - } - object ob3 { - implicit def f1(x: Int): String = "Int" - implicit val f2: Long => String = _ => "Long" - - println(5: String) - } -} - -// int val vs. -object Moop3 { - object ob1 { - implicit val f1: Int => String = _ => "Int" - implicit object f2 extends (Long => String) { def apply(x: Long): String = "Long" } - - println(5: String) - } - object ob2 { - implicit val f1: Int => String = _ => "Int" - implicit def f2(x: Long): String = "Long" - - println(5: String) - } - object ob3 { - implicit val f1: Int => String = _ => "Int" - implicit val f2: Long => String = _ => "Long" - - println(5: String) - } -} - diff --git a/tests/pending/run/t8570.flags b/tests/pending/run/t8570.flags deleted file mode 100644 index 3d1ee4760..000000000 --- a/tests/pending/run/t8570.flags +++ /dev/null @@ -1 +0,0 @@ --Xcheckinit diff --git a/tests/pending/run/t8570.scala b/tests/pending/run/t8570.scala deleted file mode 100644 index f1f752602..000000000 --- a/tests/pending/run/t8570.scala +++ /dev/null @@ -1,10 +0,0 @@ -trait Trait40_1 { - val value37_2 = () - def run = { value37_2 } -} - -object Test { - def main(args: Array[String]): Unit = { - (new Trait40_1 {}).run - } -} diff --git a/tests/pending/run/t8570a.check b/tests/pending/run/t8570a.check deleted file mode 100644 index 6a452c185..000000000 --- a/tests/pending/run/t8570a.check +++ /dev/null @@ -1 +0,0 @@ -() diff --git a/tests/pending/run/t8570a.flags b/tests/pending/run/t8570a.flags deleted file mode 100644 index 3d1ee4760..000000000 --- a/tests/pending/run/t8570a.flags +++ /dev/null @@ -1 +0,0 @@ --Xcheckinit diff --git a/tests/pending/run/t8570a.scala b/tests/pending/run/t8570a.scala deleted file mode 100644 index b36c34037..000000000 --- a/tests/pending/run/t8570a.scala +++ /dev/null @@ -1,14 +0,0 @@ -trait Trait40_1 { - val value37_2 = () - def run = { value37_2 } -} - -trait T1 extends Trait40_1 { - override val value37_2 = () -} - -object Test { - def main(args: Array[String]): Unit = { - println((new T1 {}).run) - } -} diff --git a/tests/pending/run/t8823.scala b/tests/pending/run/t8823.scala deleted file mode 100644 index 06e3bff69..000000000 --- a/tests/pending/run/t8823.scala +++ /dev/null @@ -1,10 +0,0 @@ -class Tuple2Int(val encoding: Long) extends AnyVal with Product2[Int, Int] { - def canEqual(that: Any) = false - def _1: Int = 1 - def _2: Int = 2 -} - -object Test extends dotty.runtime.LegacyApp { - assert(new Tuple2Int(0)._1 == 1) - assert(new Tuple2Int(0)._2 == 2) -} diff --git a/tests/pending/run/t949.scala b/tests/pending/run/t949.scala deleted file mode 100644 index 9363f60c6..000000000 --- a/tests/pending/run/t949.scala +++ /dev/null @@ -1,14 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - - private def f = new T { val state = State.A } - - private object State extends Enumeration { - val A, B = Value - } - - f -} - -trait T { -} - diff --git a/tests/pending/run/t978.scala b/tests/pending/run/t978.scala deleted file mode 100644 index e87e7054a..000000000 --- a/tests/pending/run/t978.scala +++ /dev/null @@ -1,38 +0,0 @@ -class Foo(val n: Int) { - override def hashCode = n % 2 // pretty bad hash - override def equals(other: Any): Boolean = other match { - case f: Foo => f.n == n - case _ => false - } - - override def toString = "" + n -} - -object Test extends dotty.runtime.LegacyApp { - val set = new collection.mutable.HashSet[Foo] -// val set = new collection.jcl.HashSet[Foo] - - val max = 200 - for (x <- 1 to max) - set += new Foo(x) - - testRemove(2) - testExists(2) - - def testRemove(m: Int): Unit = { - for (x <- 1 to max; if x % m == 0) { - val f = new Foo(x) - set -= f - assert(!(set contains f)) - testExists(m) - } - } - - def testExists(m: Int): Unit = { - for (x <- 1 to max; if x % m == 1) { - val f = new Foo(x) - assert(set contains f, "For element: " + f + " set: " + set) - } - } - -} diff --git a/tests/pending/run/weakconform.scala b/tests/pending/run/weakconform.scala deleted file mode 100755 index e13390730..000000000 --- a/tests/pending/run/weakconform.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - val x: Float = 10/3 - assert(x == 3.0) -} -- cgit v1.2.3 From 75d5eee8c7f4d83dd64bca989027925e5ff081b6 Mon Sep 17 00:00:00 2001 From: Dmitry Petrashko Date: Mon, 15 Jun 2015 18:19:06 +0200 Subject: Move tests that have " macro" or "reify" to disabled. --- .../attachments-typed-another-ident/Impls_1.scala | 18 ++++ .../Macros_Test_2.scala | 5 + .../pos/attachments-typed-ident/Impls_1.scala | 18 ++++ .../attachments-typed-ident/Macros_Test_2.scala | 4 + .../disabled/macro/pos/liftcode_polymorphic.scala | 12 +++ .../pos/macro-bundle-disambiguate-bundle.check | 0 .../pos/macro-bundle-disambiguate-bundle.scala | 14 +++ .../pos/macro-bundle-disambiguate-nonbundle.check | 0 .../pos/macro-bundle-disambiguate-nonbundle.scala | 14 +++ .../pos/macro-implicit-invalidate-on-error.check | 0 .../pos/macro-implicit-invalidate-on-error.scala | 25 +++++ .../disabled/macro/pos/macro-qmarkqmarkqmark.scala | 7 ++ tests/disabled/macro/pos/t5223.scala | 6 ++ tests/disabled/macro/pos/t5692a/Macros_1.scala | 6 ++ tests/disabled/macro/pos/t5692a/Test_2.scala | 3 + tests/disabled/macro/pos/t5692b/Macros_1.scala | 6 ++ tests/disabled/macro/pos/t5692b/Test_2.scala | 3 + tests/disabled/macro/pos/t5706.flags | 1 + tests/disabled/macro/pos/t5706.scala | 15 +++ tests/disabled/macro/pos/t5744/Macros_1.scala | 22 ++++ tests/disabled/macro/pos/t5744/Test_2.scala | 6 ++ tests/disabled/macro/pos/t6047.flags | 1 + tests/disabled/macro/pos/t6047.scala | 20 ++++ tests/disabled/macro/pos/t6386.scala | 5 + tests/disabled/macro/pos/t6447.scala | 18 ++++ tests/disabled/macro/pos/t6485a/Macros_1.scala | 5 + tests/disabled/macro/pos/t6485a/Test_2.scala | 5 + tests/disabled/macro/pos/t6485b/Test.scala | 10 ++ tests/disabled/macro/pos/t6516.scala | 19 ++++ tests/disabled/macro/pos/t7190.scala | 26 +++++ tests/disabled/macro/pos/t7377/Client_2.scala | 11 ++ tests/disabled/macro/pos/t7377/Macro_1.scala | 7 ++ tests/disabled/macro/pos/t7461/Macros_1.scala | 13 +++ tests/disabled/macro/pos/t7461/Test_2.scala | 3 + tests/disabled/macro/pos/t7516/A_1.scala | 9 ++ tests/disabled/macro/pos/t7516/B_2.scala | 4 + tests/disabled/macro/pos/t7649.flags | 1 + tests/disabled/macro/pos/t7649.scala | 20 ++++ tests/disabled/macro/pos/t7776.check | 0 tests/disabled/macro/pos/t7776.scala | 20 ++++ tests/disabled/macro/pos/t7987/Macro_1.scala | 6 ++ tests/disabled/macro/pos/t7987/Test_2.scala | 12 +++ tests/disabled/macro/pos/t8001/Macros_1.scala | 10 ++ tests/disabled/macro/pos/t8001/Test_2.scala | 4 + .../disabled/macro/pos/t8013/inpervolated_2.scala | 11 ++ .../disabled/macro/pos/t8013/inpervolator_1.scala | 33 ++++++ tests/disabled/macro/pos/t8064/Client_2.scala | 8 ++ tests/disabled/macro/pos/t8064/Macro_1.scala | 10 ++ tests/disabled/macro/pos/t8064b/Client_2.scala | 6 ++ tests/disabled/macro/pos/t8064b/Macro_1.scala | 11 ++ tests/disabled/macro/pos/t8209a/Macros_1.scala | 17 +++ tests/disabled/macro/pos/t8209a/Test_2.scala | 4 + tests/disabled/macro/pos/t8209b/Macros_1.scala | 17 +++ tests/disabled/macro/pos/t8209b/Test_2.scala | 4 + tests/disabled/macro/pos/t8352/Macros_1.scala | 7 ++ tests/disabled/macro/pos/t8352/Test_2.scala | 5 + tests/disabled/macro/run/exprs_serialize.check | 19 ++++ tests/disabled/macro/run/exprs_serialize.scala | 39 +++++++ .../macro/run/freetypes_false_alarm1.check | 1 + .../macro/run/freetypes_false_alarm1.scala | 10 ++ .../macro/run/idempotency-case-classes.check | 55 ++++++++++ .../macro/run/idempotency-case-classes.scala | 22 ++++ .../macro/run/idempotency-extractors.check | 5 + .../macro/run/idempotency-extractors.scala | 22 ++++ tests/disabled/macro/run/idempotency-labels.check | 15 +++ tests/disabled/macro/run/idempotency-labels.scala | 22 ++++ .../disabled/macro/run/idempotency-lazy-vals.check | 23 ++++ .../disabled/macro/run/idempotency-lazy-vals.scala | 27 +++++ tests/disabled/macro/run/idempotency-this.check | 4 + tests/disabled/macro/run/idempotency-this.scala | 22 ++++ tests/disabled/macro/run/macro-abort-fresh.check | 6 ++ tests/disabled/macro/run/macro-abort-fresh.flags | 1 + .../macro/run/macro-abort-fresh/Macros_1.scala | 15 +++ .../macro/run/macro-abort-fresh/Test_2.scala | 8 ++ .../disabled/macro/run/macro-auto-duplicate.check | 1 + .../macro/run/macro-auto-duplicate/Macros_1.scala | 17 +++ .../macro/run/macro-auto-duplicate/Test_2.scala | 3 + .../disabled/macro/run/macro-basic-ma-md-mi.check | 1 + .../disabled/macro/run/macro-basic-ma-md-mi.flags | 1 + .../macro/run/macro-basic-ma-md-mi/Impls_1.scala | 21 ++++ .../macro/run/macro-basic-ma-md-mi/Macros_2.scala | 10 ++ .../macro/run/macro-basic-ma-md-mi/Test_3.scala | 4 + tests/disabled/macro/run/macro-basic-ma-mdmi.check | 1 + tests/disabled/macro/run/macro-basic-ma-mdmi.flags | 1 + .../run/macro-basic-ma-mdmi/Impls_Macros_1.scala | 32 ++++++ .../macro/run/macro-basic-ma-mdmi/Test_2.scala | 4 + tests/disabled/macro/run/macro-basic-mamd-mi.check | 1 + tests/disabled/macro/run/macro-basic-mamd-mi.flags | 1 + .../macro/run/macro-basic-mamd-mi/Impls_1.scala | 19 ++++ .../run/macro-basic-mamd-mi/Macros_Test_2.scala | 15 +++ .../macro/run/macro-blackbox-materialization.check | 3 + .../macro-blackbox-materialization/Macros_1.scala | 16 +++ .../macro-blackbox-materialization/Test_2.scala | 5 + .../macro/run/macro-bodyexpandstoimpl.check | 1 + .../macro/run/macro-bodyexpandstoimpl.flags | 1 + .../run/macro-bodyexpandstoimpl/Impls_1.scala | 16 +++ .../macro-bodyexpandstoimpl/Macros_Test_2.scala | 10 ++ .../macro/run/macro-bundle-context-alias.check | 4 + .../run/macro-bundle-context-alias/Macros_1.scala | 38 +++++++ .../run/macro-bundle-context-alias/Test_2.scala | 6 ++ .../run/macro-bundle-context-refinement.check | 2 + .../macro-bundle-context-refinement/Macros_1.scala | 19 ++++ .../macro-bundle-context-refinement/Test_2.scala | 4 + tests/disabled/macro/run/macro-bundle-repl.check | 24 +++++ tests/disabled/macro/run/macro-bundle-repl.scala | 13 +++ tests/disabled/macro/run/macro-bundle-static.check | 6 ++ .../run/macro-bundle-static/Impls_Macros_1.scala | 30 ++++++ .../macro/run/macro-bundle-static/Test_2.scala | 8 ++ .../disabled/macro/run/macro-bundle-toplevel.check | 6 ++ .../disabled/macro/run/macro-bundle-toplevel.flags | 1 + .../run/macro-bundle-toplevel/Impls_Macros_1.scala | 25 +++++ .../macro/run/macro-bundle-toplevel/Test_2.scala | 8 ++ .../macro/run/macro-bundle-whitebox-decl.check | 6 ++ .../Impls_Macros_1.scala | 26 +++++ .../run/macro-bundle-whitebox-decl/Test_2.scala | 8 ++ .../macro/run/macro-bundle-whitebox-use-raw.check | 5 + .../macro-bundle-whitebox-use-raw/Macros_1.scala | 108 +++++++++++++++++++ .../run/macro-bundle-whitebox-use-raw/Test_2.scala | 19 ++++ .../run/macro-bundle-whitebox-use-refined.check | 5 + .../Macros_1.scala | 108 +++++++++++++++++++ .../macro-bundle-whitebox-use-refined/Test_2.scala | 19 ++++ .../macro/run/macro-def-path-dependent.check | 1 + .../macro/run/macro-def-path-dependent.flags | 1 + .../macro/run/macro-def-path-dependent/Dummy.scala | 3 + .../run/macro-def-path-dependent/Test_1.scala | 25 +++++ .../run/macro-def-path-dependent/Test_2.scala | 22 ++++ .../run/macro-def-path-dependent/Test_3.scala | 22 ++++ .../run/macro-def-path-dependent/Test_4.scala | 11 ++ .../run/macro-def-path-dependent/Test_5.scala | 9 ++ .../run/macro-def-path-dependent/Test_6.scala | 9 ++ .../disabled/macro/run/macro-default-params.check | 1 + .../macro/run/macro-default-params/Macros_1.scala | 27 +++++ .../macro/run/macro-default-params/Test_2.scala | 3 + .../macro/run/macro-divergence-spurious.check | 1 + .../macro-divergence-spurious/Impls_Macros_1.scala | 23 ++++ .../run/macro-divergence-spurious/Test_2.scala | 3 + tests/disabled/macro/run/macro-duplicate.check | 3 + tests/disabled/macro/run/macro-duplicate.flags | 1 + .../macro/run/macro-duplicate/Impls_Macros_1.scala | 29 +++++ .../macro/run/macro-duplicate/Test_2.scala | 6 ++ .../macro/run/macro-enclosingowner-detectvar.check | 16 +++ .../macro-enclosingowner-detectvar/Macros_1.scala | 14 +++ .../macro-enclosingowner-detectvar/Test_2.scala | 23 ++++ .../macro/run/macro-enclosingowner-sbt.check | 16 +++ .../run/macro-enclosingowner-sbt/Macros_1.scala | 14 +++ .../run/macro-enclosingowner-sbt/Test_2.scala | 23 ++++ tests/disabled/macro/run/macro-enclosures.check | 34 ++++++ tests/disabled/macro/run/macro-enclosures.flags | 1 + .../run/macro-enclosures/Impls_Macros_1.scala | 23 ++++ .../macro/run/macro-enclosures/Test_2.scala | 11 ++ .../macro/run/macro-expand-implicit-argument.check | 1 + .../macro/run/macro-expand-implicit-argument.flags | 1 + .../macro-expand-implicit-argument/Macros_1.scala | 59 ++++++++++ .../macro-expand-implicit-argument/Test_2.scala | 4 + .../macro-expand-implicit-macro-has-implicit.check | 1 + .../macro-expand-implicit-macro-has-implicit.flags | 1 + .../Impls_1.scala | 9 ++ .../Macros_Test_2.scala | 5 + .../macro-expand-implicit-macro-is-implicit.check | 2 + .../macro-expand-implicit-macro-is-implicit.flags | 1 + .../Impls_1.scala | 9 ++ .../Macros_Test_2.scala | 11 ++ .../run/macro-expand-implicit-macro-is-val.check | 1 + .../run/macro-expand-implicit-macro-is-val.flags | 1 + .../Impls_1.scala | 9 ++ .../Macros_Test_2.scala | 5 + .../run/macro-expand-implicit-macro-is-view.check | 1 + .../Impls_1.scala | 9 ++ .../Macros_Test_2.scala | 12 +++ .../macro/run/macro-expand-multiple-arglists.check | 1 + .../macro/run/macro-expand-multiple-arglists.flags | 1 + .../macro-expand-multiple-arglists/Impls_1.scala | 10 ++ .../Macros_Test_2.scala | 4 + .../macro/run/macro-expand-nullary-generic.check | 6 ++ .../macro/run/macro-expand-nullary-generic.flags | 1 + .../run/macro-expand-nullary-generic/Impls_1.scala | 15 +++ .../Macros_Test_2.scala | 15 +++ .../run/macro-expand-nullary-nongeneric.check | 6 ++ .../run/macro-expand-nullary-nongeneric.flags | 1 + .../macro-expand-nullary-nongeneric/Impls_1.scala | 15 +++ .../Macros_Test_2.scala | 15 +++ .../disabled/macro/run/macro-expand-overload.check | 6 ++ .../disabled/macro/run/macro-expand-overload.flags | 1 + .../macro/run/macro-expand-overload/Impls_1.scala | 15 +++ .../run/macro-expand-overload/Macros_Test_2.scala | 20 ++++ .../disabled/macro/run/macro-expand-override.check | 15 +++ .../disabled/macro/run/macro-expand-override.flags | 1 + .../macro/run/macro-expand-override/Impls_1.scala | 15 +++ .../run/macro-expand-override/Macros_Test_2.scala | 43 ++++++++ .../macro/run/macro-expand-recursive.check | 1 + .../macro/run/macro-expand-recursive.flags | 1 + .../macro/run/macro-expand-recursive/Impls_1.scala | 15 +++ .../run/macro-expand-recursive/Macros_Test_2.scala | 8 ++ .../macro/run/macro-expand-tparams-bounds.check | 2 + .../macro/run/macro-expand-tparams-bounds.flags | 1 + .../run/macro-expand-tparams-bounds/Impls_1.scala | 12 +++ .../Macros_Test_2.scala | 12 +++ .../macro/run/macro-expand-tparams-explicit.check | 1 + .../macro/run/macro-expand-tparams-explicit.flags | 1 + .../macro-expand-tparams-explicit/Impls_1.scala | 11 ++ .../Macros_Test_2.scala | 4 + .../macro/run/macro-expand-tparams-implicit.check | 2 + .../macro/run/macro-expand-tparams-implicit.flags | 1 + .../macro-expand-tparams-implicit/Impls_1.scala | 11 ++ .../Macros_Test_2.scala | 5 + .../macro/run/macro-expand-tparams-prefix.check | 20 ++++ .../macro/run/macro-expand-tparams-prefix.flags | 1 + .../run/macro-expand-tparams-prefix/Impls_1.scala | 39 +++++++ .../Macros_Test_2.scala | 57 ++++++++++ .../macro/run/macro-expand-unapply-a.check | 2 + .../macro/run/macro-expand-unapply-a.flags | 1 + .../macro-expand-unapply-a/Impls_Macros_1.scala | 15 +++ .../macro/run/macro-expand-unapply-a/Test_2.scala | 6 ++ ...pand-varargs-explicit-over-nonvarargs-bad.check | 4 + ...pand-varargs-explicit-over-nonvarargs-bad.flags | 1 + .../Impls_1.scala | 9 ++ .../Macros_Test_2.scala | 12 +++ ...and-varargs-explicit-over-nonvarargs-good.check | 1 + ...and-varargs-explicit-over-nonvarargs-good.flags | 1 + .../Impls_1.scala | 13 +++ .../Macros_Test_2.scala | 8 ++ ...acro-expand-varargs-explicit-over-varargs.check | 1 + ...acro-expand-varargs-explicit-over-varargs.flags | 1 + .../Impls_1.scala | 13 +++ .../Macros_Test_2.scala | 8 ++ ...o-expand-varargs-implicit-over-nonvarargs.check | 1 + ...o-expand-varargs-implicit-over-nonvarargs.flags | 1 + .../Impls_1.scala | 9 ++ .../Macros_Test_2.scala | 7 ++ ...acro-expand-varargs-implicit-over-varargs.check | 1 + ...acro-expand-varargs-implicit-over-varargs.flags | 1 + .../Impls_1.scala | 13 +++ .../Macros_Test_2.scala | 7 ++ .../macro/run/macro-impl-default-params.check | 5 + .../macro/run/macro-impl-default-params.flags | 1 + .../macro-impl-default-params/Impls_Macros_1.scala | 20 ++++ .../run/macro-impl-default-params/Test_2.scala | 4 + tests/disabled/macro/run/macro-impl-relaxed.check | 4 + .../macro/run/macro-impl-relaxed/Macros_1.scala | 14 +++ .../macro/run/macro-impl-relaxed/Test_2.scala | 6 ++ .../macro/run/macro-impl-rename-context.check | 2 + .../macro/run/macro-impl-rename-context.flags | 1 + .../macro-impl-rename-context/Impls_Macros_1.scala | 12 +++ .../run/macro-impl-rename-context/Test_2.scala | 4 + .../macro/run/macro-impl-tparam-only-in-impl.check | 1 + .../macro/run/macro-impl-tparam-only-in-impl.flags | 1 + .../macro-impl-tparam-only-in-impl/Impls_1.scala | 5 + .../Macros_Test_2.scala | 8 ++ .../macro-impl-tparam-typetag-is-optional.check | 1 + .../macro-impl-tparam-typetag-is-optional.flags | 1 + .../Impls_1.scala | 9 ++ .../Macros_Test_2.scala | 4 + ...-invalidret-doesnt-conform-to-def-rettype.check | 5 + ...-invalidret-doesnt-conform-to-def-rettype.flags | 1 + .../Impls_Macros_1.scala | 12 +++ .../Test_2.scala | 8 ++ .../macro/run/macro-invalidret-nontypeable.check | 3 + .../macro/run/macro-invalidret-nontypeable.flags | 1 + .../Impls_Macros_1.scala | 13 +++ .../run/macro-invalidret-nontypeable/Test_2.scala | 8 ++ .../macro/run/macro-invalidusage-badret.check | 5 + .../macro/run/macro-invalidusage-badret.flags | 1 + .../macro-invalidusage-badret/Impls_Macros_1.scala | 9 ++ .../run/macro-invalidusage-badret/Test_2.scala | 8 ++ ...alidusage-partialapplication-with-tparams.check | 3 + ...alidusage-partialapplication-with-tparams.flags | 1 + .../Impls_Macros_1.scala | 13 +++ .../Test_2.scala | 8 ++ .../macro-invalidusage-partialapplication.check | 3 + .../macro-invalidusage-partialapplication.flags | 1 + .../Impls_Macros_1.scala | 14 +++ .../Test_2.scala | 8 ++ tests/disabled/macro/run/macro-openmacros.check | 3 + tests/disabled/macro/run/macro-openmacros.flags | 2 + .../run/macro-openmacros/Impls_Macros_1.scala | 25 +++++ .../macro/run/macro-openmacros/Test_2.scala | 3 + .../macro/run/macro-parse-position-malformed.check | 1 + .../Impls_Macros_1.scala | 18 ++++ .../macro-parse-position-malformed/Test_2.scala | 3 + .../disabled/macro/run/macro-parse-position.check | 5 + .../disabled/macro/run/macro-parse-position.flags | 1 + .../run/macro-parse-position/Impls_Macros_1.scala | 12 +++ .../macro/run/macro-parse-position/Test_2.scala | 3 + .../macro/run/macro-quasiinvalidbody-c.check | 1 + .../macro/run/macro-quasiinvalidbody-c.flags | 1 + .../macro-quasiinvalidbody-c/Impls_Macros_1.scala | 9 ++ .../run/macro-quasiinvalidbody-c/Test_2.scala | 4 + tests/disabled/macro/run/macro-quasiquotes.check | 4 + .../macro/run/macro-quasiquotes/Macros_1.scala | 15 +++ .../macro/run/macro-quasiquotes/Test_2.scala | 5 + tests/disabled/macro/run/macro-range.check | 9 ++ tests/disabled/macro/run/macro-range.flags | 1 + .../disabled/macro/run/macro-range/Common_1.scala | 48 +++++++++ .../run/macro-range/Expansion_Impossible_2.scala | 53 +++++++++ .../run/macro-range/Expansion_Possible_3.scala | 7 ++ tests/disabled/macro/run/macro-rangepos-args.check | 1 + tests/disabled/macro/run/macro-rangepos-args.flags | 1 + .../macro/run/macro-rangepos-args/Macros_1.scala | 10 ++ .../macro/run/macro-rangepos-args/Test_2.scala | 4 + .../macro/run/macro-rangepos-subpatterns.check | 1 + .../macro/run/macro-rangepos-subpatterns.flags | 1 + .../run/macro-rangepos-subpatterns/Macros_1.scala | 18 ++++ .../run/macro-rangepos-subpatterns/Test_2.scala | 5 + .../run/macro-reflective-ma-normal-mdmi.check | 1 + .../run/macro-reflective-ma-normal-mdmi.flags | 1 + .../Impls_Macros_1.scala | 13 +++ .../macro-reflective-ma-normal-mdmi/Test_2.scala | 7 ++ .../run/macro-reflective-mamd-normal-mi.check | 1 + .../macro-reflective-mamd-normal-mi/Impls_1.scala | 9 ++ .../Macros_Test_2.scala | 20 ++++ tests/disabled/macro/run/macro-reify-basic.check | 1 + tests/disabled/macro/run/macro-reify-basic.flags | 1 + .../macro/run/macro-reify-basic/Macros_1.scala | 11 ++ .../macro/run/macro-reify-basic/Test_2.scala | 3 + .../run/macro-reify-chained1/Impls_Macros_1.scala | 47 ++++++++ .../macro/run/macro-reify-chained1/Test_2.scala | 9 ++ .../run/macro-reify-chained2/Impls_Macros_1.scala | 47 ++++++++ .../macro/run/macro-reify-chained2/Test_2.scala | 9 ++ .../disabled/macro/run/macro-reify-freevars.check | 3 + .../disabled/macro/run/macro-reify-freevars.flags | 1 + .../macro/run/macro-reify-freevars/Macros_1.scala | 20 ++++ .../macro/run/macro-reify-freevars/Test_2.scala | 11 ++ .../run/macro-reify-nested-a1/Impls_Macros_1.scala | 47 ++++++++ .../macro/run/macro-reify-nested-a1/Test_2.scala | 9 ++ .../run/macro-reify-nested-a2/Impls_Macros_1.scala | 47 ++++++++ .../macro/run/macro-reify-nested-a2/Test_2.scala | 9 ++ .../run/macro-reify-nested-b1/Impls_Macros_1.scala | 47 ++++++++ .../macro/run/macro-reify-nested-b1/Test_2.scala | 9 ++ .../run/macro-reify-nested-b2/Impls_Macros_1.scala | 47 ++++++++ .../macro/run/macro-reify-nested-b2/Test_2.scala | 9 ++ .../macro/run/macro-reify-ref-to-packageless.check | 1 + .../macro/run/macro-reify-ref-to-packageless.flags | 1 + .../macro-reify-ref-to-packageless/Impls_1.scala | 6 ++ .../macro-reify-ref-to-packageless/Test_2.scala | 4 + .../run/macro-reify-splice-outside-reify.check | 1 + .../run/macro-reify-splice-outside-reify.flags | 1 + .../Impls_Macros_1.scala | 13 +++ .../macro-reify-splice-outside-reify/Test_2.scala | 8 ++ .../disabled/macro/run/macro-reify-staticXXX.check | 12 +++ .../disabled/macro/run/macro-reify-staticXXX.flags | 1 + .../macro/run/macro-reify-staticXXX/Macros_1.scala | 48 +++++++++ .../macro/run/macro-reify-staticXXX/Test_2.scala | 4 + .../disabled/macro/run/macro-reify-tagful-a.check | 1 + .../disabled/macro/run/macro-reify-tagful-a.flags | 1 + .../macro/run/macro-reify-tagful-a/Macros_1.scala | 12 +++ .../macro/run/macro-reify-tagful-a/Test_2.scala | 4 + .../disabled/macro/run/macro-reify-tagless-a.check | 3 + .../disabled/macro/run/macro-reify-tagless-a.flags | 1 + .../run/macro-reify-tagless-a/Impls_Macros_1.scala | 11 ++ .../macro/run/macro-reify-tagless-a/Test_2.scala | 14 +++ tests/disabled/macro/run/macro-reify-type.check | 1 + tests/disabled/macro/run/macro-reify-type.flags | 1 + .../macro/run/macro-reify-type/Macros_1.scala | 28 +++++ .../macro/run/macro-reify-type/Test_2.scala | 21 ++++ .../run/macro-reify-typetag-notypeparams.check | 2 + .../macro-reify-typetag-notypeparams/Test.scala | 6 ++ .../run/macro-reify-typetag-typeparams-tags.check | 2 + .../macro-reify-typetag-typeparams-tags/Test.scala | 9 ++ tests/disabled/macro/run/macro-reify-unreify.check | 1 + tests/disabled/macro/run/macro-reify-unreify.flags | 1 + .../macro/run/macro-reify-unreify/Macros_1.scala | 20 ++++ .../macro/run/macro-reify-unreify/Test_2.scala | 3 + tests/disabled/macro/run/macro-repl-basic.check | 52 +++++++++ tests/disabled/macro/run/macro-repl-basic.scala | 39 +++++++ .../disabled/macro/run/macro-repl-dontexpand.check | 16 +++ .../disabled/macro/run/macro-repl-dontexpand.scala | 11 ++ tests/disabled/macro/run/macro-settings.check | 1 + tests/disabled/macro/run/macro-settings.flags | 1 + .../macro/run/macro-settings/Impls_Macros_1.scala | 14 +++ .../disabled/macro/run/macro-settings/Test_2.scala | 3 + tests/disabled/macro/run/macro-sip19-revised.check | 5 + tests/disabled/macro/run/macro-sip19-revised.flags | 1 + .../run/macro-sip19-revised/Impls_Macros_1.scala | 35 ++++++ .../macro/run/macro-sip19-revised/Test_2.scala | 12 +++ tests/disabled/macro/run/macro-sip19.check | 5 + tests/disabled/macro/run/macro-sip19.flags | 1 + .../macro/run/macro-sip19/Impls_Macros_1.scala | 26 +++++ tests/disabled/macro/run/macro-sip19/Test_2.scala | 16 +++ tests/disabled/macro/run/macro-subpatterns.check | 3 + .../macro/run/macro-subpatterns/Macro_1.scala | 17 +++ .../macro/run/macro-subpatterns/Test_2.scala | 5 + .../macro/run/macro-system-properties.check | 22 ++++ .../macro/run/macro-system-properties.scala | 16 +++ .../run/macro-term-declared-in-annotation.check | 1 + .../run/macro-term-declared-in-annotation.flags | 1 + .../Impls_1.scala | 11 ++ .../Macros_2.scala | 8 ++ .../macro-term-declared-in-annotation/Test_3.scala | 3 + .../run/macro-term-declared-in-anonymous.check | 2 + .../run/macro-term-declared-in-anonymous.flags | 1 + .../macro-term-declared-in-anonymous/Impls_1.scala | 11 ++ .../Macros_Test_2.scala | 6 ++ .../macro/run/macro-term-declared-in-block.check | 2 + .../macro/run/macro-term-declared-in-block.flags | 1 + .../run/macro-term-declared-in-block/Impls_1.scala | 11 ++ .../Macros_Test_2.scala | 6 ++ .../run/macro-term-declared-in-class-class.check | 2 + .../run/macro-term-declared-in-class-class.flags | 1 + .../Impls_1.scala | 11 ++ .../Macros_Test_2.scala | 10 ++ .../run/macro-term-declared-in-class-object.check | 2 + .../run/macro-term-declared-in-class-object.flags | 1 + .../Impls_1.scala | 11 ++ .../Macros_Test_2.scala | 10 ++ .../macro/run/macro-term-declared-in-class.check | 2 + .../macro/run/macro-term-declared-in-class.flags | 1 + .../run/macro-term-declared-in-class/Impls_1.scala | 11 ++ .../Macros_Test_2.scala | 7 ++ .../run/macro-term-declared-in-default-param.check | 5 + .../run/macro-term-declared-in-default-param.flags | 1 + .../Impls_1.scala | 11 ++ .../Macros_Test_2.scala | 7 ++ .../macro-term-declared-in-implicit-class.check | 2 + .../macro-term-declared-in-implicit-class.flags | 1 + .../Impls_Macros_1.scala | 19 ++++ .../Test_2.scala | 4 + .../macro/run/macro-term-declared-in-method.check | 2 + .../macro/run/macro-term-declared-in-method.flags | 1 + .../macro-term-declared-in-method/Impls_1.scala | 11 ++ .../Macros_Test_2.scala | 8 ++ .../run/macro-term-declared-in-object-class.check | 2 + .../run/macro-term-declared-in-object-class.flags | 1 + .../Impls_1.scala | 11 ++ .../Macros_Test_2.scala | 10 ++ .../run/macro-term-declared-in-object-object.check | 2 + .../run/macro-term-declared-in-object-object.flags | 1 + .../Impls_1.scala | 11 ++ .../Macros_Test_2.scala | 10 ++ .../macro/run/macro-term-declared-in-object.check | 2 + .../macro/run/macro-term-declared-in-object.flags | 1 + .../macro-term-declared-in-object/Impls_1.scala | 11 ++ .../Macros_Test_2.scala | 7 ++ .../macro-term-declared-in-package-object.check | 2 + .../macro-term-declared-in-package-object.flags | 1 + .../Impls_1.scala | 11 ++ .../Macros_Test_2.scala | 8 ++ .../run/macro-term-declared-in-refinement.check | 2 + .../run/macro-term-declared-in-refinement.flags | 1 + .../Impls_1.scala | 11 ++ .../Macros_Test_2.scala | 8 ++ .../macro/run/macro-term-declared-in-trait.check | 15 +++ .../macro/run/macro-term-declared-in-trait.flags | 1 + .../run/macro-term-declared-in-trait/Impls_1.scala | 11 ++ .../Macros_Test_2.scala | 13 +++ .../run/macro-typecheck-implicitsdisabled.check | 2 + .../run/macro-typecheck-implicitsdisabled.flags | 1 + .../Impls_Macros_1.scala | 28 +++++ .../macro-typecheck-implicitsdisabled/Test_2.scala | 4 + .../macro/run/macro-typecheck-macrosdisabled.check | 32 ++++++ .../macro/run/macro-typecheck-macrosdisabled.flags | 1 + .../Impls_Macros_1.scala | 31 ++++++ .../macro-typecheck-macrosdisabled/Test_2.scala | 4 + .../run/macro-typecheck-macrosdisabled2.check | 32 ++++++ .../run/macro-typecheck-macrosdisabled2.flags | 1 + .../Impls_Macros_1.scala | 31 ++++++ .../macro-typecheck-macrosdisabled2/Test_2.scala | 4 + .../macro/run/macro-undetparams-consfromsls.check | 5 + .../macro/run/macro-undetparams-consfromsls.flags | 1 + .../Impls_Macros_1.scala | 24 +++++ .../run/macro-undetparams-consfromsls/Test_2.scala | 7 ++ .../macro/run/macro-undetparams-macroitself.check | 2 + .../macro/run/macro-undetparams-macroitself.flags | 1 + .../Impls_Macros_1.scala | 11 ++ .../run/macro-undetparams-macroitself/Test_2.scala | 4 + .../macro/run/macro-vampire-false-warning.check | 2 + .../macro/run/macro-vampire-false-warning.flags | 1 + .../run/macro-vampire-false-warning/Macros_1.scala | 52 +++++++++ .../run/macro-vampire-false-warning/Test_2.scala | 6 ++ .../macro-whitebox-dynamic-materialization.check | 2 + .../Macros_1.scala | 25 +++++ .../Test_2.scala | 4 + .../macro/run/macro-whitebox-extractor.check | 1 + .../run/macro-whitebox-extractor/Macros_1.scala | 21 ++++ .../run/macro-whitebox-extractor/Test_2.scala | 5 + .../macro-whitebox-fundep-materialization.check | 1 + .../Macros_1.scala | 39 +++++++ .../Test_2.scala | 12 +++ .../macro/run/macro-whitebox-structural.check | 1 + .../macro-whitebox-structural/Impls_Macros_1.scala | 16 +++ .../run/macro-whitebox-structural/Test_2.scala | 5 + .../run/macroPlugins-isBlackbox/Macros_2.scala | 11 ++ .../run/macroPlugins-isBlackbox/Plugin_1.scala | 21 ++++ .../macro/run/macroPlugins-isBlackbox/Test_3.flags | 1 + .../macro/run/macroPlugins-isBlackbox/Test_3.scala | 3 + .../run/macroPlugins-isBlackbox/scalac-plugin.xml | 4 + .../macro/run/macroPlugins-macroArgs.check | 2 + .../run/macroPlugins-macroArgs/Macros_2.scala | 11 ++ .../run/macroPlugins-macroArgs/Plugin_1.scala | 21 ++++ .../macro/run/macroPlugins-macroArgs/Test_3.flags | 1 + .../macro/run/macroPlugins-macroArgs/Test_3.scala | 4 + .../run/macroPlugins-macroArgs/scalac-plugin.xml | 4 + .../macro/run/macroPlugins-macroExpand.check | 2 + .../macro/run/macroPlugins-macroExpand.flags | 1 + .../run/macroPlugins-macroExpand/Macros_2.scala | 18 ++++ .../run/macroPlugins-macroExpand/Plugin_1.scala | 27 +++++ .../run/macroPlugins-macroExpand/Test_3.flags | 1 + .../run/macroPlugins-macroExpand/Test_3.scala | 4 + .../run/macroPlugins-macroExpand/scalac-plugin.xml | 4 + .../macro/run/macroPlugins-macroRuntime.check | 2 + .../run/macroPlugins-macroRuntime/Macros_2.scala | 11 ++ .../run/macroPlugins-macroRuntime/Plugin_1.scala | 20 ++++ .../run/macroPlugins-macroRuntime/Test_3.flags | 1 + .../run/macroPlugins-macroRuntime/Test_3.scala | 4 + .../macroPlugins-macroRuntime/scalac-plugin.xml | 4 + .../macro/run/macroPlugins-namerHooks.check | 45 ++++++++ .../macro/run/macroPlugins-namerHooks.scala | 39 +++++++ .../macro/run/macroPlugins-typedMacroBody.check | 2 + .../macro/run/macroPlugins-typedMacroBody.flags | 1 + .../run/macroPlugins-typedMacroBody/Macros_2.flags | 1 + .../run/macroPlugins-typedMacroBody/Macros_2.scala | 18 ++++ .../run/macroPlugins-typedMacroBody/Plugin_1.scala | 21 ++++ .../run/macroPlugins-typedMacroBody/Test_3.scala | 4 + .../macroPlugins-typedMacroBody/scalac-plugin.xml | 4 + .../macro/run/reflection-magicsymbols-invoke.check | 119 +++++++++++++++++++++ .../macro/run/reflection-magicsymbols-invoke.scala | 100 +++++++++++++++++ .../disabled/macro/run/reify-each-node-type.check | 35 ++++++ .../disabled/macro/run/reify-each-node-type.scala | 110 +++++++++++++++++++ .../macro/run/reify-repl-fail-gracefully.check | 17 +++ .../macro/run/reify-repl-fail-gracefully.scala | 10 ++ tests/disabled/macro/run/reify-staticXXX.check | 24 +++++ tests/disabled/macro/run/reify-staticXXX.scala | 56 ++++++++++ tests/disabled/macro/run/reify_ann1a.check | 30 ++++++ tests/disabled/macro/run/reify_ann1a.scala | 28 +++++ tests/disabled/macro/run/reify_ann1b.check | 35 ++++++ tests/disabled/macro/run/reify_ann1b.scala | 28 +++++ tests/disabled/macro/run/reify_ann2a.check | 44 ++++++++ tests/disabled/macro/run/reify_ann2a.scala | 28 +++++ tests/disabled/macro/run/reify_ann3.check | 21 ++++ tests/disabled/macro/run/reify_ann3.scala | 22 ++++ tests/disabled/macro/run/reify_ann4.check | 32 ++++++ tests/disabled/macro/run/reify_ann4.scala | 26 +++++ tests/disabled/macro/run/reify_ann5.check | 22 ++++ tests/disabled/macro/run/reify_ann5.scala | 23 ++++ tests/disabled/macro/run/reify_anonymous.check | 1 + tests/disabled/macro/run/reify_anonymous.scala | 8 ++ .../disabled/macro/run/reify_classfileann_a.check | 23 ++++ .../disabled/macro/run/reify_classfileann_a.scala | 22 ++++ .../disabled/macro/run/reify_classfileann_b.check | 25 +++++ .../disabled/macro/run/reify_classfileann_b.scala | 26 +++++ tests/disabled/macro/run/reify_closure1.check | 2 + tests/disabled/macro/run/reify_closure1.scala | 19 ++++ tests/disabled/macro/run/reify_closure2a.check | 2 + tests/disabled/macro/run/reify_closure2a.scala | 19 ++++ tests/disabled/macro/run/reify_closure3a.check | 2 + tests/disabled/macro/run/reify_closure3a.scala | 21 ++++ tests/disabled/macro/run/reify_closure4a.check | 2 + tests/disabled/macro/run/reify_closure4a.scala | 21 ++++ tests/disabled/macro/run/reify_closure5a.check | 2 + tests/disabled/macro/run/reify_closure5a.scala | 21 ++++ tests/disabled/macro/run/reify_closure6.check | 7 ++ tests/disabled/macro/run/reify_closure6.scala | 29 +++++ tests/disabled/macro/run/reify_closure7.check | 6 ++ tests/disabled/macro/run/reify_closure7.scala | 33 ++++++ tests/disabled/macro/run/reify_closure8a.check | 1 + tests/disabled/macro/run/reify_closure8a.scala | 15 +++ tests/disabled/macro/run/reify_closure8b.check | 3 + tests/disabled/macro/run/reify_closure8b.scala | 21 ++++ tests/disabled/macro/run/reify_closures10.check | 2 + tests/disabled/macro/run/reify_closures10.scala | 13 +++ tests/disabled/macro/run/reify_complex.check | 1 + tests/disabled/macro/run/reify_complex.scala | 25 +++++ tests/disabled/macro/run/reify_copypaste1.check | 2 + tests/disabled/macro/run/reify_copypaste1.scala | 19 ++++ tests/disabled/macro/run/reify_copypaste2.check | 1 + tests/disabled/macro/run/reify_copypaste2.scala | 10 ++ tests/disabled/macro/run/reify_csv.check | 10 ++ tests/disabled/macro/run/reify_csv.scala | 36 +++++++ .../disabled/macro/run/reify_extendbuiltins.check | 1 + .../disabled/macro/run/reify_extendbuiltins.scala | 17 +++ tests/disabled/macro/run/reify_for1.scala | 10 ++ .../disabled/macro/run/reify_fors_newpatmat.check | 5 + .../disabled/macro/run/reify_fors_newpatmat.scala | 101 +++++++++++++++++ .../disabled/macro/run/reify_fors_oldpatmat.check | 5 + .../disabled/macro/run/reify_fors_oldpatmat.scala | 101 +++++++++++++++++ tests/disabled/macro/run/reify_generic.check | 1 + tests/disabled/macro/run/reify_generic.scala | 9 ++ tests/disabled/macro/run/reify_generic2.check | 1 + tests/disabled/macro/run/reify_generic2.scala | 10 ++ tests/disabled/macro/run/reify_getter.check | 1 + tests/disabled/macro/run/reify_getter.scala | 18 ++++ tests/disabled/macro/run/reify_implicits-new.check | 1 + tests/disabled/macro/run/reify_implicits-new.scala | 18 ++++ tests/disabled/macro/run/reify_implicits-old.check | 1 + tests/disabled/macro/run/reify_implicits-old.scala | 17 +++ tests/disabled/macro/run/reify_inheritance.check | 1 + tests/disabled/macro/run/reify_inheritance.scala | 17 +++ tests/disabled/macro/run/reify_inner1.check | 1 + tests/disabled/macro/run/reify_inner1.scala | 16 +++ tests/disabled/macro/run/reify_inner2.check | 1 + tests/disabled/macro/run/reify_inner2.scala | 16 +++ tests/disabled/macro/run/reify_inner3.check | 1 + tests/disabled/macro/run/reify_inner3.scala | 16 +++ tests/disabled/macro/run/reify_inner4.check | 1 + tests/disabled/macro/run/reify_inner4.scala | 16 +++ .../disabled/macro/run/reify_lazyevaluation.check | 8 ++ .../disabled/macro/run/reify_lazyevaluation.scala | 61 +++++++++++ tests/disabled/macro/run/reify_lazyunit.check | 6 ++ tests/disabled/macro/run/reify_lazyunit.scala | 13 +++ .../disabled/macro/run/reify_maps_newpatmat.check | 4 + .../disabled/macro/run/reify_maps_newpatmat.scala | 20 ++++ .../disabled/macro/run/reify_maps_oldpatmat.check | 4 + .../disabled/macro/run/reify_maps_oldpatmat.scala | 20 ++++ .../reify_metalevel_breach_+0_refers_to_1.check | 1 + .../reify_metalevel_breach_+0_refers_to_1.scala | 18 ++++ .../reify_metalevel_breach_-1_refers_to_0_a.check | 1 + .../reify_metalevel_breach_-1_refers_to_0_a.scala | 16 +++ .../reify_metalevel_breach_-1_refers_to_0_b.check | 1 + .../reify_metalevel_breach_-1_refers_to_0_b.scala | 21 ++++ .../reify_metalevel_breach_-1_refers_to_1.check | 1 + .../reify_metalevel_breach_-1_refers_to_1.scala | 18 ++++ .../run/reify_nested_inner_refers_to_global.check | 1 + .../run/reify_nested_inner_refers_to_global.scala | 17 +++ .../run/reify_nested_inner_refers_to_local.check | 1 + .../run/reify_nested_inner_refers_to_local.scala | 17 +++ .../run/reify_nested_outer_refers_to_global.check | 1 + .../run/reify_nested_outer_refers_to_global.scala | 19 ++++ .../run/reify_nested_outer_refers_to_local.check | 1 + .../run/reify_nested_outer_refers_to_local.scala | 19 ++++ tests/disabled/macro/run/reify_newimpl_01.check | 1 + tests/disabled/macro/run/reify_newimpl_01.scala | 13 +++ tests/disabled/macro/run/reify_newimpl_02.check | 1 + tests/disabled/macro/run/reify_newimpl_02.scala | 13 +++ tests/disabled/macro/run/reify_newimpl_03.check | 1 + tests/disabled/macro/run/reify_newimpl_03.scala | 13 +++ tests/disabled/macro/run/reify_newimpl_04.check | 1 + tests/disabled/macro/run/reify_newimpl_04.scala | 13 +++ tests/disabled/macro/run/reify_newimpl_05.check | 1 + tests/disabled/macro/run/reify_newimpl_05.scala | 14 +++ tests/disabled/macro/run/reify_newimpl_06.check | 1 + tests/disabled/macro/run/reify_newimpl_06.scala | 13 +++ tests/disabled/macro/run/reify_newimpl_11.check | 4 + tests/disabled/macro/run/reify_newimpl_11.scala | 19 ++++ tests/disabled/macro/run/reify_newimpl_12.check | 1 + tests/disabled/macro/run/reify_newimpl_12.scala | 14 +++ tests/disabled/macro/run/reify_newimpl_13.check | 4 + tests/disabled/macro/run/reify_newimpl_13.scala | 21 ++++ tests/disabled/macro/run/reify_newimpl_14.check | 1 + tests/disabled/macro/run/reify_newimpl_14.scala | 16 +++ tests/disabled/macro/run/reify_newimpl_15.check | 1 + tests/disabled/macro/run/reify_newimpl_15.scala | 15 +++ tests/disabled/macro/run/reify_newimpl_18.check | 1 + tests/disabled/macro/run/reify_newimpl_18.scala | 15 +++ tests/disabled/macro/run/reify_newimpl_19.check | 4 + tests/disabled/macro/run/reify_newimpl_19.scala | 20 ++++ tests/disabled/macro/run/reify_newimpl_20.check | 1 + tests/disabled/macro/run/reify_newimpl_20.scala | 16 +++ tests/disabled/macro/run/reify_newimpl_21.check | 1 + tests/disabled/macro/run/reify_newimpl_21.scala | 20 ++++ tests/disabled/macro/run/reify_newimpl_22.check | 25 +++++ tests/disabled/macro/run/reify_newimpl_22.scala | 17 +++ tests/disabled/macro/run/reify_newimpl_23.check | 24 +++++ tests/disabled/macro/run/reify_newimpl_23.scala | 16 +++ tests/disabled/macro/run/reify_newimpl_27.check | 1 + tests/disabled/macro/run/reify_newimpl_27.scala | 15 +++ tests/disabled/macro/run/reify_newimpl_29.check | 1 + tests/disabled/macro/run/reify_newimpl_29.scala | 15 +++ tests/disabled/macro/run/reify_newimpl_30.check | 4 + tests/disabled/macro/run/reify_newimpl_30.scala | 18 ++++ tests/disabled/macro/run/reify_newimpl_31.check | 1 + tests/disabled/macro/run/reify_newimpl_31.scala | 15 +++ tests/disabled/macro/run/reify_newimpl_33.check | 1 + tests/disabled/macro/run/reify_newimpl_33.scala | 16 +++ tests/disabled/macro/run/reify_newimpl_35.check | 13 +++ tests/disabled/macro/run/reify_newimpl_35.scala | 10 ++ tests/disabled/macro/run/reify_newimpl_36.check | 1 + tests/disabled/macro/run/reify_newimpl_36.scala | 15 +++ tests/disabled/macro/run/reify_newimpl_37.check | 1 + tests/disabled/macro/run/reify_newimpl_37.scala | 16 +++ tests/disabled/macro/run/reify_newimpl_38.check | 1 + tests/disabled/macro/run/reify_newimpl_38.scala | 15 +++ tests/disabled/macro/run/reify_newimpl_39.check | 1 + tests/disabled/macro/run/reify_newimpl_39.scala | 16 +++ tests/disabled/macro/run/reify_newimpl_40.check | 1 + tests/disabled/macro/run/reify_newimpl_40.scala | 16 +++ tests/disabled/macro/run/reify_newimpl_41.check | 3 + tests/disabled/macro/run/reify_newimpl_41.scala | 18 ++++ tests/disabled/macro/run/reify_newimpl_42.check | 3 + tests/disabled/macro/run/reify_newimpl_42.scala | 17 +++ tests/disabled/macro/run/reify_newimpl_43.check | 2 + tests/disabled/macro/run/reify_newimpl_43.scala | 16 +++ tests/disabled/macro/run/reify_newimpl_44.check | 2 + tests/disabled/macro/run/reify_newimpl_44.scala | 16 +++ tests/disabled/macro/run/reify_newimpl_45.check | 2 + tests/disabled/macro/run/reify_newimpl_45.scala | 16 +++ tests/disabled/macro/run/reify_newimpl_47.check | 1 + tests/disabled/macro/run/reify_newimpl_47.scala | 17 +++ tests/disabled/macro/run/reify_newimpl_48.check | 1 + tests/disabled/macro/run/reify_newimpl_48.scala | 22 ++++ tests/disabled/macro/run/reify_newimpl_49.check | 3 + tests/disabled/macro/run/reify_newimpl_49.scala | 16 +++ tests/disabled/macro/run/reify_newimpl_50.check | 3 + tests/disabled/macro/run/reify_newimpl_50.scala | 15 +++ tests/disabled/macro/run/reify_newimpl_51.check | 3 + tests/disabled/macro/run/reify_newimpl_51.scala | 18 ++++ tests/disabled/macro/run/reify_newimpl_52.check | 3 + tests/disabled/macro/run/reify_newimpl_52.scala | 18 ++++ tests/disabled/macro/run/reify_printf.check | 1 + tests/disabled/macro/run/reify_printf.scala | 71 ++++++++++++ tests/disabled/macro/run/reify_properties.check | 2 + tests/disabled/macro/run/reify_properties.scala | 57 ++++++++++ .../macro/run/reify_renamed_term_basic.check | 1 + .../macro/run/reify_renamed_term_basic.scala | 20 ++++ .../run/reify_renamed_term_local_to_reifee.check | 1 + .../run/reify_renamed_term_local_to_reifee.scala | 20 ++++ .../run/reify_renamed_term_overloaded_method.check | 1 + .../run/reify_renamed_term_overloaded_method.scala | 17 +++ .../macro/run/reify_renamed_term_t5841.check | 1 + .../macro/run/reify_renamed_term_t5841.scala | 7 ++ .../macro/run/reify_renamed_type_basic.check | 1 + .../macro/run/reify_renamed_type_basic.scala | 16 +++ .../run/reify_renamed_type_local_to_reifee.check | 1 + .../run/reify_renamed_type_local_to_reifee.scala | 24 +++++ .../macro/run/reify_renamed_type_spliceable.check | 1 + .../macro/run/reify_renamed_type_spliceable.scala | 21 ++++ tests/disabled/macro/run/reify_sort.check | 2 + tests/disabled/macro/run/reify_sort.scala | 51 +++++++++ tests/disabled/macro/run/reify_sort1.check | 2 + tests/disabled/macro/run/reify_sort1.scala | 21 ++++ tests/disabled/macro/run/reify_this.check | 5 + tests/disabled/macro/run/reify_this.scala | 20 ++++ tests/disabled/macro/run/reify_timeofday.check | 1 + tests/disabled/macro/run/reify_timeofday.scala | 42 ++++++++ tests/disabled/macro/run/reify_typerefs_1a.check | 1 + tests/disabled/macro/run/reify_typerefs_1a.scala | 18 ++++ tests/disabled/macro/run/reify_typerefs_1b.check | 1 + tests/disabled/macro/run/reify_typerefs_1b.scala | 18 ++++ tests/disabled/macro/run/reify_typerefs_2a.check | 1 + tests/disabled/macro/run/reify_typerefs_2a.scala | 20 ++++ tests/disabled/macro/run/reify_typerefs_2b.check | 1 + tests/disabled/macro/run/reify_typerefs_2b.scala | 20 ++++ tests/disabled/macro/run/reify_typerefs_3a.check | 1 + tests/disabled/macro/run/reify_typerefs_3a.scala | 20 ++++ tests/disabled/macro/run/reify_typerefs_3b.check | 1 + tests/disabled/macro/run/reify_typerefs_3b.scala | 20 ++++ tests/disabled/macro/run/reify_varargs.check | 1 + tests/disabled/macro/run/reify_varargs.scala | 11 ++ tests/disabled/macro/run/repl-term-macros.check | 40 +++++++ tests/disabled/macro/run/repl-term-macros.scala | 20 ++++ tests/disabled/macro/run/runtimeEval1.check | 1 + tests/disabled/macro/run/runtimeEval1.scala | 9 ++ tests/disabled/macro/run/runtimeEval2.check | 1 + tests/disabled/macro/run/runtimeEval2.scala | 11 ++ tests/disabled/macro/run/showdecl.check | 34 ++++++ tests/disabled/macro/run/showdecl/Macros_1.scala | 30 ++++++ tests/disabled/macro/run/showdecl/Test_2.scala | 32 ++++++ tests/disabled/macro/run/showraw_mods.check | 1 + tests/disabled/macro/run/showraw_mods.scala | 6 ++ tests/disabled/macro/run/showraw_tree.check | 2 + tests/disabled/macro/run/showraw_tree.scala | 8 ++ tests/disabled/macro/run/showraw_tree_ids.check | 2 + tests/disabled/macro/run/showraw_tree_ids.scala | 9 ++ tests/disabled/macro/run/showraw_tree_kinds.check | 2 + tests/disabled/macro/run/showraw_tree_kinds.scala | 8 ++ .../macro/run/showraw_tree_types_ids.check | 12 +++ .../macro/run/showraw_tree_types_ids.scala | 11 ++ .../macro/run/showraw_tree_types_typed.check | 12 +++ .../macro/run/showraw_tree_types_typed.scala | 10 ++ .../macro/run/showraw_tree_types_untyped.check | 2 + .../macro/run/showraw_tree_types_untyped.scala | 8 ++ .../disabled/macro/run/showraw_tree_ultimate.check | 12 +++ .../disabled/macro/run/showraw_tree_ultimate.scala | 11 ++ tests/disabled/macro/run/t2886.check | 5 + tests/disabled/macro/run/t2886.scala | 9 ++ tests/disabled/macro/run/t5224.check | 14 +++ tests/disabled/macro/run/t5224.scala | 8 ++ tests/disabled/macro/run/t5225_1.check | 4 + tests/disabled/macro/run/t5225_1.scala | 6 ++ tests/disabled/macro/run/t5225_2.check | 4 + tests/disabled/macro/run/t5225_2.scala | 6 ++ tests/disabled/macro/run/t5229_1.scala | 8 ++ tests/disabled/macro/run/t5229_2.check | 2 + tests/disabled/macro/run/t5229_2.scala | 18 ++++ tests/disabled/macro/run/t5230.check | 2 + tests/disabled/macro/run/t5230.scala | 18 ++++ tests/disabled/macro/run/t5258a.check | 1 + tests/disabled/macro/run/t5258a.scala | 8 ++ tests/disabled/macro/run/t5266_1.check | 2 + tests/disabled/macro/run/t5266_1.scala | 15 +++ tests/disabled/macro/run/t5266_2.check | 2 + tests/disabled/macro/run/t5266_2.scala | 16 +++ tests/disabled/macro/run/t5269.check | 1 + tests/disabled/macro/run/t5269.scala | 16 +++ tests/disabled/macro/run/t5270.check | 1 + tests/disabled/macro/run/t5270.scala | 20 ++++ tests/disabled/macro/run/t5271_1.check | 12 +++ tests/disabled/macro/run/t5271_1.scala | 15 +++ tests/disabled/macro/run/t5271_2.check | 14 +++ tests/disabled/macro/run/t5271_2.scala | 17 +++ tests/disabled/macro/run/t5271_3.check | 21 ++++ tests/disabled/macro/run/t5271_3.scala | 18 ++++ tests/disabled/macro/run/t5271_4.scala | 8 ++ tests/disabled/macro/run/t5272_1_newpatmat.check | 1 + tests/disabled/macro/run/t5272_1_newpatmat.scala | 11 ++ tests/disabled/macro/run/t5272_1_oldpatmat.check | 1 + tests/disabled/macro/run/t5272_1_oldpatmat.scala | 11 ++ tests/disabled/macro/run/t5272_2_newpatmat.check | 1 + tests/disabled/macro/run/t5272_2_newpatmat.scala | 10 ++ tests/disabled/macro/run/t5272_2_oldpatmat.check | 1 + tests/disabled/macro/run/t5272_2_oldpatmat.scala | 10 ++ tests/disabled/macro/run/t5273_1_newpatmat.check | 1 + tests/disabled/macro/run/t5273_1_newpatmat.scala | 11 ++ tests/disabled/macro/run/t5273_1_oldpatmat.check | 1 + tests/disabled/macro/run/t5273_1_oldpatmat.scala | 11 ++ tests/disabled/macro/run/t5273_2a_newpatmat.check | 1 + tests/disabled/macro/run/t5273_2a_newpatmat.scala | 9 ++ tests/disabled/macro/run/t5273_2a_oldpatmat.check | 1 + tests/disabled/macro/run/t5273_2a_oldpatmat.scala | 9 ++ tests/disabled/macro/run/t5273_2b_newpatmat.check | 1 + tests/disabled/macro/run/t5273_2b_newpatmat.scala | 10 ++ tests/disabled/macro/run/t5273_2b_oldpatmat.check | 1 + tests/disabled/macro/run/t5273_2b_oldpatmat.scala | 10 ++ tests/disabled/macro/run/t5274_1.check | 3 + tests/disabled/macro/run/t5274_1.scala | 14 +++ tests/disabled/macro/run/t5274_2.check | 2 + tests/disabled/macro/run/t5274_2.scala | 51 +++++++++ tests/disabled/macro/run/t5275.check | 1 + tests/disabled/macro/run/t5275.scala | 9 ++ tests/disabled/macro/run/t5276_1a.check | 1 + tests/disabled/macro/run/t5276_1a.scala | 9 ++ tests/disabled/macro/run/t5276_1b.check | 1 + tests/disabled/macro/run/t5276_1b.scala | 9 ++ tests/disabled/macro/run/t5276_2a.check | 1 + tests/disabled/macro/run/t5276_2a.scala | 12 +++ tests/disabled/macro/run/t5276_2b.check | 1 + tests/disabled/macro/run/t5276_2b.scala | 13 +++ tests/disabled/macro/run/t5277_1.check | 1 + tests/disabled/macro/run/t5277_1.scala | 16 +++ tests/disabled/macro/run/t5277_2.check | 2 + tests/disabled/macro/run/t5277_2.scala | 12 +++ tests/disabled/macro/run/t5279.check | 1 + tests/disabled/macro/run/t5279.scala | 8 ++ tests/disabled/macro/run/t5334_1.check | 1 + tests/disabled/macro/run/t5334_1.scala | 15 +++ tests/disabled/macro/run/t5334_2.check | 1 + tests/disabled/macro/run/t5334_2.scala | 15 +++ tests/disabled/macro/run/t5335.check | 1 + tests/disabled/macro/run/t5335.scala | 8 ++ tests/disabled/macro/run/t5415.scala | 12 +++ tests/disabled/macro/run/t5418.scala | 8 ++ tests/disabled/macro/run/t5418a.check | 1 + tests/disabled/macro/run/t5418a.scala | 3 + tests/disabled/macro/run/t5418b.check | 2 + tests/disabled/macro/run/t5418b.scala | 11 ++ tests/disabled/macro/run/t5419.check | 1 + tests/disabled/macro/run/t5419.scala | 8 ++ tests/disabled/macro/run/t5704.check | 1 + tests/disabled/macro/run/t5704.flags | 1 + tests/disabled/macro/run/t5704.scala | 19 ++++ tests/disabled/macro/run/t5710-1.check | 1 + tests/disabled/macro/run/t5710-1.scala | 15 +++ tests/disabled/macro/run/t5710-2.check | 1 + tests/disabled/macro/run/t5710-2.scala | 15 +++ tests/disabled/macro/run/t5713.check | 1 + tests/disabled/macro/run/t5713.flags | 1 + .../disabled/macro/run/t5713/Impls_Macros_1.scala | 28 +++++ tests/disabled/macro/run/t5713/Test_2.scala | 5 + tests/disabled/macro/run/t5753_1.check | 1 + tests/disabled/macro/run/t5753_1.flags | 1 + .../macro/run/t5753_1/Impls_Macros_1.scala | 10 ++ tests/disabled/macro/run/t5753_1/Test_2.scala | 4 + tests/disabled/macro/run/t5753_2.check | 1 + tests/disabled/macro/run/t5753_2.flags | 1 + .../macro/run/t5753_2/Impls_Macros_1.scala | 10 ++ tests/disabled/macro/run/t5753_2/Test_2.scala | 4 + tests/disabled/macro/run/t5770.check | 10 ++ tests/disabled/macro/run/t5770.scala | 25 +++++ tests/disabled/macro/run/t5816.check | 1 + tests/disabled/macro/run/t5816.scala | 17 +++ tests/disabled/macro/run/t5824.check | 1 + tests/disabled/macro/run/t5824.scala | 8 ++ tests/disabled/macro/run/t5840.scala | 7 ++ tests/disabled/macro/run/t5894.scala | 18 ++++ tests/disabled/macro/run/t5903a.check | 1 + tests/disabled/macro/run/t5903a.flags | 1 + tests/disabled/macro/run/t5903a/Macros_1.scala | 28 +++++ tests/disabled/macro/run/t5903a/Test_2.scala | 6 ++ tests/disabled/macro/run/t5903b.check | 1 + tests/disabled/macro/run/t5903b.flags | 1 + tests/disabled/macro/run/t5903b/Macros_1.scala | 25 +++++ tests/disabled/macro/run/t5903b/Test_2.scala | 6 ++ tests/disabled/macro/run/t5903c.check | 1 + tests/disabled/macro/run/t5903c.flags | 1 + tests/disabled/macro/run/t5903c/Macros_1.scala | 23 ++++ tests/disabled/macro/run/t5903c/Test_2.scala | 6 ++ tests/disabled/macro/run/t5903d.check | 1 + tests/disabled/macro/run/t5903d.flags | 1 + tests/disabled/macro/run/t5903d/Macros_1.scala | 25 +++++ tests/disabled/macro/run/t5903d/Test_2.scala | 6 ++ tests/disabled/macro/run/t5923a.check | 3 + tests/disabled/macro/run/t5923a/Macros_1.scala | 53 +++++++++ tests/disabled/macro/run/t5923a/Test_2.scala | 5 + tests/disabled/macro/run/t5923d/Macros_1.scala | 9 ++ tests/disabled/macro/run/t5923d/Test_2.scala | 7 ++ tests/disabled/macro/run/t5940.scala | 41 +++++++ tests/disabled/macro/run/t6023.check | 12 +++ tests/disabled/macro/run/t6023.scala | 17 +++ tests/disabled/macro/run/t6187.check | 32 ++++++ tests/disabled/macro/run/t6187.scala | 18 ++++ tests/disabled/macro/run/t6187b.scala | 5 + tests/disabled/macro/run/t6221.check | 1 + tests/disabled/macro/run/t6221/Macros_1.scala | 23 ++++ tests/disabled/macro/run/t6221/Test_2.scala | 10 ++ tests/disabled/macro/run/t6379.check | 14 +++ tests/disabled/macro/run/t6379/Macros_1.scala | 26 +++++ tests/disabled/macro/run/t6379/Test_2.scala | 22 ++++ tests/disabled/macro/run/t6381.check | 19 ++++ tests/disabled/macro/run/t6381.scala | 15 +++ tests/disabled/macro/run/t6394a.check | 1 + tests/disabled/macro/run/t6394a.flags | 1 + tests/disabled/macro/run/t6394a/Macros_1.scala | 12 +++ tests/disabled/macro/run/t6394a/Test_2.scala | 4 + tests/disabled/macro/run/t6394b.check | 1 + tests/disabled/macro/run/t6394b.flags | 1 + tests/disabled/macro/run/t6394b/Macros_1.scala | 12 +++ tests/disabled/macro/run/t6394b/Test_2.scala | 4 + tests/disabled/macro/run/t6591_1.check | 1 + tests/disabled/macro/run/t6591_1.scala | 19 ++++ tests/disabled/macro/run/t6591_2.check | 1 + tests/disabled/macro/run/t6591_2.scala | 19 ++++ tests/disabled/macro/run/t6591_3.check | 1 + tests/disabled/macro/run/t6591_3.scala | 17 +++ tests/disabled/macro/run/t6591_5.check | 1 + tests/disabled/macro/run/t6591_5.scala | 23 ++++ tests/disabled/macro/run/t6591_6.check | 1 + tests/disabled/macro/run/t6591_6.scala | 24 +++++ tests/disabled/macro/run/t6591_7.check | 4 + tests/disabled/macro/run/t6591_7.scala | 27 +++++ tests/disabled/macro/run/t6662.check | 1 + tests/disabled/macro/run/t6662/Macro_1.scala | 8 ++ tests/disabled/macro/run/t6662/Test_2.scala | 8 ++ tests/disabled/macro/run/t6814.check | 7 ++ tests/disabled/macro/run/t6814/Macros_1.scala | 24 +++++ tests/disabled/macro/run/t6814/Test_2.scala | 3 + tests/disabled/macro/run/t6992.check | 4 + tests/disabled/macro/run/t6992/Macros_1.scala | 75 +++++++++++++ tests/disabled/macro/run/t6992/Test_2.scala | 14 +++ tests/disabled/macro/run/t7008-scala-defined.check | 7 ++ tests/disabled/macro/run/t7008-scala-defined.flags | 1 + .../run/t7008-scala-defined/Impls_Macros_2.scala | 13 +++ .../ScalaClassWithCheckedExceptions_1.scala | 6 ++ .../macro/run/t7008-scala-defined/Test_3.scala | 9 ++ tests/disabled/macro/run/t7008.check | 9 ++ .../disabled/macro/run/t7008/Impls_Macros_2.scala | 13 +++ .../t7008/JavaClassWithCheckedExceptions_1.java | 7 ++ tests/disabled/macro/run/t7008/Test_3.scala | 9 ++ tests/disabled/macro/run/t7044.check | 14 +++ tests/disabled/macro/run/t7044/Macros_1.scala | 26 +++++ tests/disabled/macro/run/t7044/Test_2.scala | 19 ++++ tests/disabled/macro/run/t7047.check | 3 + .../disabled/macro/run/t7047/Impls_Macros_1.scala | 19 ++++ tests/disabled/macro/run/t7047/Test_2.scala | 3 + tests/disabled/macro/run/t7157.check | 1 + .../disabled/macro/run/t7157/Impls_Macros_1.scala | 15 +++ tests/disabled/macro/run/t7157/Test_2.scala | 5 + tests/disabled/macro/run/t7185.check | 32 ++++++ tests/disabled/macro/run/t7185.scala | 12 +++ tests/disabled/macro/run/t7235.check | 4 + tests/disabled/macro/run/t7235.scala | 14 +++ tests/disabled/macro/run/t7240/Macros_1.scala | 48 +++++++++ tests/disabled/macro/run/t7240/Test_2.scala | 3 + tests/disabled/macro/run/t7375b.check | 4 + tests/disabled/macro/run/t7375b/Macros_1.scala | 18 ++++ tests/disabled/macro/run/t7375b/Test_2.scala | 3 + tests/disabled/macro/run/t7558.scala | 9 ++ tests/disabled/macro/run/t7617a.check | 2 + tests/disabled/macro/run/t7617a/Macros_1.scala | 22 ++++ tests/disabled/macro/run/t7617a/Test_2.scala | 5 + tests/disabled/macro/run/t7617b.check | 1 + tests/disabled/macro/run/t7617b/Macros_1.scala | 8 ++ tests/disabled/macro/run/t7617b/Test_2.scala | 11 ++ tests/disabled/macro/run/t7657.check | 3 + tests/disabled/macro/run/t7657/Macros_1.scala | 8 ++ tests/disabled/macro/run/t7657/Test_2.scala | 6 ++ tests/disabled/macro/run/t7777.check | 7 ++ tests/disabled/macro/run/t7777/Macros_1.scala | 17 +++ tests/disabled/macro/run/t7777/Test_2.scala | 6 ++ tests/disabled/macro/run/t7868b.check | 6 ++ tests/disabled/macro/run/t7868b.scala | 11 ++ tests/disabled/macro/run/t7871.check | 1 + tests/disabled/macro/run/t7871/Macros_1.scala | 27 +++++ tests/disabled/macro/run/t7871/Test_2.scala | 6 ++ tests/disabled/macro/run/t8048a.check | 1 + tests/disabled/macro/run/t8048a/Macros_1.scala | 11 ++ tests/disabled/macro/run/t8048a/Test_2.scala | 4 + tests/disabled/macro/run/t8048b.check | 3 + tests/disabled/macro/run/t8048b/Macros_1.scala | 37 +++++++ tests/disabled/macro/run/t8048b/Test_2.scala | 5 + tests/disabled/macro/run/t8104.check | 2 + tests/disabled/macro/run/t8104/Macros_1.scala | 11 ++ tests/disabled/macro/run/t8104/Test_2.scala | 19 ++++ tests/disabled/macro/run/t8192.check | 32 ++++++ tests/disabled/macro/run/t8192/Macros_1.scala | 45 ++++++++ tests/disabled/macro/run/t8192/Test_2.scala | 40 +++++++ tests/disabled/macro/run/t8321.check | 1 + tests/disabled/macro/run/t8321/Macros_1.scala | 11 ++ tests/disabled/macro/run/t8321/Test_2.scala | 3 + tests/disabled/macro/run/t8425.check | 1 + tests/disabled/macro/run/t8425/Macros_1.scala | 12 +++ tests/disabled/macro/run/t8425/Test_2.scala | 3 + tests/disabled/macro/run/t8437.check | 2 + tests/disabled/macro/run/t8437/Macros_1.scala | 18 ++++ tests/disabled/macro/run/t8437/Test_2.scala | 4 + .../macro/run/toolbox_console_reporter.check | 8 ++ .../macro/run/toolbox_console_reporter.scala | 28 +++++ .../macro/run/toolbox_current_run_compiles.check | 2 + .../macro/run/toolbox_current_run_compiles.scala | 28 +++++ .../run/toolbox_default_reporter_is_silent.check | 1 + .../run/toolbox_default_reporter_is_silent.scala | 16 +++ .../macro/run/toolbox_silent_reporter.check | 4 + .../macro/run/toolbox_silent_reporter.scala | 19 ++++ .../run/toolbox_typecheck_macrosdisabled.check | 41 +++++++ .../run/toolbox_typecheck_macrosdisabled.scala | 26 +++++ .../run/toolbox_typecheck_macrosdisabled2.check | 41 +++++++ .../run/toolbox_typecheck_macrosdisabled2.scala | 26 +++++ tests/disabled/macro/run/typecheck.check | 0 tests/disabled/macro/run/typecheck/Macros_1.scala | 12 +++ tests/disabled/macro/run/typecheck/Test_2.scala | 10 ++ tests/disabled/macro/run/typed-annotated.check | 1 + .../macro/run/typed-annotated/Macros_1.scala | 17 +++ .../macro/run/typed-annotated/Test_2.scala | 3 + .../attachments-typed-another-ident/Impls_1.scala | 18 ---- .../Macros_Test_2.scala | 5 - .../pos/attachments-typed-ident/Impls_1.scala | 18 ---- .../attachments-typed-ident/Macros_Test_2.scala | 4 - tests/pending/pos/liftcode_polymorphic.scala | 12 --- .../pos/macro-bundle-disambiguate-bundle.check | 0 .../pos/macro-bundle-disambiguate-bundle.scala | 14 --- .../pos/macro-bundle-disambiguate-nonbundle.check | 0 .../pos/macro-bundle-disambiguate-nonbundle.scala | 14 --- .../pos/macro-implicit-invalidate-on-error.check | 0 .../pos/macro-implicit-invalidate-on-error.scala | 25 ----- tests/pending/pos/macro-qmarkqmarkqmark.scala | 7 -- tests/pending/pos/t5223.scala | 6 -- tests/pending/pos/t5692a/Macros_1.scala | 6 -- tests/pending/pos/t5692a/Test_2.scala | 3 - tests/pending/pos/t5692b/Macros_1.scala | 6 -- tests/pending/pos/t5692b/Test_2.scala | 3 - tests/pending/pos/t5706.flags | 1 - tests/pending/pos/t5706.scala | 15 --- tests/pending/pos/t5744/Macros_1.scala | 22 ---- tests/pending/pos/t5744/Test_2.scala | 6 -- tests/pending/pos/t6047.flags | 1 - tests/pending/pos/t6047.scala | 20 ---- tests/pending/pos/t6386.scala | 5 - tests/pending/pos/t6447.scala | 18 ---- tests/pending/pos/t6485a/Macros_1.scala | 5 - tests/pending/pos/t6485a/Test_2.scala | 5 - tests/pending/pos/t6485b/Test.scala | 10 -- tests/pending/pos/t6516.scala | 19 ---- tests/pending/pos/t7190.scala | 26 ----- tests/pending/pos/t7377/Client_2.scala | 11 -- tests/pending/pos/t7377/Macro_1.scala | 7 -- tests/pending/pos/t7461/Macros_1.scala | 13 --- tests/pending/pos/t7461/Test_2.scala | 3 - tests/pending/pos/t7516/A_1.scala | 9 -- tests/pending/pos/t7516/B_2.scala | 4 - tests/pending/pos/t7649.flags | 1 - tests/pending/pos/t7649.scala | 20 ---- tests/pending/pos/t7776.check | 0 tests/pending/pos/t7776.scala | 20 ---- tests/pending/pos/t7987/Macro_1.scala | 6 -- tests/pending/pos/t7987/Test_2.scala | 12 --- tests/pending/pos/t8001/Macros_1.scala | 10 -- tests/pending/pos/t8001/Test_2.scala | 4 - tests/pending/pos/t8013/inpervolated_2.scala | 11 -- tests/pending/pos/t8013/inpervolator_1.scala | 33 ------ tests/pending/pos/t8064/Client_2.scala | 8 -- tests/pending/pos/t8064/Macro_1.scala | 10 -- tests/pending/pos/t8064b/Client_2.scala | 6 -- tests/pending/pos/t8064b/Macro_1.scala | 11 -- tests/pending/pos/t8209a/Macros_1.scala | 17 --- tests/pending/pos/t8209a/Test_2.scala | 4 - tests/pending/pos/t8209b/Macros_1.scala | 17 --- tests/pending/pos/t8209b/Test_2.scala | 4 - tests/pending/pos/t8352/Macros_1.scala | 7 -- tests/pending/pos/t8352/Test_2.scala | 5 - tests/pending/run/exprs_serialize.check | 19 ---- tests/pending/run/exprs_serialize.scala | 39 ------- tests/pending/run/freetypes_false_alarm1.check | 1 - tests/pending/run/freetypes_false_alarm1.scala | 10 -- tests/pending/run/idempotency-case-classes.check | 55 ---------- tests/pending/run/idempotency-case-classes.scala | 22 ---- tests/pending/run/idempotency-extractors.check | 5 - tests/pending/run/idempotency-extractors.scala | 22 ---- tests/pending/run/idempotency-labels.check | 15 --- tests/pending/run/idempotency-labels.scala | 22 ---- tests/pending/run/idempotency-lazy-vals.check | 23 ---- tests/pending/run/idempotency-lazy-vals.scala | 27 ----- tests/pending/run/idempotency-this.check | 4 - tests/pending/run/idempotency-this.scala | 22 ---- tests/pending/run/macro-abort-fresh.check | 6 -- tests/pending/run/macro-abort-fresh.flags | 1 - tests/pending/run/macro-abort-fresh/Macros_1.scala | 15 --- tests/pending/run/macro-abort-fresh/Test_2.scala | 8 -- tests/pending/run/macro-auto-duplicate.check | 1 - .../run/macro-auto-duplicate/Macros_1.scala | 17 --- .../pending/run/macro-auto-duplicate/Test_2.scala | 3 - tests/pending/run/macro-basic-ma-md-mi.check | 1 - tests/pending/run/macro-basic-ma-md-mi.flags | 1 - .../pending/run/macro-basic-ma-md-mi/Impls_1.scala | 21 ---- .../run/macro-basic-ma-md-mi/Macros_2.scala | 10 -- .../pending/run/macro-basic-ma-md-mi/Test_3.scala | 4 - tests/pending/run/macro-basic-ma-mdmi.check | 1 - tests/pending/run/macro-basic-ma-mdmi.flags | 1 - .../run/macro-basic-ma-mdmi/Impls_Macros_1.scala | 32 ------ tests/pending/run/macro-basic-ma-mdmi/Test_2.scala | 4 - tests/pending/run/macro-basic-mamd-mi.check | 1 - tests/pending/run/macro-basic-mamd-mi.flags | 1 - .../pending/run/macro-basic-mamd-mi/Impls_1.scala | 19 ---- .../run/macro-basic-mamd-mi/Macros_Test_2.scala | 15 --- .../run/macro-blackbox-materialization.check | 3 - .../macro-blackbox-materialization/Macros_1.scala | 16 --- .../macro-blackbox-materialization/Test_2.scala | 5 - tests/pending/run/macro-bodyexpandstoimpl.check | 1 - tests/pending/run/macro-bodyexpandstoimpl.flags | 1 - .../run/macro-bodyexpandstoimpl/Impls_1.scala | 16 --- .../macro-bodyexpandstoimpl/Macros_Test_2.scala | 10 -- tests/pending/run/macro-bundle-context-alias.check | 4 - .../run/macro-bundle-context-alias/Macros_1.scala | 38 ------- .../run/macro-bundle-context-alias/Test_2.scala | 6 -- .../run/macro-bundle-context-refinement.check | 2 - .../macro-bundle-context-refinement/Macros_1.scala | 19 ---- .../macro-bundle-context-refinement/Test_2.scala | 4 - tests/pending/run/macro-bundle-repl.check | 24 ----- tests/pending/run/macro-bundle-repl.scala | 13 --- tests/pending/run/macro-bundle-static.check | 6 -- .../run/macro-bundle-static/Impls_Macros_1.scala | 30 ------ tests/pending/run/macro-bundle-static/Test_2.scala | 8 -- tests/pending/run/macro-bundle-toplevel.check | 6 -- tests/pending/run/macro-bundle-toplevel.flags | 1 - .../run/macro-bundle-toplevel/Impls_Macros_1.scala | 25 ----- .../pending/run/macro-bundle-toplevel/Test_2.scala | 8 -- tests/pending/run/macro-bundle-whitebox-decl.check | 6 -- .../Impls_Macros_1.scala | 26 ----- .../run/macro-bundle-whitebox-decl/Test_2.scala | 8 -- .../run/macro-bundle-whitebox-use-raw.check | 5 - .../macro-bundle-whitebox-use-raw/Macros_1.scala | 108 ------------------- .../run/macro-bundle-whitebox-use-raw/Test_2.scala | 19 ---- .../run/macro-bundle-whitebox-use-refined.check | 5 - .../Macros_1.scala | 108 ------------------- .../macro-bundle-whitebox-use-refined/Test_2.scala | 19 ---- tests/pending/run/macro-def-path-dependent.check | 1 - tests/pending/run/macro-def-path-dependent.flags | 1 - .../run/macro-def-path-dependent/Dummy.scala | 3 - .../run/macro-def-path-dependent/Test_1.scala | 25 ----- .../run/macro-def-path-dependent/Test_2.scala | 22 ---- .../run/macro-def-path-dependent/Test_3.scala | 22 ---- .../run/macro-def-path-dependent/Test_4.scala | 11 -- .../run/macro-def-path-dependent/Test_5.scala | 9 -- .../run/macro-def-path-dependent/Test_6.scala | 9 -- tests/pending/run/macro-default-params.check | 1 - .../run/macro-default-params/Macros_1.scala | 27 ----- .../pending/run/macro-default-params/Test_2.scala | 3 - tests/pending/run/macro-divergence-spurious.check | 1 - .../macro-divergence-spurious/Impls_Macros_1.scala | 23 ---- .../run/macro-divergence-spurious/Test_2.scala | 3 - tests/pending/run/macro-duplicate.check | 3 - tests/pending/run/macro-duplicate.flags | 1 - .../run/macro-duplicate/Impls_Macros_1.scala | 29 ----- tests/pending/run/macro-duplicate/Test_2.scala | 6 -- .../run/macro-enclosingowner-detectvar.check | 16 --- .../macro-enclosingowner-detectvar/Macros_1.scala | 14 --- .../macro-enclosingowner-detectvar/Test_2.scala | 23 ---- tests/pending/run/macro-enclosingowner-sbt.check | 16 --- .../run/macro-enclosingowner-sbt/Macros_1.scala | 14 --- .../run/macro-enclosingowner-sbt/Test_2.scala | 23 ---- tests/pending/run/macro-enclosures.check | 34 ------ tests/pending/run/macro-enclosures.flags | 1 - .../run/macro-enclosures/Impls_Macros_1.scala | 23 ---- tests/pending/run/macro-enclosures/Test_2.scala | 11 -- .../run/macro-expand-implicit-argument.check | 1 - .../run/macro-expand-implicit-argument.flags | 1 - .../macro-expand-implicit-argument/Macros_1.scala | 59 ---------- .../macro-expand-implicit-argument/Test_2.scala | 4 - .../macro-expand-implicit-macro-has-implicit.check | 1 - .../macro-expand-implicit-macro-has-implicit.flags | 1 - .../Impls_1.scala | 9 -- .../Macros_Test_2.scala | 5 - .../macro-expand-implicit-macro-is-implicit.check | 2 - .../macro-expand-implicit-macro-is-implicit.flags | 1 - .../Impls_1.scala | 9 -- .../Macros_Test_2.scala | 11 -- .../run/macro-expand-implicit-macro-is-val.check | 1 - .../run/macro-expand-implicit-macro-is-val.flags | 1 - .../Impls_1.scala | 9 -- .../Macros_Test_2.scala | 5 - .../run/macro-expand-implicit-macro-is-view.check | 1 - .../Impls_1.scala | 9 -- .../Macros_Test_2.scala | 12 --- .../run/macro-expand-multiple-arglists.check | 1 - .../run/macro-expand-multiple-arglists.flags | 1 - .../macro-expand-multiple-arglists/Impls_1.scala | 10 -- .../Macros_Test_2.scala | 4 - .../pending/run/macro-expand-nullary-generic.check | 6 -- .../pending/run/macro-expand-nullary-generic.flags | 1 - .../run/macro-expand-nullary-generic/Impls_1.scala | 15 --- .../Macros_Test_2.scala | 15 --- .../run/macro-expand-nullary-nongeneric.check | 6 -- .../run/macro-expand-nullary-nongeneric.flags | 1 - .../macro-expand-nullary-nongeneric/Impls_1.scala | 15 --- .../Macros_Test_2.scala | 15 --- tests/pending/run/macro-expand-overload.check | 6 -- tests/pending/run/macro-expand-overload.flags | 1 - .../run/macro-expand-overload/Impls_1.scala | 15 --- .../run/macro-expand-overload/Macros_Test_2.scala | 20 ---- tests/pending/run/macro-expand-override.check | 15 --- tests/pending/run/macro-expand-override.flags | 1 - .../run/macro-expand-override/Impls_1.scala | 15 --- .../run/macro-expand-override/Macros_Test_2.scala | 43 -------- tests/pending/run/macro-expand-recursive.check | 1 - tests/pending/run/macro-expand-recursive.flags | 1 - .../run/macro-expand-recursive/Impls_1.scala | 15 --- .../run/macro-expand-recursive/Macros_Test_2.scala | 8 -- .../pending/run/macro-expand-tparams-bounds.check | 2 - .../pending/run/macro-expand-tparams-bounds.flags | 1 - .../run/macro-expand-tparams-bounds/Impls_1.scala | 12 --- .../Macros_Test_2.scala | 12 --- .../run/macro-expand-tparams-explicit.check | 1 - .../run/macro-expand-tparams-explicit.flags | 1 - .../macro-expand-tparams-explicit/Impls_1.scala | 11 -- .../Macros_Test_2.scala | 4 - .../run/macro-expand-tparams-implicit.check | 2 - .../run/macro-expand-tparams-implicit.flags | 1 - .../macro-expand-tparams-implicit/Impls_1.scala | 11 -- .../Macros_Test_2.scala | 5 - .../pending/run/macro-expand-tparams-prefix.check | 20 ---- .../pending/run/macro-expand-tparams-prefix.flags | 1 - .../run/macro-expand-tparams-prefix/Impls_1.scala | 39 ------- .../Macros_Test_2.scala | 57 ---------- tests/pending/run/macro-expand-unapply-a.check | 2 - tests/pending/run/macro-expand-unapply-a.flags | 1 - .../macro-expand-unapply-a/Impls_Macros_1.scala | 15 --- .../run/macro-expand-unapply-a/Test_2.scala | 6 -- ...pand-varargs-explicit-over-nonvarargs-bad.check | 4 - ...pand-varargs-explicit-over-nonvarargs-bad.flags | 1 - .../Impls_1.scala | 9 -- .../Macros_Test_2.scala | 12 --- ...and-varargs-explicit-over-nonvarargs-good.check | 1 - ...and-varargs-explicit-over-nonvarargs-good.flags | 1 - .../Impls_1.scala | 13 --- .../Macros_Test_2.scala | 8 -- ...acro-expand-varargs-explicit-over-varargs.check | 1 - ...acro-expand-varargs-explicit-over-varargs.flags | 1 - .../Impls_1.scala | 13 --- .../Macros_Test_2.scala | 8 -- ...o-expand-varargs-implicit-over-nonvarargs.check | 1 - ...o-expand-varargs-implicit-over-nonvarargs.flags | 1 - .../Impls_1.scala | 9 -- .../Macros_Test_2.scala | 7 -- ...acro-expand-varargs-implicit-over-varargs.check | 1 - ...acro-expand-varargs-implicit-over-varargs.flags | 1 - .../Impls_1.scala | 13 --- .../Macros_Test_2.scala | 7 -- tests/pending/run/macro-impl-default-params.check | 5 - tests/pending/run/macro-impl-default-params.flags | 1 - .../macro-impl-default-params/Impls_Macros_1.scala | 20 ---- .../run/macro-impl-default-params/Test_2.scala | 4 - tests/pending/run/macro-impl-relaxed.check | 4 - .../pending/run/macro-impl-relaxed/Macros_1.scala | 14 --- tests/pending/run/macro-impl-relaxed/Test_2.scala | 6 -- tests/pending/run/macro-impl-rename-context.check | 2 - tests/pending/run/macro-impl-rename-context.flags | 1 - .../macro-impl-rename-context/Impls_Macros_1.scala | 12 --- .../run/macro-impl-rename-context/Test_2.scala | 4 - .../run/macro-impl-tparam-only-in-impl.check | 1 - .../run/macro-impl-tparam-only-in-impl.flags | 1 - .../macro-impl-tparam-only-in-impl/Impls_1.scala | 5 - .../Macros_Test_2.scala | 8 -- .../macro-impl-tparam-typetag-is-optional.check | 1 - .../macro-impl-tparam-typetag-is-optional.flags | 1 - .../Impls_1.scala | 9 -- .../Macros_Test_2.scala | 4 - ...-invalidret-doesnt-conform-to-def-rettype.check | 5 - ...-invalidret-doesnt-conform-to-def-rettype.flags | 1 - .../Impls_Macros_1.scala | 12 --- .../Test_2.scala | 8 -- .../pending/run/macro-invalidret-nontypeable.check | 3 - .../pending/run/macro-invalidret-nontypeable.flags | 1 - .../Impls_Macros_1.scala | 13 --- .../run/macro-invalidret-nontypeable/Test_2.scala | 8 -- tests/pending/run/macro-invalidusage-badret.check | 5 - tests/pending/run/macro-invalidusage-badret.flags | 1 - .../macro-invalidusage-badret/Impls_Macros_1.scala | 9 -- .../run/macro-invalidusage-badret/Test_2.scala | 8 -- ...alidusage-partialapplication-with-tparams.check | 3 - ...alidusage-partialapplication-with-tparams.flags | 1 - .../Impls_Macros_1.scala | 13 --- .../Test_2.scala | 8 -- .../macro-invalidusage-partialapplication.check | 3 - .../macro-invalidusage-partialapplication.flags | 1 - .../Impls_Macros_1.scala | 14 --- .../Test_2.scala | 8 -- tests/pending/run/macro-openmacros.check | 3 - tests/pending/run/macro-openmacros.flags | 2 - .../run/macro-openmacros/Impls_Macros_1.scala | 25 ----- tests/pending/run/macro-openmacros/Test_2.scala | 3 - .../run/macro-parse-position-malformed.check | 1 - .../Impls_Macros_1.scala | 18 ---- .../macro-parse-position-malformed/Test_2.scala | 3 - tests/pending/run/macro-parse-position.check | 5 - tests/pending/run/macro-parse-position.flags | 1 - .../run/macro-parse-position/Impls_Macros_1.scala | 12 --- .../pending/run/macro-parse-position/Test_2.scala | 3 - tests/pending/run/macro-quasiinvalidbody-c.check | 1 - tests/pending/run/macro-quasiinvalidbody-c.flags | 1 - .../macro-quasiinvalidbody-c/Impls_Macros_1.scala | 9 -- .../run/macro-quasiinvalidbody-c/Test_2.scala | 4 - tests/pending/run/macro-quasiquotes.check | 4 - tests/pending/run/macro-quasiquotes/Macros_1.scala | 15 --- tests/pending/run/macro-quasiquotes/Test_2.scala | 5 - tests/pending/run/macro-range.check | 9 -- tests/pending/run/macro-range.flags | 1 - tests/pending/run/macro-range/Common_1.scala | 48 --------- .../run/macro-range/Expansion_Impossible_2.scala | 53 --------- .../run/macro-range/Expansion_Possible_3.scala | 7 -- tests/pending/run/macro-rangepos-args.check | 1 - tests/pending/run/macro-rangepos-args.flags | 1 - .../pending/run/macro-rangepos-args/Macros_1.scala | 10 -- tests/pending/run/macro-rangepos-args/Test_2.scala | 4 - tests/pending/run/macro-rangepos-subpatterns.check | 1 - tests/pending/run/macro-rangepos-subpatterns.flags | 1 - .../run/macro-rangepos-subpatterns/Macros_1.scala | 18 ---- .../run/macro-rangepos-subpatterns/Test_2.scala | 5 - .../run/macro-reflective-ma-normal-mdmi.check | 1 - .../run/macro-reflective-ma-normal-mdmi.flags | 1 - .../Impls_Macros_1.scala | 13 --- .../macro-reflective-ma-normal-mdmi/Test_2.scala | 7 -- .../run/macro-reflective-mamd-normal-mi.check | 1 - .../macro-reflective-mamd-normal-mi/Impls_1.scala | 9 -- .../Macros_Test_2.scala | 20 ---- tests/pending/run/macro-reify-basic.check | 1 - tests/pending/run/macro-reify-basic.flags | 1 - tests/pending/run/macro-reify-basic/Macros_1.scala | 11 -- tests/pending/run/macro-reify-basic/Test_2.scala | 3 - .../run/macro-reify-chained1/Impls_Macros_1.scala | 47 -------- .../pending/run/macro-reify-chained1/Test_2.scala | 9 -- .../run/macro-reify-chained2/Impls_Macros_1.scala | 47 -------- .../pending/run/macro-reify-chained2/Test_2.scala | 9 -- tests/pending/run/macro-reify-freevars.check | 3 - tests/pending/run/macro-reify-freevars.flags | 1 - .../run/macro-reify-freevars/Macros_1.scala | 20 ---- .../pending/run/macro-reify-freevars/Test_2.scala | 11 -- .../run/macro-reify-nested-a1/Impls_Macros_1.scala | 47 -------- .../pending/run/macro-reify-nested-a1/Test_2.scala | 9 -- .../run/macro-reify-nested-a2/Impls_Macros_1.scala | 47 -------- .../pending/run/macro-reify-nested-a2/Test_2.scala | 9 -- .../run/macro-reify-nested-b1/Impls_Macros_1.scala | 47 -------- .../pending/run/macro-reify-nested-b1/Test_2.scala | 9 -- .../run/macro-reify-nested-b2/Impls_Macros_1.scala | 47 -------- .../pending/run/macro-reify-nested-b2/Test_2.scala | 9 -- .../run/macro-reify-ref-to-packageless.check | 1 - .../run/macro-reify-ref-to-packageless.flags | 1 - .../macro-reify-ref-to-packageless/Impls_1.scala | 6 -- .../macro-reify-ref-to-packageless/Test_2.scala | 4 - .../run/macro-reify-splice-outside-reify.check | 1 - .../run/macro-reify-splice-outside-reify.flags | 1 - .../Impls_Macros_1.scala | 13 --- .../macro-reify-splice-outside-reify/Test_2.scala | 8 -- tests/pending/run/macro-reify-staticXXX.check | 12 --- tests/pending/run/macro-reify-staticXXX.flags | 1 - .../run/macro-reify-staticXXX/Macros_1.scala | 48 --------- .../pending/run/macro-reify-staticXXX/Test_2.scala | 4 - tests/pending/run/macro-reify-tagful-a.check | 1 - tests/pending/run/macro-reify-tagful-a.flags | 1 - .../run/macro-reify-tagful-a/Macros_1.scala | 12 --- .../pending/run/macro-reify-tagful-a/Test_2.scala | 4 - tests/pending/run/macro-reify-tagless-a.check | 3 - tests/pending/run/macro-reify-tagless-a.flags | 1 - .../run/macro-reify-tagless-a/Impls_Macros_1.scala | 11 -- .../pending/run/macro-reify-tagless-a/Test_2.scala | 14 --- tests/pending/run/macro-reify-type.check | 1 - tests/pending/run/macro-reify-type.flags | 1 - tests/pending/run/macro-reify-type/Macros_1.scala | 28 ----- tests/pending/run/macro-reify-type/Test_2.scala | 21 ---- .../run/macro-reify-typetag-notypeparams.check | 2 - .../macro-reify-typetag-notypeparams/Test.scala | 6 -- .../run/macro-reify-typetag-typeparams-tags.check | 2 - .../macro-reify-typetag-typeparams-tags/Test.scala | 9 -- tests/pending/run/macro-reify-unreify.check | 1 - tests/pending/run/macro-reify-unreify.flags | 1 - .../pending/run/macro-reify-unreify/Macros_1.scala | 20 ---- tests/pending/run/macro-reify-unreify/Test_2.scala | 3 - tests/pending/run/macro-repl-basic.check | 52 --------- tests/pending/run/macro-repl-basic.scala | 39 ------- tests/pending/run/macro-repl-dontexpand.check | 16 --- tests/pending/run/macro-repl-dontexpand.scala | 11 -- tests/pending/run/macro-settings.check | 1 - tests/pending/run/macro-settings.flags | 1 - .../run/macro-settings/Impls_Macros_1.scala | 14 --- tests/pending/run/macro-settings/Test_2.scala | 3 - tests/pending/run/macro-sip19-revised.check | 5 - tests/pending/run/macro-sip19-revised.flags | 1 - .../run/macro-sip19-revised/Impls_Macros_1.scala | 35 ------ tests/pending/run/macro-sip19-revised/Test_2.scala | 12 --- tests/pending/run/macro-sip19.check | 5 - tests/pending/run/macro-sip19.flags | 1 - tests/pending/run/macro-sip19/Impls_Macros_1.scala | 26 ----- tests/pending/run/macro-sip19/Test_2.scala | 16 --- tests/pending/run/macro-subpatterns.check | 3 - tests/pending/run/macro-subpatterns/Macro_1.scala | 17 --- tests/pending/run/macro-subpatterns/Test_2.scala | 5 - tests/pending/run/macro-system-properties.check | 22 ---- tests/pending/run/macro-system-properties.scala | 16 --- .../run/macro-term-declared-in-annotation.check | 1 - .../run/macro-term-declared-in-annotation.flags | 1 - .../Impls_1.scala | 11 -- .../Macros_2.scala | 8 -- .../macro-term-declared-in-annotation/Test_3.scala | 3 - .../run/macro-term-declared-in-anonymous.check | 2 - .../run/macro-term-declared-in-anonymous.flags | 1 - .../macro-term-declared-in-anonymous/Impls_1.scala | 11 -- .../Macros_Test_2.scala | 6 -- .../pending/run/macro-term-declared-in-block.check | 2 - .../pending/run/macro-term-declared-in-block.flags | 1 - .../run/macro-term-declared-in-block/Impls_1.scala | 11 -- .../Macros_Test_2.scala | 6 -- .../run/macro-term-declared-in-class-class.check | 2 - .../run/macro-term-declared-in-class-class.flags | 1 - .../Impls_1.scala | 11 -- .../Macros_Test_2.scala | 10 -- .../run/macro-term-declared-in-class-object.check | 2 - .../run/macro-term-declared-in-class-object.flags | 1 - .../Impls_1.scala | 11 -- .../Macros_Test_2.scala | 10 -- .../pending/run/macro-term-declared-in-class.check | 2 - .../pending/run/macro-term-declared-in-class.flags | 1 - .../run/macro-term-declared-in-class/Impls_1.scala | 11 -- .../Macros_Test_2.scala | 7 -- .../run/macro-term-declared-in-default-param.check | 5 - .../run/macro-term-declared-in-default-param.flags | 1 - .../Impls_1.scala | 11 -- .../Macros_Test_2.scala | 7 -- .../macro-term-declared-in-implicit-class.check | 2 - .../macro-term-declared-in-implicit-class.flags | 1 - .../Impls_Macros_1.scala | 19 ---- .../Test_2.scala | 4 - .../run/macro-term-declared-in-method.check | 2 - .../run/macro-term-declared-in-method.flags | 1 - .../macro-term-declared-in-method/Impls_1.scala | 11 -- .../Macros_Test_2.scala | 8 -- .../run/macro-term-declared-in-object-class.check | 2 - .../run/macro-term-declared-in-object-class.flags | 1 - .../Impls_1.scala | 11 -- .../Macros_Test_2.scala | 10 -- .../run/macro-term-declared-in-object-object.check | 2 - .../run/macro-term-declared-in-object-object.flags | 1 - .../Impls_1.scala | 11 -- .../Macros_Test_2.scala | 10 -- .../run/macro-term-declared-in-object.check | 2 - .../run/macro-term-declared-in-object.flags | 1 - .../macro-term-declared-in-object/Impls_1.scala | 11 -- .../Macros_Test_2.scala | 7 -- .../macro-term-declared-in-package-object.check | 2 - .../macro-term-declared-in-package-object.flags | 1 - .../Impls_1.scala | 11 -- .../Macros_Test_2.scala | 8 -- .../run/macro-term-declared-in-refinement.check | 2 - .../run/macro-term-declared-in-refinement.flags | 1 - .../Impls_1.scala | 11 -- .../Macros_Test_2.scala | 8 -- .../pending/run/macro-term-declared-in-trait.check | 15 --- .../pending/run/macro-term-declared-in-trait.flags | 1 - .../run/macro-term-declared-in-trait/Impls_1.scala | 11 -- .../Macros_Test_2.scala | 13 --- .../run/macro-typecheck-implicitsdisabled.check | 2 - .../run/macro-typecheck-implicitsdisabled.flags | 1 - .../Impls_Macros_1.scala | 28 ----- .../macro-typecheck-implicitsdisabled/Test_2.scala | 4 - .../run/macro-typecheck-macrosdisabled.check | 32 ------ .../run/macro-typecheck-macrosdisabled.flags | 1 - .../Impls_Macros_1.scala | 31 ------ .../macro-typecheck-macrosdisabled/Test_2.scala | 4 - .../run/macro-typecheck-macrosdisabled2.check | 32 ------ .../run/macro-typecheck-macrosdisabled2.flags | 1 - .../Impls_Macros_1.scala | 31 ------ .../macro-typecheck-macrosdisabled2/Test_2.scala | 4 - .../run/macro-undetparams-consfromsls.check | 5 - .../run/macro-undetparams-consfromsls.flags | 1 - .../Impls_Macros_1.scala | 24 ----- .../run/macro-undetparams-consfromsls/Test_2.scala | 7 -- .../run/macro-undetparams-macroitself.check | 2 - .../run/macro-undetparams-macroitself.flags | 1 - .../Impls_Macros_1.scala | 11 -- .../run/macro-undetparams-macroitself/Test_2.scala | 4 - .../pending/run/macro-vampire-false-warning.check | 2 - .../pending/run/macro-vampire-false-warning.flags | 1 - .../run/macro-vampire-false-warning/Macros_1.scala | 52 --------- .../run/macro-vampire-false-warning/Test_2.scala | 6 -- .../macro-whitebox-dynamic-materialization.check | 2 - .../Macros_1.scala | 25 ----- .../Test_2.scala | 4 - tests/pending/run/macro-whitebox-extractor.check | 1 - .../run/macro-whitebox-extractor/Macros_1.scala | 21 ---- .../run/macro-whitebox-extractor/Test_2.scala | 5 - .../macro-whitebox-fundep-materialization.check | 1 - .../Macros_1.scala | 39 ------- .../Test_2.scala | 12 --- tests/pending/run/macro-whitebox-structural.check | 1 - .../macro-whitebox-structural/Impls_Macros_1.scala | 16 --- .../run/macro-whitebox-structural/Test_2.scala | 5 - .../run/macroPlugins-isBlackbox/Macros_2.scala | 11 -- .../run/macroPlugins-isBlackbox/Plugin_1.scala | 21 ---- .../run/macroPlugins-isBlackbox/Test_3.flags | 1 - .../run/macroPlugins-isBlackbox/Test_3.scala | 3 - .../run/macroPlugins-isBlackbox/scalac-plugin.xml | 4 - tests/pending/run/macroPlugins-macroArgs.check | 2 - .../run/macroPlugins-macroArgs/Macros_2.scala | 11 -- .../run/macroPlugins-macroArgs/Plugin_1.scala | 21 ---- .../run/macroPlugins-macroArgs/Test_3.flags | 1 - .../run/macroPlugins-macroArgs/Test_3.scala | 4 - .../run/macroPlugins-macroArgs/scalac-plugin.xml | 4 - tests/pending/run/macroPlugins-macroExpand.check | 2 - tests/pending/run/macroPlugins-macroExpand.flags | 1 - .../run/macroPlugins-macroExpand/Macros_2.scala | 18 ---- .../run/macroPlugins-macroExpand/Plugin_1.scala | 27 ----- .../run/macroPlugins-macroExpand/Test_3.flags | 1 - .../run/macroPlugins-macroExpand/Test_3.scala | 4 - .../run/macroPlugins-macroExpand/scalac-plugin.xml | 4 - tests/pending/run/macroPlugins-macroRuntime.check | 2 - .../run/macroPlugins-macroRuntime/Macros_2.scala | 11 -- .../run/macroPlugins-macroRuntime/Plugin_1.scala | 20 ---- .../run/macroPlugins-macroRuntime/Test_3.flags | 1 - .../run/macroPlugins-macroRuntime/Test_3.scala | 4 - .../macroPlugins-macroRuntime/scalac-plugin.xml | 4 - tests/pending/run/macroPlugins-namerHooks.check | 45 -------- tests/pending/run/macroPlugins-namerHooks.scala | 39 ------- .../pending/run/macroPlugins-typedMacroBody.check | 2 - .../pending/run/macroPlugins-typedMacroBody.flags | 1 - .../run/macroPlugins-typedMacroBody/Macros_2.flags | 1 - .../run/macroPlugins-typedMacroBody/Macros_2.scala | 18 ---- .../run/macroPlugins-typedMacroBody/Plugin_1.scala | 21 ---- .../run/macroPlugins-typedMacroBody/Test_3.scala | 4 - .../macroPlugins-typedMacroBody/scalac-plugin.xml | 4 - .../run/reflection-magicsymbols-invoke.check | 119 --------------------- .../run/reflection-magicsymbols-invoke.scala | 100 ----------------- tests/pending/run/reify-each-node-type.check | 35 ------ tests/pending/run/reify-each-node-type.scala | 110 ------------------- tests/pending/run/reify-repl-fail-gracefully.check | 17 --- tests/pending/run/reify-repl-fail-gracefully.scala | 10 -- tests/pending/run/reify-staticXXX.check | 24 ----- tests/pending/run/reify-staticXXX.scala | 56 ---------- tests/pending/run/reify_ann1a.check | 30 ------ tests/pending/run/reify_ann1a.scala | 28 ----- tests/pending/run/reify_ann1b.check | 35 ------ tests/pending/run/reify_ann1b.scala | 28 ----- tests/pending/run/reify_ann2a.check | 44 -------- tests/pending/run/reify_ann2a.scala | 28 ----- tests/pending/run/reify_ann3.check | 21 ---- tests/pending/run/reify_ann3.scala | 22 ---- tests/pending/run/reify_ann4.check | 32 ------ tests/pending/run/reify_ann4.scala | 26 ----- tests/pending/run/reify_ann5.check | 22 ---- tests/pending/run/reify_ann5.scala | 23 ---- tests/pending/run/reify_anonymous.check | 1 - tests/pending/run/reify_anonymous.scala | 8 -- tests/pending/run/reify_classfileann_a.check | 23 ---- tests/pending/run/reify_classfileann_a.scala | 22 ---- tests/pending/run/reify_classfileann_b.check | 25 ----- tests/pending/run/reify_classfileann_b.scala | 26 ----- tests/pending/run/reify_closure1.check | 2 - tests/pending/run/reify_closure1.scala | 19 ---- tests/pending/run/reify_closure2a.check | 2 - tests/pending/run/reify_closure2a.scala | 19 ---- tests/pending/run/reify_closure3a.check | 2 - tests/pending/run/reify_closure3a.scala | 21 ---- tests/pending/run/reify_closure4a.check | 2 - tests/pending/run/reify_closure4a.scala | 21 ---- tests/pending/run/reify_closure5a.check | 2 - tests/pending/run/reify_closure5a.scala | 21 ---- tests/pending/run/reify_closure6.check | 7 -- tests/pending/run/reify_closure6.scala | 29 ----- tests/pending/run/reify_closure7.check | 6 -- tests/pending/run/reify_closure7.scala | 33 ------ tests/pending/run/reify_closure8a.check | 1 - tests/pending/run/reify_closure8a.scala | 15 --- tests/pending/run/reify_closure8b.check | 3 - tests/pending/run/reify_closure8b.scala | 21 ---- tests/pending/run/reify_closures10.check | 2 - tests/pending/run/reify_closures10.scala | 13 --- tests/pending/run/reify_complex.check | 1 - tests/pending/run/reify_complex.scala | 25 ----- tests/pending/run/reify_copypaste1.check | 2 - tests/pending/run/reify_copypaste1.scala | 19 ---- tests/pending/run/reify_copypaste2.check | 1 - tests/pending/run/reify_copypaste2.scala | 10 -- tests/pending/run/reify_csv.check | 10 -- tests/pending/run/reify_csv.scala | 36 ------- tests/pending/run/reify_extendbuiltins.check | 1 - tests/pending/run/reify_extendbuiltins.scala | 17 --- tests/pending/run/reify_for1.scala | 10 -- tests/pending/run/reify_fors_newpatmat.check | 5 - tests/pending/run/reify_fors_newpatmat.scala | 101 ----------------- tests/pending/run/reify_fors_oldpatmat.check | 5 - tests/pending/run/reify_fors_oldpatmat.scala | 101 ----------------- tests/pending/run/reify_generic.check | 1 - tests/pending/run/reify_generic.scala | 9 -- tests/pending/run/reify_generic2.check | 1 - tests/pending/run/reify_generic2.scala | 10 -- tests/pending/run/reify_getter.check | 1 - tests/pending/run/reify_getter.scala | 18 ---- tests/pending/run/reify_implicits-new.check | 1 - tests/pending/run/reify_implicits-new.scala | 18 ---- tests/pending/run/reify_implicits-old.check | 1 - tests/pending/run/reify_implicits-old.scala | 17 --- tests/pending/run/reify_inheritance.check | 1 - tests/pending/run/reify_inheritance.scala | 17 --- tests/pending/run/reify_inner1.check | 1 - tests/pending/run/reify_inner1.scala | 16 --- tests/pending/run/reify_inner2.check | 1 - tests/pending/run/reify_inner2.scala | 16 --- tests/pending/run/reify_inner3.check | 1 - tests/pending/run/reify_inner3.scala | 16 --- tests/pending/run/reify_inner4.check | 1 - tests/pending/run/reify_inner4.scala | 16 --- tests/pending/run/reify_lazyevaluation.check | 8 -- tests/pending/run/reify_lazyevaluation.scala | 61 ----------- tests/pending/run/reify_lazyunit.check | 6 -- tests/pending/run/reify_lazyunit.scala | 13 --- tests/pending/run/reify_maps_newpatmat.check | 4 - tests/pending/run/reify_maps_newpatmat.scala | 20 ---- tests/pending/run/reify_maps_oldpatmat.check | 4 - tests/pending/run/reify_maps_oldpatmat.scala | 20 ---- .../reify_metalevel_breach_+0_refers_to_1.check | 1 - .../reify_metalevel_breach_+0_refers_to_1.scala | 18 ---- .../reify_metalevel_breach_-1_refers_to_0_a.check | 1 - .../reify_metalevel_breach_-1_refers_to_0_a.scala | 16 --- .../reify_metalevel_breach_-1_refers_to_0_b.check | 1 - .../reify_metalevel_breach_-1_refers_to_0_b.scala | 21 ---- .../reify_metalevel_breach_-1_refers_to_1.check | 1 - .../reify_metalevel_breach_-1_refers_to_1.scala | 18 ---- .../run/reify_nested_inner_refers_to_global.check | 1 - .../run/reify_nested_inner_refers_to_global.scala | 17 --- .../run/reify_nested_inner_refers_to_local.check | 1 - .../run/reify_nested_inner_refers_to_local.scala | 17 --- .../run/reify_nested_outer_refers_to_global.check | 1 - .../run/reify_nested_outer_refers_to_global.scala | 19 ---- .../run/reify_nested_outer_refers_to_local.check | 1 - .../run/reify_nested_outer_refers_to_local.scala | 19 ---- tests/pending/run/reify_newimpl_01.check | 1 - tests/pending/run/reify_newimpl_01.scala | 13 --- tests/pending/run/reify_newimpl_02.check | 1 - tests/pending/run/reify_newimpl_02.scala | 13 --- tests/pending/run/reify_newimpl_03.check | 1 - tests/pending/run/reify_newimpl_03.scala | 13 --- tests/pending/run/reify_newimpl_04.check | 1 - tests/pending/run/reify_newimpl_04.scala | 13 --- tests/pending/run/reify_newimpl_05.check | 1 - tests/pending/run/reify_newimpl_05.scala | 14 --- tests/pending/run/reify_newimpl_06.check | 1 - tests/pending/run/reify_newimpl_06.scala | 13 --- tests/pending/run/reify_newimpl_11.check | 4 - tests/pending/run/reify_newimpl_11.scala | 19 ---- tests/pending/run/reify_newimpl_12.check | 1 - tests/pending/run/reify_newimpl_12.scala | 14 --- tests/pending/run/reify_newimpl_13.check | 4 - tests/pending/run/reify_newimpl_13.scala | 21 ---- tests/pending/run/reify_newimpl_14.check | 1 - tests/pending/run/reify_newimpl_14.scala | 16 --- tests/pending/run/reify_newimpl_15.check | 1 - tests/pending/run/reify_newimpl_15.scala | 15 --- tests/pending/run/reify_newimpl_18.check | 1 - tests/pending/run/reify_newimpl_18.scala | 15 --- tests/pending/run/reify_newimpl_19.check | 4 - tests/pending/run/reify_newimpl_19.scala | 20 ---- tests/pending/run/reify_newimpl_20.check | 1 - tests/pending/run/reify_newimpl_20.scala | 16 --- tests/pending/run/reify_newimpl_21.check | 1 - tests/pending/run/reify_newimpl_21.scala | 20 ---- tests/pending/run/reify_newimpl_22.check | 25 ----- tests/pending/run/reify_newimpl_22.scala | 17 --- tests/pending/run/reify_newimpl_23.check | 24 ----- tests/pending/run/reify_newimpl_23.scala | 16 --- tests/pending/run/reify_newimpl_27.check | 1 - tests/pending/run/reify_newimpl_27.scala | 15 --- tests/pending/run/reify_newimpl_29.check | 1 - tests/pending/run/reify_newimpl_29.scala | 15 --- tests/pending/run/reify_newimpl_30.check | 4 - tests/pending/run/reify_newimpl_30.scala | 18 ---- tests/pending/run/reify_newimpl_31.check | 1 - tests/pending/run/reify_newimpl_31.scala | 15 --- tests/pending/run/reify_newimpl_33.check | 1 - tests/pending/run/reify_newimpl_33.scala | 16 --- tests/pending/run/reify_newimpl_35.check | 13 --- tests/pending/run/reify_newimpl_35.scala | 10 -- tests/pending/run/reify_newimpl_36.check | 1 - tests/pending/run/reify_newimpl_36.scala | 15 --- tests/pending/run/reify_newimpl_37.check | 1 - tests/pending/run/reify_newimpl_37.scala | 16 --- tests/pending/run/reify_newimpl_38.check | 1 - tests/pending/run/reify_newimpl_38.scala | 15 --- tests/pending/run/reify_newimpl_39.check | 1 - tests/pending/run/reify_newimpl_39.scala | 16 --- tests/pending/run/reify_newimpl_40.check | 1 - tests/pending/run/reify_newimpl_40.scala | 16 --- tests/pending/run/reify_newimpl_41.check | 3 - tests/pending/run/reify_newimpl_41.scala | 18 ---- tests/pending/run/reify_newimpl_42.check | 3 - tests/pending/run/reify_newimpl_42.scala | 17 --- tests/pending/run/reify_newimpl_43.check | 2 - tests/pending/run/reify_newimpl_43.scala | 16 --- tests/pending/run/reify_newimpl_44.check | 2 - tests/pending/run/reify_newimpl_44.scala | 16 --- tests/pending/run/reify_newimpl_45.check | 2 - tests/pending/run/reify_newimpl_45.scala | 16 --- tests/pending/run/reify_newimpl_47.check | 1 - tests/pending/run/reify_newimpl_47.scala | 17 --- tests/pending/run/reify_newimpl_48.check | 1 - tests/pending/run/reify_newimpl_48.scala | 22 ---- tests/pending/run/reify_newimpl_49.check | 3 - tests/pending/run/reify_newimpl_49.scala | 16 --- tests/pending/run/reify_newimpl_50.check | 3 - tests/pending/run/reify_newimpl_50.scala | 15 --- tests/pending/run/reify_newimpl_51.check | 3 - tests/pending/run/reify_newimpl_51.scala | 18 ---- tests/pending/run/reify_newimpl_52.check | 3 - tests/pending/run/reify_newimpl_52.scala | 18 ---- tests/pending/run/reify_printf.check | 1 - tests/pending/run/reify_printf.scala | 71 ------------ tests/pending/run/reify_properties.check | 2 - tests/pending/run/reify_properties.scala | 57 ---------- tests/pending/run/reify_renamed_term_basic.check | 1 - tests/pending/run/reify_renamed_term_basic.scala | 20 ---- .../run/reify_renamed_term_local_to_reifee.check | 1 - .../run/reify_renamed_term_local_to_reifee.scala | 20 ---- .../run/reify_renamed_term_overloaded_method.check | 1 - .../run/reify_renamed_term_overloaded_method.scala | 17 --- tests/pending/run/reify_renamed_term_t5841.check | 1 - tests/pending/run/reify_renamed_term_t5841.scala | 7 -- tests/pending/run/reify_renamed_type_basic.check | 1 - tests/pending/run/reify_renamed_type_basic.scala | 16 --- .../run/reify_renamed_type_local_to_reifee.check | 1 - .../run/reify_renamed_type_local_to_reifee.scala | 24 ----- .../run/reify_renamed_type_spliceable.check | 1 - .../run/reify_renamed_type_spliceable.scala | 21 ---- tests/pending/run/reify_sort.check | 2 - tests/pending/run/reify_sort.scala | 51 --------- tests/pending/run/reify_sort1.check | 2 - tests/pending/run/reify_sort1.scala | 21 ---- tests/pending/run/reify_this.check | 5 - tests/pending/run/reify_this.scala | 20 ---- tests/pending/run/reify_timeofday.check | 1 - tests/pending/run/reify_timeofday.scala | 42 -------- tests/pending/run/reify_typerefs_1a.check | 1 - tests/pending/run/reify_typerefs_1a.scala | 18 ---- tests/pending/run/reify_typerefs_1b.check | 1 - tests/pending/run/reify_typerefs_1b.scala | 18 ---- tests/pending/run/reify_typerefs_2a.check | 1 - tests/pending/run/reify_typerefs_2a.scala | 20 ---- tests/pending/run/reify_typerefs_2b.check | 1 - tests/pending/run/reify_typerefs_2b.scala | 20 ---- tests/pending/run/reify_typerefs_3a.check | 1 - tests/pending/run/reify_typerefs_3a.scala | 20 ---- tests/pending/run/reify_typerefs_3b.check | 1 - tests/pending/run/reify_typerefs_3b.scala | 20 ---- tests/pending/run/reify_varargs.check | 1 - tests/pending/run/reify_varargs.scala | 11 -- tests/pending/run/repl-term-macros.check | 40 ------- tests/pending/run/repl-term-macros.scala | 20 ---- tests/pending/run/runtimeEval1.check | 1 - tests/pending/run/runtimeEval1.scala | 9 -- tests/pending/run/runtimeEval2.check | 1 - tests/pending/run/runtimeEval2.scala | 11 -- tests/pending/run/showdecl.check | 34 ------ tests/pending/run/showdecl/Macros_1.scala | 30 ------ tests/pending/run/showdecl/Test_2.scala | 32 ------ tests/pending/run/showraw_mods.check | 1 - tests/pending/run/showraw_mods.scala | 6 -- tests/pending/run/showraw_tree.check | 2 - tests/pending/run/showraw_tree.scala | 8 -- tests/pending/run/showraw_tree_ids.check | 2 - tests/pending/run/showraw_tree_ids.scala | 9 -- tests/pending/run/showraw_tree_kinds.check | 2 - tests/pending/run/showraw_tree_kinds.scala | 8 -- tests/pending/run/showraw_tree_types_ids.check | 12 --- tests/pending/run/showraw_tree_types_ids.scala | 11 -- tests/pending/run/showraw_tree_types_typed.check | 12 --- tests/pending/run/showraw_tree_types_typed.scala | 10 -- tests/pending/run/showraw_tree_types_untyped.check | 2 - tests/pending/run/showraw_tree_types_untyped.scala | 8 -- tests/pending/run/showraw_tree_ultimate.check | 12 --- tests/pending/run/showraw_tree_ultimate.scala | 11 -- tests/pending/run/t2886.check | 5 - tests/pending/run/t2886.scala | 9 -- tests/pending/run/t5224.check | 14 --- tests/pending/run/t5224.scala | 8 -- tests/pending/run/t5225_1.check | 4 - tests/pending/run/t5225_1.scala | 6 -- tests/pending/run/t5225_2.check | 4 - tests/pending/run/t5225_2.scala | 6 -- tests/pending/run/t5229_1.scala | 8 -- tests/pending/run/t5229_2.check | 2 - tests/pending/run/t5229_2.scala | 18 ---- tests/pending/run/t5230.check | 2 - tests/pending/run/t5230.scala | 18 ---- tests/pending/run/t5258a.check | 1 - tests/pending/run/t5258a.scala | 8 -- tests/pending/run/t5266_1.check | 2 - tests/pending/run/t5266_1.scala | 15 --- tests/pending/run/t5266_2.check | 2 - tests/pending/run/t5266_2.scala | 16 --- tests/pending/run/t5269.check | 1 - tests/pending/run/t5269.scala | 16 --- tests/pending/run/t5270.check | 1 - tests/pending/run/t5270.scala | 20 ---- tests/pending/run/t5271_1.check | 12 --- tests/pending/run/t5271_1.scala | 15 --- tests/pending/run/t5271_2.check | 14 --- tests/pending/run/t5271_2.scala | 17 --- tests/pending/run/t5271_3.check | 21 ---- tests/pending/run/t5271_3.scala | 18 ---- tests/pending/run/t5271_4.scala | 8 -- tests/pending/run/t5272_1_newpatmat.check | 1 - tests/pending/run/t5272_1_newpatmat.scala | 11 -- tests/pending/run/t5272_1_oldpatmat.check | 1 - tests/pending/run/t5272_1_oldpatmat.scala | 11 -- tests/pending/run/t5272_2_newpatmat.check | 1 - tests/pending/run/t5272_2_newpatmat.scala | 10 -- tests/pending/run/t5272_2_oldpatmat.check | 1 - tests/pending/run/t5272_2_oldpatmat.scala | 10 -- tests/pending/run/t5273_1_newpatmat.check | 1 - tests/pending/run/t5273_1_newpatmat.scala | 11 -- tests/pending/run/t5273_1_oldpatmat.check | 1 - tests/pending/run/t5273_1_oldpatmat.scala | 11 -- tests/pending/run/t5273_2a_newpatmat.check | 1 - tests/pending/run/t5273_2a_newpatmat.scala | 9 -- tests/pending/run/t5273_2a_oldpatmat.check | 1 - tests/pending/run/t5273_2a_oldpatmat.scala | 9 -- tests/pending/run/t5273_2b_newpatmat.check | 1 - tests/pending/run/t5273_2b_newpatmat.scala | 10 -- tests/pending/run/t5273_2b_oldpatmat.check | 1 - tests/pending/run/t5273_2b_oldpatmat.scala | 10 -- tests/pending/run/t5274_1.check | 3 - tests/pending/run/t5274_1.scala | 14 --- tests/pending/run/t5274_2.check | 2 - tests/pending/run/t5274_2.scala | 51 --------- tests/pending/run/t5275.check | 1 - tests/pending/run/t5275.scala | 9 -- tests/pending/run/t5276_1a.check | 1 - tests/pending/run/t5276_1a.scala | 9 -- tests/pending/run/t5276_1b.check | 1 - tests/pending/run/t5276_1b.scala | 9 -- tests/pending/run/t5276_2a.check | 1 - tests/pending/run/t5276_2a.scala | 12 --- tests/pending/run/t5276_2b.check | 1 - tests/pending/run/t5276_2b.scala | 13 --- tests/pending/run/t5277_1.check | 1 - tests/pending/run/t5277_1.scala | 16 --- tests/pending/run/t5277_2.check | 2 - tests/pending/run/t5277_2.scala | 12 --- tests/pending/run/t5279.check | 1 - tests/pending/run/t5279.scala | 8 -- tests/pending/run/t5334_1.check | 1 - tests/pending/run/t5334_1.scala | 15 --- tests/pending/run/t5334_2.check | 1 - tests/pending/run/t5334_2.scala | 15 --- tests/pending/run/t5335.check | 1 - tests/pending/run/t5335.scala | 8 -- tests/pending/run/t5415.scala | 12 --- tests/pending/run/t5418.scala | 8 -- tests/pending/run/t5418a.check | 1 - tests/pending/run/t5418a.scala | 3 - tests/pending/run/t5418b.check | 2 - tests/pending/run/t5418b.scala | 11 -- tests/pending/run/t5419.check | 1 - tests/pending/run/t5419.scala | 8 -- tests/pending/run/t5704.check | 1 - tests/pending/run/t5704.flags | 1 - tests/pending/run/t5704.scala | 19 ---- tests/pending/run/t5710-1.check | 1 - tests/pending/run/t5710-1.scala | 15 --- tests/pending/run/t5710-2.check | 1 - tests/pending/run/t5710-2.scala | 15 --- tests/pending/run/t5713.check | 1 - tests/pending/run/t5713.flags | 1 - tests/pending/run/t5713/Impls_Macros_1.scala | 28 ----- tests/pending/run/t5713/Test_2.scala | 5 - tests/pending/run/t5753_1.check | 1 - tests/pending/run/t5753_1.flags | 1 - tests/pending/run/t5753_1/Impls_Macros_1.scala | 10 -- tests/pending/run/t5753_1/Test_2.scala | 4 - tests/pending/run/t5753_2.check | 1 - tests/pending/run/t5753_2.flags | 1 - tests/pending/run/t5753_2/Impls_Macros_1.scala | 10 -- tests/pending/run/t5753_2/Test_2.scala | 4 - tests/pending/run/t5770.check | 10 -- tests/pending/run/t5770.scala | 25 ----- tests/pending/run/t5816.check | 1 - tests/pending/run/t5816.scala | 17 --- tests/pending/run/t5824.check | 1 - tests/pending/run/t5824.scala | 8 -- tests/pending/run/t5840.scala | 7 -- tests/pending/run/t5894.scala | 18 ---- tests/pending/run/t5903a.check | 1 - tests/pending/run/t5903a.flags | 1 - tests/pending/run/t5903a/Macros_1.scala | 28 ----- tests/pending/run/t5903a/Test_2.scala | 6 -- tests/pending/run/t5903b.check | 1 - tests/pending/run/t5903b.flags | 1 - tests/pending/run/t5903b/Macros_1.scala | 25 ----- tests/pending/run/t5903b/Test_2.scala | 6 -- tests/pending/run/t5903c.check | 1 - tests/pending/run/t5903c.flags | 1 - tests/pending/run/t5903c/Macros_1.scala | 23 ---- tests/pending/run/t5903c/Test_2.scala | 6 -- tests/pending/run/t5903d.check | 1 - tests/pending/run/t5903d.flags | 1 - tests/pending/run/t5903d/Macros_1.scala | 25 ----- tests/pending/run/t5903d/Test_2.scala | 6 -- tests/pending/run/t5923a.check | 3 - tests/pending/run/t5923a/Macros_1.scala | 53 --------- tests/pending/run/t5923a/Test_2.scala | 5 - tests/pending/run/t5923d/Macros_1.scala | 9 -- tests/pending/run/t5923d/Test_2.scala | 7 -- tests/pending/run/t5940.scala | 41 ------- tests/pending/run/t6023.check | 12 --- tests/pending/run/t6023.scala | 17 --- tests/pending/run/t6187.check | 32 ------ tests/pending/run/t6187.scala | 18 ---- tests/pending/run/t6187b.scala | 5 - tests/pending/run/t6221.check | 1 - tests/pending/run/t6221/Macros_1.scala | 23 ---- tests/pending/run/t6221/Test_2.scala | 10 -- tests/pending/run/t6379.check | 14 --- tests/pending/run/t6379/Macros_1.scala | 26 ----- tests/pending/run/t6379/Test_2.scala | 22 ---- tests/pending/run/t6381.check | 19 ---- tests/pending/run/t6381.scala | 15 --- tests/pending/run/t6394a.check | 1 - tests/pending/run/t6394a.flags | 1 - tests/pending/run/t6394a/Macros_1.scala | 12 --- tests/pending/run/t6394a/Test_2.scala | 4 - tests/pending/run/t6394b.check | 1 - tests/pending/run/t6394b.flags | 1 - tests/pending/run/t6394b/Macros_1.scala | 12 --- tests/pending/run/t6394b/Test_2.scala | 4 - tests/pending/run/t6591_1.check | 1 - tests/pending/run/t6591_1.scala | 19 ---- tests/pending/run/t6591_2.check | 1 - tests/pending/run/t6591_2.scala | 19 ---- tests/pending/run/t6591_3.check | 1 - tests/pending/run/t6591_3.scala | 17 --- tests/pending/run/t6591_5.check | 1 - tests/pending/run/t6591_5.scala | 23 ---- tests/pending/run/t6591_6.check | 1 - tests/pending/run/t6591_6.scala | 24 ----- tests/pending/run/t6591_7.check | 4 - tests/pending/run/t6591_7.scala | 27 ----- tests/pending/run/t6662.check | 1 - tests/pending/run/t6662/Macro_1.scala | 8 -- tests/pending/run/t6662/Test_2.scala | 8 -- tests/pending/run/t6814.check | 7 -- tests/pending/run/t6814/Macros_1.scala | 24 ----- tests/pending/run/t6814/Test_2.scala | 3 - tests/pending/run/t6992.check | 4 - tests/pending/run/t6992/Macros_1.scala | 75 ------------- tests/pending/run/t6992/Test_2.scala | 14 --- tests/pending/run/t7008-scala-defined.check | 7 -- tests/pending/run/t7008-scala-defined.flags | 1 - .../run/t7008-scala-defined/Impls_Macros_2.scala | 13 --- .../ScalaClassWithCheckedExceptions_1.scala | 6 -- tests/pending/run/t7008-scala-defined/Test_3.scala | 9 -- tests/pending/run/t7008.check | 9 -- tests/pending/run/t7008/Impls_Macros_2.scala | 13 --- .../t7008/JavaClassWithCheckedExceptions_1.java | 7 -- tests/pending/run/t7008/Test_3.scala | 9 -- tests/pending/run/t7044.check | 14 --- tests/pending/run/t7044/Macros_1.scala | 26 ----- tests/pending/run/t7044/Test_2.scala | 19 ---- tests/pending/run/t7047.check | 3 - tests/pending/run/t7047/Impls_Macros_1.scala | 19 ---- tests/pending/run/t7047/Test_2.scala | 3 - tests/pending/run/t7157.check | 1 - tests/pending/run/t7157/Impls_Macros_1.scala | 15 --- tests/pending/run/t7157/Test_2.scala | 5 - tests/pending/run/t7185.check | 32 ------ tests/pending/run/t7185.scala | 12 --- tests/pending/run/t7235.check | 4 - tests/pending/run/t7235.scala | 14 --- tests/pending/run/t7240/Macros_1.scala | 48 --------- tests/pending/run/t7240/Test_2.scala | 3 - tests/pending/run/t7375b.check | 4 - tests/pending/run/t7375b/Macros_1.scala | 18 ---- tests/pending/run/t7375b/Test_2.scala | 3 - tests/pending/run/t7558.scala | 9 -- tests/pending/run/t7617a.check | 2 - tests/pending/run/t7617a/Macros_1.scala | 22 ---- tests/pending/run/t7617a/Test_2.scala | 5 - tests/pending/run/t7617b.check | 1 - tests/pending/run/t7617b/Macros_1.scala | 8 -- tests/pending/run/t7617b/Test_2.scala | 11 -- tests/pending/run/t7657.check | 3 - tests/pending/run/t7657/Macros_1.scala | 8 -- tests/pending/run/t7657/Test_2.scala | 6 -- tests/pending/run/t7777.check | 7 -- tests/pending/run/t7777/Macros_1.scala | 17 --- tests/pending/run/t7777/Test_2.scala | 6 -- tests/pending/run/t7868b.check | 6 -- tests/pending/run/t7868b.scala | 11 -- tests/pending/run/t7871.check | 1 - tests/pending/run/t7871/Macros_1.scala | 27 ----- tests/pending/run/t7871/Test_2.scala | 6 -- tests/pending/run/t8048a.check | 1 - tests/pending/run/t8048a/Macros_1.scala | 11 -- tests/pending/run/t8048a/Test_2.scala | 4 - tests/pending/run/t8048b.check | 3 - tests/pending/run/t8048b/Macros_1.scala | 37 ------- tests/pending/run/t8048b/Test_2.scala | 5 - tests/pending/run/t8104.check | 2 - tests/pending/run/t8104/Macros_1.scala | 11 -- tests/pending/run/t8104/Test_2.scala | 19 ---- tests/pending/run/t8192.check | 32 ------ tests/pending/run/t8192/Macros_1.scala | 45 -------- tests/pending/run/t8192/Test_2.scala | 40 ------- tests/pending/run/t8321.check | 1 - tests/pending/run/t8321/Macros_1.scala | 11 -- tests/pending/run/t8321/Test_2.scala | 3 - tests/pending/run/t8425.check | 1 - tests/pending/run/t8425/Macros_1.scala | 12 --- tests/pending/run/t8425/Test_2.scala | 3 - tests/pending/run/t8437.check | 2 - tests/pending/run/t8437/Macros_1.scala | 18 ---- tests/pending/run/t8437/Test_2.scala | 4 - tests/pending/run/toolbox_console_reporter.check | 8 -- tests/pending/run/toolbox_console_reporter.scala | 28 ----- .../pending/run/toolbox_current_run_compiles.check | 2 - .../pending/run/toolbox_current_run_compiles.scala | 28 ----- .../run/toolbox_default_reporter_is_silent.check | 1 - .../run/toolbox_default_reporter_is_silent.scala | 16 --- tests/pending/run/toolbox_silent_reporter.check | 4 - tests/pending/run/toolbox_silent_reporter.scala | 19 ---- .../run/toolbox_typecheck_macrosdisabled.check | 41 ------- .../run/toolbox_typecheck_macrosdisabled.scala | 26 ----- .../run/toolbox_typecheck_macrosdisabled2.check | 41 ------- .../run/toolbox_typecheck_macrosdisabled2.scala | 26 ----- tests/pending/run/typecheck.check | 0 tests/pending/run/typecheck/Macros_1.scala | 12 --- tests/pending/run/typecheck/Test_2.scala | 10 -- tests/pending/run/typed-annotated.check | 1 - tests/pending/run/typed-annotated/Macros_1.scala | 17 --- tests/pending/run/typed-annotated/Test_2.scala | 3 - 2040 files changed, 11391 insertions(+), 11391 deletions(-) create mode 100644 tests/disabled/macro/pos/attachments-typed-another-ident/Impls_1.scala create mode 100644 tests/disabled/macro/pos/attachments-typed-another-ident/Macros_Test_2.scala create mode 100644 tests/disabled/macro/pos/attachments-typed-ident/Impls_1.scala create mode 100644 tests/disabled/macro/pos/attachments-typed-ident/Macros_Test_2.scala create mode 100644 tests/disabled/macro/pos/liftcode_polymorphic.scala create mode 100644 tests/disabled/macro/pos/macro-bundle-disambiguate-bundle.check create mode 100644 tests/disabled/macro/pos/macro-bundle-disambiguate-bundle.scala create mode 100644 tests/disabled/macro/pos/macro-bundle-disambiguate-nonbundle.check create mode 100644 tests/disabled/macro/pos/macro-bundle-disambiguate-nonbundle.scala create mode 100644 tests/disabled/macro/pos/macro-implicit-invalidate-on-error.check create mode 100644 tests/disabled/macro/pos/macro-implicit-invalidate-on-error.scala create mode 100644 tests/disabled/macro/pos/macro-qmarkqmarkqmark.scala create mode 100644 tests/disabled/macro/pos/t5223.scala create mode 100644 tests/disabled/macro/pos/t5692a/Macros_1.scala create mode 100644 tests/disabled/macro/pos/t5692a/Test_2.scala create mode 100644 tests/disabled/macro/pos/t5692b/Macros_1.scala create mode 100644 tests/disabled/macro/pos/t5692b/Test_2.scala create mode 100644 tests/disabled/macro/pos/t5706.flags create mode 100644 tests/disabled/macro/pos/t5706.scala create mode 100644 tests/disabled/macro/pos/t5744/Macros_1.scala create mode 100644 tests/disabled/macro/pos/t5744/Test_2.scala create mode 100644 tests/disabled/macro/pos/t6047.flags create mode 100644 tests/disabled/macro/pos/t6047.scala create mode 100644 tests/disabled/macro/pos/t6386.scala create mode 100644 tests/disabled/macro/pos/t6447.scala create mode 100644 tests/disabled/macro/pos/t6485a/Macros_1.scala create mode 100644 tests/disabled/macro/pos/t6485a/Test_2.scala create mode 100644 tests/disabled/macro/pos/t6485b/Test.scala create mode 100644 tests/disabled/macro/pos/t6516.scala create mode 100644 tests/disabled/macro/pos/t7190.scala create mode 100644 tests/disabled/macro/pos/t7377/Client_2.scala create mode 100644 tests/disabled/macro/pos/t7377/Macro_1.scala create mode 100644 tests/disabled/macro/pos/t7461/Macros_1.scala create mode 100644 tests/disabled/macro/pos/t7461/Test_2.scala create mode 100644 tests/disabled/macro/pos/t7516/A_1.scala create mode 100644 tests/disabled/macro/pos/t7516/B_2.scala create mode 100644 tests/disabled/macro/pos/t7649.flags create mode 100644 tests/disabled/macro/pos/t7649.scala create mode 100644 tests/disabled/macro/pos/t7776.check create mode 100644 tests/disabled/macro/pos/t7776.scala create mode 100644 tests/disabled/macro/pos/t7987/Macro_1.scala create mode 100644 tests/disabled/macro/pos/t7987/Test_2.scala create mode 100644 tests/disabled/macro/pos/t8001/Macros_1.scala create mode 100644 tests/disabled/macro/pos/t8001/Test_2.scala create mode 100644 tests/disabled/macro/pos/t8013/inpervolated_2.scala create mode 100644 tests/disabled/macro/pos/t8013/inpervolator_1.scala create mode 100644 tests/disabled/macro/pos/t8064/Client_2.scala create mode 100644 tests/disabled/macro/pos/t8064/Macro_1.scala create mode 100644 tests/disabled/macro/pos/t8064b/Client_2.scala create mode 100644 tests/disabled/macro/pos/t8064b/Macro_1.scala create mode 100644 tests/disabled/macro/pos/t8209a/Macros_1.scala create mode 100644 tests/disabled/macro/pos/t8209a/Test_2.scala create mode 100644 tests/disabled/macro/pos/t8209b/Macros_1.scala create mode 100644 tests/disabled/macro/pos/t8209b/Test_2.scala create mode 100644 tests/disabled/macro/pos/t8352/Macros_1.scala create mode 100644 tests/disabled/macro/pos/t8352/Test_2.scala create mode 100644 tests/disabled/macro/run/exprs_serialize.check create mode 100644 tests/disabled/macro/run/exprs_serialize.scala create mode 100644 tests/disabled/macro/run/freetypes_false_alarm1.check create mode 100644 tests/disabled/macro/run/freetypes_false_alarm1.scala create mode 100644 tests/disabled/macro/run/idempotency-case-classes.check create mode 100644 tests/disabled/macro/run/idempotency-case-classes.scala create mode 100644 tests/disabled/macro/run/idempotency-extractors.check create mode 100644 tests/disabled/macro/run/idempotency-extractors.scala create mode 100644 tests/disabled/macro/run/idempotency-labels.check create mode 100644 tests/disabled/macro/run/idempotency-labels.scala create mode 100644 tests/disabled/macro/run/idempotency-lazy-vals.check create mode 100644 tests/disabled/macro/run/idempotency-lazy-vals.scala create mode 100644 tests/disabled/macro/run/idempotency-this.check create mode 100644 tests/disabled/macro/run/idempotency-this.scala create mode 100644 tests/disabled/macro/run/macro-abort-fresh.check create mode 100644 tests/disabled/macro/run/macro-abort-fresh.flags create mode 100644 tests/disabled/macro/run/macro-abort-fresh/Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-abort-fresh/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-auto-duplicate.check create mode 100644 tests/disabled/macro/run/macro-auto-duplicate/Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-auto-duplicate/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-basic-ma-md-mi.check create mode 100644 tests/disabled/macro/run/macro-basic-ma-md-mi.flags create mode 100644 tests/disabled/macro/run/macro-basic-ma-md-mi/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-basic-ma-md-mi/Macros_2.scala create mode 100644 tests/disabled/macro/run/macro-basic-ma-md-mi/Test_3.scala create mode 100644 tests/disabled/macro/run/macro-basic-ma-mdmi.check create mode 100644 tests/disabled/macro/run/macro-basic-ma-mdmi.flags create mode 100644 tests/disabled/macro/run/macro-basic-ma-mdmi/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-basic-ma-mdmi/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-basic-mamd-mi.check create mode 100644 tests/disabled/macro/run/macro-basic-mamd-mi.flags create mode 100644 tests/disabled/macro/run/macro-basic-mamd-mi/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-basic-mamd-mi/Macros_Test_2.scala create mode 100644 tests/disabled/macro/run/macro-blackbox-materialization.check create mode 100644 tests/disabled/macro/run/macro-blackbox-materialization/Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-blackbox-materialization/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-bodyexpandstoimpl.check create mode 100644 tests/disabled/macro/run/macro-bodyexpandstoimpl.flags create mode 100644 tests/disabled/macro/run/macro-bodyexpandstoimpl/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-bodyexpandstoimpl/Macros_Test_2.scala create mode 100644 tests/disabled/macro/run/macro-bundle-context-alias.check create mode 100644 tests/disabled/macro/run/macro-bundle-context-alias/Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-bundle-context-alias/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-bundle-context-refinement.check create mode 100644 tests/disabled/macro/run/macro-bundle-context-refinement/Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-bundle-context-refinement/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-bundle-repl.check create mode 100644 tests/disabled/macro/run/macro-bundle-repl.scala create mode 100644 tests/disabled/macro/run/macro-bundle-static.check create mode 100644 tests/disabled/macro/run/macro-bundle-static/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-bundle-static/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-bundle-toplevel.check create mode 100644 tests/disabled/macro/run/macro-bundle-toplevel.flags create mode 100644 tests/disabled/macro/run/macro-bundle-toplevel/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-bundle-toplevel/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-bundle-whitebox-decl.check create mode 100644 tests/disabled/macro/run/macro-bundle-whitebox-decl/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-bundle-whitebox-decl/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-bundle-whitebox-use-raw.check create mode 100644 tests/disabled/macro/run/macro-bundle-whitebox-use-raw/Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-bundle-whitebox-use-raw/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-bundle-whitebox-use-refined.check create mode 100644 tests/disabled/macro/run/macro-bundle-whitebox-use-refined/Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-bundle-whitebox-use-refined/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-def-path-dependent.check create mode 100644 tests/disabled/macro/run/macro-def-path-dependent.flags create mode 100644 tests/disabled/macro/run/macro-def-path-dependent/Dummy.scala create mode 100644 tests/disabled/macro/run/macro-def-path-dependent/Test_1.scala create mode 100644 tests/disabled/macro/run/macro-def-path-dependent/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-def-path-dependent/Test_3.scala create mode 100644 tests/disabled/macro/run/macro-def-path-dependent/Test_4.scala create mode 100644 tests/disabled/macro/run/macro-def-path-dependent/Test_5.scala create mode 100644 tests/disabled/macro/run/macro-def-path-dependent/Test_6.scala create mode 100644 tests/disabled/macro/run/macro-default-params.check create mode 100644 tests/disabled/macro/run/macro-default-params/Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-default-params/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-divergence-spurious.check create mode 100644 tests/disabled/macro/run/macro-divergence-spurious/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-divergence-spurious/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-duplicate.check create mode 100644 tests/disabled/macro/run/macro-duplicate.flags create mode 100644 tests/disabled/macro/run/macro-duplicate/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-duplicate/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-enclosingowner-detectvar.check create mode 100644 tests/disabled/macro/run/macro-enclosingowner-detectvar/Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-enclosingowner-detectvar/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-enclosingowner-sbt.check create mode 100644 tests/disabled/macro/run/macro-enclosingowner-sbt/Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-enclosingowner-sbt/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-enclosures.check create mode 100644 tests/disabled/macro/run/macro-enclosures.flags create mode 100644 tests/disabled/macro/run/macro-enclosures/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-enclosures/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-expand-implicit-argument.check create mode 100644 tests/disabled/macro/run/macro-expand-implicit-argument.flags create mode 100644 tests/disabled/macro/run/macro-expand-implicit-argument/Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-expand-implicit-argument/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-expand-implicit-macro-has-implicit.check create mode 100644 tests/disabled/macro/run/macro-expand-implicit-macro-has-implicit.flags create mode 100644 tests/disabled/macro/run/macro-expand-implicit-macro-has-implicit/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-expand-implicit-macro-has-implicit/Macros_Test_2.scala create mode 100644 tests/disabled/macro/run/macro-expand-implicit-macro-is-implicit.check create mode 100644 tests/disabled/macro/run/macro-expand-implicit-macro-is-implicit.flags create mode 100644 tests/disabled/macro/run/macro-expand-implicit-macro-is-implicit/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-expand-implicit-macro-is-implicit/Macros_Test_2.scala create mode 100644 tests/disabled/macro/run/macro-expand-implicit-macro-is-val.check create mode 100644 tests/disabled/macro/run/macro-expand-implicit-macro-is-val.flags create mode 100644 tests/disabled/macro/run/macro-expand-implicit-macro-is-val/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-expand-implicit-macro-is-val/Macros_Test_2.scala create mode 100644 tests/disabled/macro/run/macro-expand-implicit-macro-is-view.check create mode 100644 tests/disabled/macro/run/macro-expand-implicit-macro-is-view/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-expand-implicit-macro-is-view/Macros_Test_2.scala create mode 100644 tests/disabled/macro/run/macro-expand-multiple-arglists.check create mode 100644 tests/disabled/macro/run/macro-expand-multiple-arglists.flags create mode 100644 tests/disabled/macro/run/macro-expand-multiple-arglists/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-expand-multiple-arglists/Macros_Test_2.scala create mode 100644 tests/disabled/macro/run/macro-expand-nullary-generic.check create mode 100644 tests/disabled/macro/run/macro-expand-nullary-generic.flags create mode 100644 tests/disabled/macro/run/macro-expand-nullary-generic/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-expand-nullary-generic/Macros_Test_2.scala create mode 100644 tests/disabled/macro/run/macro-expand-nullary-nongeneric.check create mode 100644 tests/disabled/macro/run/macro-expand-nullary-nongeneric.flags create mode 100644 tests/disabled/macro/run/macro-expand-nullary-nongeneric/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-expand-nullary-nongeneric/Macros_Test_2.scala create mode 100644 tests/disabled/macro/run/macro-expand-overload.check create mode 100644 tests/disabled/macro/run/macro-expand-overload.flags create mode 100644 tests/disabled/macro/run/macro-expand-overload/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-expand-overload/Macros_Test_2.scala create mode 100644 tests/disabled/macro/run/macro-expand-override.check create mode 100644 tests/disabled/macro/run/macro-expand-override.flags create mode 100644 tests/disabled/macro/run/macro-expand-override/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-expand-override/Macros_Test_2.scala create mode 100644 tests/disabled/macro/run/macro-expand-recursive.check create mode 100644 tests/disabled/macro/run/macro-expand-recursive.flags create mode 100644 tests/disabled/macro/run/macro-expand-recursive/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-expand-recursive/Macros_Test_2.scala create mode 100644 tests/disabled/macro/run/macro-expand-tparams-bounds.check create mode 100644 tests/disabled/macro/run/macro-expand-tparams-bounds.flags create mode 100644 tests/disabled/macro/run/macro-expand-tparams-bounds/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-expand-tparams-bounds/Macros_Test_2.scala create mode 100644 tests/disabled/macro/run/macro-expand-tparams-explicit.check create mode 100644 tests/disabled/macro/run/macro-expand-tparams-explicit.flags create mode 100644 tests/disabled/macro/run/macro-expand-tparams-explicit/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-expand-tparams-explicit/Macros_Test_2.scala create mode 100644 tests/disabled/macro/run/macro-expand-tparams-implicit.check create mode 100644 tests/disabled/macro/run/macro-expand-tparams-implicit.flags create mode 100644 tests/disabled/macro/run/macro-expand-tparams-implicit/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-expand-tparams-implicit/Macros_Test_2.scala create mode 100644 tests/disabled/macro/run/macro-expand-tparams-prefix.check create mode 100644 tests/disabled/macro/run/macro-expand-tparams-prefix.flags create mode 100644 tests/disabled/macro/run/macro-expand-tparams-prefix/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-expand-tparams-prefix/Macros_Test_2.scala create mode 100644 tests/disabled/macro/run/macro-expand-unapply-a.check create mode 100644 tests/disabled/macro/run/macro-expand-unapply-a.flags create mode 100644 tests/disabled/macro/run/macro-expand-unapply-a/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-expand-unapply-a/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-expand-varargs-explicit-over-nonvarargs-bad.check create mode 100644 tests/disabled/macro/run/macro-expand-varargs-explicit-over-nonvarargs-bad.flags create mode 100644 tests/disabled/macro/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Macros_Test_2.scala create mode 100644 tests/disabled/macro/run/macro-expand-varargs-explicit-over-nonvarargs-good.check create mode 100644 tests/disabled/macro/run/macro-expand-varargs-explicit-over-nonvarargs-good.flags create mode 100644 tests/disabled/macro/run/macro-expand-varargs-explicit-over-nonvarargs-good/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-expand-varargs-explicit-over-nonvarargs-good/Macros_Test_2.scala create mode 100644 tests/disabled/macro/run/macro-expand-varargs-explicit-over-varargs.check create mode 100644 tests/disabled/macro/run/macro-expand-varargs-explicit-over-varargs.flags create mode 100644 tests/disabled/macro/run/macro-expand-varargs-explicit-over-varargs/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-expand-varargs-explicit-over-varargs/Macros_Test_2.scala create mode 100644 tests/disabled/macro/run/macro-expand-varargs-implicit-over-nonvarargs.check create mode 100644 tests/disabled/macro/run/macro-expand-varargs-implicit-over-nonvarargs.flags create mode 100644 tests/disabled/macro/run/macro-expand-varargs-implicit-over-nonvarargs/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-expand-varargs-implicit-over-nonvarargs/Macros_Test_2.scala create mode 100644 tests/disabled/macro/run/macro-expand-varargs-implicit-over-varargs.check create mode 100644 tests/disabled/macro/run/macro-expand-varargs-implicit-over-varargs.flags create mode 100644 tests/disabled/macro/run/macro-expand-varargs-implicit-over-varargs/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-expand-varargs-implicit-over-varargs/Macros_Test_2.scala create mode 100644 tests/disabled/macro/run/macro-impl-default-params.check create mode 100644 tests/disabled/macro/run/macro-impl-default-params.flags create mode 100644 tests/disabled/macro/run/macro-impl-default-params/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-impl-default-params/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-impl-relaxed.check create mode 100644 tests/disabled/macro/run/macro-impl-relaxed/Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-impl-relaxed/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-impl-rename-context.check create mode 100644 tests/disabled/macro/run/macro-impl-rename-context.flags create mode 100644 tests/disabled/macro/run/macro-impl-rename-context/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-impl-rename-context/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-impl-tparam-only-in-impl.check create mode 100644 tests/disabled/macro/run/macro-impl-tparam-only-in-impl.flags create mode 100644 tests/disabled/macro/run/macro-impl-tparam-only-in-impl/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-impl-tparam-only-in-impl/Macros_Test_2.scala create mode 100644 tests/disabled/macro/run/macro-impl-tparam-typetag-is-optional.check create mode 100644 tests/disabled/macro/run/macro-impl-tparam-typetag-is-optional.flags create mode 100644 tests/disabled/macro/run/macro-impl-tparam-typetag-is-optional/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-impl-tparam-typetag-is-optional/Macros_Test_2.scala create mode 100644 tests/disabled/macro/run/macro-invalidret-doesnt-conform-to-def-rettype.check create mode 100644 tests/disabled/macro/run/macro-invalidret-doesnt-conform-to-def-rettype.flags create mode 100644 tests/disabled/macro/run/macro-invalidret-doesnt-conform-to-def-rettype/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-invalidret-doesnt-conform-to-def-rettype/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-invalidret-nontypeable.check create mode 100644 tests/disabled/macro/run/macro-invalidret-nontypeable.flags create mode 100644 tests/disabled/macro/run/macro-invalidret-nontypeable/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-invalidret-nontypeable/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-invalidusage-badret.check create mode 100644 tests/disabled/macro/run/macro-invalidusage-badret.flags create mode 100644 tests/disabled/macro/run/macro-invalidusage-badret/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-invalidusage-badret/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-invalidusage-partialapplication-with-tparams.check create mode 100644 tests/disabled/macro/run/macro-invalidusage-partialapplication-with-tparams.flags create mode 100644 tests/disabled/macro/run/macro-invalidusage-partialapplication-with-tparams/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-invalidusage-partialapplication-with-tparams/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-invalidusage-partialapplication.check create mode 100644 tests/disabled/macro/run/macro-invalidusage-partialapplication.flags create mode 100644 tests/disabled/macro/run/macro-invalidusage-partialapplication/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-invalidusage-partialapplication/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-openmacros.check create mode 100644 tests/disabled/macro/run/macro-openmacros.flags create mode 100644 tests/disabled/macro/run/macro-openmacros/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-openmacros/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-parse-position-malformed.check create mode 100644 tests/disabled/macro/run/macro-parse-position-malformed/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-parse-position-malformed/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-parse-position.check create mode 100644 tests/disabled/macro/run/macro-parse-position.flags create mode 100644 tests/disabled/macro/run/macro-parse-position/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-parse-position/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-quasiinvalidbody-c.check create mode 100644 tests/disabled/macro/run/macro-quasiinvalidbody-c.flags create mode 100644 tests/disabled/macro/run/macro-quasiinvalidbody-c/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-quasiinvalidbody-c/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-quasiquotes.check create mode 100644 tests/disabled/macro/run/macro-quasiquotes/Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-quasiquotes/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-range.check create mode 100644 tests/disabled/macro/run/macro-range.flags create mode 100644 tests/disabled/macro/run/macro-range/Common_1.scala create mode 100644 tests/disabled/macro/run/macro-range/Expansion_Impossible_2.scala create mode 100644 tests/disabled/macro/run/macro-range/Expansion_Possible_3.scala create mode 100644 tests/disabled/macro/run/macro-rangepos-args.check create mode 100644 tests/disabled/macro/run/macro-rangepos-args.flags create mode 100644 tests/disabled/macro/run/macro-rangepos-args/Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-rangepos-args/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-rangepos-subpatterns.check create mode 100644 tests/disabled/macro/run/macro-rangepos-subpatterns.flags create mode 100644 tests/disabled/macro/run/macro-rangepos-subpatterns/Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-rangepos-subpatterns/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-reflective-ma-normal-mdmi.check create mode 100644 tests/disabled/macro/run/macro-reflective-ma-normal-mdmi.flags create mode 100644 tests/disabled/macro/run/macro-reflective-ma-normal-mdmi/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-reflective-ma-normal-mdmi/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-reflective-mamd-normal-mi.check create mode 100644 tests/disabled/macro/run/macro-reflective-mamd-normal-mi/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-reflective-mamd-normal-mi/Macros_Test_2.scala create mode 100644 tests/disabled/macro/run/macro-reify-basic.check create mode 100644 tests/disabled/macro/run/macro-reify-basic.flags create mode 100644 tests/disabled/macro/run/macro-reify-basic/Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-reify-basic/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-reify-chained1/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-reify-chained1/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-reify-chained2/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-reify-chained2/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-reify-freevars.check create mode 100644 tests/disabled/macro/run/macro-reify-freevars.flags create mode 100644 tests/disabled/macro/run/macro-reify-freevars/Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-reify-freevars/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-reify-nested-a1/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-reify-nested-a1/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-reify-nested-a2/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-reify-nested-a2/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-reify-nested-b1/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-reify-nested-b1/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-reify-nested-b2/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-reify-nested-b2/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-reify-ref-to-packageless.check create mode 100644 tests/disabled/macro/run/macro-reify-ref-to-packageless.flags create mode 100644 tests/disabled/macro/run/macro-reify-ref-to-packageless/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-reify-ref-to-packageless/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-reify-splice-outside-reify.check create mode 100644 tests/disabled/macro/run/macro-reify-splice-outside-reify.flags create mode 100644 tests/disabled/macro/run/macro-reify-splice-outside-reify/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-reify-splice-outside-reify/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-reify-staticXXX.check create mode 100644 tests/disabled/macro/run/macro-reify-staticXXX.flags create mode 100644 tests/disabled/macro/run/macro-reify-staticXXX/Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-reify-staticXXX/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-reify-tagful-a.check create mode 100644 tests/disabled/macro/run/macro-reify-tagful-a.flags create mode 100644 tests/disabled/macro/run/macro-reify-tagful-a/Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-reify-tagful-a/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-reify-tagless-a.check create mode 100644 tests/disabled/macro/run/macro-reify-tagless-a.flags create mode 100644 tests/disabled/macro/run/macro-reify-tagless-a/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-reify-tagless-a/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-reify-type.check create mode 100644 tests/disabled/macro/run/macro-reify-type.flags create mode 100644 tests/disabled/macro/run/macro-reify-type/Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-reify-type/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-reify-typetag-notypeparams.check create mode 100644 tests/disabled/macro/run/macro-reify-typetag-notypeparams/Test.scala create mode 100644 tests/disabled/macro/run/macro-reify-typetag-typeparams-tags.check create mode 100644 tests/disabled/macro/run/macro-reify-typetag-typeparams-tags/Test.scala create mode 100644 tests/disabled/macro/run/macro-reify-unreify.check create mode 100644 tests/disabled/macro/run/macro-reify-unreify.flags create mode 100644 tests/disabled/macro/run/macro-reify-unreify/Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-reify-unreify/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-repl-basic.check create mode 100644 tests/disabled/macro/run/macro-repl-basic.scala create mode 100644 tests/disabled/macro/run/macro-repl-dontexpand.check create mode 100644 tests/disabled/macro/run/macro-repl-dontexpand.scala create mode 100644 tests/disabled/macro/run/macro-settings.check create mode 100644 tests/disabled/macro/run/macro-settings.flags create mode 100644 tests/disabled/macro/run/macro-settings/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-settings/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-sip19-revised.check create mode 100644 tests/disabled/macro/run/macro-sip19-revised.flags create mode 100644 tests/disabled/macro/run/macro-sip19-revised/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-sip19-revised/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-sip19.check create mode 100644 tests/disabled/macro/run/macro-sip19.flags create mode 100644 tests/disabled/macro/run/macro-sip19/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-sip19/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-subpatterns.check create mode 100644 tests/disabled/macro/run/macro-subpatterns/Macro_1.scala create mode 100644 tests/disabled/macro/run/macro-subpatterns/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-system-properties.check create mode 100644 tests/disabled/macro/run/macro-system-properties.scala create mode 100644 tests/disabled/macro/run/macro-term-declared-in-annotation.check create mode 100644 tests/disabled/macro/run/macro-term-declared-in-annotation.flags create mode 100644 tests/disabled/macro/run/macro-term-declared-in-annotation/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-term-declared-in-annotation/Macros_2.scala create mode 100644 tests/disabled/macro/run/macro-term-declared-in-annotation/Test_3.scala create mode 100644 tests/disabled/macro/run/macro-term-declared-in-anonymous.check create mode 100644 tests/disabled/macro/run/macro-term-declared-in-anonymous.flags create mode 100644 tests/disabled/macro/run/macro-term-declared-in-anonymous/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-term-declared-in-anonymous/Macros_Test_2.scala create mode 100644 tests/disabled/macro/run/macro-term-declared-in-block.check create mode 100644 tests/disabled/macro/run/macro-term-declared-in-block.flags create mode 100644 tests/disabled/macro/run/macro-term-declared-in-block/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-term-declared-in-block/Macros_Test_2.scala create mode 100644 tests/disabled/macro/run/macro-term-declared-in-class-class.check create mode 100644 tests/disabled/macro/run/macro-term-declared-in-class-class.flags create mode 100644 tests/disabled/macro/run/macro-term-declared-in-class-class/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-term-declared-in-class-class/Macros_Test_2.scala create mode 100644 tests/disabled/macro/run/macro-term-declared-in-class-object.check create mode 100644 tests/disabled/macro/run/macro-term-declared-in-class-object.flags create mode 100644 tests/disabled/macro/run/macro-term-declared-in-class-object/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-term-declared-in-class-object/Macros_Test_2.scala create mode 100644 tests/disabled/macro/run/macro-term-declared-in-class.check create mode 100644 tests/disabled/macro/run/macro-term-declared-in-class.flags create mode 100644 tests/disabled/macro/run/macro-term-declared-in-class/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-term-declared-in-class/Macros_Test_2.scala create mode 100644 tests/disabled/macro/run/macro-term-declared-in-default-param.check create mode 100644 tests/disabled/macro/run/macro-term-declared-in-default-param.flags create mode 100644 tests/disabled/macro/run/macro-term-declared-in-default-param/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-term-declared-in-default-param/Macros_Test_2.scala create mode 100644 tests/disabled/macro/run/macro-term-declared-in-implicit-class.check create mode 100644 tests/disabled/macro/run/macro-term-declared-in-implicit-class.flags create mode 100644 tests/disabled/macro/run/macro-term-declared-in-implicit-class/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-term-declared-in-implicit-class/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-term-declared-in-method.check create mode 100644 tests/disabled/macro/run/macro-term-declared-in-method.flags create mode 100644 tests/disabled/macro/run/macro-term-declared-in-method/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-term-declared-in-method/Macros_Test_2.scala create mode 100644 tests/disabled/macro/run/macro-term-declared-in-object-class.check create mode 100644 tests/disabled/macro/run/macro-term-declared-in-object-class.flags create mode 100644 tests/disabled/macro/run/macro-term-declared-in-object-class/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-term-declared-in-object-class/Macros_Test_2.scala create mode 100644 tests/disabled/macro/run/macro-term-declared-in-object-object.check create mode 100644 tests/disabled/macro/run/macro-term-declared-in-object-object.flags create mode 100644 tests/disabled/macro/run/macro-term-declared-in-object-object/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-term-declared-in-object-object/Macros_Test_2.scala create mode 100644 tests/disabled/macro/run/macro-term-declared-in-object.check create mode 100644 tests/disabled/macro/run/macro-term-declared-in-object.flags create mode 100644 tests/disabled/macro/run/macro-term-declared-in-object/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-term-declared-in-object/Macros_Test_2.scala create mode 100644 tests/disabled/macro/run/macro-term-declared-in-package-object.check create mode 100644 tests/disabled/macro/run/macro-term-declared-in-package-object.flags create mode 100644 tests/disabled/macro/run/macro-term-declared-in-package-object/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-term-declared-in-package-object/Macros_Test_2.scala create mode 100644 tests/disabled/macro/run/macro-term-declared-in-refinement.check create mode 100644 tests/disabled/macro/run/macro-term-declared-in-refinement.flags create mode 100644 tests/disabled/macro/run/macro-term-declared-in-refinement/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-term-declared-in-refinement/Macros_Test_2.scala create mode 100644 tests/disabled/macro/run/macro-term-declared-in-trait.check create mode 100644 tests/disabled/macro/run/macro-term-declared-in-trait.flags create mode 100644 tests/disabled/macro/run/macro-term-declared-in-trait/Impls_1.scala create mode 100644 tests/disabled/macro/run/macro-term-declared-in-trait/Macros_Test_2.scala create mode 100644 tests/disabled/macro/run/macro-typecheck-implicitsdisabled.check create mode 100644 tests/disabled/macro/run/macro-typecheck-implicitsdisabled.flags create mode 100644 tests/disabled/macro/run/macro-typecheck-implicitsdisabled/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-typecheck-implicitsdisabled/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-typecheck-macrosdisabled.check create mode 100644 tests/disabled/macro/run/macro-typecheck-macrosdisabled.flags create mode 100644 tests/disabled/macro/run/macro-typecheck-macrosdisabled/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-typecheck-macrosdisabled/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-typecheck-macrosdisabled2.check create mode 100644 tests/disabled/macro/run/macro-typecheck-macrosdisabled2.flags create mode 100644 tests/disabled/macro/run/macro-typecheck-macrosdisabled2/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-typecheck-macrosdisabled2/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-undetparams-consfromsls.check create mode 100644 tests/disabled/macro/run/macro-undetparams-consfromsls.flags create mode 100644 tests/disabled/macro/run/macro-undetparams-consfromsls/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-undetparams-consfromsls/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-undetparams-macroitself.check create mode 100644 tests/disabled/macro/run/macro-undetparams-macroitself.flags create mode 100644 tests/disabled/macro/run/macro-undetparams-macroitself/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-undetparams-macroitself/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-vampire-false-warning.check create mode 100644 tests/disabled/macro/run/macro-vampire-false-warning.flags create mode 100644 tests/disabled/macro/run/macro-vampire-false-warning/Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-vampire-false-warning/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-whitebox-dynamic-materialization.check create mode 100644 tests/disabled/macro/run/macro-whitebox-dynamic-materialization/Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-whitebox-dynamic-materialization/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-whitebox-extractor.check create mode 100644 tests/disabled/macro/run/macro-whitebox-extractor/Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-whitebox-extractor/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-whitebox-fundep-materialization.check create mode 100644 tests/disabled/macro/run/macro-whitebox-fundep-materialization/Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-whitebox-fundep-materialization/Test_2.scala create mode 100644 tests/disabled/macro/run/macro-whitebox-structural.check create mode 100644 tests/disabled/macro/run/macro-whitebox-structural/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/macro-whitebox-structural/Test_2.scala create mode 100644 tests/disabled/macro/run/macroPlugins-isBlackbox/Macros_2.scala create mode 100644 tests/disabled/macro/run/macroPlugins-isBlackbox/Plugin_1.scala create mode 100644 tests/disabled/macro/run/macroPlugins-isBlackbox/Test_3.flags create mode 100644 tests/disabled/macro/run/macroPlugins-isBlackbox/Test_3.scala create mode 100644 tests/disabled/macro/run/macroPlugins-isBlackbox/scalac-plugin.xml create mode 100644 tests/disabled/macro/run/macroPlugins-macroArgs.check create mode 100644 tests/disabled/macro/run/macroPlugins-macroArgs/Macros_2.scala create mode 100644 tests/disabled/macro/run/macroPlugins-macroArgs/Plugin_1.scala create mode 100644 tests/disabled/macro/run/macroPlugins-macroArgs/Test_3.flags create mode 100644 tests/disabled/macro/run/macroPlugins-macroArgs/Test_3.scala create mode 100644 tests/disabled/macro/run/macroPlugins-macroArgs/scalac-plugin.xml create mode 100644 tests/disabled/macro/run/macroPlugins-macroExpand.check create mode 100644 tests/disabled/macro/run/macroPlugins-macroExpand.flags create mode 100644 tests/disabled/macro/run/macroPlugins-macroExpand/Macros_2.scala create mode 100644 tests/disabled/macro/run/macroPlugins-macroExpand/Plugin_1.scala create mode 100644 tests/disabled/macro/run/macroPlugins-macroExpand/Test_3.flags create mode 100644 tests/disabled/macro/run/macroPlugins-macroExpand/Test_3.scala create mode 100644 tests/disabled/macro/run/macroPlugins-macroExpand/scalac-plugin.xml create mode 100644 tests/disabled/macro/run/macroPlugins-macroRuntime.check create mode 100644 tests/disabled/macro/run/macroPlugins-macroRuntime/Macros_2.scala create mode 100644 tests/disabled/macro/run/macroPlugins-macroRuntime/Plugin_1.scala create mode 100644 tests/disabled/macro/run/macroPlugins-macroRuntime/Test_3.flags create mode 100644 tests/disabled/macro/run/macroPlugins-macroRuntime/Test_3.scala create mode 100644 tests/disabled/macro/run/macroPlugins-macroRuntime/scalac-plugin.xml create mode 100644 tests/disabled/macro/run/macroPlugins-namerHooks.check create mode 100644 tests/disabled/macro/run/macroPlugins-namerHooks.scala create mode 100644 tests/disabled/macro/run/macroPlugins-typedMacroBody.check create mode 100644 tests/disabled/macro/run/macroPlugins-typedMacroBody.flags create mode 100644 tests/disabled/macro/run/macroPlugins-typedMacroBody/Macros_2.flags create mode 100644 tests/disabled/macro/run/macroPlugins-typedMacroBody/Macros_2.scala create mode 100644 tests/disabled/macro/run/macroPlugins-typedMacroBody/Plugin_1.scala create mode 100644 tests/disabled/macro/run/macroPlugins-typedMacroBody/Test_3.scala create mode 100644 tests/disabled/macro/run/macroPlugins-typedMacroBody/scalac-plugin.xml create mode 100644 tests/disabled/macro/run/reflection-magicsymbols-invoke.check create mode 100644 tests/disabled/macro/run/reflection-magicsymbols-invoke.scala create mode 100644 tests/disabled/macro/run/reify-each-node-type.check create mode 100644 tests/disabled/macro/run/reify-each-node-type.scala create mode 100644 tests/disabled/macro/run/reify-repl-fail-gracefully.check create mode 100644 tests/disabled/macro/run/reify-repl-fail-gracefully.scala create mode 100644 tests/disabled/macro/run/reify-staticXXX.check create mode 100644 tests/disabled/macro/run/reify-staticXXX.scala create mode 100644 tests/disabled/macro/run/reify_ann1a.check create mode 100644 tests/disabled/macro/run/reify_ann1a.scala create mode 100644 tests/disabled/macro/run/reify_ann1b.check create mode 100644 tests/disabled/macro/run/reify_ann1b.scala create mode 100644 tests/disabled/macro/run/reify_ann2a.check create mode 100644 tests/disabled/macro/run/reify_ann2a.scala create mode 100644 tests/disabled/macro/run/reify_ann3.check create mode 100644 tests/disabled/macro/run/reify_ann3.scala create mode 100644 tests/disabled/macro/run/reify_ann4.check create mode 100644 tests/disabled/macro/run/reify_ann4.scala create mode 100644 tests/disabled/macro/run/reify_ann5.check create mode 100644 tests/disabled/macro/run/reify_ann5.scala create mode 100644 tests/disabled/macro/run/reify_anonymous.check create mode 100644 tests/disabled/macro/run/reify_anonymous.scala create mode 100644 tests/disabled/macro/run/reify_classfileann_a.check create mode 100644 tests/disabled/macro/run/reify_classfileann_a.scala create mode 100644 tests/disabled/macro/run/reify_classfileann_b.check create mode 100644 tests/disabled/macro/run/reify_classfileann_b.scala create mode 100644 tests/disabled/macro/run/reify_closure1.check create mode 100644 tests/disabled/macro/run/reify_closure1.scala create mode 100644 tests/disabled/macro/run/reify_closure2a.check create mode 100644 tests/disabled/macro/run/reify_closure2a.scala create mode 100644 tests/disabled/macro/run/reify_closure3a.check create mode 100644 tests/disabled/macro/run/reify_closure3a.scala create mode 100644 tests/disabled/macro/run/reify_closure4a.check create mode 100644 tests/disabled/macro/run/reify_closure4a.scala create mode 100644 tests/disabled/macro/run/reify_closure5a.check create mode 100644 tests/disabled/macro/run/reify_closure5a.scala create mode 100644 tests/disabled/macro/run/reify_closure6.check create mode 100644 tests/disabled/macro/run/reify_closure6.scala create mode 100644 tests/disabled/macro/run/reify_closure7.check create mode 100644 tests/disabled/macro/run/reify_closure7.scala create mode 100644 tests/disabled/macro/run/reify_closure8a.check create mode 100644 tests/disabled/macro/run/reify_closure8a.scala create mode 100644 tests/disabled/macro/run/reify_closure8b.check create mode 100644 tests/disabled/macro/run/reify_closure8b.scala create mode 100644 tests/disabled/macro/run/reify_closures10.check create mode 100644 tests/disabled/macro/run/reify_closures10.scala create mode 100644 tests/disabled/macro/run/reify_complex.check create mode 100644 tests/disabled/macro/run/reify_complex.scala create mode 100644 tests/disabled/macro/run/reify_copypaste1.check create mode 100644 tests/disabled/macro/run/reify_copypaste1.scala create mode 100644 tests/disabled/macro/run/reify_copypaste2.check create mode 100644 tests/disabled/macro/run/reify_copypaste2.scala create mode 100644 tests/disabled/macro/run/reify_csv.check create mode 100644 tests/disabled/macro/run/reify_csv.scala create mode 100644 tests/disabled/macro/run/reify_extendbuiltins.check create mode 100644 tests/disabled/macro/run/reify_extendbuiltins.scala create mode 100644 tests/disabled/macro/run/reify_for1.scala create mode 100644 tests/disabled/macro/run/reify_fors_newpatmat.check create mode 100644 tests/disabled/macro/run/reify_fors_newpatmat.scala create mode 100644 tests/disabled/macro/run/reify_fors_oldpatmat.check create mode 100644 tests/disabled/macro/run/reify_fors_oldpatmat.scala create mode 100644 tests/disabled/macro/run/reify_generic.check create mode 100644 tests/disabled/macro/run/reify_generic.scala create mode 100644 tests/disabled/macro/run/reify_generic2.check create mode 100644 tests/disabled/macro/run/reify_generic2.scala create mode 100644 tests/disabled/macro/run/reify_getter.check create mode 100644 tests/disabled/macro/run/reify_getter.scala create mode 100644 tests/disabled/macro/run/reify_implicits-new.check create mode 100644 tests/disabled/macro/run/reify_implicits-new.scala create mode 100644 tests/disabled/macro/run/reify_implicits-old.check create mode 100644 tests/disabled/macro/run/reify_implicits-old.scala create mode 100644 tests/disabled/macro/run/reify_inheritance.check create mode 100644 tests/disabled/macro/run/reify_inheritance.scala create mode 100644 tests/disabled/macro/run/reify_inner1.check create mode 100644 tests/disabled/macro/run/reify_inner1.scala create mode 100644 tests/disabled/macro/run/reify_inner2.check create mode 100644 tests/disabled/macro/run/reify_inner2.scala create mode 100644 tests/disabled/macro/run/reify_inner3.check create mode 100644 tests/disabled/macro/run/reify_inner3.scala create mode 100644 tests/disabled/macro/run/reify_inner4.check create mode 100644 tests/disabled/macro/run/reify_inner4.scala create mode 100644 tests/disabled/macro/run/reify_lazyevaluation.check create mode 100644 tests/disabled/macro/run/reify_lazyevaluation.scala create mode 100644 tests/disabled/macro/run/reify_lazyunit.check create mode 100644 tests/disabled/macro/run/reify_lazyunit.scala create mode 100644 tests/disabled/macro/run/reify_maps_newpatmat.check create mode 100644 tests/disabled/macro/run/reify_maps_newpatmat.scala create mode 100644 tests/disabled/macro/run/reify_maps_oldpatmat.check create mode 100644 tests/disabled/macro/run/reify_maps_oldpatmat.scala create mode 100644 tests/disabled/macro/run/reify_metalevel_breach_+0_refers_to_1.check create mode 100644 tests/disabled/macro/run/reify_metalevel_breach_+0_refers_to_1.scala create mode 100644 tests/disabled/macro/run/reify_metalevel_breach_-1_refers_to_0_a.check create mode 100644 tests/disabled/macro/run/reify_metalevel_breach_-1_refers_to_0_a.scala create mode 100644 tests/disabled/macro/run/reify_metalevel_breach_-1_refers_to_0_b.check create mode 100644 tests/disabled/macro/run/reify_metalevel_breach_-1_refers_to_0_b.scala create mode 100644 tests/disabled/macro/run/reify_metalevel_breach_-1_refers_to_1.check create mode 100644 tests/disabled/macro/run/reify_metalevel_breach_-1_refers_to_1.scala create mode 100644 tests/disabled/macro/run/reify_nested_inner_refers_to_global.check create mode 100644 tests/disabled/macro/run/reify_nested_inner_refers_to_global.scala create mode 100644 tests/disabled/macro/run/reify_nested_inner_refers_to_local.check create mode 100644 tests/disabled/macro/run/reify_nested_inner_refers_to_local.scala create mode 100644 tests/disabled/macro/run/reify_nested_outer_refers_to_global.check create mode 100644 tests/disabled/macro/run/reify_nested_outer_refers_to_global.scala create mode 100644 tests/disabled/macro/run/reify_nested_outer_refers_to_local.check create mode 100644 tests/disabled/macro/run/reify_nested_outer_refers_to_local.scala create mode 100644 tests/disabled/macro/run/reify_newimpl_01.check create mode 100644 tests/disabled/macro/run/reify_newimpl_01.scala create mode 100644 tests/disabled/macro/run/reify_newimpl_02.check create mode 100644 tests/disabled/macro/run/reify_newimpl_02.scala create mode 100644 tests/disabled/macro/run/reify_newimpl_03.check create mode 100644 tests/disabled/macro/run/reify_newimpl_03.scala create mode 100644 tests/disabled/macro/run/reify_newimpl_04.check create mode 100644 tests/disabled/macro/run/reify_newimpl_04.scala create mode 100644 tests/disabled/macro/run/reify_newimpl_05.check create mode 100644 tests/disabled/macro/run/reify_newimpl_05.scala create mode 100644 tests/disabled/macro/run/reify_newimpl_06.check create mode 100644 tests/disabled/macro/run/reify_newimpl_06.scala create mode 100644 tests/disabled/macro/run/reify_newimpl_11.check create mode 100644 tests/disabled/macro/run/reify_newimpl_11.scala create mode 100644 tests/disabled/macro/run/reify_newimpl_12.check create mode 100644 tests/disabled/macro/run/reify_newimpl_12.scala create mode 100644 tests/disabled/macro/run/reify_newimpl_13.check create mode 100644 tests/disabled/macro/run/reify_newimpl_13.scala create mode 100644 tests/disabled/macro/run/reify_newimpl_14.check create mode 100644 tests/disabled/macro/run/reify_newimpl_14.scala create mode 100644 tests/disabled/macro/run/reify_newimpl_15.check create mode 100644 tests/disabled/macro/run/reify_newimpl_15.scala create mode 100644 tests/disabled/macro/run/reify_newimpl_18.check create mode 100644 tests/disabled/macro/run/reify_newimpl_18.scala create mode 100644 tests/disabled/macro/run/reify_newimpl_19.check create mode 100644 tests/disabled/macro/run/reify_newimpl_19.scala create mode 100644 tests/disabled/macro/run/reify_newimpl_20.check create mode 100644 tests/disabled/macro/run/reify_newimpl_20.scala create mode 100644 tests/disabled/macro/run/reify_newimpl_21.check create mode 100644 tests/disabled/macro/run/reify_newimpl_21.scala create mode 100644 tests/disabled/macro/run/reify_newimpl_22.check create mode 100644 tests/disabled/macro/run/reify_newimpl_22.scala create mode 100644 tests/disabled/macro/run/reify_newimpl_23.check create mode 100644 tests/disabled/macro/run/reify_newimpl_23.scala create mode 100644 tests/disabled/macro/run/reify_newimpl_27.check create mode 100644 tests/disabled/macro/run/reify_newimpl_27.scala create mode 100644 tests/disabled/macro/run/reify_newimpl_29.check create mode 100644 tests/disabled/macro/run/reify_newimpl_29.scala create mode 100644 tests/disabled/macro/run/reify_newimpl_30.check create mode 100644 tests/disabled/macro/run/reify_newimpl_30.scala create mode 100644 tests/disabled/macro/run/reify_newimpl_31.check create mode 100644 tests/disabled/macro/run/reify_newimpl_31.scala create mode 100644 tests/disabled/macro/run/reify_newimpl_33.check create mode 100644 tests/disabled/macro/run/reify_newimpl_33.scala create mode 100644 tests/disabled/macro/run/reify_newimpl_35.check create mode 100644 tests/disabled/macro/run/reify_newimpl_35.scala create mode 100644 tests/disabled/macro/run/reify_newimpl_36.check create mode 100644 tests/disabled/macro/run/reify_newimpl_36.scala create mode 100644 tests/disabled/macro/run/reify_newimpl_37.check create mode 100644 tests/disabled/macro/run/reify_newimpl_37.scala create mode 100644 tests/disabled/macro/run/reify_newimpl_38.check create mode 100644 tests/disabled/macro/run/reify_newimpl_38.scala create mode 100644 tests/disabled/macro/run/reify_newimpl_39.check create mode 100644 tests/disabled/macro/run/reify_newimpl_39.scala create mode 100644 tests/disabled/macro/run/reify_newimpl_40.check create mode 100644 tests/disabled/macro/run/reify_newimpl_40.scala create mode 100644 tests/disabled/macro/run/reify_newimpl_41.check create mode 100644 tests/disabled/macro/run/reify_newimpl_41.scala create mode 100644 tests/disabled/macro/run/reify_newimpl_42.check create mode 100644 tests/disabled/macro/run/reify_newimpl_42.scala create mode 100644 tests/disabled/macro/run/reify_newimpl_43.check create mode 100644 tests/disabled/macro/run/reify_newimpl_43.scala create mode 100644 tests/disabled/macro/run/reify_newimpl_44.check create mode 100644 tests/disabled/macro/run/reify_newimpl_44.scala create mode 100644 tests/disabled/macro/run/reify_newimpl_45.check create mode 100644 tests/disabled/macro/run/reify_newimpl_45.scala create mode 100644 tests/disabled/macro/run/reify_newimpl_47.check create mode 100644 tests/disabled/macro/run/reify_newimpl_47.scala create mode 100644 tests/disabled/macro/run/reify_newimpl_48.check create mode 100644 tests/disabled/macro/run/reify_newimpl_48.scala create mode 100644 tests/disabled/macro/run/reify_newimpl_49.check create mode 100644 tests/disabled/macro/run/reify_newimpl_49.scala create mode 100644 tests/disabled/macro/run/reify_newimpl_50.check create mode 100644 tests/disabled/macro/run/reify_newimpl_50.scala create mode 100644 tests/disabled/macro/run/reify_newimpl_51.check create mode 100644 tests/disabled/macro/run/reify_newimpl_51.scala create mode 100644 tests/disabled/macro/run/reify_newimpl_52.check create mode 100644 tests/disabled/macro/run/reify_newimpl_52.scala create mode 100644 tests/disabled/macro/run/reify_printf.check create mode 100644 tests/disabled/macro/run/reify_printf.scala create mode 100644 tests/disabled/macro/run/reify_properties.check create mode 100644 tests/disabled/macro/run/reify_properties.scala create mode 100644 tests/disabled/macro/run/reify_renamed_term_basic.check create mode 100644 tests/disabled/macro/run/reify_renamed_term_basic.scala create mode 100644 tests/disabled/macro/run/reify_renamed_term_local_to_reifee.check create mode 100644 tests/disabled/macro/run/reify_renamed_term_local_to_reifee.scala create mode 100644 tests/disabled/macro/run/reify_renamed_term_overloaded_method.check create mode 100644 tests/disabled/macro/run/reify_renamed_term_overloaded_method.scala create mode 100644 tests/disabled/macro/run/reify_renamed_term_t5841.check create mode 100644 tests/disabled/macro/run/reify_renamed_term_t5841.scala create mode 100644 tests/disabled/macro/run/reify_renamed_type_basic.check create mode 100644 tests/disabled/macro/run/reify_renamed_type_basic.scala create mode 100644 tests/disabled/macro/run/reify_renamed_type_local_to_reifee.check create mode 100644 tests/disabled/macro/run/reify_renamed_type_local_to_reifee.scala create mode 100644 tests/disabled/macro/run/reify_renamed_type_spliceable.check create mode 100644 tests/disabled/macro/run/reify_renamed_type_spliceable.scala create mode 100644 tests/disabled/macro/run/reify_sort.check create mode 100644 tests/disabled/macro/run/reify_sort.scala create mode 100644 tests/disabled/macro/run/reify_sort1.check create mode 100644 tests/disabled/macro/run/reify_sort1.scala create mode 100644 tests/disabled/macro/run/reify_this.check create mode 100644 tests/disabled/macro/run/reify_this.scala create mode 100644 tests/disabled/macro/run/reify_timeofday.check create mode 100644 tests/disabled/macro/run/reify_timeofday.scala create mode 100644 tests/disabled/macro/run/reify_typerefs_1a.check create mode 100644 tests/disabled/macro/run/reify_typerefs_1a.scala create mode 100644 tests/disabled/macro/run/reify_typerefs_1b.check create mode 100644 tests/disabled/macro/run/reify_typerefs_1b.scala create mode 100644 tests/disabled/macro/run/reify_typerefs_2a.check create mode 100644 tests/disabled/macro/run/reify_typerefs_2a.scala create mode 100644 tests/disabled/macro/run/reify_typerefs_2b.check create mode 100644 tests/disabled/macro/run/reify_typerefs_2b.scala create mode 100644 tests/disabled/macro/run/reify_typerefs_3a.check create mode 100644 tests/disabled/macro/run/reify_typerefs_3a.scala create mode 100644 tests/disabled/macro/run/reify_typerefs_3b.check create mode 100644 tests/disabled/macro/run/reify_typerefs_3b.scala create mode 100644 tests/disabled/macro/run/reify_varargs.check create mode 100644 tests/disabled/macro/run/reify_varargs.scala create mode 100644 tests/disabled/macro/run/repl-term-macros.check create mode 100644 tests/disabled/macro/run/repl-term-macros.scala create mode 100644 tests/disabled/macro/run/runtimeEval1.check create mode 100644 tests/disabled/macro/run/runtimeEval1.scala create mode 100644 tests/disabled/macro/run/runtimeEval2.check create mode 100644 tests/disabled/macro/run/runtimeEval2.scala create mode 100644 tests/disabled/macro/run/showdecl.check create mode 100644 tests/disabled/macro/run/showdecl/Macros_1.scala create mode 100644 tests/disabled/macro/run/showdecl/Test_2.scala create mode 100644 tests/disabled/macro/run/showraw_mods.check create mode 100644 tests/disabled/macro/run/showraw_mods.scala create mode 100644 tests/disabled/macro/run/showraw_tree.check create mode 100644 tests/disabled/macro/run/showraw_tree.scala create mode 100644 tests/disabled/macro/run/showraw_tree_ids.check create mode 100644 tests/disabled/macro/run/showraw_tree_ids.scala create mode 100644 tests/disabled/macro/run/showraw_tree_kinds.check create mode 100644 tests/disabled/macro/run/showraw_tree_kinds.scala create mode 100644 tests/disabled/macro/run/showraw_tree_types_ids.check create mode 100644 tests/disabled/macro/run/showraw_tree_types_ids.scala create mode 100644 tests/disabled/macro/run/showraw_tree_types_typed.check create mode 100644 tests/disabled/macro/run/showraw_tree_types_typed.scala create mode 100644 tests/disabled/macro/run/showraw_tree_types_untyped.check create mode 100644 tests/disabled/macro/run/showraw_tree_types_untyped.scala create mode 100644 tests/disabled/macro/run/showraw_tree_ultimate.check create mode 100644 tests/disabled/macro/run/showraw_tree_ultimate.scala create mode 100644 tests/disabled/macro/run/t2886.check create mode 100644 tests/disabled/macro/run/t2886.scala create mode 100644 tests/disabled/macro/run/t5224.check create mode 100644 tests/disabled/macro/run/t5224.scala create mode 100644 tests/disabled/macro/run/t5225_1.check create mode 100644 tests/disabled/macro/run/t5225_1.scala create mode 100644 tests/disabled/macro/run/t5225_2.check create mode 100644 tests/disabled/macro/run/t5225_2.scala create mode 100644 tests/disabled/macro/run/t5229_1.scala create mode 100644 tests/disabled/macro/run/t5229_2.check create mode 100644 tests/disabled/macro/run/t5229_2.scala create mode 100644 tests/disabled/macro/run/t5230.check create mode 100644 tests/disabled/macro/run/t5230.scala create mode 100644 tests/disabled/macro/run/t5258a.check create mode 100644 tests/disabled/macro/run/t5258a.scala create mode 100644 tests/disabled/macro/run/t5266_1.check create mode 100644 tests/disabled/macro/run/t5266_1.scala create mode 100644 tests/disabled/macro/run/t5266_2.check create mode 100644 tests/disabled/macro/run/t5266_2.scala create mode 100644 tests/disabled/macro/run/t5269.check create mode 100644 tests/disabled/macro/run/t5269.scala create mode 100644 tests/disabled/macro/run/t5270.check create mode 100644 tests/disabled/macro/run/t5270.scala create mode 100644 tests/disabled/macro/run/t5271_1.check create mode 100644 tests/disabled/macro/run/t5271_1.scala create mode 100644 tests/disabled/macro/run/t5271_2.check create mode 100644 tests/disabled/macro/run/t5271_2.scala create mode 100644 tests/disabled/macro/run/t5271_3.check create mode 100644 tests/disabled/macro/run/t5271_3.scala create mode 100644 tests/disabled/macro/run/t5271_4.scala create mode 100644 tests/disabled/macro/run/t5272_1_newpatmat.check create mode 100644 tests/disabled/macro/run/t5272_1_newpatmat.scala create mode 100644 tests/disabled/macro/run/t5272_1_oldpatmat.check create mode 100644 tests/disabled/macro/run/t5272_1_oldpatmat.scala create mode 100644 tests/disabled/macro/run/t5272_2_newpatmat.check create mode 100644 tests/disabled/macro/run/t5272_2_newpatmat.scala create mode 100644 tests/disabled/macro/run/t5272_2_oldpatmat.check create mode 100644 tests/disabled/macro/run/t5272_2_oldpatmat.scala create mode 100644 tests/disabled/macro/run/t5273_1_newpatmat.check create mode 100644 tests/disabled/macro/run/t5273_1_newpatmat.scala create mode 100644 tests/disabled/macro/run/t5273_1_oldpatmat.check create mode 100644 tests/disabled/macro/run/t5273_1_oldpatmat.scala create mode 100644 tests/disabled/macro/run/t5273_2a_newpatmat.check create mode 100644 tests/disabled/macro/run/t5273_2a_newpatmat.scala create mode 100644 tests/disabled/macro/run/t5273_2a_oldpatmat.check create mode 100644 tests/disabled/macro/run/t5273_2a_oldpatmat.scala create mode 100644 tests/disabled/macro/run/t5273_2b_newpatmat.check create mode 100644 tests/disabled/macro/run/t5273_2b_newpatmat.scala create mode 100644 tests/disabled/macro/run/t5273_2b_oldpatmat.check create mode 100644 tests/disabled/macro/run/t5273_2b_oldpatmat.scala create mode 100644 tests/disabled/macro/run/t5274_1.check create mode 100644 tests/disabled/macro/run/t5274_1.scala create mode 100644 tests/disabled/macro/run/t5274_2.check create mode 100644 tests/disabled/macro/run/t5274_2.scala create mode 100644 tests/disabled/macro/run/t5275.check create mode 100644 tests/disabled/macro/run/t5275.scala create mode 100644 tests/disabled/macro/run/t5276_1a.check create mode 100644 tests/disabled/macro/run/t5276_1a.scala create mode 100644 tests/disabled/macro/run/t5276_1b.check create mode 100644 tests/disabled/macro/run/t5276_1b.scala create mode 100644 tests/disabled/macro/run/t5276_2a.check create mode 100644 tests/disabled/macro/run/t5276_2a.scala create mode 100644 tests/disabled/macro/run/t5276_2b.check create mode 100644 tests/disabled/macro/run/t5276_2b.scala create mode 100644 tests/disabled/macro/run/t5277_1.check create mode 100644 tests/disabled/macro/run/t5277_1.scala create mode 100644 tests/disabled/macro/run/t5277_2.check create mode 100644 tests/disabled/macro/run/t5277_2.scala create mode 100644 tests/disabled/macro/run/t5279.check create mode 100644 tests/disabled/macro/run/t5279.scala create mode 100644 tests/disabled/macro/run/t5334_1.check create mode 100644 tests/disabled/macro/run/t5334_1.scala create mode 100644 tests/disabled/macro/run/t5334_2.check create mode 100644 tests/disabled/macro/run/t5334_2.scala create mode 100644 tests/disabled/macro/run/t5335.check create mode 100644 tests/disabled/macro/run/t5335.scala create mode 100644 tests/disabled/macro/run/t5415.scala create mode 100644 tests/disabled/macro/run/t5418.scala create mode 100644 tests/disabled/macro/run/t5418a.check create mode 100644 tests/disabled/macro/run/t5418a.scala create mode 100644 tests/disabled/macro/run/t5418b.check create mode 100644 tests/disabled/macro/run/t5418b.scala create mode 100644 tests/disabled/macro/run/t5419.check create mode 100644 tests/disabled/macro/run/t5419.scala create mode 100644 tests/disabled/macro/run/t5704.check create mode 100644 tests/disabled/macro/run/t5704.flags create mode 100644 tests/disabled/macro/run/t5704.scala create mode 100644 tests/disabled/macro/run/t5710-1.check create mode 100644 tests/disabled/macro/run/t5710-1.scala create mode 100644 tests/disabled/macro/run/t5710-2.check create mode 100644 tests/disabled/macro/run/t5710-2.scala create mode 100644 tests/disabled/macro/run/t5713.check create mode 100644 tests/disabled/macro/run/t5713.flags create mode 100644 tests/disabled/macro/run/t5713/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/t5713/Test_2.scala create mode 100644 tests/disabled/macro/run/t5753_1.check create mode 100644 tests/disabled/macro/run/t5753_1.flags create mode 100644 tests/disabled/macro/run/t5753_1/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/t5753_1/Test_2.scala create mode 100644 tests/disabled/macro/run/t5753_2.check create mode 100644 tests/disabled/macro/run/t5753_2.flags create mode 100644 tests/disabled/macro/run/t5753_2/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/t5753_2/Test_2.scala create mode 100644 tests/disabled/macro/run/t5770.check create mode 100644 tests/disabled/macro/run/t5770.scala create mode 100644 tests/disabled/macro/run/t5816.check create mode 100644 tests/disabled/macro/run/t5816.scala create mode 100644 tests/disabled/macro/run/t5824.check create mode 100644 tests/disabled/macro/run/t5824.scala create mode 100644 tests/disabled/macro/run/t5840.scala create mode 100644 tests/disabled/macro/run/t5894.scala create mode 100644 tests/disabled/macro/run/t5903a.check create mode 100644 tests/disabled/macro/run/t5903a.flags create mode 100644 tests/disabled/macro/run/t5903a/Macros_1.scala create mode 100644 tests/disabled/macro/run/t5903a/Test_2.scala create mode 100644 tests/disabled/macro/run/t5903b.check create mode 100644 tests/disabled/macro/run/t5903b.flags create mode 100644 tests/disabled/macro/run/t5903b/Macros_1.scala create mode 100644 tests/disabled/macro/run/t5903b/Test_2.scala create mode 100644 tests/disabled/macro/run/t5903c.check create mode 100644 tests/disabled/macro/run/t5903c.flags create mode 100644 tests/disabled/macro/run/t5903c/Macros_1.scala create mode 100644 tests/disabled/macro/run/t5903c/Test_2.scala create mode 100644 tests/disabled/macro/run/t5903d.check create mode 100644 tests/disabled/macro/run/t5903d.flags create mode 100644 tests/disabled/macro/run/t5903d/Macros_1.scala create mode 100644 tests/disabled/macro/run/t5903d/Test_2.scala create mode 100644 tests/disabled/macro/run/t5923a.check create mode 100644 tests/disabled/macro/run/t5923a/Macros_1.scala create mode 100644 tests/disabled/macro/run/t5923a/Test_2.scala create mode 100644 tests/disabled/macro/run/t5923d/Macros_1.scala create mode 100644 tests/disabled/macro/run/t5923d/Test_2.scala create mode 100644 tests/disabled/macro/run/t5940.scala create mode 100644 tests/disabled/macro/run/t6023.check create mode 100644 tests/disabled/macro/run/t6023.scala create mode 100644 tests/disabled/macro/run/t6187.check create mode 100644 tests/disabled/macro/run/t6187.scala create mode 100644 tests/disabled/macro/run/t6187b.scala create mode 100644 tests/disabled/macro/run/t6221.check create mode 100644 tests/disabled/macro/run/t6221/Macros_1.scala create mode 100644 tests/disabled/macro/run/t6221/Test_2.scala create mode 100644 tests/disabled/macro/run/t6379.check create mode 100644 tests/disabled/macro/run/t6379/Macros_1.scala create mode 100644 tests/disabled/macro/run/t6379/Test_2.scala create mode 100644 tests/disabled/macro/run/t6381.check create mode 100644 tests/disabled/macro/run/t6381.scala create mode 100644 tests/disabled/macro/run/t6394a.check create mode 100644 tests/disabled/macro/run/t6394a.flags create mode 100644 tests/disabled/macro/run/t6394a/Macros_1.scala create mode 100644 tests/disabled/macro/run/t6394a/Test_2.scala create mode 100644 tests/disabled/macro/run/t6394b.check create mode 100644 tests/disabled/macro/run/t6394b.flags create mode 100644 tests/disabled/macro/run/t6394b/Macros_1.scala create mode 100644 tests/disabled/macro/run/t6394b/Test_2.scala create mode 100644 tests/disabled/macro/run/t6591_1.check create mode 100644 tests/disabled/macro/run/t6591_1.scala create mode 100644 tests/disabled/macro/run/t6591_2.check create mode 100644 tests/disabled/macro/run/t6591_2.scala create mode 100644 tests/disabled/macro/run/t6591_3.check create mode 100644 tests/disabled/macro/run/t6591_3.scala create mode 100644 tests/disabled/macro/run/t6591_5.check create mode 100644 tests/disabled/macro/run/t6591_5.scala create mode 100644 tests/disabled/macro/run/t6591_6.check create mode 100644 tests/disabled/macro/run/t6591_6.scala create mode 100644 tests/disabled/macro/run/t6591_7.check create mode 100644 tests/disabled/macro/run/t6591_7.scala create mode 100644 tests/disabled/macro/run/t6662.check create mode 100644 tests/disabled/macro/run/t6662/Macro_1.scala create mode 100644 tests/disabled/macro/run/t6662/Test_2.scala create mode 100644 tests/disabled/macro/run/t6814.check create mode 100644 tests/disabled/macro/run/t6814/Macros_1.scala create mode 100644 tests/disabled/macro/run/t6814/Test_2.scala create mode 100644 tests/disabled/macro/run/t6992.check create mode 100644 tests/disabled/macro/run/t6992/Macros_1.scala create mode 100644 tests/disabled/macro/run/t6992/Test_2.scala create mode 100644 tests/disabled/macro/run/t7008-scala-defined.check create mode 100644 tests/disabled/macro/run/t7008-scala-defined.flags create mode 100644 tests/disabled/macro/run/t7008-scala-defined/Impls_Macros_2.scala create mode 100644 tests/disabled/macro/run/t7008-scala-defined/ScalaClassWithCheckedExceptions_1.scala create mode 100644 tests/disabled/macro/run/t7008-scala-defined/Test_3.scala create mode 100644 tests/disabled/macro/run/t7008.check create mode 100644 tests/disabled/macro/run/t7008/Impls_Macros_2.scala create mode 100644 tests/disabled/macro/run/t7008/JavaClassWithCheckedExceptions_1.java create mode 100644 tests/disabled/macro/run/t7008/Test_3.scala create mode 100644 tests/disabled/macro/run/t7044.check create mode 100644 tests/disabled/macro/run/t7044/Macros_1.scala create mode 100644 tests/disabled/macro/run/t7044/Test_2.scala create mode 100644 tests/disabled/macro/run/t7047.check create mode 100644 tests/disabled/macro/run/t7047/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/t7047/Test_2.scala create mode 100644 tests/disabled/macro/run/t7157.check create mode 100644 tests/disabled/macro/run/t7157/Impls_Macros_1.scala create mode 100644 tests/disabled/macro/run/t7157/Test_2.scala create mode 100644 tests/disabled/macro/run/t7185.check create mode 100644 tests/disabled/macro/run/t7185.scala create mode 100644 tests/disabled/macro/run/t7235.check create mode 100644 tests/disabled/macro/run/t7235.scala create mode 100644 tests/disabled/macro/run/t7240/Macros_1.scala create mode 100644 tests/disabled/macro/run/t7240/Test_2.scala create mode 100644 tests/disabled/macro/run/t7375b.check create mode 100644 tests/disabled/macro/run/t7375b/Macros_1.scala create mode 100644 tests/disabled/macro/run/t7375b/Test_2.scala create mode 100644 tests/disabled/macro/run/t7558.scala create mode 100644 tests/disabled/macro/run/t7617a.check create mode 100644 tests/disabled/macro/run/t7617a/Macros_1.scala create mode 100644 tests/disabled/macro/run/t7617a/Test_2.scala create mode 100644 tests/disabled/macro/run/t7617b.check create mode 100644 tests/disabled/macro/run/t7617b/Macros_1.scala create mode 100644 tests/disabled/macro/run/t7617b/Test_2.scala create mode 100644 tests/disabled/macro/run/t7657.check create mode 100644 tests/disabled/macro/run/t7657/Macros_1.scala create mode 100644 tests/disabled/macro/run/t7657/Test_2.scala create mode 100644 tests/disabled/macro/run/t7777.check create mode 100644 tests/disabled/macro/run/t7777/Macros_1.scala create mode 100644 tests/disabled/macro/run/t7777/Test_2.scala create mode 100644 tests/disabled/macro/run/t7868b.check create mode 100644 tests/disabled/macro/run/t7868b.scala create mode 100644 tests/disabled/macro/run/t7871.check create mode 100644 tests/disabled/macro/run/t7871/Macros_1.scala create mode 100644 tests/disabled/macro/run/t7871/Test_2.scala create mode 100644 tests/disabled/macro/run/t8048a.check create mode 100644 tests/disabled/macro/run/t8048a/Macros_1.scala create mode 100644 tests/disabled/macro/run/t8048a/Test_2.scala create mode 100644 tests/disabled/macro/run/t8048b.check create mode 100644 tests/disabled/macro/run/t8048b/Macros_1.scala create mode 100644 tests/disabled/macro/run/t8048b/Test_2.scala create mode 100644 tests/disabled/macro/run/t8104.check create mode 100644 tests/disabled/macro/run/t8104/Macros_1.scala create mode 100644 tests/disabled/macro/run/t8104/Test_2.scala create mode 100644 tests/disabled/macro/run/t8192.check create mode 100644 tests/disabled/macro/run/t8192/Macros_1.scala create mode 100644 tests/disabled/macro/run/t8192/Test_2.scala create mode 100644 tests/disabled/macro/run/t8321.check create mode 100644 tests/disabled/macro/run/t8321/Macros_1.scala create mode 100644 tests/disabled/macro/run/t8321/Test_2.scala create mode 100644 tests/disabled/macro/run/t8425.check create mode 100644 tests/disabled/macro/run/t8425/Macros_1.scala create mode 100644 tests/disabled/macro/run/t8425/Test_2.scala create mode 100644 tests/disabled/macro/run/t8437.check create mode 100644 tests/disabled/macro/run/t8437/Macros_1.scala create mode 100644 tests/disabled/macro/run/t8437/Test_2.scala create mode 100644 tests/disabled/macro/run/toolbox_console_reporter.check create mode 100644 tests/disabled/macro/run/toolbox_console_reporter.scala create mode 100644 tests/disabled/macro/run/toolbox_current_run_compiles.check create mode 100644 tests/disabled/macro/run/toolbox_current_run_compiles.scala create mode 100644 tests/disabled/macro/run/toolbox_default_reporter_is_silent.check create mode 100644 tests/disabled/macro/run/toolbox_default_reporter_is_silent.scala create mode 100644 tests/disabled/macro/run/toolbox_silent_reporter.check create mode 100644 tests/disabled/macro/run/toolbox_silent_reporter.scala create mode 100644 tests/disabled/macro/run/toolbox_typecheck_macrosdisabled.check create mode 100644 tests/disabled/macro/run/toolbox_typecheck_macrosdisabled.scala create mode 100644 tests/disabled/macro/run/toolbox_typecheck_macrosdisabled2.check create mode 100644 tests/disabled/macro/run/toolbox_typecheck_macrosdisabled2.scala create mode 100644 tests/disabled/macro/run/typecheck.check create mode 100644 tests/disabled/macro/run/typecheck/Macros_1.scala create mode 100644 tests/disabled/macro/run/typecheck/Test_2.scala create mode 100644 tests/disabled/macro/run/typed-annotated.check create mode 100644 tests/disabled/macro/run/typed-annotated/Macros_1.scala create mode 100644 tests/disabled/macro/run/typed-annotated/Test_2.scala delete mode 100644 tests/pending/pos/attachments-typed-another-ident/Impls_1.scala delete mode 100644 tests/pending/pos/attachments-typed-another-ident/Macros_Test_2.scala delete mode 100644 tests/pending/pos/attachments-typed-ident/Impls_1.scala delete mode 100644 tests/pending/pos/attachments-typed-ident/Macros_Test_2.scala delete mode 100644 tests/pending/pos/liftcode_polymorphic.scala delete mode 100644 tests/pending/pos/macro-bundle-disambiguate-bundle.check delete mode 100644 tests/pending/pos/macro-bundle-disambiguate-bundle.scala delete mode 100644 tests/pending/pos/macro-bundle-disambiguate-nonbundle.check delete mode 100644 tests/pending/pos/macro-bundle-disambiguate-nonbundle.scala delete mode 100644 tests/pending/pos/macro-implicit-invalidate-on-error.check delete mode 100644 tests/pending/pos/macro-implicit-invalidate-on-error.scala delete mode 100644 tests/pending/pos/macro-qmarkqmarkqmark.scala delete mode 100644 tests/pending/pos/t5223.scala delete mode 100644 tests/pending/pos/t5692a/Macros_1.scala delete mode 100644 tests/pending/pos/t5692a/Test_2.scala delete mode 100644 tests/pending/pos/t5692b/Macros_1.scala delete mode 100644 tests/pending/pos/t5692b/Test_2.scala delete mode 100644 tests/pending/pos/t5706.flags delete mode 100644 tests/pending/pos/t5706.scala delete mode 100644 tests/pending/pos/t5744/Macros_1.scala delete mode 100644 tests/pending/pos/t5744/Test_2.scala delete mode 100644 tests/pending/pos/t6047.flags delete mode 100644 tests/pending/pos/t6047.scala delete mode 100644 tests/pending/pos/t6386.scala delete mode 100644 tests/pending/pos/t6447.scala delete mode 100644 tests/pending/pos/t6485a/Macros_1.scala delete mode 100644 tests/pending/pos/t6485a/Test_2.scala delete mode 100644 tests/pending/pos/t6485b/Test.scala delete mode 100644 tests/pending/pos/t6516.scala delete mode 100644 tests/pending/pos/t7190.scala delete mode 100644 tests/pending/pos/t7377/Client_2.scala delete mode 100644 tests/pending/pos/t7377/Macro_1.scala delete mode 100644 tests/pending/pos/t7461/Macros_1.scala delete mode 100644 tests/pending/pos/t7461/Test_2.scala delete mode 100644 tests/pending/pos/t7516/A_1.scala delete mode 100644 tests/pending/pos/t7516/B_2.scala delete mode 100644 tests/pending/pos/t7649.flags delete mode 100644 tests/pending/pos/t7649.scala delete mode 100644 tests/pending/pos/t7776.check delete mode 100644 tests/pending/pos/t7776.scala delete mode 100644 tests/pending/pos/t7987/Macro_1.scala delete mode 100644 tests/pending/pos/t7987/Test_2.scala delete mode 100644 tests/pending/pos/t8001/Macros_1.scala delete mode 100644 tests/pending/pos/t8001/Test_2.scala delete mode 100644 tests/pending/pos/t8013/inpervolated_2.scala delete mode 100644 tests/pending/pos/t8013/inpervolator_1.scala delete mode 100644 tests/pending/pos/t8064/Client_2.scala delete mode 100644 tests/pending/pos/t8064/Macro_1.scala delete mode 100644 tests/pending/pos/t8064b/Client_2.scala delete mode 100644 tests/pending/pos/t8064b/Macro_1.scala delete mode 100644 tests/pending/pos/t8209a/Macros_1.scala delete mode 100644 tests/pending/pos/t8209a/Test_2.scala delete mode 100644 tests/pending/pos/t8209b/Macros_1.scala delete mode 100644 tests/pending/pos/t8209b/Test_2.scala delete mode 100644 tests/pending/pos/t8352/Macros_1.scala delete mode 100644 tests/pending/pos/t8352/Test_2.scala delete mode 100644 tests/pending/run/exprs_serialize.check delete mode 100644 tests/pending/run/exprs_serialize.scala delete mode 100644 tests/pending/run/freetypes_false_alarm1.check delete mode 100644 tests/pending/run/freetypes_false_alarm1.scala delete mode 100644 tests/pending/run/idempotency-case-classes.check delete mode 100644 tests/pending/run/idempotency-case-classes.scala delete mode 100644 tests/pending/run/idempotency-extractors.check delete mode 100644 tests/pending/run/idempotency-extractors.scala delete mode 100644 tests/pending/run/idempotency-labels.check delete mode 100644 tests/pending/run/idempotency-labels.scala delete mode 100644 tests/pending/run/idempotency-lazy-vals.check delete mode 100644 tests/pending/run/idempotency-lazy-vals.scala delete mode 100644 tests/pending/run/idempotency-this.check delete mode 100644 tests/pending/run/idempotency-this.scala delete mode 100644 tests/pending/run/macro-abort-fresh.check delete mode 100644 tests/pending/run/macro-abort-fresh.flags delete mode 100644 tests/pending/run/macro-abort-fresh/Macros_1.scala delete mode 100644 tests/pending/run/macro-abort-fresh/Test_2.scala delete mode 100644 tests/pending/run/macro-auto-duplicate.check delete mode 100644 tests/pending/run/macro-auto-duplicate/Macros_1.scala delete mode 100644 tests/pending/run/macro-auto-duplicate/Test_2.scala delete mode 100644 tests/pending/run/macro-basic-ma-md-mi.check delete mode 100644 tests/pending/run/macro-basic-ma-md-mi.flags delete mode 100644 tests/pending/run/macro-basic-ma-md-mi/Impls_1.scala delete mode 100644 tests/pending/run/macro-basic-ma-md-mi/Macros_2.scala delete mode 100644 tests/pending/run/macro-basic-ma-md-mi/Test_3.scala delete mode 100644 tests/pending/run/macro-basic-ma-mdmi.check delete mode 100644 tests/pending/run/macro-basic-ma-mdmi.flags delete mode 100644 tests/pending/run/macro-basic-ma-mdmi/Impls_Macros_1.scala delete mode 100644 tests/pending/run/macro-basic-ma-mdmi/Test_2.scala delete mode 100644 tests/pending/run/macro-basic-mamd-mi.check delete mode 100644 tests/pending/run/macro-basic-mamd-mi.flags delete mode 100644 tests/pending/run/macro-basic-mamd-mi/Impls_1.scala delete mode 100644 tests/pending/run/macro-basic-mamd-mi/Macros_Test_2.scala delete mode 100644 tests/pending/run/macro-blackbox-materialization.check delete mode 100644 tests/pending/run/macro-blackbox-materialization/Macros_1.scala delete mode 100644 tests/pending/run/macro-blackbox-materialization/Test_2.scala delete mode 100644 tests/pending/run/macro-bodyexpandstoimpl.check delete mode 100644 tests/pending/run/macro-bodyexpandstoimpl.flags delete mode 100644 tests/pending/run/macro-bodyexpandstoimpl/Impls_1.scala delete mode 100644 tests/pending/run/macro-bodyexpandstoimpl/Macros_Test_2.scala delete mode 100644 tests/pending/run/macro-bundle-context-alias.check delete mode 100644 tests/pending/run/macro-bundle-context-alias/Macros_1.scala delete mode 100644 tests/pending/run/macro-bundle-context-alias/Test_2.scala delete mode 100644 tests/pending/run/macro-bundle-context-refinement.check delete mode 100644 tests/pending/run/macro-bundle-context-refinement/Macros_1.scala delete mode 100644 tests/pending/run/macro-bundle-context-refinement/Test_2.scala delete mode 100644 tests/pending/run/macro-bundle-repl.check delete mode 100644 tests/pending/run/macro-bundle-repl.scala delete mode 100644 tests/pending/run/macro-bundle-static.check delete mode 100644 tests/pending/run/macro-bundle-static/Impls_Macros_1.scala delete mode 100644 tests/pending/run/macro-bundle-static/Test_2.scala delete mode 100644 tests/pending/run/macro-bundle-toplevel.check delete mode 100644 tests/pending/run/macro-bundle-toplevel.flags delete mode 100644 tests/pending/run/macro-bundle-toplevel/Impls_Macros_1.scala delete mode 100644 tests/pending/run/macro-bundle-toplevel/Test_2.scala delete mode 100644 tests/pending/run/macro-bundle-whitebox-decl.check delete mode 100644 tests/pending/run/macro-bundle-whitebox-decl/Impls_Macros_1.scala delete mode 100644 tests/pending/run/macro-bundle-whitebox-decl/Test_2.scala delete mode 100644 tests/pending/run/macro-bundle-whitebox-use-raw.check delete mode 100644 tests/pending/run/macro-bundle-whitebox-use-raw/Macros_1.scala delete mode 100644 tests/pending/run/macro-bundle-whitebox-use-raw/Test_2.scala delete mode 100644 tests/pending/run/macro-bundle-whitebox-use-refined.check delete mode 100644 tests/pending/run/macro-bundle-whitebox-use-refined/Macros_1.scala delete mode 100644 tests/pending/run/macro-bundle-whitebox-use-refined/Test_2.scala delete mode 100644 tests/pending/run/macro-def-path-dependent.check delete mode 100644 tests/pending/run/macro-def-path-dependent.flags delete mode 100644 tests/pending/run/macro-def-path-dependent/Dummy.scala delete mode 100644 tests/pending/run/macro-def-path-dependent/Test_1.scala delete mode 100644 tests/pending/run/macro-def-path-dependent/Test_2.scala delete mode 100644 tests/pending/run/macro-def-path-dependent/Test_3.scala delete mode 100644 tests/pending/run/macro-def-path-dependent/Test_4.scala delete mode 100644 tests/pending/run/macro-def-path-dependent/Test_5.scala delete mode 100644 tests/pending/run/macro-def-path-dependent/Test_6.scala delete mode 100644 tests/pending/run/macro-default-params.check delete mode 100644 tests/pending/run/macro-default-params/Macros_1.scala delete mode 100644 tests/pending/run/macro-default-params/Test_2.scala delete mode 100644 tests/pending/run/macro-divergence-spurious.check delete mode 100644 tests/pending/run/macro-divergence-spurious/Impls_Macros_1.scala delete mode 100644 tests/pending/run/macro-divergence-spurious/Test_2.scala delete mode 100644 tests/pending/run/macro-duplicate.check delete mode 100644 tests/pending/run/macro-duplicate.flags delete mode 100644 tests/pending/run/macro-duplicate/Impls_Macros_1.scala delete mode 100644 tests/pending/run/macro-duplicate/Test_2.scala delete mode 100644 tests/pending/run/macro-enclosingowner-detectvar.check delete mode 100644 tests/pending/run/macro-enclosingowner-detectvar/Macros_1.scala delete mode 100644 tests/pending/run/macro-enclosingowner-detectvar/Test_2.scala delete mode 100644 tests/pending/run/macro-enclosingowner-sbt.check delete mode 100644 tests/pending/run/macro-enclosingowner-sbt/Macros_1.scala delete mode 100644 tests/pending/run/macro-enclosingowner-sbt/Test_2.scala delete mode 100644 tests/pending/run/macro-enclosures.check delete mode 100644 tests/pending/run/macro-enclosures.flags delete mode 100644 tests/pending/run/macro-enclosures/Impls_Macros_1.scala delete mode 100644 tests/pending/run/macro-enclosures/Test_2.scala delete mode 100644 tests/pending/run/macro-expand-implicit-argument.check delete mode 100644 tests/pending/run/macro-expand-implicit-argument.flags delete mode 100644 tests/pending/run/macro-expand-implicit-argument/Macros_1.scala delete mode 100644 tests/pending/run/macro-expand-implicit-argument/Test_2.scala delete mode 100644 tests/pending/run/macro-expand-implicit-macro-has-implicit.check delete mode 100644 tests/pending/run/macro-expand-implicit-macro-has-implicit.flags delete mode 100644 tests/pending/run/macro-expand-implicit-macro-has-implicit/Impls_1.scala delete mode 100644 tests/pending/run/macro-expand-implicit-macro-has-implicit/Macros_Test_2.scala delete mode 100644 tests/pending/run/macro-expand-implicit-macro-is-implicit.check delete mode 100644 tests/pending/run/macro-expand-implicit-macro-is-implicit.flags delete mode 100644 tests/pending/run/macro-expand-implicit-macro-is-implicit/Impls_1.scala delete mode 100644 tests/pending/run/macro-expand-implicit-macro-is-implicit/Macros_Test_2.scala delete mode 100644 tests/pending/run/macro-expand-implicit-macro-is-val.check delete mode 100644 tests/pending/run/macro-expand-implicit-macro-is-val.flags delete mode 100644 tests/pending/run/macro-expand-implicit-macro-is-val/Impls_1.scala delete mode 100644 tests/pending/run/macro-expand-implicit-macro-is-val/Macros_Test_2.scala delete mode 100644 tests/pending/run/macro-expand-implicit-macro-is-view.check delete mode 100644 tests/pending/run/macro-expand-implicit-macro-is-view/Impls_1.scala delete mode 100644 tests/pending/run/macro-expand-implicit-macro-is-view/Macros_Test_2.scala delete mode 100644 tests/pending/run/macro-expand-multiple-arglists.check delete mode 100644 tests/pending/run/macro-expand-multiple-arglists.flags delete mode 100644 tests/pending/run/macro-expand-multiple-arglists/Impls_1.scala delete mode 100644 tests/pending/run/macro-expand-multiple-arglists/Macros_Test_2.scala delete mode 100644 tests/pending/run/macro-expand-nullary-generic.check delete mode 100644 tests/pending/run/macro-expand-nullary-generic.flags delete mode 100644 tests/pending/run/macro-expand-nullary-generic/Impls_1.scala delete mode 100644 tests/pending/run/macro-expand-nullary-generic/Macros_Test_2.scala delete mode 100644 tests/pending/run/macro-expand-nullary-nongeneric.check delete mode 100644 tests/pending/run/macro-expand-nullary-nongeneric.flags delete mode 100644 tests/pending/run/macro-expand-nullary-nongeneric/Impls_1.scala delete mode 100644 tests/pending/run/macro-expand-nullary-nongeneric/Macros_Test_2.scala delete mode 100644 tests/pending/run/macro-expand-overload.check delete mode 100644 tests/pending/run/macro-expand-overload.flags delete mode 100644 tests/pending/run/macro-expand-overload/Impls_1.scala delete mode 100644 tests/pending/run/macro-expand-overload/Macros_Test_2.scala delete mode 100644 tests/pending/run/macro-expand-override.check delete mode 100644 tests/pending/run/macro-expand-override.flags delete mode 100644 tests/pending/run/macro-expand-override/Impls_1.scala delete mode 100644 tests/pending/run/macro-expand-override/Macros_Test_2.scala delete mode 100644 tests/pending/run/macro-expand-recursive.check delete mode 100644 tests/pending/run/macro-expand-recursive.flags delete mode 100644 tests/pending/run/macro-expand-recursive/Impls_1.scala delete mode 100644 tests/pending/run/macro-expand-recursive/Macros_Test_2.scala delete mode 100644 tests/pending/run/macro-expand-tparams-bounds.check delete mode 100644 tests/pending/run/macro-expand-tparams-bounds.flags delete mode 100644 tests/pending/run/macro-expand-tparams-bounds/Impls_1.scala delete mode 100644 tests/pending/run/macro-expand-tparams-bounds/Macros_Test_2.scala delete mode 100644 tests/pending/run/macro-expand-tparams-explicit.check delete mode 100644 tests/pending/run/macro-expand-tparams-explicit.flags delete mode 100644 tests/pending/run/macro-expand-tparams-explicit/Impls_1.scala delete mode 100644 tests/pending/run/macro-expand-tparams-explicit/Macros_Test_2.scala delete mode 100644 tests/pending/run/macro-expand-tparams-implicit.check delete mode 100644 tests/pending/run/macro-expand-tparams-implicit.flags delete mode 100644 tests/pending/run/macro-expand-tparams-implicit/Impls_1.scala delete mode 100644 tests/pending/run/macro-expand-tparams-implicit/Macros_Test_2.scala delete mode 100644 tests/pending/run/macro-expand-tparams-prefix.check delete mode 100644 tests/pending/run/macro-expand-tparams-prefix.flags delete mode 100644 tests/pending/run/macro-expand-tparams-prefix/Impls_1.scala delete mode 100644 tests/pending/run/macro-expand-tparams-prefix/Macros_Test_2.scala delete mode 100644 tests/pending/run/macro-expand-unapply-a.check delete mode 100644 tests/pending/run/macro-expand-unapply-a.flags delete mode 100644 tests/pending/run/macro-expand-unapply-a/Impls_Macros_1.scala delete mode 100644 tests/pending/run/macro-expand-unapply-a/Test_2.scala delete mode 100644 tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-bad.check delete mode 100644 tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-bad.flags delete mode 100644 tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Impls_1.scala delete mode 100644 tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Macros_Test_2.scala delete mode 100644 tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-good.check delete mode 100644 tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-good.flags delete mode 100644 tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-good/Impls_1.scala delete mode 100644 tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-good/Macros_Test_2.scala delete mode 100644 tests/pending/run/macro-expand-varargs-explicit-over-varargs.check delete mode 100644 tests/pending/run/macro-expand-varargs-explicit-over-varargs.flags delete mode 100644 tests/pending/run/macro-expand-varargs-explicit-over-varargs/Impls_1.scala delete mode 100644 tests/pending/run/macro-expand-varargs-explicit-over-varargs/Macros_Test_2.scala delete mode 100644 tests/pending/run/macro-expand-varargs-implicit-over-nonvarargs.check delete mode 100644 tests/pending/run/macro-expand-varargs-implicit-over-nonvarargs.flags delete mode 100644 tests/pending/run/macro-expand-varargs-implicit-over-nonvarargs/Impls_1.scala delete mode 100644 tests/pending/run/macro-expand-varargs-implicit-over-nonvarargs/Macros_Test_2.scala delete mode 100644 tests/pending/run/macro-expand-varargs-implicit-over-varargs.check delete mode 100644 tests/pending/run/macro-expand-varargs-implicit-over-varargs.flags delete mode 100644 tests/pending/run/macro-expand-varargs-implicit-over-varargs/Impls_1.scala delete mode 100644 tests/pending/run/macro-expand-varargs-implicit-over-varargs/Macros_Test_2.scala delete mode 100644 tests/pending/run/macro-impl-default-params.check delete mode 100644 tests/pending/run/macro-impl-default-params.flags delete mode 100644 tests/pending/run/macro-impl-default-params/Impls_Macros_1.scala delete mode 100644 tests/pending/run/macro-impl-default-params/Test_2.scala delete mode 100644 tests/pending/run/macro-impl-relaxed.check delete mode 100644 tests/pending/run/macro-impl-relaxed/Macros_1.scala delete mode 100644 tests/pending/run/macro-impl-relaxed/Test_2.scala delete mode 100644 tests/pending/run/macro-impl-rename-context.check delete mode 100644 tests/pending/run/macro-impl-rename-context.flags delete mode 100644 tests/pending/run/macro-impl-rename-context/Impls_Macros_1.scala delete mode 100644 tests/pending/run/macro-impl-rename-context/Test_2.scala delete mode 100644 tests/pending/run/macro-impl-tparam-only-in-impl.check delete mode 100644 tests/pending/run/macro-impl-tparam-only-in-impl.flags delete mode 100644 tests/pending/run/macro-impl-tparam-only-in-impl/Impls_1.scala delete mode 100644 tests/pending/run/macro-impl-tparam-only-in-impl/Macros_Test_2.scala delete mode 100644 tests/pending/run/macro-impl-tparam-typetag-is-optional.check delete mode 100644 tests/pending/run/macro-impl-tparam-typetag-is-optional.flags delete mode 100644 tests/pending/run/macro-impl-tparam-typetag-is-optional/Impls_1.scala delete mode 100644 tests/pending/run/macro-impl-tparam-typetag-is-optional/Macros_Test_2.scala delete mode 100644 tests/pending/run/macro-invalidret-doesnt-conform-to-def-rettype.check delete mode 100644 tests/pending/run/macro-invalidret-doesnt-conform-to-def-rettype.flags delete mode 100644 tests/pending/run/macro-invalidret-doesnt-conform-to-def-rettype/Impls_Macros_1.scala delete mode 100644 tests/pending/run/macro-invalidret-doesnt-conform-to-def-rettype/Test_2.scala delete mode 100644 tests/pending/run/macro-invalidret-nontypeable.check delete mode 100644 tests/pending/run/macro-invalidret-nontypeable.flags delete mode 100644 tests/pending/run/macro-invalidret-nontypeable/Impls_Macros_1.scala delete mode 100644 tests/pending/run/macro-invalidret-nontypeable/Test_2.scala delete mode 100644 tests/pending/run/macro-invalidusage-badret.check delete mode 100644 tests/pending/run/macro-invalidusage-badret.flags delete mode 100644 tests/pending/run/macro-invalidusage-badret/Impls_Macros_1.scala delete mode 100644 tests/pending/run/macro-invalidusage-badret/Test_2.scala delete mode 100644 tests/pending/run/macro-invalidusage-partialapplication-with-tparams.check delete mode 100644 tests/pending/run/macro-invalidusage-partialapplication-with-tparams.flags delete mode 100644 tests/pending/run/macro-invalidusage-partialapplication-with-tparams/Impls_Macros_1.scala delete mode 100644 tests/pending/run/macro-invalidusage-partialapplication-with-tparams/Test_2.scala delete mode 100644 tests/pending/run/macro-invalidusage-partialapplication.check delete mode 100644 tests/pending/run/macro-invalidusage-partialapplication.flags delete mode 100644 tests/pending/run/macro-invalidusage-partialapplication/Impls_Macros_1.scala delete mode 100644 tests/pending/run/macro-invalidusage-partialapplication/Test_2.scala delete mode 100644 tests/pending/run/macro-openmacros.check delete mode 100644 tests/pending/run/macro-openmacros.flags delete mode 100644 tests/pending/run/macro-openmacros/Impls_Macros_1.scala delete mode 100644 tests/pending/run/macro-openmacros/Test_2.scala delete mode 100644 tests/pending/run/macro-parse-position-malformed.check delete mode 100644 tests/pending/run/macro-parse-position-malformed/Impls_Macros_1.scala delete mode 100644 tests/pending/run/macro-parse-position-malformed/Test_2.scala delete mode 100644 tests/pending/run/macro-parse-position.check delete mode 100644 tests/pending/run/macro-parse-position.flags delete mode 100644 tests/pending/run/macro-parse-position/Impls_Macros_1.scala delete mode 100644 tests/pending/run/macro-parse-position/Test_2.scala delete mode 100644 tests/pending/run/macro-quasiinvalidbody-c.check delete mode 100644 tests/pending/run/macro-quasiinvalidbody-c.flags delete mode 100644 tests/pending/run/macro-quasiinvalidbody-c/Impls_Macros_1.scala delete mode 100644 tests/pending/run/macro-quasiinvalidbody-c/Test_2.scala delete mode 100644 tests/pending/run/macro-quasiquotes.check delete mode 100644 tests/pending/run/macro-quasiquotes/Macros_1.scala delete mode 100644 tests/pending/run/macro-quasiquotes/Test_2.scala delete mode 100644 tests/pending/run/macro-range.check delete mode 100644 tests/pending/run/macro-range.flags delete mode 100644 tests/pending/run/macro-range/Common_1.scala delete mode 100644 tests/pending/run/macro-range/Expansion_Impossible_2.scala delete mode 100644 tests/pending/run/macro-range/Expansion_Possible_3.scala delete mode 100644 tests/pending/run/macro-rangepos-args.check delete mode 100644 tests/pending/run/macro-rangepos-args.flags delete mode 100644 tests/pending/run/macro-rangepos-args/Macros_1.scala delete mode 100644 tests/pending/run/macro-rangepos-args/Test_2.scala delete mode 100644 tests/pending/run/macro-rangepos-subpatterns.check delete mode 100644 tests/pending/run/macro-rangepos-subpatterns.flags delete mode 100644 tests/pending/run/macro-rangepos-subpatterns/Macros_1.scala delete mode 100644 tests/pending/run/macro-rangepos-subpatterns/Test_2.scala delete mode 100644 tests/pending/run/macro-reflective-ma-normal-mdmi.check delete mode 100644 tests/pending/run/macro-reflective-ma-normal-mdmi.flags delete mode 100644 tests/pending/run/macro-reflective-ma-normal-mdmi/Impls_Macros_1.scala delete mode 100644 tests/pending/run/macro-reflective-ma-normal-mdmi/Test_2.scala delete mode 100644 tests/pending/run/macro-reflective-mamd-normal-mi.check delete mode 100644 tests/pending/run/macro-reflective-mamd-normal-mi/Impls_1.scala delete mode 100644 tests/pending/run/macro-reflective-mamd-normal-mi/Macros_Test_2.scala delete mode 100644 tests/pending/run/macro-reify-basic.check delete mode 100644 tests/pending/run/macro-reify-basic.flags delete mode 100644 tests/pending/run/macro-reify-basic/Macros_1.scala delete mode 100644 tests/pending/run/macro-reify-basic/Test_2.scala delete mode 100644 tests/pending/run/macro-reify-chained1/Impls_Macros_1.scala delete mode 100644 tests/pending/run/macro-reify-chained1/Test_2.scala delete mode 100644 tests/pending/run/macro-reify-chained2/Impls_Macros_1.scala delete mode 100644 tests/pending/run/macro-reify-chained2/Test_2.scala delete mode 100644 tests/pending/run/macro-reify-freevars.check delete mode 100644 tests/pending/run/macro-reify-freevars.flags delete mode 100644 tests/pending/run/macro-reify-freevars/Macros_1.scala delete mode 100644 tests/pending/run/macro-reify-freevars/Test_2.scala delete mode 100644 tests/pending/run/macro-reify-nested-a1/Impls_Macros_1.scala delete mode 100644 tests/pending/run/macro-reify-nested-a1/Test_2.scala delete mode 100644 tests/pending/run/macro-reify-nested-a2/Impls_Macros_1.scala delete mode 100644 tests/pending/run/macro-reify-nested-a2/Test_2.scala delete mode 100644 tests/pending/run/macro-reify-nested-b1/Impls_Macros_1.scala delete mode 100644 tests/pending/run/macro-reify-nested-b1/Test_2.scala delete mode 100644 tests/pending/run/macro-reify-nested-b2/Impls_Macros_1.scala delete mode 100644 tests/pending/run/macro-reify-nested-b2/Test_2.scala delete mode 100644 tests/pending/run/macro-reify-ref-to-packageless.check delete mode 100644 tests/pending/run/macro-reify-ref-to-packageless.flags delete mode 100644 tests/pending/run/macro-reify-ref-to-packageless/Impls_1.scala delete mode 100644 tests/pending/run/macro-reify-ref-to-packageless/Test_2.scala delete mode 100644 tests/pending/run/macro-reify-splice-outside-reify.check delete mode 100644 tests/pending/run/macro-reify-splice-outside-reify.flags delete mode 100644 tests/pending/run/macro-reify-splice-outside-reify/Impls_Macros_1.scala delete mode 100644 tests/pending/run/macro-reify-splice-outside-reify/Test_2.scala delete mode 100644 tests/pending/run/macro-reify-staticXXX.check delete mode 100644 tests/pending/run/macro-reify-staticXXX.flags delete mode 100644 tests/pending/run/macro-reify-staticXXX/Macros_1.scala delete mode 100644 tests/pending/run/macro-reify-staticXXX/Test_2.scala delete mode 100644 tests/pending/run/macro-reify-tagful-a.check delete mode 100644 tests/pending/run/macro-reify-tagful-a.flags delete mode 100644 tests/pending/run/macro-reify-tagful-a/Macros_1.scala delete mode 100644 tests/pending/run/macro-reify-tagful-a/Test_2.scala delete mode 100644 tests/pending/run/macro-reify-tagless-a.check delete mode 100644 tests/pending/run/macro-reify-tagless-a.flags delete mode 100644 tests/pending/run/macro-reify-tagless-a/Impls_Macros_1.scala delete mode 100644 tests/pending/run/macro-reify-tagless-a/Test_2.scala delete mode 100644 tests/pending/run/macro-reify-type.check delete mode 100644 tests/pending/run/macro-reify-type.flags delete mode 100644 tests/pending/run/macro-reify-type/Macros_1.scala delete mode 100644 tests/pending/run/macro-reify-type/Test_2.scala delete mode 100644 tests/pending/run/macro-reify-typetag-notypeparams.check delete mode 100644 tests/pending/run/macro-reify-typetag-notypeparams/Test.scala delete mode 100644 tests/pending/run/macro-reify-typetag-typeparams-tags.check delete mode 100644 tests/pending/run/macro-reify-typetag-typeparams-tags/Test.scala delete mode 100644 tests/pending/run/macro-reify-unreify.check delete mode 100644 tests/pending/run/macro-reify-unreify.flags delete mode 100644 tests/pending/run/macro-reify-unreify/Macros_1.scala delete mode 100644 tests/pending/run/macro-reify-unreify/Test_2.scala delete mode 100644 tests/pending/run/macro-repl-basic.check delete mode 100644 tests/pending/run/macro-repl-basic.scala delete mode 100644 tests/pending/run/macro-repl-dontexpand.check delete mode 100644 tests/pending/run/macro-repl-dontexpand.scala delete mode 100644 tests/pending/run/macro-settings.check delete mode 100644 tests/pending/run/macro-settings.flags delete mode 100644 tests/pending/run/macro-settings/Impls_Macros_1.scala delete mode 100644 tests/pending/run/macro-settings/Test_2.scala delete mode 100644 tests/pending/run/macro-sip19-revised.check delete mode 100644 tests/pending/run/macro-sip19-revised.flags delete mode 100644 tests/pending/run/macro-sip19-revised/Impls_Macros_1.scala delete mode 100644 tests/pending/run/macro-sip19-revised/Test_2.scala delete mode 100644 tests/pending/run/macro-sip19.check delete mode 100644 tests/pending/run/macro-sip19.flags delete mode 100644 tests/pending/run/macro-sip19/Impls_Macros_1.scala delete mode 100644 tests/pending/run/macro-sip19/Test_2.scala delete mode 100644 tests/pending/run/macro-subpatterns.check delete mode 100644 tests/pending/run/macro-subpatterns/Macro_1.scala delete mode 100644 tests/pending/run/macro-subpatterns/Test_2.scala delete mode 100644 tests/pending/run/macro-system-properties.check delete mode 100644 tests/pending/run/macro-system-properties.scala delete mode 100644 tests/pending/run/macro-term-declared-in-annotation.check delete mode 100644 tests/pending/run/macro-term-declared-in-annotation.flags delete mode 100644 tests/pending/run/macro-term-declared-in-annotation/Impls_1.scala delete mode 100644 tests/pending/run/macro-term-declared-in-annotation/Macros_2.scala delete mode 100644 tests/pending/run/macro-term-declared-in-annotation/Test_3.scala delete mode 100644 tests/pending/run/macro-term-declared-in-anonymous.check delete mode 100644 tests/pending/run/macro-term-declared-in-anonymous.flags delete mode 100644 tests/pending/run/macro-term-declared-in-anonymous/Impls_1.scala delete mode 100644 tests/pending/run/macro-term-declared-in-anonymous/Macros_Test_2.scala delete mode 100644 tests/pending/run/macro-term-declared-in-block.check delete mode 100644 tests/pending/run/macro-term-declared-in-block.flags delete mode 100644 tests/pending/run/macro-term-declared-in-block/Impls_1.scala delete mode 100644 tests/pending/run/macro-term-declared-in-block/Macros_Test_2.scala delete mode 100644 tests/pending/run/macro-term-declared-in-class-class.check delete mode 100644 tests/pending/run/macro-term-declared-in-class-class.flags delete mode 100644 tests/pending/run/macro-term-declared-in-class-class/Impls_1.scala delete mode 100644 tests/pending/run/macro-term-declared-in-class-class/Macros_Test_2.scala delete mode 100644 tests/pending/run/macro-term-declared-in-class-object.check delete mode 100644 tests/pending/run/macro-term-declared-in-class-object.flags delete mode 100644 tests/pending/run/macro-term-declared-in-class-object/Impls_1.scala delete mode 100644 tests/pending/run/macro-term-declared-in-class-object/Macros_Test_2.scala delete mode 100644 tests/pending/run/macro-term-declared-in-class.check delete mode 100644 tests/pending/run/macro-term-declared-in-class.flags delete mode 100644 tests/pending/run/macro-term-declared-in-class/Impls_1.scala delete mode 100644 tests/pending/run/macro-term-declared-in-class/Macros_Test_2.scala delete mode 100644 tests/pending/run/macro-term-declared-in-default-param.check delete mode 100644 tests/pending/run/macro-term-declared-in-default-param.flags delete mode 100644 tests/pending/run/macro-term-declared-in-default-param/Impls_1.scala delete mode 100644 tests/pending/run/macro-term-declared-in-default-param/Macros_Test_2.scala delete mode 100644 tests/pending/run/macro-term-declared-in-implicit-class.check delete mode 100644 tests/pending/run/macro-term-declared-in-implicit-class.flags delete mode 100644 tests/pending/run/macro-term-declared-in-implicit-class/Impls_Macros_1.scala delete mode 100644 tests/pending/run/macro-term-declared-in-implicit-class/Test_2.scala delete mode 100644 tests/pending/run/macro-term-declared-in-method.check delete mode 100644 tests/pending/run/macro-term-declared-in-method.flags delete mode 100644 tests/pending/run/macro-term-declared-in-method/Impls_1.scala delete mode 100644 tests/pending/run/macro-term-declared-in-method/Macros_Test_2.scala delete mode 100644 tests/pending/run/macro-term-declared-in-object-class.check delete mode 100644 tests/pending/run/macro-term-declared-in-object-class.flags delete mode 100644 tests/pending/run/macro-term-declared-in-object-class/Impls_1.scala delete mode 100644 tests/pending/run/macro-term-declared-in-object-class/Macros_Test_2.scala delete mode 100644 tests/pending/run/macro-term-declared-in-object-object.check delete mode 100644 tests/pending/run/macro-term-declared-in-object-object.flags delete mode 100644 tests/pending/run/macro-term-declared-in-object-object/Impls_1.scala delete mode 100644 tests/pending/run/macro-term-declared-in-object-object/Macros_Test_2.scala delete mode 100644 tests/pending/run/macro-term-declared-in-object.check delete mode 100644 tests/pending/run/macro-term-declared-in-object.flags delete mode 100644 tests/pending/run/macro-term-declared-in-object/Impls_1.scala delete mode 100644 tests/pending/run/macro-term-declared-in-object/Macros_Test_2.scala delete mode 100644 tests/pending/run/macro-term-declared-in-package-object.check delete mode 100644 tests/pending/run/macro-term-declared-in-package-object.flags delete mode 100644 tests/pending/run/macro-term-declared-in-package-object/Impls_1.scala delete mode 100644 tests/pending/run/macro-term-declared-in-package-object/Macros_Test_2.scala delete mode 100644 tests/pending/run/macro-term-declared-in-refinement.check delete mode 100644 tests/pending/run/macro-term-declared-in-refinement.flags delete mode 100644 tests/pending/run/macro-term-declared-in-refinement/Impls_1.scala delete mode 100644 tests/pending/run/macro-term-declared-in-refinement/Macros_Test_2.scala delete mode 100644 tests/pending/run/macro-term-declared-in-trait.check delete mode 100644 tests/pending/run/macro-term-declared-in-trait.flags delete mode 100644 tests/pending/run/macro-term-declared-in-trait/Impls_1.scala delete mode 100644 tests/pending/run/macro-term-declared-in-trait/Macros_Test_2.scala delete mode 100644 tests/pending/run/macro-typecheck-implicitsdisabled.check delete mode 100644 tests/pending/run/macro-typecheck-implicitsdisabled.flags delete mode 100644 tests/pending/run/macro-typecheck-implicitsdisabled/Impls_Macros_1.scala delete mode 100644 tests/pending/run/macro-typecheck-implicitsdisabled/Test_2.scala delete mode 100644 tests/pending/run/macro-typecheck-macrosdisabled.check delete mode 100644 tests/pending/run/macro-typecheck-macrosdisabled.flags delete mode 100644 tests/pending/run/macro-typecheck-macrosdisabled/Impls_Macros_1.scala delete mode 100644 tests/pending/run/macro-typecheck-macrosdisabled/Test_2.scala delete mode 100644 tests/pending/run/macro-typecheck-macrosdisabled2.check delete mode 100644 tests/pending/run/macro-typecheck-macrosdisabled2.flags delete mode 100644 tests/pending/run/macro-typecheck-macrosdisabled2/Impls_Macros_1.scala delete mode 100644 tests/pending/run/macro-typecheck-macrosdisabled2/Test_2.scala delete mode 100644 tests/pending/run/macro-undetparams-consfromsls.check delete mode 100644 tests/pending/run/macro-undetparams-consfromsls.flags delete mode 100644 tests/pending/run/macro-undetparams-consfromsls/Impls_Macros_1.scala delete mode 100644 tests/pending/run/macro-undetparams-consfromsls/Test_2.scala delete mode 100644 tests/pending/run/macro-undetparams-macroitself.check delete mode 100644 tests/pending/run/macro-undetparams-macroitself.flags delete mode 100644 tests/pending/run/macro-undetparams-macroitself/Impls_Macros_1.scala delete mode 100644 tests/pending/run/macro-undetparams-macroitself/Test_2.scala delete mode 100644 tests/pending/run/macro-vampire-false-warning.check delete mode 100644 tests/pending/run/macro-vampire-false-warning.flags delete mode 100644 tests/pending/run/macro-vampire-false-warning/Macros_1.scala delete mode 100644 tests/pending/run/macro-vampire-false-warning/Test_2.scala delete mode 100644 tests/pending/run/macro-whitebox-dynamic-materialization.check delete mode 100644 tests/pending/run/macro-whitebox-dynamic-materialization/Macros_1.scala delete mode 100644 tests/pending/run/macro-whitebox-dynamic-materialization/Test_2.scala delete mode 100644 tests/pending/run/macro-whitebox-extractor.check delete mode 100644 tests/pending/run/macro-whitebox-extractor/Macros_1.scala delete mode 100644 tests/pending/run/macro-whitebox-extractor/Test_2.scala delete mode 100644 tests/pending/run/macro-whitebox-fundep-materialization.check delete mode 100644 tests/pending/run/macro-whitebox-fundep-materialization/Macros_1.scala delete mode 100644 tests/pending/run/macro-whitebox-fundep-materialization/Test_2.scala delete mode 100644 tests/pending/run/macro-whitebox-structural.check delete mode 100644 tests/pending/run/macro-whitebox-structural/Impls_Macros_1.scala delete mode 100644 tests/pending/run/macro-whitebox-structural/Test_2.scala delete mode 100644 tests/pending/run/macroPlugins-isBlackbox/Macros_2.scala delete mode 100644 tests/pending/run/macroPlugins-isBlackbox/Plugin_1.scala delete mode 100644 tests/pending/run/macroPlugins-isBlackbox/Test_3.flags delete mode 100644 tests/pending/run/macroPlugins-isBlackbox/Test_3.scala delete mode 100644 tests/pending/run/macroPlugins-isBlackbox/scalac-plugin.xml delete mode 100644 tests/pending/run/macroPlugins-macroArgs.check delete mode 100644 tests/pending/run/macroPlugins-macroArgs/Macros_2.scala delete mode 100644 tests/pending/run/macroPlugins-macroArgs/Plugin_1.scala delete mode 100644 tests/pending/run/macroPlugins-macroArgs/Test_3.flags delete mode 100644 tests/pending/run/macroPlugins-macroArgs/Test_3.scala delete mode 100644 tests/pending/run/macroPlugins-macroArgs/scalac-plugin.xml delete mode 100644 tests/pending/run/macroPlugins-macroExpand.check delete mode 100644 tests/pending/run/macroPlugins-macroExpand.flags delete mode 100644 tests/pending/run/macroPlugins-macroExpand/Macros_2.scala delete mode 100644 tests/pending/run/macroPlugins-macroExpand/Plugin_1.scala delete mode 100644 tests/pending/run/macroPlugins-macroExpand/Test_3.flags delete mode 100644 tests/pending/run/macroPlugins-macroExpand/Test_3.scala delete mode 100644 tests/pending/run/macroPlugins-macroExpand/scalac-plugin.xml delete mode 100644 tests/pending/run/macroPlugins-macroRuntime.check delete mode 100644 tests/pending/run/macroPlugins-macroRuntime/Macros_2.scala delete mode 100644 tests/pending/run/macroPlugins-macroRuntime/Plugin_1.scala delete mode 100644 tests/pending/run/macroPlugins-macroRuntime/Test_3.flags delete mode 100644 tests/pending/run/macroPlugins-macroRuntime/Test_3.scala delete mode 100644 tests/pending/run/macroPlugins-macroRuntime/scalac-plugin.xml delete mode 100644 tests/pending/run/macroPlugins-namerHooks.check delete mode 100644 tests/pending/run/macroPlugins-namerHooks.scala delete mode 100644 tests/pending/run/macroPlugins-typedMacroBody.check delete mode 100644 tests/pending/run/macroPlugins-typedMacroBody.flags delete mode 100644 tests/pending/run/macroPlugins-typedMacroBody/Macros_2.flags delete mode 100644 tests/pending/run/macroPlugins-typedMacroBody/Macros_2.scala delete mode 100644 tests/pending/run/macroPlugins-typedMacroBody/Plugin_1.scala delete mode 100644 tests/pending/run/macroPlugins-typedMacroBody/Test_3.scala delete mode 100644 tests/pending/run/macroPlugins-typedMacroBody/scalac-plugin.xml delete mode 100644 tests/pending/run/reflection-magicsymbols-invoke.check delete mode 100644 tests/pending/run/reflection-magicsymbols-invoke.scala delete mode 100644 tests/pending/run/reify-each-node-type.check delete mode 100644 tests/pending/run/reify-each-node-type.scala delete mode 100644 tests/pending/run/reify-repl-fail-gracefully.check delete mode 100644 tests/pending/run/reify-repl-fail-gracefully.scala delete mode 100644 tests/pending/run/reify-staticXXX.check delete mode 100644 tests/pending/run/reify-staticXXX.scala delete mode 100644 tests/pending/run/reify_ann1a.check delete mode 100644 tests/pending/run/reify_ann1a.scala delete mode 100644 tests/pending/run/reify_ann1b.check delete mode 100644 tests/pending/run/reify_ann1b.scala delete mode 100644 tests/pending/run/reify_ann2a.check delete mode 100644 tests/pending/run/reify_ann2a.scala delete mode 100644 tests/pending/run/reify_ann3.check delete mode 100644 tests/pending/run/reify_ann3.scala delete mode 100644 tests/pending/run/reify_ann4.check delete mode 100644 tests/pending/run/reify_ann4.scala delete mode 100644 tests/pending/run/reify_ann5.check delete mode 100644 tests/pending/run/reify_ann5.scala delete mode 100644 tests/pending/run/reify_anonymous.check delete mode 100644 tests/pending/run/reify_anonymous.scala delete mode 100644 tests/pending/run/reify_classfileann_a.check delete mode 100644 tests/pending/run/reify_classfileann_a.scala delete mode 100644 tests/pending/run/reify_classfileann_b.check delete mode 100644 tests/pending/run/reify_classfileann_b.scala delete mode 100644 tests/pending/run/reify_closure1.check delete mode 100644 tests/pending/run/reify_closure1.scala delete mode 100644 tests/pending/run/reify_closure2a.check delete mode 100644 tests/pending/run/reify_closure2a.scala delete mode 100644 tests/pending/run/reify_closure3a.check delete mode 100644 tests/pending/run/reify_closure3a.scala delete mode 100644 tests/pending/run/reify_closure4a.check delete mode 100644 tests/pending/run/reify_closure4a.scala delete mode 100644 tests/pending/run/reify_closure5a.check delete mode 100644 tests/pending/run/reify_closure5a.scala delete mode 100644 tests/pending/run/reify_closure6.check delete mode 100644 tests/pending/run/reify_closure6.scala delete mode 100644 tests/pending/run/reify_closure7.check delete mode 100644 tests/pending/run/reify_closure7.scala delete mode 100644 tests/pending/run/reify_closure8a.check delete mode 100644 tests/pending/run/reify_closure8a.scala delete mode 100644 tests/pending/run/reify_closure8b.check delete mode 100644 tests/pending/run/reify_closure8b.scala delete mode 100644 tests/pending/run/reify_closures10.check delete mode 100644 tests/pending/run/reify_closures10.scala delete mode 100644 tests/pending/run/reify_complex.check delete mode 100644 tests/pending/run/reify_complex.scala delete mode 100644 tests/pending/run/reify_copypaste1.check delete mode 100644 tests/pending/run/reify_copypaste1.scala delete mode 100644 tests/pending/run/reify_copypaste2.check delete mode 100644 tests/pending/run/reify_copypaste2.scala delete mode 100644 tests/pending/run/reify_csv.check delete mode 100644 tests/pending/run/reify_csv.scala delete mode 100644 tests/pending/run/reify_extendbuiltins.check delete mode 100644 tests/pending/run/reify_extendbuiltins.scala delete mode 100644 tests/pending/run/reify_for1.scala delete mode 100644 tests/pending/run/reify_fors_newpatmat.check delete mode 100644 tests/pending/run/reify_fors_newpatmat.scala delete mode 100644 tests/pending/run/reify_fors_oldpatmat.check delete mode 100644 tests/pending/run/reify_fors_oldpatmat.scala delete mode 100644 tests/pending/run/reify_generic.check delete mode 100644 tests/pending/run/reify_generic.scala delete mode 100644 tests/pending/run/reify_generic2.check delete mode 100644 tests/pending/run/reify_generic2.scala delete mode 100644 tests/pending/run/reify_getter.check delete mode 100644 tests/pending/run/reify_getter.scala delete mode 100644 tests/pending/run/reify_implicits-new.check delete mode 100644 tests/pending/run/reify_implicits-new.scala delete mode 100644 tests/pending/run/reify_implicits-old.check delete mode 100644 tests/pending/run/reify_implicits-old.scala delete mode 100644 tests/pending/run/reify_inheritance.check delete mode 100644 tests/pending/run/reify_inheritance.scala delete mode 100644 tests/pending/run/reify_inner1.check delete mode 100644 tests/pending/run/reify_inner1.scala delete mode 100644 tests/pending/run/reify_inner2.check delete mode 100644 tests/pending/run/reify_inner2.scala delete mode 100644 tests/pending/run/reify_inner3.check delete mode 100644 tests/pending/run/reify_inner3.scala delete mode 100644 tests/pending/run/reify_inner4.check delete mode 100644 tests/pending/run/reify_inner4.scala delete mode 100644 tests/pending/run/reify_lazyevaluation.check delete mode 100644 tests/pending/run/reify_lazyevaluation.scala delete mode 100644 tests/pending/run/reify_lazyunit.check delete mode 100644 tests/pending/run/reify_lazyunit.scala delete mode 100644 tests/pending/run/reify_maps_newpatmat.check delete mode 100644 tests/pending/run/reify_maps_newpatmat.scala delete mode 100644 tests/pending/run/reify_maps_oldpatmat.check delete mode 100644 tests/pending/run/reify_maps_oldpatmat.scala delete mode 100644 tests/pending/run/reify_metalevel_breach_+0_refers_to_1.check delete mode 100644 tests/pending/run/reify_metalevel_breach_+0_refers_to_1.scala delete mode 100644 tests/pending/run/reify_metalevel_breach_-1_refers_to_0_a.check delete mode 100644 tests/pending/run/reify_metalevel_breach_-1_refers_to_0_a.scala delete mode 100644 tests/pending/run/reify_metalevel_breach_-1_refers_to_0_b.check delete mode 100644 tests/pending/run/reify_metalevel_breach_-1_refers_to_0_b.scala delete mode 100644 tests/pending/run/reify_metalevel_breach_-1_refers_to_1.check delete mode 100644 tests/pending/run/reify_metalevel_breach_-1_refers_to_1.scala delete mode 100644 tests/pending/run/reify_nested_inner_refers_to_global.check delete mode 100644 tests/pending/run/reify_nested_inner_refers_to_global.scala delete mode 100644 tests/pending/run/reify_nested_inner_refers_to_local.check delete mode 100644 tests/pending/run/reify_nested_inner_refers_to_local.scala delete mode 100644 tests/pending/run/reify_nested_outer_refers_to_global.check delete mode 100644 tests/pending/run/reify_nested_outer_refers_to_global.scala delete mode 100644 tests/pending/run/reify_nested_outer_refers_to_local.check delete mode 100644 tests/pending/run/reify_nested_outer_refers_to_local.scala delete mode 100644 tests/pending/run/reify_newimpl_01.check delete mode 100644 tests/pending/run/reify_newimpl_01.scala delete mode 100644 tests/pending/run/reify_newimpl_02.check delete mode 100644 tests/pending/run/reify_newimpl_02.scala delete mode 100644 tests/pending/run/reify_newimpl_03.check delete mode 100644 tests/pending/run/reify_newimpl_03.scala delete mode 100644 tests/pending/run/reify_newimpl_04.check delete mode 100644 tests/pending/run/reify_newimpl_04.scala delete mode 100644 tests/pending/run/reify_newimpl_05.check delete mode 100644 tests/pending/run/reify_newimpl_05.scala delete mode 100644 tests/pending/run/reify_newimpl_06.check delete mode 100644 tests/pending/run/reify_newimpl_06.scala delete mode 100644 tests/pending/run/reify_newimpl_11.check delete mode 100644 tests/pending/run/reify_newimpl_11.scala delete mode 100644 tests/pending/run/reify_newimpl_12.check delete mode 100644 tests/pending/run/reify_newimpl_12.scala delete mode 100644 tests/pending/run/reify_newimpl_13.check delete mode 100644 tests/pending/run/reify_newimpl_13.scala delete mode 100644 tests/pending/run/reify_newimpl_14.check delete mode 100644 tests/pending/run/reify_newimpl_14.scala delete mode 100644 tests/pending/run/reify_newimpl_15.check delete mode 100644 tests/pending/run/reify_newimpl_15.scala delete mode 100644 tests/pending/run/reify_newimpl_18.check delete mode 100644 tests/pending/run/reify_newimpl_18.scala delete mode 100644 tests/pending/run/reify_newimpl_19.check delete mode 100644 tests/pending/run/reify_newimpl_19.scala delete mode 100644 tests/pending/run/reify_newimpl_20.check delete mode 100644 tests/pending/run/reify_newimpl_20.scala delete mode 100644 tests/pending/run/reify_newimpl_21.check delete mode 100644 tests/pending/run/reify_newimpl_21.scala delete mode 100644 tests/pending/run/reify_newimpl_22.check delete mode 100644 tests/pending/run/reify_newimpl_22.scala delete mode 100644 tests/pending/run/reify_newimpl_23.check delete mode 100644 tests/pending/run/reify_newimpl_23.scala delete mode 100644 tests/pending/run/reify_newimpl_27.check delete mode 100644 tests/pending/run/reify_newimpl_27.scala delete mode 100644 tests/pending/run/reify_newimpl_29.check delete mode 100644 tests/pending/run/reify_newimpl_29.scala delete mode 100644 tests/pending/run/reify_newimpl_30.check delete mode 100644 tests/pending/run/reify_newimpl_30.scala delete mode 100644 tests/pending/run/reify_newimpl_31.check delete mode 100644 tests/pending/run/reify_newimpl_31.scala delete mode 100644 tests/pending/run/reify_newimpl_33.check delete mode 100644 tests/pending/run/reify_newimpl_33.scala delete mode 100644 tests/pending/run/reify_newimpl_35.check delete mode 100644 tests/pending/run/reify_newimpl_35.scala delete mode 100644 tests/pending/run/reify_newimpl_36.check delete mode 100644 tests/pending/run/reify_newimpl_36.scala delete mode 100644 tests/pending/run/reify_newimpl_37.check delete mode 100644 tests/pending/run/reify_newimpl_37.scala delete mode 100644 tests/pending/run/reify_newimpl_38.check delete mode 100644 tests/pending/run/reify_newimpl_38.scala delete mode 100644 tests/pending/run/reify_newimpl_39.check delete mode 100644 tests/pending/run/reify_newimpl_39.scala delete mode 100644 tests/pending/run/reify_newimpl_40.check delete mode 100644 tests/pending/run/reify_newimpl_40.scala delete mode 100644 tests/pending/run/reify_newimpl_41.check delete mode 100644 tests/pending/run/reify_newimpl_41.scala delete mode 100644 tests/pending/run/reify_newimpl_42.check delete mode 100644 tests/pending/run/reify_newimpl_42.scala delete mode 100644 tests/pending/run/reify_newimpl_43.check delete mode 100644 tests/pending/run/reify_newimpl_43.scala delete mode 100644 tests/pending/run/reify_newimpl_44.check delete mode 100644 tests/pending/run/reify_newimpl_44.scala delete mode 100644 tests/pending/run/reify_newimpl_45.check delete mode 100644 tests/pending/run/reify_newimpl_45.scala delete mode 100644 tests/pending/run/reify_newimpl_47.check delete mode 100644 tests/pending/run/reify_newimpl_47.scala delete mode 100644 tests/pending/run/reify_newimpl_48.check delete mode 100644 tests/pending/run/reify_newimpl_48.scala delete mode 100644 tests/pending/run/reify_newimpl_49.check delete mode 100644 tests/pending/run/reify_newimpl_49.scala delete mode 100644 tests/pending/run/reify_newimpl_50.check delete mode 100644 tests/pending/run/reify_newimpl_50.scala delete mode 100644 tests/pending/run/reify_newimpl_51.check delete mode 100644 tests/pending/run/reify_newimpl_51.scala delete mode 100644 tests/pending/run/reify_newimpl_52.check delete mode 100644 tests/pending/run/reify_newimpl_52.scala delete mode 100644 tests/pending/run/reify_printf.check delete mode 100644 tests/pending/run/reify_printf.scala delete mode 100644 tests/pending/run/reify_properties.check delete mode 100644 tests/pending/run/reify_properties.scala delete mode 100644 tests/pending/run/reify_renamed_term_basic.check delete mode 100644 tests/pending/run/reify_renamed_term_basic.scala delete mode 100644 tests/pending/run/reify_renamed_term_local_to_reifee.check delete mode 100644 tests/pending/run/reify_renamed_term_local_to_reifee.scala delete mode 100644 tests/pending/run/reify_renamed_term_overloaded_method.check delete mode 100644 tests/pending/run/reify_renamed_term_overloaded_method.scala delete mode 100644 tests/pending/run/reify_renamed_term_t5841.check delete mode 100644 tests/pending/run/reify_renamed_term_t5841.scala delete mode 100644 tests/pending/run/reify_renamed_type_basic.check delete mode 100644 tests/pending/run/reify_renamed_type_basic.scala delete mode 100644 tests/pending/run/reify_renamed_type_local_to_reifee.check delete mode 100644 tests/pending/run/reify_renamed_type_local_to_reifee.scala delete mode 100644 tests/pending/run/reify_renamed_type_spliceable.check delete mode 100644 tests/pending/run/reify_renamed_type_spliceable.scala delete mode 100644 tests/pending/run/reify_sort.check delete mode 100644 tests/pending/run/reify_sort.scala delete mode 100644 tests/pending/run/reify_sort1.check delete mode 100644 tests/pending/run/reify_sort1.scala delete mode 100644 tests/pending/run/reify_this.check delete mode 100644 tests/pending/run/reify_this.scala delete mode 100644 tests/pending/run/reify_timeofday.check delete mode 100644 tests/pending/run/reify_timeofday.scala delete mode 100644 tests/pending/run/reify_typerefs_1a.check delete mode 100644 tests/pending/run/reify_typerefs_1a.scala delete mode 100644 tests/pending/run/reify_typerefs_1b.check delete mode 100644 tests/pending/run/reify_typerefs_1b.scala delete mode 100644 tests/pending/run/reify_typerefs_2a.check delete mode 100644 tests/pending/run/reify_typerefs_2a.scala delete mode 100644 tests/pending/run/reify_typerefs_2b.check delete mode 100644 tests/pending/run/reify_typerefs_2b.scala delete mode 100644 tests/pending/run/reify_typerefs_3a.check delete mode 100644 tests/pending/run/reify_typerefs_3a.scala delete mode 100644 tests/pending/run/reify_typerefs_3b.check delete mode 100644 tests/pending/run/reify_typerefs_3b.scala delete mode 100644 tests/pending/run/reify_varargs.check delete mode 100644 tests/pending/run/reify_varargs.scala delete mode 100644 tests/pending/run/repl-term-macros.check delete mode 100644 tests/pending/run/repl-term-macros.scala delete mode 100644 tests/pending/run/runtimeEval1.check delete mode 100644 tests/pending/run/runtimeEval1.scala delete mode 100644 tests/pending/run/runtimeEval2.check delete mode 100644 tests/pending/run/runtimeEval2.scala delete mode 100644 tests/pending/run/showdecl.check delete mode 100644 tests/pending/run/showdecl/Macros_1.scala delete mode 100644 tests/pending/run/showdecl/Test_2.scala delete mode 100644 tests/pending/run/showraw_mods.check delete mode 100644 tests/pending/run/showraw_mods.scala delete mode 100644 tests/pending/run/showraw_tree.check delete mode 100644 tests/pending/run/showraw_tree.scala delete mode 100644 tests/pending/run/showraw_tree_ids.check delete mode 100644 tests/pending/run/showraw_tree_ids.scala delete mode 100644 tests/pending/run/showraw_tree_kinds.check delete mode 100644 tests/pending/run/showraw_tree_kinds.scala delete mode 100644 tests/pending/run/showraw_tree_types_ids.check delete mode 100644 tests/pending/run/showraw_tree_types_ids.scala delete mode 100644 tests/pending/run/showraw_tree_types_typed.check delete mode 100644 tests/pending/run/showraw_tree_types_typed.scala delete mode 100644 tests/pending/run/showraw_tree_types_untyped.check delete mode 100644 tests/pending/run/showraw_tree_types_untyped.scala delete mode 100644 tests/pending/run/showraw_tree_ultimate.check delete mode 100644 tests/pending/run/showraw_tree_ultimate.scala delete mode 100644 tests/pending/run/t2886.check delete mode 100644 tests/pending/run/t2886.scala delete mode 100644 tests/pending/run/t5224.check delete mode 100644 tests/pending/run/t5224.scala delete mode 100644 tests/pending/run/t5225_1.check delete mode 100644 tests/pending/run/t5225_1.scala delete mode 100644 tests/pending/run/t5225_2.check delete mode 100644 tests/pending/run/t5225_2.scala delete mode 100644 tests/pending/run/t5229_1.scala delete mode 100644 tests/pending/run/t5229_2.check delete mode 100644 tests/pending/run/t5229_2.scala delete mode 100644 tests/pending/run/t5230.check delete mode 100644 tests/pending/run/t5230.scala delete mode 100644 tests/pending/run/t5258a.check delete mode 100644 tests/pending/run/t5258a.scala delete mode 100644 tests/pending/run/t5266_1.check delete mode 100644 tests/pending/run/t5266_1.scala delete mode 100644 tests/pending/run/t5266_2.check delete mode 100644 tests/pending/run/t5266_2.scala delete mode 100644 tests/pending/run/t5269.check delete mode 100644 tests/pending/run/t5269.scala delete mode 100644 tests/pending/run/t5270.check delete mode 100644 tests/pending/run/t5270.scala delete mode 100644 tests/pending/run/t5271_1.check delete mode 100644 tests/pending/run/t5271_1.scala delete mode 100644 tests/pending/run/t5271_2.check delete mode 100644 tests/pending/run/t5271_2.scala delete mode 100644 tests/pending/run/t5271_3.check delete mode 100644 tests/pending/run/t5271_3.scala delete mode 100644 tests/pending/run/t5271_4.scala delete mode 100644 tests/pending/run/t5272_1_newpatmat.check delete mode 100644 tests/pending/run/t5272_1_newpatmat.scala delete mode 100644 tests/pending/run/t5272_1_oldpatmat.check delete mode 100644 tests/pending/run/t5272_1_oldpatmat.scala delete mode 100644 tests/pending/run/t5272_2_newpatmat.check delete mode 100644 tests/pending/run/t5272_2_newpatmat.scala delete mode 100644 tests/pending/run/t5272_2_oldpatmat.check delete mode 100644 tests/pending/run/t5272_2_oldpatmat.scala delete mode 100644 tests/pending/run/t5273_1_newpatmat.check delete mode 100644 tests/pending/run/t5273_1_newpatmat.scala delete mode 100644 tests/pending/run/t5273_1_oldpatmat.check delete mode 100644 tests/pending/run/t5273_1_oldpatmat.scala delete mode 100644 tests/pending/run/t5273_2a_newpatmat.check delete mode 100644 tests/pending/run/t5273_2a_newpatmat.scala delete mode 100644 tests/pending/run/t5273_2a_oldpatmat.check delete mode 100644 tests/pending/run/t5273_2a_oldpatmat.scala delete mode 100644 tests/pending/run/t5273_2b_newpatmat.check delete mode 100644 tests/pending/run/t5273_2b_newpatmat.scala delete mode 100644 tests/pending/run/t5273_2b_oldpatmat.check delete mode 100644 tests/pending/run/t5273_2b_oldpatmat.scala delete mode 100644 tests/pending/run/t5274_1.check delete mode 100644 tests/pending/run/t5274_1.scala delete mode 100644 tests/pending/run/t5274_2.check delete mode 100644 tests/pending/run/t5274_2.scala delete mode 100644 tests/pending/run/t5275.check delete mode 100644 tests/pending/run/t5275.scala delete mode 100644 tests/pending/run/t5276_1a.check delete mode 100644 tests/pending/run/t5276_1a.scala delete mode 100644 tests/pending/run/t5276_1b.check delete mode 100644 tests/pending/run/t5276_1b.scala delete mode 100644 tests/pending/run/t5276_2a.check delete mode 100644 tests/pending/run/t5276_2a.scala delete mode 100644 tests/pending/run/t5276_2b.check delete mode 100644 tests/pending/run/t5276_2b.scala delete mode 100644 tests/pending/run/t5277_1.check delete mode 100644 tests/pending/run/t5277_1.scala delete mode 100644 tests/pending/run/t5277_2.check delete mode 100644 tests/pending/run/t5277_2.scala delete mode 100644 tests/pending/run/t5279.check delete mode 100644 tests/pending/run/t5279.scala delete mode 100644 tests/pending/run/t5334_1.check delete mode 100644 tests/pending/run/t5334_1.scala delete mode 100644 tests/pending/run/t5334_2.check delete mode 100644 tests/pending/run/t5334_2.scala delete mode 100644 tests/pending/run/t5335.check delete mode 100644 tests/pending/run/t5335.scala delete mode 100644 tests/pending/run/t5415.scala delete mode 100644 tests/pending/run/t5418.scala delete mode 100644 tests/pending/run/t5418a.check delete mode 100644 tests/pending/run/t5418a.scala delete mode 100644 tests/pending/run/t5418b.check delete mode 100644 tests/pending/run/t5418b.scala delete mode 100644 tests/pending/run/t5419.check delete mode 100644 tests/pending/run/t5419.scala delete mode 100644 tests/pending/run/t5704.check delete mode 100644 tests/pending/run/t5704.flags delete mode 100644 tests/pending/run/t5704.scala delete mode 100644 tests/pending/run/t5710-1.check delete mode 100644 tests/pending/run/t5710-1.scala delete mode 100644 tests/pending/run/t5710-2.check delete mode 100644 tests/pending/run/t5710-2.scala delete mode 100644 tests/pending/run/t5713.check delete mode 100644 tests/pending/run/t5713.flags delete mode 100644 tests/pending/run/t5713/Impls_Macros_1.scala delete mode 100644 tests/pending/run/t5713/Test_2.scala delete mode 100644 tests/pending/run/t5753_1.check delete mode 100644 tests/pending/run/t5753_1.flags delete mode 100644 tests/pending/run/t5753_1/Impls_Macros_1.scala delete mode 100644 tests/pending/run/t5753_1/Test_2.scala delete mode 100644 tests/pending/run/t5753_2.check delete mode 100644 tests/pending/run/t5753_2.flags delete mode 100644 tests/pending/run/t5753_2/Impls_Macros_1.scala delete mode 100644 tests/pending/run/t5753_2/Test_2.scala delete mode 100644 tests/pending/run/t5770.check delete mode 100644 tests/pending/run/t5770.scala delete mode 100644 tests/pending/run/t5816.check delete mode 100644 tests/pending/run/t5816.scala delete mode 100644 tests/pending/run/t5824.check delete mode 100644 tests/pending/run/t5824.scala delete mode 100644 tests/pending/run/t5840.scala delete mode 100644 tests/pending/run/t5894.scala delete mode 100644 tests/pending/run/t5903a.check delete mode 100644 tests/pending/run/t5903a.flags delete mode 100644 tests/pending/run/t5903a/Macros_1.scala delete mode 100644 tests/pending/run/t5903a/Test_2.scala delete mode 100644 tests/pending/run/t5903b.check delete mode 100644 tests/pending/run/t5903b.flags delete mode 100644 tests/pending/run/t5903b/Macros_1.scala delete mode 100644 tests/pending/run/t5903b/Test_2.scala delete mode 100644 tests/pending/run/t5903c.check delete mode 100644 tests/pending/run/t5903c.flags delete mode 100644 tests/pending/run/t5903c/Macros_1.scala delete mode 100644 tests/pending/run/t5903c/Test_2.scala delete mode 100644 tests/pending/run/t5903d.check delete mode 100644 tests/pending/run/t5903d.flags delete mode 100644 tests/pending/run/t5903d/Macros_1.scala delete mode 100644 tests/pending/run/t5903d/Test_2.scala delete mode 100644 tests/pending/run/t5923a.check delete mode 100644 tests/pending/run/t5923a/Macros_1.scala delete mode 100644 tests/pending/run/t5923a/Test_2.scala delete mode 100644 tests/pending/run/t5923d/Macros_1.scala delete mode 100644 tests/pending/run/t5923d/Test_2.scala delete mode 100644 tests/pending/run/t5940.scala delete mode 100644 tests/pending/run/t6023.check delete mode 100644 tests/pending/run/t6023.scala delete mode 100644 tests/pending/run/t6187.check delete mode 100644 tests/pending/run/t6187.scala delete mode 100644 tests/pending/run/t6187b.scala delete mode 100644 tests/pending/run/t6221.check delete mode 100644 tests/pending/run/t6221/Macros_1.scala delete mode 100644 tests/pending/run/t6221/Test_2.scala delete mode 100644 tests/pending/run/t6379.check delete mode 100644 tests/pending/run/t6379/Macros_1.scala delete mode 100644 tests/pending/run/t6379/Test_2.scala delete mode 100644 tests/pending/run/t6381.check delete mode 100644 tests/pending/run/t6381.scala delete mode 100644 tests/pending/run/t6394a.check delete mode 100644 tests/pending/run/t6394a.flags delete mode 100644 tests/pending/run/t6394a/Macros_1.scala delete mode 100644 tests/pending/run/t6394a/Test_2.scala delete mode 100644 tests/pending/run/t6394b.check delete mode 100644 tests/pending/run/t6394b.flags delete mode 100644 tests/pending/run/t6394b/Macros_1.scala delete mode 100644 tests/pending/run/t6394b/Test_2.scala delete mode 100644 tests/pending/run/t6591_1.check delete mode 100644 tests/pending/run/t6591_1.scala delete mode 100644 tests/pending/run/t6591_2.check delete mode 100644 tests/pending/run/t6591_2.scala delete mode 100644 tests/pending/run/t6591_3.check delete mode 100644 tests/pending/run/t6591_3.scala delete mode 100644 tests/pending/run/t6591_5.check delete mode 100644 tests/pending/run/t6591_5.scala delete mode 100644 tests/pending/run/t6591_6.check delete mode 100644 tests/pending/run/t6591_6.scala delete mode 100644 tests/pending/run/t6591_7.check delete mode 100644 tests/pending/run/t6591_7.scala delete mode 100644 tests/pending/run/t6662.check delete mode 100644 tests/pending/run/t6662/Macro_1.scala delete mode 100644 tests/pending/run/t6662/Test_2.scala delete mode 100644 tests/pending/run/t6814.check delete mode 100644 tests/pending/run/t6814/Macros_1.scala delete mode 100644 tests/pending/run/t6814/Test_2.scala delete mode 100644 tests/pending/run/t6992.check delete mode 100644 tests/pending/run/t6992/Macros_1.scala delete mode 100644 tests/pending/run/t6992/Test_2.scala delete mode 100644 tests/pending/run/t7008-scala-defined.check delete mode 100644 tests/pending/run/t7008-scala-defined.flags delete mode 100644 tests/pending/run/t7008-scala-defined/Impls_Macros_2.scala delete mode 100644 tests/pending/run/t7008-scala-defined/ScalaClassWithCheckedExceptions_1.scala delete mode 100644 tests/pending/run/t7008-scala-defined/Test_3.scala delete mode 100644 tests/pending/run/t7008.check delete mode 100644 tests/pending/run/t7008/Impls_Macros_2.scala delete mode 100644 tests/pending/run/t7008/JavaClassWithCheckedExceptions_1.java delete mode 100644 tests/pending/run/t7008/Test_3.scala delete mode 100644 tests/pending/run/t7044.check delete mode 100644 tests/pending/run/t7044/Macros_1.scala delete mode 100644 tests/pending/run/t7044/Test_2.scala delete mode 100644 tests/pending/run/t7047.check delete mode 100644 tests/pending/run/t7047/Impls_Macros_1.scala delete mode 100644 tests/pending/run/t7047/Test_2.scala delete mode 100644 tests/pending/run/t7157.check delete mode 100644 tests/pending/run/t7157/Impls_Macros_1.scala delete mode 100644 tests/pending/run/t7157/Test_2.scala delete mode 100644 tests/pending/run/t7185.check delete mode 100644 tests/pending/run/t7185.scala delete mode 100644 tests/pending/run/t7235.check delete mode 100644 tests/pending/run/t7235.scala delete mode 100644 tests/pending/run/t7240/Macros_1.scala delete mode 100644 tests/pending/run/t7240/Test_2.scala delete mode 100644 tests/pending/run/t7375b.check delete mode 100644 tests/pending/run/t7375b/Macros_1.scala delete mode 100644 tests/pending/run/t7375b/Test_2.scala delete mode 100644 tests/pending/run/t7558.scala delete mode 100644 tests/pending/run/t7617a.check delete mode 100644 tests/pending/run/t7617a/Macros_1.scala delete mode 100644 tests/pending/run/t7617a/Test_2.scala delete mode 100644 tests/pending/run/t7617b.check delete mode 100644 tests/pending/run/t7617b/Macros_1.scala delete mode 100644 tests/pending/run/t7617b/Test_2.scala delete mode 100644 tests/pending/run/t7657.check delete mode 100644 tests/pending/run/t7657/Macros_1.scala delete mode 100644 tests/pending/run/t7657/Test_2.scala delete mode 100644 tests/pending/run/t7777.check delete mode 100644 tests/pending/run/t7777/Macros_1.scala delete mode 100644 tests/pending/run/t7777/Test_2.scala delete mode 100644 tests/pending/run/t7868b.check delete mode 100644 tests/pending/run/t7868b.scala delete mode 100644 tests/pending/run/t7871.check delete mode 100644 tests/pending/run/t7871/Macros_1.scala delete mode 100644 tests/pending/run/t7871/Test_2.scala delete mode 100644 tests/pending/run/t8048a.check delete mode 100644 tests/pending/run/t8048a/Macros_1.scala delete mode 100644 tests/pending/run/t8048a/Test_2.scala delete mode 100644 tests/pending/run/t8048b.check delete mode 100644 tests/pending/run/t8048b/Macros_1.scala delete mode 100644 tests/pending/run/t8048b/Test_2.scala delete mode 100644 tests/pending/run/t8104.check delete mode 100644 tests/pending/run/t8104/Macros_1.scala delete mode 100644 tests/pending/run/t8104/Test_2.scala delete mode 100644 tests/pending/run/t8192.check delete mode 100644 tests/pending/run/t8192/Macros_1.scala delete mode 100644 tests/pending/run/t8192/Test_2.scala delete mode 100644 tests/pending/run/t8321.check delete mode 100644 tests/pending/run/t8321/Macros_1.scala delete mode 100644 tests/pending/run/t8321/Test_2.scala delete mode 100644 tests/pending/run/t8425.check delete mode 100644 tests/pending/run/t8425/Macros_1.scala delete mode 100644 tests/pending/run/t8425/Test_2.scala delete mode 100644 tests/pending/run/t8437.check delete mode 100644 tests/pending/run/t8437/Macros_1.scala delete mode 100644 tests/pending/run/t8437/Test_2.scala delete mode 100644 tests/pending/run/toolbox_console_reporter.check delete mode 100644 tests/pending/run/toolbox_console_reporter.scala delete mode 100644 tests/pending/run/toolbox_current_run_compiles.check delete mode 100644 tests/pending/run/toolbox_current_run_compiles.scala delete mode 100644 tests/pending/run/toolbox_default_reporter_is_silent.check delete mode 100644 tests/pending/run/toolbox_default_reporter_is_silent.scala delete mode 100644 tests/pending/run/toolbox_silent_reporter.check delete mode 100644 tests/pending/run/toolbox_silent_reporter.scala delete mode 100644 tests/pending/run/toolbox_typecheck_macrosdisabled.check delete mode 100644 tests/pending/run/toolbox_typecheck_macrosdisabled.scala delete mode 100644 tests/pending/run/toolbox_typecheck_macrosdisabled2.check delete mode 100644 tests/pending/run/toolbox_typecheck_macrosdisabled2.scala delete mode 100644 tests/pending/run/typecheck.check delete mode 100644 tests/pending/run/typecheck/Macros_1.scala delete mode 100644 tests/pending/run/typecheck/Test_2.scala delete mode 100644 tests/pending/run/typed-annotated.check delete mode 100644 tests/pending/run/typed-annotated/Macros_1.scala delete mode 100644 tests/pending/run/typed-annotated/Test_2.scala (limited to 'tests/pending') diff --git a/tests/disabled/macro/pos/attachments-typed-another-ident/Impls_1.scala b/tests/disabled/macro/pos/attachments-typed-another-ident/Impls_1.scala new file mode 100644 index 000000000..98062a9c7 --- /dev/null +++ b/tests/disabled/macro/pos/attachments-typed-another-ident/Impls_1.scala @@ -0,0 +1,18 @@ +import scala.reflect.macros.blackbox.Context +import language.experimental.macros + +object MyAttachment + +object Macros { + def impl(c: Context) = { + import c.universe._ + import internal._ + val ident = updateAttachment(Ident(TermName("bar")), MyAttachment) + assert(attachments(ident).get[MyAttachment.type].isDefined, attachments(ident)) + val typed = c.typecheck(ident) + assert(attachments(typed).get[MyAttachment.type].isDefined, attachments(typed)) + c.Expr[Int](typed) + } + + def foo = macro impl +} diff --git a/tests/disabled/macro/pos/attachments-typed-another-ident/Macros_Test_2.scala b/tests/disabled/macro/pos/attachments-typed-another-ident/Macros_Test_2.scala new file mode 100644 index 000000000..022639bfe --- /dev/null +++ b/tests/disabled/macro/pos/attachments-typed-another-ident/Macros_Test_2.scala @@ -0,0 +1,5 @@ +object Test extends App { + def bar = 2 + Macros.foo +} + diff --git a/tests/disabled/macro/pos/attachments-typed-ident/Impls_1.scala b/tests/disabled/macro/pos/attachments-typed-ident/Impls_1.scala new file mode 100644 index 000000000..98062a9c7 --- /dev/null +++ b/tests/disabled/macro/pos/attachments-typed-ident/Impls_1.scala @@ -0,0 +1,18 @@ +import scala.reflect.macros.blackbox.Context +import language.experimental.macros + +object MyAttachment + +object Macros { + def impl(c: Context) = { + import c.universe._ + import internal._ + val ident = updateAttachment(Ident(TermName("bar")), MyAttachment) + assert(attachments(ident).get[MyAttachment.type].isDefined, attachments(ident)) + val typed = c.typecheck(ident) + assert(attachments(typed).get[MyAttachment.type].isDefined, attachments(typed)) + c.Expr[Int](typed) + } + + def foo = macro impl +} diff --git a/tests/disabled/macro/pos/attachments-typed-ident/Macros_Test_2.scala b/tests/disabled/macro/pos/attachments-typed-ident/Macros_Test_2.scala new file mode 100644 index 000000000..45a0609de --- /dev/null +++ b/tests/disabled/macro/pos/attachments-typed-ident/Macros_Test_2.scala @@ -0,0 +1,4 @@ +object Test extends App { + def bar = 2 + Macros.foo +} diff --git a/tests/disabled/macro/pos/liftcode_polymorphic.scala b/tests/disabled/macro/pos/liftcode_polymorphic.scala new file mode 100644 index 000000000..249f5a056 --- /dev/null +++ b/tests/disabled/macro/pos/liftcode_polymorphic.scala @@ -0,0 +1,12 @@ +import scala.reflect.runtime.universe._ + +object Append extends App { + + def append[A](l1: List[A], l2: List[A]):List[A] = + l1 match { + case Nil => l2 + case x::xs => x :: append(xs, l2) + } + + println(reify(append _).tree) +} diff --git a/tests/disabled/macro/pos/macro-bundle-disambiguate-bundle.check b/tests/disabled/macro/pos/macro-bundle-disambiguate-bundle.check new file mode 100644 index 000000000..e69de29bb diff --git a/tests/disabled/macro/pos/macro-bundle-disambiguate-bundle.scala b/tests/disabled/macro/pos/macro-bundle-disambiguate-bundle.scala new file mode 100644 index 000000000..40d965b0e --- /dev/null +++ b/tests/disabled/macro/pos/macro-bundle-disambiguate-bundle.scala @@ -0,0 +1,14 @@ +import scala.reflect.macros.whitebox._ +import scala.language.experimental.macros + +class Macros(val c: Context) { + def impl = ??? +} + +object Macros { + def impl(c: Context)(x: c.Tree) = ??? +} + +object Test extends App { + def foo: Unit = macro Macros.impl +} diff --git a/tests/disabled/macro/pos/macro-bundle-disambiguate-nonbundle.check b/tests/disabled/macro/pos/macro-bundle-disambiguate-nonbundle.check new file mode 100644 index 000000000..e69de29bb diff --git a/tests/disabled/macro/pos/macro-bundle-disambiguate-nonbundle.scala b/tests/disabled/macro/pos/macro-bundle-disambiguate-nonbundle.scala new file mode 100644 index 000000000..185177607 --- /dev/null +++ b/tests/disabled/macro/pos/macro-bundle-disambiguate-nonbundle.scala @@ -0,0 +1,14 @@ +import scala.reflect.macros.whitebox._ +import scala.language.experimental.macros + +class Macros(val c: Context) { + def impl(x: c.Tree) = ??? +} + +object Macros { + def impl(c: Context) = ??? +} + +object Test extends App { + def foo: Unit = macro Macros.impl +} diff --git a/tests/disabled/macro/pos/macro-implicit-invalidate-on-error.check b/tests/disabled/macro/pos/macro-implicit-invalidate-on-error.check new file mode 100644 index 000000000..e69de29bb diff --git a/tests/disabled/macro/pos/macro-implicit-invalidate-on-error.scala b/tests/disabled/macro/pos/macro-implicit-invalidate-on-error.scala new file mode 100644 index 000000000..bb83e3cc3 --- /dev/null +++ b/tests/disabled/macro/pos/macro-implicit-invalidate-on-error.scala @@ -0,0 +1,25 @@ +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.Context + +trait LegacyLiftable[T] { + def apply(universe: scala.reflect.api.Universe, value: T): universe.Tree +} + +object LegacyLiftable { + implicit def liftCaseClass[T <: Product]: LegacyLiftable[T] = macro liftCaseClassImpl[T] + + def liftCaseClassImpl[T: c.WeakTypeTag](c: Context): c.Expr[LegacyLiftable[T]] = { + import c.universe._ + val tpe = weakTypeOf[T] + if (!tpe.typeSymbol.asClass.isCaseClass) c.abort(c.enclosingPosition, "denied") + val p = List(q"Literal(Constant(1))") + c.Expr[LegacyLiftable[T]] { q""" + new LegacyLiftable[$tpe] { + def apply(universe: scala.reflect.api.Universe, value: $tpe): universe.Tree = { + import universe._ + Apply(Select(Ident(TermName("C")), TermName("apply")), List(..$p)) + } + } + """ } + } +} diff --git a/tests/disabled/macro/pos/macro-qmarkqmarkqmark.scala b/tests/disabled/macro/pos/macro-qmarkqmarkqmark.scala new file mode 100644 index 000000000..de94d69d5 --- /dev/null +++ b/tests/disabled/macro/pos/macro-qmarkqmarkqmark.scala @@ -0,0 +1,7 @@ +import language.experimental.macros + +object Macros { + def foo1 = macro ??? + def foo2(x: Int) = macro ??? + def foo3[T] = macro ??? +} diff --git a/tests/disabled/macro/pos/t5223.scala b/tests/disabled/macro/pos/t5223.scala new file mode 100644 index 000000000..bfd1e153c --- /dev/null +++ b/tests/disabled/macro/pos/t5223.scala @@ -0,0 +1,6 @@ +import scala.reflect.runtime.universe._ + +object Foo extends App { + reify{def printf(format: String, args: Any*): String = null } + reify{def printf(format: String, args: Any*): String = ("abc": @deprecated)} +} diff --git a/tests/disabled/macro/pos/t5692a/Macros_1.scala b/tests/disabled/macro/pos/t5692a/Macros_1.scala new file mode 100644 index 000000000..6e5069aff --- /dev/null +++ b/tests/disabled/macro/pos/t5692a/Macros_1.scala @@ -0,0 +1,6 @@ +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl[T](c: Context) = { import c.universe._; c.Expr[Unit](q"()") } + def foo[T] = macro impl[T] +} diff --git a/tests/disabled/macro/pos/t5692a/Test_2.scala b/tests/disabled/macro/pos/t5692a/Test_2.scala new file mode 100644 index 000000000..72ecd9576 --- /dev/null +++ b/tests/disabled/macro/pos/t5692a/Test_2.scala @@ -0,0 +1,3 @@ +class Test { + def x = Macros.foo +} diff --git a/tests/disabled/macro/pos/t5692b/Macros_1.scala b/tests/disabled/macro/pos/t5692b/Macros_1.scala new file mode 100644 index 000000000..82109075f --- /dev/null +++ b/tests/disabled/macro/pos/t5692b/Macros_1.scala @@ -0,0 +1,6 @@ +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl[T, U](c: Context) = { import c.universe._; c.Expr[Unit](q"()") } + def foo[T, U] = macro impl[T, U] +} diff --git a/tests/disabled/macro/pos/t5692b/Test_2.scala b/tests/disabled/macro/pos/t5692b/Test_2.scala new file mode 100644 index 000000000..72ecd9576 --- /dev/null +++ b/tests/disabled/macro/pos/t5692b/Test_2.scala @@ -0,0 +1,3 @@ +class Test { + def x = Macros.foo +} diff --git a/tests/disabled/macro/pos/t5706.flags b/tests/disabled/macro/pos/t5706.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/pos/t5706.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/pos/t5706.scala b/tests/disabled/macro/pos/t5706.scala new file mode 100644 index 000000000..6f0207366 --- /dev/null +++ b/tests/disabled/macro/pos/t5706.scala @@ -0,0 +1,15 @@ +import scala.reflect.macros.blackbox.{Context => BlackboxContext} +import scala.reflect.macros.whitebox.{Context => WhiteboxContext} + +class Logger { + def error1(message: String) = macro Impls.error1 + def error2(message: String) = macro Impls.error2 +} + +object Impls { + type LoggerContext1 = BlackboxContext { type PrefixType = Logger } + def error1(c: LoggerContext1)(message: c.Expr[String]): c.Expr[Unit] = ??? + + type LoggerContext2 = WhiteboxContext { type PrefixType = Logger } + def error2(c: LoggerContext2)(message: c.Expr[String]): c.Expr[Unit] = ??? +} diff --git a/tests/disabled/macro/pos/t5744/Macros_1.scala b/tests/disabled/macro/pos/t5744/Macros_1.scala new file mode 100644 index 000000000..11da37f17 --- /dev/null +++ b/tests/disabled/macro/pos/t5744/Macros_1.scala @@ -0,0 +1,22 @@ +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.Context + +object Macros { + def foo[U: Numeric](x: U) = macro foo_impl[U] + def bar[U: Numeric : Equiv, Y <% String](x: U)(implicit s: String) = macro bar_impl[U, Y] + + def foo_impl[U](c: Context)(x: c.Expr[U])(numeric: c.Expr[Numeric[U]]) = { + import c.universe._ + val plusOne = Apply(Select(numeric.tree, newTermName("plus")), List(x.tree, Literal(Constant(1)))) + val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(plusOne)) + c.Expr[Unit](body) + } + + def bar_impl[U, Y](c: Context)(x: c.Expr[U])(numeric: c.Expr[Numeric[U]], equiv: c.Expr[Equiv[U]], viewAsString: c.Expr[Y => String], s: c.Expr[String]) = { + import c.universe._ + val plusOne = Apply(Select(numeric.tree, newTermName("plus")), List(x.tree, Literal(Constant(1)))) + val plusLen = Apply(Select(numeric.tree, newTermName("plus")), List(plusOne, Select(s.tree, newTermName("length")))) + val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(plusLen)) + c.Expr[Unit](body) + } +} diff --git a/tests/disabled/macro/pos/t5744/Test_2.scala b/tests/disabled/macro/pos/t5744/Test_2.scala new file mode 100644 index 000000000..dc3de03e4 --- /dev/null +++ b/tests/disabled/macro/pos/t5744/Test_2.scala @@ -0,0 +1,6 @@ +object Test extends App { + import Macros._ + foo(42) + implicit val s = "" + bar(43) +} diff --git a/tests/disabled/macro/pos/t6047.flags b/tests/disabled/macro/pos/t6047.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/pos/t6047.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/pos/t6047.scala b/tests/disabled/macro/pos/t6047.scala new file mode 100644 index 000000000..e7d0c38c6 --- /dev/null +++ b/tests/disabled/macro/pos/t6047.scala @@ -0,0 +1,20 @@ +import scala.reflect.macros.blackbox.Context +import java.io.InputStream + +object Macros { + def unpack[A](input: InputStream): A = macro unpack_impl[A] + + def unpack_impl[A: c.WeakTypeTag](c: Context)(input: c.Expr[InputStream]): c.Expr[A] = { + import c.universe._ + + def unpackcode(tpe: c.Type): c.Expr[_] = { + if (tpe <:< implicitly[c.WeakTypeTag[Traversable[_]]].tpe) { + + } + ??? + } + + unpackcode(implicitly[c.WeakTypeTag[A]].tpe) + ??? + } + } diff --git a/tests/disabled/macro/pos/t6386.scala b/tests/disabled/macro/pos/t6386.scala new file mode 100644 index 000000000..4031ae267 --- /dev/null +++ b/tests/disabled/macro/pos/t6386.scala @@ -0,0 +1,5 @@ +import scala.reflect.runtime.universe._ + +object Test extends App { + reify(manifest[Some[_]]) +} diff --git a/tests/disabled/macro/pos/t6447.scala b/tests/disabled/macro/pos/t6447.scala new file mode 100644 index 000000000..6ef69d485 --- /dev/null +++ b/tests/disabled/macro/pos/t6447.scala @@ -0,0 +1,18 @@ +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.Context + +class X { type T } + +object X { + // this works + def foo(x: X): x.T = macro fooImpl + def fooImpl(c: Context)(x: c.Expr[X]): c.Expr[x.value.T] = ??? + + // this doesn't + def bar(x: X, y: X): (x.T, y.T) = macro barImpl + def barImpl(c: Context)(x: c.Expr[X], y: c.Expr[X]): c.Expr[(x.value.T, y.value.T)] = ??? + + // neither does this + def baz(x: X)(xs: List[x.T]): Unit = macro bazImpl + def bazImpl(c: Context)(x: c.Expr[X])(xs: c.Expr[List[x.value.T]]): c.Expr[Unit] = ??? +} diff --git a/tests/disabled/macro/pos/t6485a/Macros_1.scala b/tests/disabled/macro/pos/t6485a/Macros_1.scala new file mode 100644 index 000000000..cc7dc3d3e --- /dev/null +++ b/tests/disabled/macro/pos/t6485a/Macros_1.scala @@ -0,0 +1,5 @@ +import scala.reflect.macros.blackbox.Context + +object Macros { + def crash(c: Context): c.Expr[Unit] = c.universe.reify(()) +} diff --git a/tests/disabled/macro/pos/t6485a/Test_2.scala b/tests/disabled/macro/pos/t6485a/Test_2.scala new file mode 100644 index 000000000..54e260ac7 --- /dev/null +++ b/tests/disabled/macro/pos/t6485a/Test_2.scala @@ -0,0 +1,5 @@ +import scala.language.experimental.macros + +final class Ops[T](val x: T) extends AnyVal { + def f = macro Macros.crash +} diff --git a/tests/disabled/macro/pos/t6485b/Test.scala b/tests/disabled/macro/pos/t6485b/Test.scala new file mode 100644 index 000000000..46d707073 --- /dev/null +++ b/tests/disabled/macro/pos/t6485b/Test.scala @@ -0,0 +1,10 @@ +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.Context + +final class Ops[T](val x: T) extends AnyVal { + def f = macro Macros.crash +} + +object Macros { + def crash(c: Context): c.Expr[Unit] = c.universe.reify(()) +} diff --git a/tests/disabled/macro/pos/t6516.scala b/tests/disabled/macro/pos/t6516.scala new file mode 100644 index 000000000..2980d83eb --- /dev/null +++ b/tests/disabled/macro/pos/t6516.scala @@ -0,0 +1,19 @@ +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.Context +import scala.collection.TraversableLike + +// This one compiles +object Test { + type Alias[T, CC[_]] = Context { type PrefixType = TraversableLike[T, CC[T]] } + def f() = macro f_impl + def f_impl(c: Alias[Int, List])() = ??? +} + +// This one doesn't +object Test2 { + type Ctx = scala.reflect.macros.blackbox.Context + type Alias[T, CC[_]] = Ctx { type PrefixType = TraversableLike[T, CC[T]] } + + def f() = macro f_impl + def f_impl(c: Alias[Int, List])() = ??? +} diff --git a/tests/disabled/macro/pos/t7190.scala b/tests/disabled/macro/pos/t7190.scala new file mode 100644 index 000000000..449e5c83f --- /dev/null +++ b/tests/disabled/macro/pos/t7190.scala @@ -0,0 +1,26 @@ +import scala.language.experimental.macros +import scala.reflect.macros._ + +trait A[T] { + def min[U >: T](implicit ord: Numeric[U]): T = macro A.min[T, U] +} + +object A { + def min[T: c.WeakTypeTag, U >: T: c.WeakTypeTag](c: Context)(ord: c.Expr[Numeric[U]]): c.Expr[T] = { + c.universe.reify { + ord.splice.zero.asInstanceOf[T] + } + } +} + +class B extends A[Int] { + override def min[U >: Int](implicit ord: Numeric[U]): Int = macro B.min[U] +} + +object B { + def min[U >: Int: c.WeakTypeTag](c: Context)(ord: c.Expr[Numeric[U]]): c.Expr[Int] = { + c.universe.reify { + ord.splice.zero.asInstanceOf[Int] + } + } +} diff --git a/tests/disabled/macro/pos/t7377/Client_2.scala b/tests/disabled/macro/pos/t7377/Client_2.scala new file mode 100644 index 000000000..5728956cc --- /dev/null +++ b/tests/disabled/macro/pos/t7377/Client_2.scala @@ -0,0 +1,11 @@ +object Test { + M.noop(List(1) match { case Nil => 0; case (x::xs) => x }) + + case class Foo(a: Int) + val FooAlias: Foo.type = Foo + M.noop(Foo(0) match { case FooAlias(_) => 0 }) + + case class Bar() + val BarAlias: Bar.type = Bar + M.noop(Bar() match { case BarAlias() => 0 }) +} diff --git a/tests/disabled/macro/pos/t7377/Macro_1.scala b/tests/disabled/macro/pos/t7377/Macro_1.scala new file mode 100644 index 000000000..b38687c8b --- /dev/null +++ b/tests/disabled/macro/pos/t7377/Macro_1.scala @@ -0,0 +1,7 @@ +import language.experimental._ +import scala.reflect.macros.blackbox.Context + +object M { + def noopImpl[A](c: Context)(expr: c.Expr[A]): c.Expr[A] = c.Expr(c.typecheck(c.untypecheck(expr.tree))) + def noop[A](expr: A): A = macro noopImpl[A] +} diff --git a/tests/disabled/macro/pos/t7461/Macros_1.scala b/tests/disabled/macro/pos/t7461/Macros_1.scala new file mode 100644 index 000000000..74ebf5af9 --- /dev/null +++ b/tests/disabled/macro/pos/t7461/Macros_1.scala @@ -0,0 +1,13 @@ +import scala.reflect.macros.blackbox.Context +import language.experimental.macros + +object Macros { + def impl(c: Context) = { + import c.universe._ + val wut = c.typecheck(Select(Literal(Constant(10)), newTermName("$minus")), silent = true) + // println(showRaw(wut, printIds = true, printTypes = true)) + c.Expr[Unit](q"()") + } + + def foo = macro impl +} diff --git a/tests/disabled/macro/pos/t7461/Test_2.scala b/tests/disabled/macro/pos/t7461/Test_2.scala new file mode 100644 index 000000000..866e3dc6f --- /dev/null +++ b/tests/disabled/macro/pos/t7461/Test_2.scala @@ -0,0 +1,3 @@ +class C { + def foo = Macros.foo +} diff --git a/tests/disabled/macro/pos/t7516/A_1.scala b/tests/disabled/macro/pos/t7516/A_1.scala new file mode 100644 index 000000000..3bd477dcd --- /dev/null +++ b/tests/disabled/macro/pos/t7516/A_1.scala @@ -0,0 +1,9 @@ +import scala.reflect._,macros._, scala.language.experimental.macros + +object A { + def impl[T: c.WeakTypeTag](c: Context)(t: c.Expr[T]): c.Expr[List[T]] = { + val r = c.universe.reify { List(t.splice) } + c.Expr[List[T]]( c.untypecheck(r.tree) ) + } + def demo[T](t: T): List[T] = macro impl[T] +} diff --git a/tests/disabled/macro/pos/t7516/B_2.scala b/tests/disabled/macro/pos/t7516/B_2.scala new file mode 100644 index 000000000..1b8531bc8 --- /dev/null +++ b/tests/disabled/macro/pos/t7516/B_2.scala @@ -0,0 +1,4 @@ +object B { + final case class CV(p: Int = 3, g: Int = 2) + A.demo { val d = 4; CV(g = d); "a" } +} diff --git a/tests/disabled/macro/pos/t7649.flags b/tests/disabled/macro/pos/t7649.flags new file mode 100644 index 000000000..fcf951d90 --- /dev/null +++ b/tests/disabled/macro/pos/t7649.flags @@ -0,0 +1 @@ +-Yrangepos \ No newline at end of file diff --git a/tests/disabled/macro/pos/t7649.scala b/tests/disabled/macro/pos/t7649.scala new file mode 100644 index 000000000..d70dc05ea --- /dev/null +++ b/tests/disabled/macro/pos/t7649.scala @@ -0,0 +1,20 @@ +object Test { + val c: scala.reflect.macros.blackbox.Context = ??? + import c.universe._ + reify { + // The lookup of the implicit WeakTypeTag[Any] + // was triggering an unpositioned tree. + c.Expr[Any](q"0").splice + } + + import scala.reflect.ClassTag + def ct[A: ClassTag]: Expr[A] = ??? + def tt[A: TypeTag]: Expr[A] = ??? + def wtt[A: WeakTypeTag]: Expr[A] = ??? + + reify { + ct[String].splice + tt[String].splice + wtt[String].splice + } +} diff --git a/tests/disabled/macro/pos/t7776.check b/tests/disabled/macro/pos/t7776.check new file mode 100644 index 000000000..e69de29bb diff --git a/tests/disabled/macro/pos/t7776.scala b/tests/disabled/macro/pos/t7776.scala new file mode 100644 index 000000000..627d20dd6 --- /dev/null +++ b/tests/disabled/macro/pos/t7776.scala @@ -0,0 +1,20 @@ +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.Context + +class MacroErasure { + def app(f: Any => Any, x: Any): Any = macro MacroErasure.appMacro + def app[A](f: A => Any, x: Any): Any = macro MacroErasure.appMacroA[A] +} + +object MacroErasure { + def appMacro(c: Context)( + f: c.Expr[Any => Any], x: c.Expr[Any]): c.Expr[Any] = { + import c.universe._ + c.Expr(q"$f($x)") + } + def appMacroA[A](c: Context)(f: c.Expr[A => Any], x: c.Expr[Any])( + implicit tt: c.WeakTypeTag[A]): c.Expr[Any] = { + import c.universe._ + c.Expr(q"$f[${tt.tpe}]($x)") + } +} diff --git a/tests/disabled/macro/pos/t7987/Macro_1.scala b/tests/disabled/macro/pos/t7987/Macro_1.scala new file mode 100644 index 000000000..81f717b9c --- /dev/null +++ b/tests/disabled/macro/pos/t7987/Macro_1.scala @@ -0,0 +1,6 @@ +import scala.language.experimental._ + +object Macro { + def apply[A](a: A): A = macro impl[A] + def impl[A](c: reflect.macros.Context)(a: c.Expr[A]): c.Expr[A] = a +} diff --git a/tests/disabled/macro/pos/t7987/Test_2.scala b/tests/disabled/macro/pos/t7987/Test_2.scala new file mode 100644 index 000000000..aaa21ec4c --- /dev/null +++ b/tests/disabled/macro/pos/t7987/Test_2.scala @@ -0,0 +1,12 @@ +class C[T] { + def foo = 0 +} + +object Test { + implicit def AnyToC[T](a: Any): C[T] = new C[T] + // was: "macro not expanded" + Macro { + "".foo + () + } +} diff --git a/tests/disabled/macro/pos/t8001/Macros_1.scala b/tests/disabled/macro/pos/t8001/Macros_1.scala new file mode 100644 index 000000000..077082a9c --- /dev/null +++ b/tests/disabled/macro/pos/t8001/Macros_1.scala @@ -0,0 +1,10 @@ +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.Context + +object Macros { + def foo: Unit = macro impl + def impl(c: Context) = { + import c.universe._ + q"()" + } +} diff --git a/tests/disabled/macro/pos/t8001/Test_2.scala b/tests/disabled/macro/pos/t8001/Test_2.scala new file mode 100644 index 000000000..55024506e --- /dev/null +++ b/tests/disabled/macro/pos/t8001/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends App { + Macros.foo + (): Unit +} diff --git a/tests/disabled/macro/pos/t8013/inpervolated_2.scala b/tests/disabled/macro/pos/t8013/inpervolated_2.scala new file mode 100644 index 000000000..90e571b42 --- /dev/null +++ b/tests/disabled/macro/pos/t8013/inpervolated_2.scala @@ -0,0 +1,11 @@ +/* + * scalac: -Xfatal-warnings -Xlint + */ +package t8013 + +// unsuspecting user of perverse macro +trait User { + import Perverse.Impervolator + val foo = "bar" + Console println p"Hello, $foo" +} diff --git a/tests/disabled/macro/pos/t8013/inpervolator_1.scala b/tests/disabled/macro/pos/t8013/inpervolator_1.scala new file mode 100644 index 000000000..612e1d727 --- /dev/null +++ b/tests/disabled/macro/pos/t8013/inpervolator_1.scala @@ -0,0 +1,33 @@ + +package t8013 + +// perverse macro to confuse Xlint + +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.Context + +object Perverse { + + implicit class Impervolator(sc: StringContext) { + def p(args: Any*): String = macro pImpl + } + + // turn a nice interpolation into something that looks + // nothing like an interpolation or anything we might + // recognize, but which includes a "$id" in an apply. + def pImpl(c: Context)(args: c.Expr[Any]*): c.Expr[String] = { + import c.universe._ + val macroPos = c.macroApplication.pos + val text = macroPos.source.lineToString(macroPos.line - 1) substring macroPos.column + val tt = Literal(Constant(text)) + val tree = q"t8013.Perverse.pervert($tt)" + c.Expr[String](tree) + } + + // identity doesn't seem very perverse in this context + //def pervert(text: String): String = text + def pervert(text: String): String = { + Console println s"Perverting [$text]" + text + } +} diff --git a/tests/disabled/macro/pos/t8064/Client_2.scala b/tests/disabled/macro/pos/t8064/Client_2.scala new file mode 100644 index 000000000..42c9b21ce --- /dev/null +++ b/tests/disabled/macro/pos/t8064/Client_2.scala @@ -0,0 +1,8 @@ +object Test { + Macro { + def s = "" + Macro(s): @unchecked + ??? + } +} +// Was: a range position validation error (unpositioned tree) diff --git a/tests/disabled/macro/pos/t8064/Macro_1.scala b/tests/disabled/macro/pos/t8064/Macro_1.scala new file mode 100644 index 000000000..9f1e6955b --- /dev/null +++ b/tests/disabled/macro/pos/t8064/Macro_1.scala @@ -0,0 +1,10 @@ +import language.experimental.macros +import scala.reflect.macros.blackbox.Context + +object Macro { + def apply(a: Any): Any = macro impl + + def impl(c: Context)(a: c.Tree): c.Tree = { + c.untypecheck(a) + } +} diff --git a/tests/disabled/macro/pos/t8064b/Client_2.scala b/tests/disabled/macro/pos/t8064b/Client_2.scala new file mode 100644 index 000000000..055b7a606 --- /dev/null +++ b/tests/disabled/macro/pos/t8064b/Client_2.scala @@ -0,0 +1,6 @@ +object Test { + Macro { + "".reverse + } +} +// Was: a range position validation error (tree with offset position enclosing tree with range position) diff --git a/tests/disabled/macro/pos/t8064b/Macro_1.scala b/tests/disabled/macro/pos/t8064b/Macro_1.scala new file mode 100644 index 000000000..60996bfec --- /dev/null +++ b/tests/disabled/macro/pos/t8064b/Macro_1.scala @@ -0,0 +1,11 @@ +import language.experimental.macros +import scala.reflect.macros.blackbox.Context + +object Macro { + def apply(a: Any): Any = macro impl + def impl(c: Context)(a: c.Tree): c.Tree = { + import c.universe._ + + q"{$a; true}" + } +} diff --git a/tests/disabled/macro/pos/t8209a/Macros_1.scala b/tests/disabled/macro/pos/t8209a/Macros_1.scala new file mode 100644 index 000000000..5d7852cb7 --- /dev/null +++ b/tests/disabled/macro/pos/t8209a/Macros_1.scala @@ -0,0 +1,17 @@ +import scala.language.experimental.macros +import scala.language.implicitConversions +import scala.reflect.macros.blackbox.Context + +class A +object A { implicit def a2b(a: A): B = ??? } +class B +class C extends A + +object Macros { + def impl(c: Context) = { + import c.universe._ + q"new C" + } + + def foo: A = macro impl +} diff --git a/tests/disabled/macro/pos/t8209a/Test_2.scala b/tests/disabled/macro/pos/t8209a/Test_2.scala new file mode 100644 index 000000000..bedef776f --- /dev/null +++ b/tests/disabled/macro/pos/t8209a/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends App { + val a: A = Macros.foo + val b: B = Macros.foo +} diff --git a/tests/disabled/macro/pos/t8209b/Macros_1.scala b/tests/disabled/macro/pos/t8209b/Macros_1.scala new file mode 100644 index 000000000..fa521d38d --- /dev/null +++ b/tests/disabled/macro/pos/t8209b/Macros_1.scala @@ -0,0 +1,17 @@ +import scala.language.experimental.macros +import scala.language.implicitConversions +import scala.reflect.macros.whitebox.Context + +class A +object A { implicit def a2b(a: A): B = ??? } +class B +class C extends A + +object Macros { + def impl(c: Context) = { + import c.universe._ + q"new C" + } + + def foo: A = macro impl +} diff --git a/tests/disabled/macro/pos/t8209b/Test_2.scala b/tests/disabled/macro/pos/t8209b/Test_2.scala new file mode 100644 index 000000000..bedef776f --- /dev/null +++ b/tests/disabled/macro/pos/t8209b/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends App { + val a: A = Macros.foo + val b: B = Macros.foo +} diff --git a/tests/disabled/macro/pos/t8352/Macros_1.scala b/tests/disabled/macro/pos/t8352/Macros_1.scala new file mode 100644 index 000000000..c1c63e57b --- /dev/null +++ b/tests/disabled/macro/pos/t8352/Macros_1.scala @@ -0,0 +1,7 @@ +import scala.reflect.macros.whitebox._ +import scala.language.experimental.macros + +object Macros { + def impl(c: Context)(x: c.Expr[Boolean]): c.Expr[Boolean] = x + def foo(x: Boolean): Boolean = macro impl +} diff --git a/tests/disabled/macro/pos/t8352/Test_2.scala b/tests/disabled/macro/pos/t8352/Test_2.scala new file mode 100644 index 000000000..1f84c3ca1 --- /dev/null +++ b/tests/disabled/macro/pos/t8352/Test_2.scala @@ -0,0 +1,5 @@ +object Test extends App { + def expectUnit(): Unit = { + Macros.foo(true) + } +} diff --git a/tests/disabled/macro/run/exprs_serialize.check b/tests/disabled/macro/run/exprs_serialize.check new file mode 100644 index 000000000..551823ccd --- /dev/null +++ b/tests/disabled/macro/run/exprs_serialize.check @@ -0,0 +1,19 @@ +Expr[Int(2)](2) +Expr[java.lang.String]({ + def foo = "hello"; + foo.$plus("world!") +}) +Expr[Boolean]({ + def foo(x: Int) = { + class Local extends AnyRef { + def () = { + super.(); + () + }; + val f = 2 + }; + val obj = new Local(); + x.$percent(obj.f).$eq$eq(0) + }; + foo(5) +}) diff --git a/tests/disabled/macro/run/exprs_serialize.scala b/tests/disabled/macro/run/exprs_serialize.scala new file mode 100644 index 000000000..85cf55e1c --- /dev/null +++ b/tests/disabled/macro/run/exprs_serialize.scala @@ -0,0 +1,39 @@ +import java.io._ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} + +object Test extends dotty.runtime.LegacyApp { + def test(expr: Expr[_]) = + try { + val fout = new ByteArrayOutputStream() + val out = new ObjectOutputStream(fout) + out.writeObject(expr) + out.close() + fout.close() + + val fin = new ByteArrayInputStream(fout.toByteArray) + val in = new ObjectInputStream(fin) + val reexpr = in.readObject().asInstanceOf[ru.Expr[_]].in(cm) + in.close() + fin.close() + + println(reexpr) + } catch { + case ex: Exception => + println(ex) + } + + test(reify(2)) + test(reify{def foo = "hello"; foo + "world!"}) + test(reify { + def foo(x: Int) = { + class Local { + val f = 2 + } + val obj = new Local + x % obj.f == 0 + } + foo(5) + }) +} diff --git a/tests/disabled/macro/run/freetypes_false_alarm1.check b/tests/disabled/macro/run/freetypes_false_alarm1.check new file mode 100644 index 000000000..085b3ee50 --- /dev/null +++ b/tests/disabled/macro/run/freetypes_false_alarm1.check @@ -0,0 +1 @@ +scala.List[Int] diff --git a/tests/disabled/macro/run/freetypes_false_alarm1.scala b/tests/disabled/macro/run/freetypes_false_alarm1.scala new file mode 100644 index 000000000..b06e10efe --- /dev/null +++ b/tests/disabled/macro/run/freetypes_false_alarm1.scala @@ -0,0 +1,10 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + val ru = scala.reflect.runtime.universe + val tpe: ru.Type = ru.typeOf[List[Int]] + println(tpe) + }.eval +} diff --git a/tests/disabled/macro/run/idempotency-case-classes.check b/tests/disabled/macro/run/idempotency-case-classes.check new file mode 100644 index 000000000..5a8d0ad9d --- /dev/null +++ b/tests/disabled/macro/run/idempotency-case-classes.check @@ -0,0 +1,55 @@ +C(2,3) +() +{ + case class C extends AnyRef with Product with Serializable { + private[this] val x: Int = _; + def x: Int = C.this.x; + private[this] val y: Int = _; + def y: Int = C.this.y; + def (x: Int, y: Int): C = { + C.super.(); + () + }; + def copy(x: Int = x, y: Int = y): C = new C(x, y); + def copy$default$1: Int = C.this.x; + def copy$default$2: Int = C.this.y; + override def productPrefix: String = "C"; + def productArity: Int = 2; + def productElement(x$1: Int): Any = x$1 match { + case 0 => C.this.x + case 1 => C.this.y + case _ => throw new IndexOutOfBoundsException(x$1.toString()) + }; + override def productIterator: Iterator[Any] = runtime.this.ScalaRunTime.typedProductIterator[Any](C.this); + def canEqual(x$1: Any): Boolean = x$1.$isInstanceOf[C](); + override def hashCode(): Int = { + var acc: Int = -889275714; + acc = Statics.this.mix(acc, x); + acc = Statics.this.mix(acc, y); + Statics.this.finalizeHash(acc, 2) + }; + override def toString(): String = ScalaRunTime.this._toString(C.this); + override def equals(x$1: Any): Boolean = C.this.eq(x$1.asInstanceOf[Object]).||(x$1 match { + case (_: C) => true + case _ => false +}.&&({ + val C$1: C = x$1.asInstanceOf[C]; + C.this.x.==(C$1.x).&&(C.this.y.==(C$1.y)).&&(C$1.canEqual(C.this)) + })) + }; + object C extends scala.runtime.AbstractFunction2[Int,Int,C] with Serializable { + def (): C.type = { + C.super.(); + () + }; + final override def toString(): String = "C"; + case def apply(x: Int, y: Int): C = new C(x, y); + case def unapply(x$0: C): Option[(Int, Int)] = if (x$0.==(null)) + scala.this.None + else + Some.apply[(Int, Int)](scala.Tuple2.apply[Int, Int](x$0.x, x$0.y)); + private def readResolve(): Object = C + }; + Predef.println(C.apply(2, 3)) +} +error! diff --git a/tests/disabled/macro/run/idempotency-case-classes.scala b/tests/disabled/macro/run/idempotency-case-classes.scala new file mode 100644 index 000000000..8c2aa70dc --- /dev/null +++ b/tests/disabled/macro/run/idempotency-case-classes.scala @@ -0,0 +1,22 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.{ToolBox, ToolBoxError} +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + val casee = reify { + case class C(x: Int, y: Int) + println(C(2, 3)) + } + println(casee.eval) + val tb = cm.mkToolBox() + val tcasee = tb.typecheck(casee.tree) + println(tcasee) + val rtcasee = tb.untypecheck(tcasee) + try { + println(tb.eval(rtcasee)) + } catch { + // this is the current behaviour, rather than the desired behavior; see SI-5467 + case _: ToolBoxError => println("error!") + } +} diff --git a/tests/disabled/macro/run/idempotency-extractors.check b/tests/disabled/macro/run/idempotency-extractors.check new file mode 100644 index 000000000..fcd50faa7 --- /dev/null +++ b/tests/disabled/macro/run/idempotency-extractors.check @@ -0,0 +1,5 @@ +2 +2 match { + case Test.this.Extractor.unapply() ((x @ _)) => x +} +error! diff --git a/tests/disabled/macro/run/idempotency-extractors.scala b/tests/disabled/macro/run/idempotency-extractors.scala new file mode 100644 index 000000000..f5d6cd193 --- /dev/null +++ b/tests/disabled/macro/run/idempotency-extractors.scala @@ -0,0 +1,22 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.{ToolBox, ToolBoxError} +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + object Extractor { def unapply(x: Int): Option[Int] = Some(x) } + val extractor = reify { + 2 match { case Extractor(x) => x } + } + println(extractor.eval) + val tb = cm.mkToolBox() + val textractor = tb.typecheck(extractor.tree) + println(textractor) + val rtextractor = tb.untypecheck(textractor) + try { + println(tb.eval(rtextractor)) + } catch { + // this is the current behaviour, rather than the desired behavior; see SI-5465 + case _: ToolBoxError => println("error!") + } +} diff --git a/tests/disabled/macro/run/idempotency-labels.check b/tests/disabled/macro/run/idempotency-labels.check new file mode 100644 index 000000000..8709efeb4 --- /dev/null +++ b/tests/disabled/macro/run/idempotency-labels.check @@ -0,0 +1,15 @@ +2 +{ + var x: Int = 0; + while$1(){ + if (x.<(2)) + { + x = x.+(1); + while$1() + } + else + () + }; + x +} +2 diff --git a/tests/disabled/macro/run/idempotency-labels.scala b/tests/disabled/macro/run/idempotency-labels.scala new file mode 100644 index 000000000..126063384 --- /dev/null +++ b/tests/disabled/macro/run/idempotency-labels.scala @@ -0,0 +1,22 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.{ToolBox, ToolBoxError} +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + val label = reify { + var x = 0 + while (x < 2) { x += 1 } + x + } + println(label.eval) + val tb = cm.mkToolBox() + val tlabel = tb.typecheck(label.tree) + println(tlabel) + val rtlabel = tb.untypecheck(tlabel) + try { + println(tb.eval(rtlabel)) + } catch { + case _: ToolBoxError => println("error!") + } +} diff --git a/tests/disabled/macro/run/idempotency-lazy-vals.check b/tests/disabled/macro/run/idempotency-lazy-vals.check new file mode 100644 index 000000000..15afa5303 --- /dev/null +++ b/tests/disabled/macro/run/idempotency-lazy-vals.check @@ -0,0 +1,23 @@ +6 +{ + class C extends AnyRef { + def (): C = { + C.super.(); + () + }; + lazy private[this] val x: Int = _; + lazy def x: Int = { + C.this.x = 2; + C.this.x + }; + lazy private[this] val y: Int = _; + implicit lazy def y: Int = { + C.this.y = 3; + C.this.y + } + }; + val c: C = new C(); + import c._; + c.x.*(Predef.implicitly[Int](c.y)) +} +error! diff --git a/tests/disabled/macro/run/idempotency-lazy-vals.scala b/tests/disabled/macro/run/idempotency-lazy-vals.scala new file mode 100644 index 000000000..cb757f1ab --- /dev/null +++ b/tests/disabled/macro/run/idempotency-lazy-vals.scala @@ -0,0 +1,27 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.{ToolBox, ToolBoxError} +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + val lazee = reify { + class C { + lazy val x = 2 + implicit lazy val y = 3 + } + val c = new C() + import c._ + x * implicitly[Int] + } + println(lazee.eval) + val tb = cm.mkToolBox() + val tlazee = tb.typecheck(lazee.tree) + println(tlazee) + val rtlazee = tb.untypecheck(tlazee) + try { + println(tb.eval(rtlazee)) + } catch { + // this is the current behaviour, rather than the desired behavior; see SI-5466 + case _: ToolBoxError => println("error!") + } +} diff --git a/tests/disabled/macro/run/idempotency-this.check b/tests/disabled/macro/run/idempotency-this.check new file mode 100644 index 000000000..88b8288ad --- /dev/null +++ b/tests/disabled/macro/run/idempotency-this.check @@ -0,0 +1,4 @@ +List() +List.apply[String]("") +Apply(TypeApply(Select(Ident(scala.collection.immutable.List), TermName("apply")), List(TypeTree().setOriginal(Select(Ident(scala.Predef), TypeName("String"))))), List(Literal(Constant("")))) +List() diff --git a/tests/disabled/macro/run/idempotency-this.scala b/tests/disabled/macro/run/idempotency-this.scala new file mode 100644 index 000000000..2e2f7cf66 --- /dev/null +++ b/tests/disabled/macro/run/idempotency-this.scala @@ -0,0 +1,22 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.{ToolBox, ToolBoxError} +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + val thiss = reify { + List[String]("") + } + println(thiss.eval) + val tb = cm.mkToolBox() + val tthiss = tb.typecheck(thiss.tree) + println(tthiss) + println(showRaw(tthiss)) + val rtthiss = tb.untypecheck(tthiss) + try { + println(tb.eval(rtthiss)) + } catch { + // this is the current behaviour, rather than the desired behavior; see SI-5705 + case _: ToolBoxError => println("error!") + } +} diff --git a/tests/disabled/macro/run/macro-abort-fresh.check b/tests/disabled/macro/run/macro-abort-fresh.check new file mode 100644 index 000000000..5064b96ee --- /dev/null +++ b/tests/disabled/macro/run/macro-abort-fresh.check @@ -0,0 +1,6 @@ +fresh$macro$1 +qwe$macro$2 +qwe$macro$3 +reflective compilation has failed: + +blargh diff --git a/tests/disabled/macro/run/macro-abort-fresh.flags b/tests/disabled/macro/run/macro-abort-fresh.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-abort-fresh.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-abort-fresh/Macros_1.scala b/tests/disabled/macro/run/macro-abort-fresh/Macros_1.scala new file mode 100644 index 000000000..2b03512ef --- /dev/null +++ b/tests/disabled/macro/run/macro-abort-fresh/Macros_1.scala @@ -0,0 +1,15 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def impl(c: Context) = { + import c.universe._ + println(c.fresh()) + println(c.fresh("qwe")) + println(c.fresh(TypeName("qwe"))) + c.abort(NoPosition, "blargh") + } +} + +object Macros { + def foo = macro Impls.impl +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-abort-fresh/Test_2.scala b/tests/disabled/macro/run/macro-abort-fresh/Test_2.scala new file mode 100644 index 000000000..dea6e6d62 --- /dev/null +++ b/tests/disabled/macro/run/macro-abort-fresh/Test_2.scala @@ -0,0 +1,8 @@ +object Test extends dotty.runtime.LegacyApp { + import scala.reflect.runtime.universe._ + import scala.reflect.runtime.{currentMirror => cm} + import scala.tools.reflect.ToolBox + val tree = Select(Ident(TermName("Macros")), TermName("foo")) + try cm.mkToolBox().eval(tree) + catch { case ex: Throwable => println(ex.getMessage) } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-auto-duplicate.check b/tests/disabled/macro/run/macro-auto-duplicate.check new file mode 100644 index 000000000..d81cc0710 --- /dev/null +++ b/tests/disabled/macro/run/macro-auto-duplicate.check @@ -0,0 +1 @@ +42 diff --git a/tests/disabled/macro/run/macro-auto-duplicate/Macros_1.scala b/tests/disabled/macro/run/macro-auto-duplicate/Macros_1.scala new file mode 100644 index 000000000..2c910e6af --- /dev/null +++ b/tests/disabled/macro/run/macro-auto-duplicate/Macros_1.scala @@ -0,0 +1,17 @@ +import scala.reflect.macros.blackbox.Context +import language.experimental.macros + +object Macros { + def impl(c: Context) = { + import c.universe._ + val x = Ident(newTermName("x")) + def defAndUseX(rhs: Tree) = { + Block(List(ValDef(NoMods, newTermName("x"), TypeTree(), rhs)), x) + } + val xi4 = defAndUseX(Literal(Constant(4))) + val xs2 = defAndUseX(Literal(Constant("2"))) + c.Expr[String](Apply(Select(xi4, newTermName("$plus")), List(xs2))) + } + + def foo = macro impl +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-auto-duplicate/Test_2.scala b/tests/disabled/macro/run/macro-auto-duplicate/Test_2.scala new file mode 100644 index 000000000..eed62a0fe --- /dev/null +++ b/tests/disabled/macro/run/macro-auto-duplicate/Test_2.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + println(Macros.foo) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-basic-ma-md-mi.check b/tests/disabled/macro/run/macro-basic-ma-md-mi.check new file mode 100644 index 000000000..b74e882ae --- /dev/null +++ b/tests/disabled/macro/run/macro-basic-ma-md-mi.check @@ -0,0 +1 @@ +31 \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-basic-ma-md-mi.flags b/tests/disabled/macro/run/macro-basic-ma-md-mi.flags new file mode 100644 index 000000000..5e5dd6ce7 --- /dev/null +++ b/tests/disabled/macro/run/macro-basic-ma-md-mi.flags @@ -0,0 +1 @@ +-language:experimental.macros diff --git a/tests/disabled/macro/run/macro-basic-ma-md-mi/Impls_1.scala b/tests/disabled/macro/run/macro-basic-ma-md-mi/Impls_1.scala new file mode 100644 index 000000000..fc75b99ef --- /dev/null +++ b/tests/disabled/macro/run/macro-basic-ma-md-mi/Impls_1.scala @@ -0,0 +1,21 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context)(x: c.Expr[Int]): c.Expr[Int] = { + import c.universe._ + val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(1)))) + c.Expr[Int](body) + } + + def bar(c: Context)(x: c.Expr[Int]): c.Expr[Int] = { + import c.universe._ + val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(2)))) + c.Expr[Int](body) + } + + def quux(c: Context)(x: c.Expr[Int]): c.Expr[Int] = { + import c.universe._ + val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(3)))) + c.Expr[Int](body) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-basic-ma-md-mi/Macros_2.scala b/tests/disabled/macro/run/macro-basic-ma-md-mi/Macros_2.scala new file mode 100644 index 000000000..527904374 --- /dev/null +++ b/tests/disabled/macro/run/macro-basic-ma-md-mi/Macros_2.scala @@ -0,0 +1,10 @@ +object Macros { + object Shmacros { + def foo(x: Int): Int = macro Impls.foo + } + def bar(x: Int): Int = macro Impls.bar +} + +class Macros { + def quux(x: Int): Int = macro Impls.quux +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-basic-ma-md-mi/Test_3.scala b/tests/disabled/macro/run/macro-basic-ma-md-mi/Test_3.scala new file mode 100644 index 000000000..9c45f59d7 --- /dev/null +++ b/tests/disabled/macro/run/macro-basic-ma-md-mi/Test_3.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + import Macros.Shmacros._ + println(foo(2) + Macros.bar(2) * new Macros().quux(4)) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-basic-ma-mdmi.check b/tests/disabled/macro/run/macro-basic-ma-mdmi.check new file mode 100644 index 000000000..b74e882ae --- /dev/null +++ b/tests/disabled/macro/run/macro-basic-ma-mdmi.check @@ -0,0 +1 @@ +31 \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-basic-ma-mdmi.flags b/tests/disabled/macro/run/macro-basic-ma-mdmi.flags new file mode 100644 index 000000000..5e5dd6ce7 --- /dev/null +++ b/tests/disabled/macro/run/macro-basic-ma-mdmi.flags @@ -0,0 +1 @@ +-language:experimental.macros diff --git a/tests/disabled/macro/run/macro-basic-ma-mdmi/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-basic-ma-mdmi/Impls_Macros_1.scala new file mode 100644 index 000000000..73a5a971a --- /dev/null +++ b/tests/disabled/macro/run/macro-basic-ma-mdmi/Impls_Macros_1.scala @@ -0,0 +1,32 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context)(x: c.Expr[Int]): c.Expr[Int] = { + import c.universe._ + val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(1)))) + c.Expr[Int](body) + } + + def bar(c: Context)(x: c.Expr[Int]): c.Expr[Int] = { + import c.universe._ + val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(2)))) + c.Expr[Int](body) + } + + def quux(c: Context)(x: c.Expr[Int]): c.Expr[Int] = { + import c.universe._ + val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(3)))) + c.Expr[Int](body) + } +} + +object Macros { + object Shmacros { + def foo(x: Int): Int = macro Impls.foo + } + def bar(x: Int): Int = macro Impls.bar +} + +class Macros { + def quux(x: Int): Int = macro Impls.quux +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-basic-ma-mdmi/Test_2.scala b/tests/disabled/macro/run/macro-basic-ma-mdmi/Test_2.scala new file mode 100644 index 000000000..9c45f59d7 --- /dev/null +++ b/tests/disabled/macro/run/macro-basic-ma-mdmi/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + import Macros.Shmacros._ + println(foo(2) + Macros.bar(2) * new Macros().quux(4)) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-basic-mamd-mi.check b/tests/disabled/macro/run/macro-basic-mamd-mi.check new file mode 100644 index 000000000..b74e882ae --- /dev/null +++ b/tests/disabled/macro/run/macro-basic-mamd-mi.check @@ -0,0 +1 @@ +31 \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-basic-mamd-mi.flags b/tests/disabled/macro/run/macro-basic-mamd-mi.flags new file mode 100644 index 000000000..5e5dd6ce7 --- /dev/null +++ b/tests/disabled/macro/run/macro-basic-mamd-mi.flags @@ -0,0 +1 @@ +-language:experimental.macros diff --git a/tests/disabled/macro/run/macro-basic-mamd-mi/Impls_1.scala b/tests/disabled/macro/run/macro-basic-mamd-mi/Impls_1.scala new file mode 100644 index 000000000..0be915c11 --- /dev/null +++ b/tests/disabled/macro/run/macro-basic-mamd-mi/Impls_1.scala @@ -0,0 +1,19 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context)(x: c.Expr[Int]): c.Expr[Int] = { + import c.universe._ + c.Expr(Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(1))))) + } + + def bar(c: Context)(x: c.Expr[Int]): c.Expr[Int] = { + import c.universe._ + c.Expr(Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(2))))) + } + + def quux(c: Context)(x: c.Expr[Int]): c.Expr[Int] = { + import c.universe._ + val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(3)))) + c.Expr[Int](body) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-basic-mamd-mi/Macros_Test_2.scala b/tests/disabled/macro/run/macro-basic-mamd-mi/Macros_Test_2.scala new file mode 100644 index 000000000..9bfcbc4a7 --- /dev/null +++ b/tests/disabled/macro/run/macro-basic-mamd-mi/Macros_Test_2.scala @@ -0,0 +1,15 @@ +object Macros { + object Shmacros { + def foo(x: Int): Int = macro Impls.foo + } + def bar(x: Int): Int = macro Impls.bar +} + +class Macros { + def quux(x: Int): Int = macro Impls.quux +} + +object Test extends dotty.runtime.LegacyApp { + import Macros.Shmacros._ + println(foo(2) + Macros.bar(2) * new Macros().quux(4)) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-blackbox-materialization.check b/tests/disabled/macro/run/macro-blackbox-materialization.check new file mode 100644 index 000000000..7165b734a --- /dev/null +++ b/tests/disabled/macro/run/macro-blackbox-materialization.check @@ -0,0 +1,3 @@ +C(Int) +C(String) +C(Nothing) diff --git a/tests/disabled/macro/run/macro-blackbox-materialization/Macros_1.scala b/tests/disabled/macro/run/macro-blackbox-materialization/Macros_1.scala new file mode 100644 index 000000000..ea8d1bed1 --- /dev/null +++ b/tests/disabled/macro/run/macro-blackbox-materialization/Macros_1.scala @@ -0,0 +1,16 @@ +// For the full version of the test, take a look at run/t5923a + +import scala.reflect.macros.blackbox.Context +import language.experimental.macros + +case class C[T](t: String) +object C { + implicit def foo[T]: C[T] = macro Macros.impl[T] +} + +object Macros { + def impl[T: c.WeakTypeTag](c: Context) = { + import c.universe._ + reify(C[T](c.literal(weakTypeOf[T].toString).splice)) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-blackbox-materialization/Test_2.scala b/tests/disabled/macro/run/macro-blackbox-materialization/Test_2.scala new file mode 100644 index 000000000..1f0413bdf --- /dev/null +++ b/tests/disabled/macro/run/macro-blackbox-materialization/Test_2.scala @@ -0,0 +1,5 @@ +object Test extends dotty.runtime.LegacyApp { + println(implicitly[C[Int]]) + println(implicitly[C[String]]) + println(implicitly[C[Nothing]]) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-bodyexpandstoimpl.check b/tests/disabled/macro/run/macro-bodyexpandstoimpl.check new file mode 100644 index 000000000..f70d7bba4 --- /dev/null +++ b/tests/disabled/macro/run/macro-bodyexpandstoimpl.check @@ -0,0 +1 @@ +42 \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-bodyexpandstoimpl.flags b/tests/disabled/macro/run/macro-bodyexpandstoimpl.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-bodyexpandstoimpl.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-bodyexpandstoimpl/Impls_1.scala b/tests/disabled/macro/run/macro-bodyexpandstoimpl/Impls_1.scala new file mode 100644 index 000000000..d46af4952 --- /dev/null +++ b/tests/disabled/macro/run/macro-bodyexpandstoimpl/Impls_1.scala @@ -0,0 +1,16 @@ +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.{Context => BlackboxContext} +import scala.reflect.macros.whitebox.{Context => WhiteboxContext} + +object Impls { + def foo(c: BlackboxContext)(x: c.Expr[Int]) = x + + def refToFoo(dummy: Int): Int = macro refToFoo_impl + def refToFoo_impl(c: WhiteboxContext)(dummy: c.Expr[Int]) = { + import c.universe._ + val body = Select(Ident(TermName("Impls")), TermName("foo")) + val global = c.universe.asInstanceOf[scala.tools.nsc.Global] + global.analyzer.markMacroImplRef(body.asInstanceOf[global.Tree]) + c.Expr[Int](body) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-bodyexpandstoimpl/Macros_Test_2.scala b/tests/disabled/macro/run/macro-bodyexpandstoimpl/Macros_Test_2.scala new file mode 100644 index 000000000..f0fe4a8e3 --- /dev/null +++ b/tests/disabled/macro/run/macro-bodyexpandstoimpl/Macros_Test_2.scala @@ -0,0 +1,10 @@ +import scala.language.experimental.macros + +object Macros { + def foo(x: Int): Int = macro Impls.refToFoo(42) +} + +object Test extends dotty.runtime.LegacyApp { + import Macros._ + println(foo(42)) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-bundle-context-alias.check b/tests/disabled/macro/run/macro-bundle-context-alias.check new file mode 100644 index 000000000..55e4dfcf9 --- /dev/null +++ b/tests/disabled/macro/run/macro-bundle-context-alias.check @@ -0,0 +1,4 @@ +C +C +C +C diff --git a/tests/disabled/macro/run/macro-bundle-context-alias/Macros_1.scala b/tests/disabled/macro/run/macro-bundle-context-alias/Macros_1.scala new file mode 100644 index 000000000..354c5e0d9 --- /dev/null +++ b/tests/disabled/macro/run/macro-bundle-context-alias/Macros_1.scala @@ -0,0 +1,38 @@ +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.{Context => BlackboxContext} +import scala.reflect.macros.whitebox.{Context => WhiteboxContext} + +object Module { + type BBC = BlackboxContext + type RBBC = BBC { type PrefixType = C } + type WBC = WhiteboxContext + type RWBC = WBC { type PrefixType = C } + + class BlackboxBundle(val c: BBC) { + import c.universe._ + def impl = q"${c.prefix}" + } + + class RefinedBlackboxBundle(val c: RBBC) { + import c.universe._ + def impl = reify(c.prefix.splice) + } + + class WhiteboxBundle(val c: WBC) { + import c.universe._ + def impl = q"${c.prefix}" + } + + class RefinedWhiteboxBundle(val c: RWBC) { + import c.universe._ + def impl = reify(c.prefix.splice) + } +} + +class C { + def blackbox: C = macro Module.BlackboxBundle.impl + def refinedBlackbox: C = macro Module.RefinedBlackboxBundle.impl + def whitebox: C = macro Module.WhiteboxBundle.impl + def refinedWhitebox: C = macro Module.RefinedWhiteboxBundle.impl + override def toString = "C" +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-bundle-context-alias/Test_2.scala b/tests/disabled/macro/run/macro-bundle-context-alias/Test_2.scala new file mode 100644 index 000000000..6c70277de --- /dev/null +++ b/tests/disabled/macro/run/macro-bundle-context-alias/Test_2.scala @@ -0,0 +1,6 @@ +object Test extends dotty.runtime.LegacyApp { + println(new C().blackbox) + println(new C().refinedBlackbox) + println(new C().whitebox) + println(new C().refinedWhitebox) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-bundle-context-refinement.check b/tests/disabled/macro/run/macro-bundle-context-refinement.check new file mode 100644 index 000000000..10f9ebb61 --- /dev/null +++ b/tests/disabled/macro/run/macro-bundle-context-refinement.check @@ -0,0 +1,2 @@ +C +C diff --git a/tests/disabled/macro/run/macro-bundle-context-refinement/Macros_1.scala b/tests/disabled/macro/run/macro-bundle-context-refinement/Macros_1.scala new file mode 100644 index 000000000..d3a5d179c --- /dev/null +++ b/tests/disabled/macro/run/macro-bundle-context-refinement/Macros_1.scala @@ -0,0 +1,19 @@ +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.{Context => BlackboxContext} +import scala.reflect.macros.whitebox.{Context => WhiteboxContext} + +class BlackboxBundle(val c: BlackboxContext { type PrefixType = C }) { + import c.universe._ + def impl = reify(c.prefix.splice) +} + +class WhiteboxBundle(val c: WhiteboxContext { type PrefixType = C }) { + import c.universe._ + def impl = reify(c.prefix.splice) +} + +class C { + def blackbox: C = macro BlackboxBundle.impl + def whitebox: C = macro WhiteboxBundle.impl + override def toString = "C" +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-bundle-context-refinement/Test_2.scala b/tests/disabled/macro/run/macro-bundle-context-refinement/Test_2.scala new file mode 100644 index 000000000..d631b8f7e --- /dev/null +++ b/tests/disabled/macro/run/macro-bundle-context-refinement/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + println(new C().blackbox) + println(new C().whitebox) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-bundle-repl.check b/tests/disabled/macro/run/macro-bundle-repl.check new file mode 100644 index 000000000..75c5c2add --- /dev/null +++ b/tests/disabled/macro/run/macro-bundle-repl.check @@ -0,0 +1,24 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> import scala.language.experimental.macros +import scala.language.experimental.macros + +scala> import scala.reflect.macros.blackbox.Context +import scala.reflect.macros.blackbox.Context + +scala> class Bar(val c: Context) { def impl = { import c.universe._; c.Expr[Unit](q"()") } };def bar: Unit = macro Bar.impl +defined class Bar +defined term macro bar: Unit + +scala> bar + +scala> class Foo(val c: Context) { def impl = { import c.universe._; c.Expr[Unit](q"()") } } +defined class Foo + +scala> def foo: Unit = macro Foo.impl +defined term macro foo: Unit + +scala> foo + +scala> :quit diff --git a/tests/disabled/macro/run/macro-bundle-repl.scala b/tests/disabled/macro/run/macro-bundle-repl.scala new file mode 100644 index 000000000..808441845 --- /dev/null +++ b/tests/disabled/macro/run/macro-bundle-repl.scala @@ -0,0 +1,13 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.Context +class Bar(val c: Context) { def impl = { import c.universe._; c.Expr[Unit](q"()") } };def bar: Unit = macro Bar.impl +bar +class Foo(val c: Context) { def impl = { import c.universe._; c.Expr[Unit](q"()") } } +def foo: Unit = macro Foo.impl +foo + """ +} diff --git a/tests/disabled/macro/run/macro-bundle-static.check b/tests/disabled/macro/run/macro-bundle-static.check new file mode 100644 index 000000000..37c8eaf27 --- /dev/null +++ b/tests/disabled/macro/run/macro-bundle-static.check @@ -0,0 +1,6 @@ +() +Int +() +true +IntInt +true diff --git a/tests/disabled/macro/run/macro-bundle-static/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-bundle-static/Impls_Macros_1.scala new file mode 100644 index 000000000..0142e5d94 --- /dev/null +++ b/tests/disabled/macro/run/macro-bundle-static/Impls_Macros_1.scala @@ -0,0 +1,30 @@ +import scala.reflect.macros.blackbox.Context +import scala.language.experimental.macros + +object Enclosing { + class Impl(val c: Context) { + def mono = { import c.universe._; c.Expr[Unit](q"()") } + def poly[T: c.WeakTypeTag] = { import c.universe._; c.Expr[String](q"${c.weakTypeOf[T].toString}") } + def weird = macro mono + } +} + +object Macros { + def mono = macro Enclosing.Impl.mono + def poly[T] = macro Enclosing.Impl.poly[T] +} + +package pkg { + object Enclosing { + class Impl(val c: Context) { + def mono = { import c.universe._; c.Expr[Boolean](q"true") } + def poly[T: c.WeakTypeTag] = { import c.universe._; c.Expr[String](q"${c.weakTypeOf[T].toString + c.weakTypeOf[T].toString}") } + def weird = macro mono + } + } + + object Macros { + def mono = macro Enclosing.Impl.mono + def poly[T] = macro Enclosing.Impl.poly[T] + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-bundle-static/Test_2.scala b/tests/disabled/macro/run/macro-bundle-static/Test_2.scala new file mode 100644 index 000000000..cfc1e1563 --- /dev/null +++ b/tests/disabled/macro/run/macro-bundle-static/Test_2.scala @@ -0,0 +1,8 @@ +object Test extends dotty.runtime.LegacyApp { + println(Macros.mono) + println(Macros.poly[Int]) + println(new Enclosing.Impl(???).weird) + println(pkg.Macros.mono) + println(pkg.Macros.poly[Int]) + println(new pkg.Enclosing.Impl(???).weird) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-bundle-toplevel.check b/tests/disabled/macro/run/macro-bundle-toplevel.check new file mode 100644 index 000000000..37c8eaf27 --- /dev/null +++ b/tests/disabled/macro/run/macro-bundle-toplevel.check @@ -0,0 +1,6 @@ +() +Int +() +true +IntInt +true diff --git a/tests/disabled/macro/run/macro-bundle-toplevel.flags b/tests/disabled/macro/run/macro-bundle-toplevel.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-bundle-toplevel.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-bundle-toplevel/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-bundle-toplevel/Impls_Macros_1.scala new file mode 100644 index 000000000..6fd7be3b2 --- /dev/null +++ b/tests/disabled/macro/run/macro-bundle-toplevel/Impls_Macros_1.scala @@ -0,0 +1,25 @@ +import scala.reflect.macros.blackbox.Context + +class Impl(val c: Context) { + def mono = { import c.universe._; c.Expr[Unit](q"()") } + def poly[T: c.WeakTypeTag] = { import c.universe._; c.Expr[String](q"${c.weakTypeOf[T].toString}") } + def weird = macro mono +} + +object Macros { + def mono = macro Impl.mono + def poly[T] = macro Impl.poly[T] +} + +package pkg { + class Impl(val c: Context) { + def mono = { import c.universe._; c.Expr[Boolean](q"true") } + def poly[T: c.WeakTypeTag] = { import c.universe._; c.Expr[String](q"${c.weakTypeOf[T].toString + c.weakTypeOf[T].toString}") } + def weird = macro mono + } + + object Macros { + def mono = macro Impl.mono + def poly[T] = macro Impl.poly[T] + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-bundle-toplevel/Test_2.scala b/tests/disabled/macro/run/macro-bundle-toplevel/Test_2.scala new file mode 100644 index 000000000..013baa348 --- /dev/null +++ b/tests/disabled/macro/run/macro-bundle-toplevel/Test_2.scala @@ -0,0 +1,8 @@ +object Test extends dotty.runtime.LegacyApp { + println(Macros.mono) + println(Macros.poly[Int]) + println(new Impl(???).weird) + println(pkg.Macros.mono) + println(pkg.Macros.poly[Int]) + println(new pkg.Impl(???).weird) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-bundle-whitebox-decl.check b/tests/disabled/macro/run/macro-bundle-whitebox-decl.check new file mode 100644 index 000000000..37c8eaf27 --- /dev/null +++ b/tests/disabled/macro/run/macro-bundle-whitebox-decl.check @@ -0,0 +1,6 @@ +() +Int +() +true +IntInt +true diff --git a/tests/disabled/macro/run/macro-bundle-whitebox-decl/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-bundle-whitebox-decl/Impls_Macros_1.scala new file mode 100644 index 000000000..5e1b11895 --- /dev/null +++ b/tests/disabled/macro/run/macro-bundle-whitebox-decl/Impls_Macros_1.scala @@ -0,0 +1,26 @@ +import scala.language.experimental.macros +import scala.reflect.macros.whitebox.Context + +class Impl(val c: Context) { + def mono = { import c.universe._; c.Expr[Unit](q"()") } + def poly[T: c.WeakTypeTag] = { import c.universe._; c.Expr[String](q"${c.weakTypeOf[T].toString}") } + def weird = macro mono +} + +object Macros { + def mono = macro Impl.mono + def poly[T] = macro Impl.poly[T] +} + +package pkg { + class Impl(val c: Context) { + def mono = { import c.universe._; c.Expr[Boolean](q"true") } + def poly[T: c.WeakTypeTag] = { import c.universe._; c.Expr[String](q"${c.weakTypeOf[T].toString + c.weakTypeOf[T].toString}") } + def weird = macro mono + } + + object Macros { + def mono = macro Impl.mono + def poly[T] = macro Impl.poly[T] + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-bundle-whitebox-decl/Test_2.scala b/tests/disabled/macro/run/macro-bundle-whitebox-decl/Test_2.scala new file mode 100644 index 000000000..013baa348 --- /dev/null +++ b/tests/disabled/macro/run/macro-bundle-whitebox-decl/Test_2.scala @@ -0,0 +1,8 @@ +object Test extends dotty.runtime.LegacyApp { + println(Macros.mono) + println(Macros.poly[Int]) + println(new Impl(???).weird) + println(pkg.Macros.mono) + println(pkg.Macros.poly[Int]) + println(new pkg.Impl(???).weird) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-bundle-whitebox-use-raw.check b/tests/disabled/macro/run/macro-bundle-whitebox-use-raw.check new file mode 100644 index 000000000..5679c5fab --- /dev/null +++ b/tests/disabled/macro/run/macro-bundle-whitebox-use-raw.check @@ -0,0 +1,5 @@ +2 +(23,foo,true) +null +C2 +42 diff --git a/tests/disabled/macro/run/macro-bundle-whitebox-use-raw/Macros_1.scala b/tests/disabled/macro/run/macro-bundle-whitebox-use-raw/Macros_1.scala new file mode 100644 index 000000000..de1863418 --- /dev/null +++ b/tests/disabled/macro/run/macro-bundle-whitebox-use-raw/Macros_1.scala @@ -0,0 +1,108 @@ +import scala.reflect.macros.whitebox.Context +import scala.language.experimental.macros + +// whitebox use case #1: return type refinement + +class ReturnTypeRefinementBundle(val c: Context) { + import c.universe._ + def impl = { + q""" + trait Foo { + def x = 2 + } + new Foo {} + """ + } +} + +object ReturnTypeRefinement { + def foo: Any = macro ReturnTypeRefinementBundle.impl +} + +// whitebox use case #2: fundep materialization + +trait FundepMaterialization[T, U] { + def to(t : T) : U + // def from(u : U) : T +} + +class FundepMaterializationBundle(val c: Context) { + import c.universe._ + import definitions._ + import Flag._ + + def impl[T: c.WeakTypeTag, U: c.WeakTypeTag]: c.Expr[FundepMaterialization[T, U]] = { + val sym = c.weakTypeOf[T].typeSymbol + if (!sym.isClass || !sym.asClass.isCaseClass) c.abort(c.enclosingPosition, s"$sym is not a case class") + val fields = sym.info.decls.toList.collect{ case x: TermSymbol if x.isVal && x.isCaseAccessor => x } + + def mkTpt() = { + val core = Ident(TupleClass(fields.length) orElse UnitClass) + if (fields.length == 0) core + else AppliedTypeTree(core, fields map (f => TypeTree(f.info))) + } + + def mkFrom() = { + if (fields.length == 0) Literal(Constant(Unit)) + else Apply(Ident(newTermName("Tuple" + fields.length)), fields map (f => Select(Ident(newTermName("f")), newTermName(f.name.toString.trim)))) + } + + val evidenceClass = ClassDef(Modifiers(FINAL), newTypeName("$anon"), List(), Template( + List(AppliedTypeTree(Ident(newTypeName("FundepMaterialization")), List(Ident(sym), mkTpt()))), + emptyValDef, + List( + DefDef(Modifiers(), termNames.CONSTRUCTOR, List(), List(List()), TypeTree(), Block(List(Apply(Select(Super(This(typeNames.EMPTY), typeNames.EMPTY), termNames.CONSTRUCTOR), List())), Literal(Constant(())))), + DefDef(Modifiers(), newTermName("to"), List(), List(List(ValDef(Modifiers(PARAM), newTermName("f"), Ident(sym), EmptyTree))), TypeTree(), mkFrom())))) + c.Expr[FundepMaterialization[T, U]](Block(List(evidenceClass), Apply(Select(New(Ident(newTypeName("$anon"))), termNames.CONSTRUCTOR), List()))) + } +} + +object FundepMaterialization { + implicit def materializeIso[T, U]: FundepMaterialization[T, U] = macro FundepMaterializationBundle.impl[T, U] +} + +// whitebox use case #3: dynamic materialization + +trait DynamicMaterialization[T] + +class C1(val x: Int) +class C2(val x: String) + +trait LowPriority { + implicit def lessSpecific[T]: DynamicMaterialization[T] = null +} + +object DynamicMaterialization extends LowPriority { + implicit def moreSpecific[T]: DynamicMaterialization[T] = macro DynamicMaterializationBundle.impl[T] +} + +class DynamicMaterializationBundle(val c: Context) { + import c.universe._ + def impl[T: c.WeakTypeTag] = { + val tpe = weakTypeOf[T] + if (tpe.members.exists(_.info =:= typeOf[Int])) + c.abort(c.enclosingPosition, "I don't like classes that contain integers") + q"new DynamicMaterialization[$tpe]{ override def toString = ${tpe.toString} }" + } +} + +// whitebox use case #4: extractor macros + +object ExtractorMacro { + def unapply(x: Int): Any = macro ExtractorBundle.unapplyImpl +} + +class ExtractorBundle(val c: Context) { + import c.universe._ + def unapplyImpl(x: Tree) = { + q""" + new { + class Match(x: Int) { + def isEmpty = false + def get = x + } + def unapply(x: Int) = new Match(x) + }.unapply($x) + """ + } +} diff --git a/tests/disabled/macro/run/macro-bundle-whitebox-use-raw/Test_2.scala b/tests/disabled/macro/run/macro-bundle-whitebox-use-raw/Test_2.scala new file mode 100644 index 000000000..b28ebfd71 --- /dev/null +++ b/tests/disabled/macro/run/macro-bundle-whitebox-use-raw/Test_2.scala @@ -0,0 +1,19 @@ +object Test extends dotty.runtime.LegacyApp { + println(ReturnTypeRefinement.foo.x) + + case class Foo(i: Int, s: String, b: Boolean) + def foo[C, L](c: C)(implicit iso: FundepMaterialization[C, L]): L = iso.to(c) + locally { + val equiv = foo(Foo(23, "foo", true)) + def typed[T](t: => T) {} + typed[(Int, String, Boolean)](equiv) + println(equiv) + } + + println(implicitly[DynamicMaterialization[C1]]) + println(implicitly[DynamicMaterialization[C2]]) + + 42 match { + case ExtractorMacro(x) => println(x) + } +} diff --git a/tests/disabled/macro/run/macro-bundle-whitebox-use-refined.check b/tests/disabled/macro/run/macro-bundle-whitebox-use-refined.check new file mode 100644 index 000000000..5679c5fab --- /dev/null +++ b/tests/disabled/macro/run/macro-bundle-whitebox-use-refined.check @@ -0,0 +1,5 @@ +2 +(23,foo,true) +null +C2 +42 diff --git a/tests/disabled/macro/run/macro-bundle-whitebox-use-refined/Macros_1.scala b/tests/disabled/macro/run/macro-bundle-whitebox-use-refined/Macros_1.scala new file mode 100644 index 000000000..de1863418 --- /dev/null +++ b/tests/disabled/macro/run/macro-bundle-whitebox-use-refined/Macros_1.scala @@ -0,0 +1,108 @@ +import scala.reflect.macros.whitebox.Context +import scala.language.experimental.macros + +// whitebox use case #1: return type refinement + +class ReturnTypeRefinementBundle(val c: Context) { + import c.universe._ + def impl = { + q""" + trait Foo { + def x = 2 + } + new Foo {} + """ + } +} + +object ReturnTypeRefinement { + def foo: Any = macro ReturnTypeRefinementBundle.impl +} + +// whitebox use case #2: fundep materialization + +trait FundepMaterialization[T, U] { + def to(t : T) : U + // def from(u : U) : T +} + +class FundepMaterializationBundle(val c: Context) { + import c.universe._ + import definitions._ + import Flag._ + + def impl[T: c.WeakTypeTag, U: c.WeakTypeTag]: c.Expr[FundepMaterialization[T, U]] = { + val sym = c.weakTypeOf[T].typeSymbol + if (!sym.isClass || !sym.asClass.isCaseClass) c.abort(c.enclosingPosition, s"$sym is not a case class") + val fields = sym.info.decls.toList.collect{ case x: TermSymbol if x.isVal && x.isCaseAccessor => x } + + def mkTpt() = { + val core = Ident(TupleClass(fields.length) orElse UnitClass) + if (fields.length == 0) core + else AppliedTypeTree(core, fields map (f => TypeTree(f.info))) + } + + def mkFrom() = { + if (fields.length == 0) Literal(Constant(Unit)) + else Apply(Ident(newTermName("Tuple" + fields.length)), fields map (f => Select(Ident(newTermName("f")), newTermName(f.name.toString.trim)))) + } + + val evidenceClass = ClassDef(Modifiers(FINAL), newTypeName("$anon"), List(), Template( + List(AppliedTypeTree(Ident(newTypeName("FundepMaterialization")), List(Ident(sym), mkTpt()))), + emptyValDef, + List( + DefDef(Modifiers(), termNames.CONSTRUCTOR, List(), List(List()), TypeTree(), Block(List(Apply(Select(Super(This(typeNames.EMPTY), typeNames.EMPTY), termNames.CONSTRUCTOR), List())), Literal(Constant(())))), + DefDef(Modifiers(), newTermName("to"), List(), List(List(ValDef(Modifiers(PARAM), newTermName("f"), Ident(sym), EmptyTree))), TypeTree(), mkFrom())))) + c.Expr[FundepMaterialization[T, U]](Block(List(evidenceClass), Apply(Select(New(Ident(newTypeName("$anon"))), termNames.CONSTRUCTOR), List()))) + } +} + +object FundepMaterialization { + implicit def materializeIso[T, U]: FundepMaterialization[T, U] = macro FundepMaterializationBundle.impl[T, U] +} + +// whitebox use case #3: dynamic materialization + +trait DynamicMaterialization[T] + +class C1(val x: Int) +class C2(val x: String) + +trait LowPriority { + implicit def lessSpecific[T]: DynamicMaterialization[T] = null +} + +object DynamicMaterialization extends LowPriority { + implicit def moreSpecific[T]: DynamicMaterialization[T] = macro DynamicMaterializationBundle.impl[T] +} + +class DynamicMaterializationBundle(val c: Context) { + import c.universe._ + def impl[T: c.WeakTypeTag] = { + val tpe = weakTypeOf[T] + if (tpe.members.exists(_.info =:= typeOf[Int])) + c.abort(c.enclosingPosition, "I don't like classes that contain integers") + q"new DynamicMaterialization[$tpe]{ override def toString = ${tpe.toString} }" + } +} + +// whitebox use case #4: extractor macros + +object ExtractorMacro { + def unapply(x: Int): Any = macro ExtractorBundle.unapplyImpl +} + +class ExtractorBundle(val c: Context) { + import c.universe._ + def unapplyImpl(x: Tree) = { + q""" + new { + class Match(x: Int) { + def isEmpty = false + def get = x + } + def unapply(x: Int) = new Match(x) + }.unapply($x) + """ + } +} diff --git a/tests/disabled/macro/run/macro-bundle-whitebox-use-refined/Test_2.scala b/tests/disabled/macro/run/macro-bundle-whitebox-use-refined/Test_2.scala new file mode 100644 index 000000000..b28ebfd71 --- /dev/null +++ b/tests/disabled/macro/run/macro-bundle-whitebox-use-refined/Test_2.scala @@ -0,0 +1,19 @@ +object Test extends dotty.runtime.LegacyApp { + println(ReturnTypeRefinement.foo.x) + + case class Foo(i: Int, s: String, b: Boolean) + def foo[C, L](c: C)(implicit iso: FundepMaterialization[C, L]): L = iso.to(c) + locally { + val equiv = foo(Foo(23, "foo", true)) + def typed[T](t: => T) {} + typed[(Int, String, Boolean)](equiv) + println(equiv) + } + + println(implicitly[DynamicMaterialization[C1]]) + println(implicitly[DynamicMaterialization[C2]]) + + 42 match { + case ExtractorMacro(x) => println(x) + } +} diff --git a/tests/disabled/macro/run/macro-def-path-dependent.check b/tests/disabled/macro/run/macro-def-path-dependent.check new file mode 100644 index 000000000..7658ad2c2 --- /dev/null +++ b/tests/disabled/macro/run/macro-def-path-dependent.check @@ -0,0 +1 @@ +it works diff --git a/tests/disabled/macro/run/macro-def-path-dependent.flags b/tests/disabled/macro/run/macro-def-path-dependent.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-def-path-dependent.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-def-path-dependent/Dummy.scala b/tests/disabled/macro/run/macro-def-path-dependent/Dummy.scala new file mode 100644 index 000000000..2ccaa3940 --- /dev/null +++ b/tests/disabled/macro/run/macro-def-path-dependent/Dummy.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + println("it works") +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-def-path-dependent/Test_1.scala b/tests/disabled/macro/run/macro-def-path-dependent/Test_1.scala new file mode 100644 index 000000000..4161a6430 --- /dev/null +++ b/tests/disabled/macro/run/macro-def-path-dependent/Test_1.scala @@ -0,0 +1,25 @@ +// NOTE: blocked by SI-8049 + +// package test1 +// +// import scala.reflect.macros.blackbox.Context +// +// trait Exprs { +// self: Universe => +// +// class Expr[T] +// } +// +// trait Reifiers { +// self: Universe => +// +// type Expr[T] +// +// def reify[T](expr: T): Expr[T] = macro Impls.reify[T] +// } +// +// trait Universe extends Exprs with Reifiers +// +// object Impls { +// def reify[T](cc: Context{ type PrefixType = Reifiers })(expr: cc.Expr[T]): cc.Expr[cc.prefix.value.Expr[T]] = ??? +// } diff --git a/tests/disabled/macro/run/macro-def-path-dependent/Test_2.scala b/tests/disabled/macro/run/macro-def-path-dependent/Test_2.scala new file mode 100644 index 000000000..75a03b54e --- /dev/null +++ b/tests/disabled/macro/run/macro-def-path-dependent/Test_2.scala @@ -0,0 +1,22 @@ +package test2 + +import scala.reflect.macros.blackbox.Context + +trait Exprs { + self: Universe => + + class Expr[T] +} + +trait Reifiers { + self: Universe => + +} + +trait Universe extends Exprs with Reifiers { + def reify[T](expr: T): Expr[T] = macro Impls.reify[T] +} + +object Impls { + def reify[T](cc: Context{ type PrefixType = Universe })(expr: cc.Expr[T]): cc.Expr[cc.prefix.value.Expr[T]] = ??? +} diff --git a/tests/disabled/macro/run/macro-def-path-dependent/Test_3.scala b/tests/disabled/macro/run/macro-def-path-dependent/Test_3.scala new file mode 100644 index 000000000..1a5da8200 --- /dev/null +++ b/tests/disabled/macro/run/macro-def-path-dependent/Test_3.scala @@ -0,0 +1,22 @@ +package test3 + +import scala.reflect.macros.blackbox.Context + +trait Exprs { + self: Universe => + + class Expr[T] +} + +trait Reifiers { + self: Universe => + +} + +trait Universe extends Exprs with Reifiers { + def reify[T](expr: T): Expr[T] = macro Impls.reify[T] +} + +object Impls { + def reify[T](cc: Context{ type PrefixType = Universe })(expr: cc.Expr[T]): cc.Expr[cc.prefix.value.Expr[T]] = ??? +} diff --git a/tests/disabled/macro/run/macro-def-path-dependent/Test_4.scala b/tests/disabled/macro/run/macro-def-path-dependent/Test_4.scala new file mode 100644 index 000000000..67cb88ee6 --- /dev/null +++ b/tests/disabled/macro/run/macro-def-path-dependent/Test_4.scala @@ -0,0 +1,11 @@ +package test4 + +import scala.reflect.runtime.universe._ +import scala.reflect.macros.blackbox.Context +import scala.reflect.api.Universe + +object Test { + def materializeTypeTag[T](u: Universe)(e: T): u.TypeTag[T] = macro materializeTypeTag_impl[T] + + def materializeTypeTag_impl[T: c.WeakTypeTag](c: Context)(u: c.Expr[Universe])(e: c.Expr[T]): c.Expr[u.value.TypeTag[T]] = ??? +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-def-path-dependent/Test_5.scala b/tests/disabled/macro/run/macro-def-path-dependent/Test_5.scala new file mode 100644 index 000000000..b518ce864 --- /dev/null +++ b/tests/disabled/macro/run/macro-def-path-dependent/Test_5.scala @@ -0,0 +1,9 @@ +package test56 + +import scala.reflect.runtime.universe._ +import scala.reflect.macros.blackbox.Context +import scala.reflect.api.Universe + +object Impls { + def materializeTypeTag_impl[T: c.WeakTypeTag](c: Context)(u: c.Expr[Universe])(e: c.Expr[T]): c.Expr[u.value.TypeTag[T]] = ??? +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-def-path-dependent/Test_6.scala b/tests/disabled/macro/run/macro-def-path-dependent/Test_6.scala new file mode 100644 index 000000000..a8b50ce7d --- /dev/null +++ b/tests/disabled/macro/run/macro-def-path-dependent/Test_6.scala @@ -0,0 +1,9 @@ +package test56 + +import scala.reflect.runtime.universe._ +import scala.reflect.macros.blackbox.Context +import scala.reflect.api.Universe + +object Macros { + def materializeTypeTag[T](u: Universe)(e: T): u.TypeTag[T] = macro Impls.materializeTypeTag_impl[T] +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-default-params.check b/tests/disabled/macro/run/macro-default-params.check new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/tests/disabled/macro/run/macro-default-params.check @@ -0,0 +1 @@ +0 diff --git a/tests/disabled/macro/run/macro-default-params/Macros_1.scala b/tests/disabled/macro/run/macro-default-params/Macros_1.scala new file mode 100644 index 000000000..74588a1cf --- /dev/null +++ b/tests/disabled/macro/run/macro-default-params/Macros_1.scala @@ -0,0 +1,27 @@ +import scala.language.experimental.macros +import scala.reflect.macros.whitebox.Context + +object Macros { + def id[A]: A = null.asInstanceOf[A] + + def foo: Any = macro impl + def impl(c: Context): c.Tree = { + import c.universe._ + import Flag._ + + lazy val tpe = TypeTree(typeOf[Int]) + + /* If we used this line instead, it would work! */ + // lazy val tpe = tq"Int" + + lazy val param: ValDef = { + val p1 = q"val a: ${tpe.duplicate} = Macros.id[${tpe.duplicate}]" + ValDef(Modifiers(DEFAULTPARAM), p1.name, p1.tpt, p1.rhs) + } + + q""" + class C { def f($param) = a } + println(new C().f()) + """ + } +} diff --git a/tests/disabled/macro/run/macro-default-params/Test_2.scala b/tests/disabled/macro/run/macro-default-params/Test_2.scala new file mode 100644 index 000000000..d75fbd0db --- /dev/null +++ b/tests/disabled/macro/run/macro-default-params/Test_2.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + Macros.foo +} diff --git a/tests/disabled/macro/run/macro-divergence-spurious.check b/tests/disabled/macro/run/macro-divergence-spurious.check new file mode 100644 index 000000000..19765bd50 --- /dev/null +++ b/tests/disabled/macro/run/macro-divergence-spurious.check @@ -0,0 +1 @@ +null diff --git a/tests/disabled/macro/run/macro-divergence-spurious/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-divergence-spurious/Impls_Macros_1.scala new file mode 100644 index 000000000..7ac8fccc3 --- /dev/null +++ b/tests/disabled/macro/run/macro-divergence-spurious/Impls_Macros_1.scala @@ -0,0 +1,23 @@ +import scala.reflect.macros.blackbox.Context +import language.experimental.macros + +trait Complex[T] + +class Foo(val bar: Bar) +class Bar(val s: String) + +object Complex { + def impl[T: c.WeakTypeTag](c: Context): c.Expr[Complex[T]] = { + import c.universe._ + val tpe = weakTypeOf[T] + for (f <- tpe.decls.collect{case f: TermSymbol if f.isParamAccessor && !f.isMethod => f}) { + val trecur = appliedType(typeOf[Complex[_]], List(f.info)) + val recur = c.inferImplicitValue(trecur, silent = true) + if (recur == EmptyTree) c.abort(c.enclosingPosition, s"couldn't synthesize $trecur") + } + c.Expr[Null](Literal(Constant(null))) + } + + implicit object ComplexString extends Complex[String] + implicit def genComplex[T]: Complex[T] = macro impl[T] +} diff --git a/tests/disabled/macro/run/macro-divergence-spurious/Test_2.scala b/tests/disabled/macro/run/macro-divergence-spurious/Test_2.scala new file mode 100644 index 000000000..0a9820701 --- /dev/null +++ b/tests/disabled/macro/run/macro-divergence-spurious/Test_2.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + println(implicitly[Complex[Foo]]) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-duplicate.check b/tests/disabled/macro/run/macro-duplicate.check new file mode 100644 index 000000000..58781b719 --- /dev/null +++ b/tests/disabled/macro/run/macro-duplicate.check @@ -0,0 +1,3 @@ +Test_2.scala:5: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + Macros.foo + ^ diff --git a/tests/disabled/macro/run/macro-duplicate.flags b/tests/disabled/macro/run/macro-duplicate.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-duplicate.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-duplicate/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-duplicate/Impls_Macros_1.scala new file mode 100644 index 000000000..84fb2c5b6 --- /dev/null +++ b/tests/disabled/macro/run/macro-duplicate/Impls_Macros_1.scala @@ -0,0 +1,29 @@ +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl(c: Context) = { + import c.universe._ + val Expr(Block((cdef: ClassDef) :: Nil, _)) = reify { class C { def x = 2 } } + val cdef1 = + new Transformer { + override def transform(tree: Tree): Tree = tree match { + case Template(_, _, ctor :: defs) => + val defs1 = defs collect { + case ddef @ DefDef(mods, name, tparams, vparamss, tpt, body) => + val future = Select(Select(Ident(TermName("scala")), TermName("concurrent")), TermName("Future")) + val Future = Select(Select(Ident(TermName("scala")), TermName("concurrent")), TypeName("Future")) + val tpt1 = if (tpt.isEmpty) tpt else AppliedTypeTree(Future, List(tpt)) + val body1 = Apply(future, List(body)) + val name1 = TermName("async" + name.toString.capitalize) + DefDef(mods, name1, tparams, vparamss, tpt1, body1) + } + Template(Nil, emptyValDef, ctor +: defs ::: defs1) + case _ => + super.transform(tree) + } + } transform cdef + c.Expr[Unit](Block(cdef1 :: Nil, Literal(Constant(())))) + } + + def foo = macro impl +} diff --git a/tests/disabled/macro/run/macro-duplicate/Test_2.scala b/tests/disabled/macro/run/macro-duplicate/Test_2.scala new file mode 100644 index 000000000..8706883b4 --- /dev/null +++ b/tests/disabled/macro/run/macro-duplicate/Test_2.scala @@ -0,0 +1,6 @@ +import scala.concurrent._ +import ExecutionContext.Implicits.global + +object Test extends dotty.runtime.LegacyApp { + Macros.foo +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-enclosingowner-detectvar.check b/tests/disabled/macro/run/macro-enclosingowner-detectvar.check new file mode 100644 index 000000000..c8f86ec73 --- /dev/null +++ b/tests/disabled/macro/run/macro-enclosingowner-detectvar.check @@ -0,0 +1,16 @@ +(true,false,false,false) +(true,false,false,false) +(true,false,false,false) +(true,false,false,false) +(false,true,false,false) +(false,true,false,false) +(false,true,false,false) +(false,true,false,false) +(false,false,true,false) +(false,false,true,false) +(false,false,true,false) +(false,false,true,false) +(false,false,false,true) +(false,false,false,true) +(false,false,false,true) +(false,false,false,true) diff --git a/tests/disabled/macro/run/macro-enclosingowner-detectvar/Macros_1.scala b/tests/disabled/macro/run/macro-enclosingowner-detectvar/Macros_1.scala new file mode 100644 index 000000000..26ed64d8c --- /dev/null +++ b/tests/disabled/macro/run/macro-enclosingowner-detectvar/Macros_1.scala @@ -0,0 +1,14 @@ +import scala.reflect.macros.whitebox._ +import scala.language.experimental.macros + +object Macros { + def impl(c: Context) = { + import c.universe._ + def detectFlags(sym: TermSymbol): String = { + (sym.isVal, sym.isVar, !sym.isVal && !sym.isVar && !sym.isLazy, sym.isLazy).toString + } + q"println(${detectFlags(c.internal.enclosingOwner.asTerm)}); 42" + } + + def foo: Int = macro impl +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-enclosingowner-detectvar/Test_2.scala b/tests/disabled/macro/run/macro-enclosingowner-detectvar/Test_2.scala new file mode 100644 index 000000000..edc0eb654 --- /dev/null +++ b/tests/disabled/macro/run/macro-enclosingowner-detectvar/Test_2.scala @@ -0,0 +1,23 @@ +object Test extends dotty.runtime.LegacyApp { + val a1 = Macros.foo + val a2 = Predef.identity(Predef.identity(Macros.foo)) + val a3: Int = Macros.foo + val a4: Int = Predef.identity(Predef.identity(Macros.foo)) + + var b1 = Macros.foo + var b2 = Predef.identity(Predef.identity(Macros.foo)) + var b3: Int = Macros.foo + var b4: Int = Predef.identity(Predef.identity(Macros.foo)) + + def c1 = Macros.foo + def c2 = Predef.identity(Predef.identity(Macros.foo)) + def c3: Int = Macros.foo + def c4: Int = Predef.identity(Predef.identity(Macros.foo)) + c1; c2; c3; c4; + + lazy val d1 = Macros.foo + lazy val d2 = Predef.identity(Predef.identity(Macros.foo)) + lazy val d3: Int = Macros.foo + lazy val d4: Int = Predef.identity(Predef.identity(Macros.foo)) + d1; d2; d3; d4 +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-enclosingowner-sbt.check b/tests/disabled/macro/run/macro-enclosingowner-sbt.check new file mode 100644 index 000000000..3c95698e9 --- /dev/null +++ b/tests/disabled/macro/run/macro-enclosingowner-sbt.check @@ -0,0 +1,16 @@ +a1 +a2 +a3 +a4 +b1 +b2 +b3 +b4 +c1 +c2 +c3 +c4 +d1 +d2 +d3 +d4 diff --git a/tests/disabled/macro/run/macro-enclosingowner-sbt/Macros_1.scala b/tests/disabled/macro/run/macro-enclosingowner-sbt/Macros_1.scala new file mode 100644 index 000000000..a98a98486 --- /dev/null +++ b/tests/disabled/macro/run/macro-enclosingowner-sbt/Macros_1.scala @@ -0,0 +1,14 @@ +import scala.reflect.macros.whitebox._ +import scala.language.experimental.macros + +object Macros { + def impl(c: Context) = { + import c.universe._ + def enclosingName(sym: Symbol): String = { + sym.name.toString.stripSuffix(termNames.LOCAL_SUFFIX_STRING) + } + q"println(${enclosingName(c.internal.enclosingOwner).toString}); 42" + } + + def foo: Int = macro impl +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-enclosingowner-sbt/Test_2.scala b/tests/disabled/macro/run/macro-enclosingowner-sbt/Test_2.scala new file mode 100644 index 000000000..edc0eb654 --- /dev/null +++ b/tests/disabled/macro/run/macro-enclosingowner-sbt/Test_2.scala @@ -0,0 +1,23 @@ +object Test extends dotty.runtime.LegacyApp { + val a1 = Macros.foo + val a2 = Predef.identity(Predef.identity(Macros.foo)) + val a3: Int = Macros.foo + val a4: Int = Predef.identity(Predef.identity(Macros.foo)) + + var b1 = Macros.foo + var b2 = Predef.identity(Predef.identity(Macros.foo)) + var b3: Int = Macros.foo + var b4: Int = Predef.identity(Predef.identity(Macros.foo)) + + def c1 = Macros.foo + def c2 = Predef.identity(Predef.identity(Macros.foo)) + def c3: Int = Macros.foo + def c4: Int = Predef.identity(Predef.identity(Macros.foo)) + c1; c2; c3; c4; + + lazy val d1 = Macros.foo + lazy val d2 = Predef.identity(Predef.identity(Macros.foo)) + lazy val d3: Int = Macros.foo + lazy val d4: Int = Predef.identity(Predef.identity(Macros.foo)) + d1; d2; d3; d4 +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-enclosures.check b/tests/disabled/macro/run/macro-enclosures.check new file mode 100644 index 000000000..b6fe7a4a9 --- /dev/null +++ b/tests/disabled/macro/run/macro-enclosures.check @@ -0,0 +1,34 @@ +enclosingPackage = package test { + object Test extends scala.AnyRef { + def () = { + super.(); + () + }; + def test = Macros.foo + } +} +enclosingClass = object Test extends scala.AnyRef { + def () = { + super.(); + () + }; + def test = Macros.foo +} +enclosingImpl = object Test extends scala.AnyRef { + def () = { + super.(); + () + }; + def test = Macros.foo +} +enclosingTemplate = scala.AnyRef { + def () = { + super.(); + () + }; + def test = Macros.foo +} +enclosingMethod = def test = Macros.foo +enclosingDef = def test = Macros.foo +enclosingOwner = method test +enclosingOwnerChain = List(method test, object Test, package test, package ) diff --git a/tests/disabled/macro/run/macro-enclosures.flags b/tests/disabled/macro/run/macro-enclosures.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-enclosures.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-enclosures/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-enclosures/Impls_Macros_1.scala new file mode 100644 index 000000000..564cdfa68 --- /dev/null +++ b/tests/disabled/macro/run/macro-enclosures/Impls_Macros_1.scala @@ -0,0 +1,23 @@ +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl(c: Context) = { + import c.universe._ + def chain(sym: Symbol): List[Symbol] = sym.owner match { + case NoSymbol => sym :: Nil + case owner => sym :: chain(owner) + } + q""" + println("enclosingPackage = " + ${c.enclosingPackage.toString}) + println("enclosingClass = " + ${c.enclosingClass.toString}) + println("enclosingImpl = " + ${c.enclosingImpl.toString}) + println("enclosingTemplate = " + ${c.enclosingTemplate.toString}) + println("enclosingMethod = " + ${c.enclosingMethod.toString}) + println("enclosingDef = " + ${c.enclosingDef.toString}) + println("enclosingOwner = " + ${c.internal.enclosingOwner.toString}) + println("enclosingOwnerChain = " + ${chain(c.internal.enclosingOwner).toString}) + """ + } + + def foo: Any = macro impl +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-enclosures/Test_2.scala b/tests/disabled/macro/run/macro-enclosures/Test_2.scala new file mode 100644 index 000000000..8b8dc10cd --- /dev/null +++ b/tests/disabled/macro/run/macro-enclosures/Test_2.scala @@ -0,0 +1,11 @@ +object Test extends dotty.runtime.LegacyApp { + test.Test.test +} + +package test { + object Test { + def test = { + Macros.foo + } + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-implicit-argument.check b/tests/disabled/macro/run/macro-expand-implicit-argument.check new file mode 100644 index 000000000..15a62794a --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-implicit-argument.check @@ -0,0 +1 @@ +List(1, 2, 3) diff --git a/tests/disabled/macro/run/macro-expand-implicit-argument.flags b/tests/disabled/macro/run/macro-expand-implicit-argument.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-implicit-argument.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-implicit-argument/Macros_1.scala b/tests/disabled/macro/run/macro-expand-implicit-argument/Macros_1.scala new file mode 100644 index 000000000..465f313ef --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-implicit-argument/Macros_1.scala @@ -0,0 +1,59 @@ +import annotation.tailrec +import scala.math.{min, max} +import scala.{specialized => spec} + +import language.experimental.macros + +import scala.reflect.ClassTag +import scala.reflect.macros.blackbox.Context + +object Macros { + def alloc[@spec A:ClassTag](src:Array[A], s1:Int, len:Int) = { + val as = Array.ofDim[A](len) + System.arraycopy(src, s1, as, 0, len) + as + } + + /** + * Efficient alternative to Array.apply. + * + * "As seen on scala-internals!" + */ + def array[A](as:A*)(implicit ct: ClassTag[A]) = macro arrayMacro[A] + + /** + * Takes in something like: + * ArrayUtil.alloc[Int](11, 22, 33, 44)(ct) + * + * and builds a tree like: + * { + * val arr:Array[Int] = ct.newArray(4) + * arr.update(0, 11) + * arr.update(1, 22) + * arr.update(2, 33) + * arr.update(3, 44) + * arr + * } + */ + def arrayMacro[A:c.WeakTypeTag](c:Context)(as:c.Expr[A]*)(ct: c.Expr[ClassTag[A]]): c.Expr[Array[A]] = { + import c.mirror._ + import c.universe._ + def const(x:Int) = Literal(Constant(x)) + + val n = as.length + val arr = TermName("arr") + + val create = Apply(Select(ct.tree, TermName("newArray")), List(const(n))) + val arrtpe = TypeTree(implicitly[c.WeakTypeTag[Array[A]]].tpe) + val valdef = ValDef(Modifiers(), arr, arrtpe, create) + + val updates = (0 until n).map { + i => Apply(Select(Ident(arr), TermName("update")), List(const(i), as(i).tree)) + } + + val exprs = (Seq(valdef) ++ updates ++ Seq(Ident(arr))).toList + val block = Block(exprs.init, exprs.last) + + c.Expr[Array[A]](block) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-implicit-argument/Test_2.scala b/tests/disabled/macro/run/macro-expand-implicit-argument/Test_2.scala new file mode 100644 index 000000000..edb1de413 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-implicit-argument/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + import Macros._ + println(array(1, 2, 3).toList) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-implicit-macro-has-implicit.check b/tests/disabled/macro/run/macro-expand-implicit-macro-has-implicit.check new file mode 100644 index 000000000..d81cc0710 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-implicit-macro-has-implicit.check @@ -0,0 +1 @@ +42 diff --git a/tests/disabled/macro/run/macro-expand-implicit-macro-has-implicit.flags b/tests/disabled/macro/run/macro-expand-implicit-macro-has-implicit.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-implicit-macro-has-implicit.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-implicit-macro-has-implicit/Impls_1.scala b/tests/disabled/macro/run/macro-expand-implicit-macro-has-implicit/Impls_1.scala new file mode 100644 index 000000000..18c97956e --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-implicit-macro-has-implicit/Impls_1.scala @@ -0,0 +1,9 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context)(x: c.Expr[Int]) = { + import c.universe._ + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(x.tree)) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-implicit-macro-has-implicit/Macros_Test_2.scala b/tests/disabled/macro/run/macro-expand-implicit-macro-has-implicit/Macros_Test_2.scala new file mode 100644 index 000000000..2f5648758 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-implicit-macro-has-implicit/Macros_Test_2.scala @@ -0,0 +1,5 @@ +object Test extends dotty.runtime.LegacyApp { + implicit val x = 42 + def foo(implicit x: Int): Unit = macro Impls.foo + foo +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-implicit-macro-is-implicit.check b/tests/disabled/macro/run/macro-expand-implicit-macro-is-implicit.check new file mode 100644 index 000000000..c205945d0 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-implicit-macro-is-implicit.check @@ -0,0 +1,2 @@ +Some(2) +2 diff --git a/tests/disabled/macro/run/macro-expand-implicit-macro-is-implicit.flags b/tests/disabled/macro/run/macro-expand-implicit-macro-is-implicit.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-implicit-macro-is-implicit.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-implicit-macro-is-implicit/Impls_1.scala b/tests/disabled/macro/run/macro-expand-implicit-macro-is-implicit/Impls_1.scala new file mode 100644 index 000000000..aeceee5a5 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-implicit-macro-is-implicit/Impls_1.scala @@ -0,0 +1,9 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context)(x: c.Expr[String]): c.Expr[Option[Int]] = { + import c.universe._ + val body = Apply(Ident(definitions.SomeModule), List(Select(x.tree, TermName("toInt")))) + c.Expr[Option[Int]](body) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-implicit-macro-is-implicit/Macros_Test_2.scala b/tests/disabled/macro/run/macro-expand-implicit-macro-is-implicit/Macros_Test_2.scala new file mode 100644 index 000000000..8f0fbe60e --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-implicit-macro-is-implicit/Macros_Test_2.scala @@ -0,0 +1,11 @@ +object Macros { + import scala.language.implicitConversions + implicit def foo(x: String): Option[Int] = macro Impls.foo +} + +object Test extends dotty.runtime.LegacyApp { + import Macros._ + println("2": Option[Int]) + val s: Int = "2" getOrElse 0 + println(s) +} diff --git a/tests/disabled/macro/run/macro-expand-implicit-macro-is-val.check b/tests/disabled/macro/run/macro-expand-implicit-macro-is-val.check new file mode 100644 index 000000000..0cfbf0888 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-implicit-macro-is-val.check @@ -0,0 +1 @@ +2 diff --git a/tests/disabled/macro/run/macro-expand-implicit-macro-is-val.flags b/tests/disabled/macro/run/macro-expand-implicit-macro-is-val.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-implicit-macro-is-val.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-implicit-macro-is-val/Impls_1.scala b/tests/disabled/macro/run/macro-expand-implicit-macro-is-val/Impls_1.scala new file mode 100644 index 000000000..fd267d32c --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-implicit-macro-is-val/Impls_1.scala @@ -0,0 +1,9 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context) = { + import c.universe._ + val body = Literal(Constant(2)) + c.Expr[Int](body) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-implicit-macro-is-val/Macros_Test_2.scala b/tests/disabled/macro/run/macro-expand-implicit-macro-is-val/Macros_Test_2.scala new file mode 100644 index 000000000..3b851de05 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-implicit-macro-is-val/Macros_Test_2.scala @@ -0,0 +1,5 @@ +object Test extends dotty.runtime.LegacyApp { + implicit def foo: Int = macro Impls.foo + def bar(implicit x: Int) = println(x) + bar +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-implicit-macro-is-view.check b/tests/disabled/macro/run/macro-expand-implicit-macro-is-view.check new file mode 100644 index 000000000..0cfbf0888 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-implicit-macro-is-view.check @@ -0,0 +1 @@ +2 diff --git a/tests/disabled/macro/run/macro-expand-implicit-macro-is-view/Impls_1.scala b/tests/disabled/macro/run/macro-expand-implicit-macro-is-view/Impls_1.scala new file mode 100644 index 000000000..d72db872e --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-implicit-macro-is-view/Impls_1.scala @@ -0,0 +1,9 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context)(x: c.Expr[String]): c.Expr[Option[Int]] = { + import c.universe._ + val body = Apply(Ident(definitions.SomeModule), List(Select(x.tree, TermName("toInt")))) + c.Expr[Option[Int]](body) + } +} diff --git a/tests/disabled/macro/run/macro-expand-implicit-macro-is-view/Macros_Test_2.scala b/tests/disabled/macro/run/macro-expand-implicit-macro-is-view/Macros_Test_2.scala new file mode 100644 index 000000000..c7b09435a --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-implicit-macro-is-view/Macros_Test_2.scala @@ -0,0 +1,12 @@ + +object Macros { + import scala.language.experimental.macros + import scala.language.implicitConversions + implicit def foo(x: String): Option[Int] = macro Impls.foo +} + +object Test extends dotty.runtime.LegacyApp { + import Macros._ + def bar[T <% Option[Int]](x: T) = println(x) + println("2") +} diff --git a/tests/disabled/macro/run/macro-expand-multiple-arglists.check b/tests/disabled/macro/run/macro-expand-multiple-arglists.check new file mode 100644 index 000000000..c24b6ae77 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-multiple-arglists.check @@ -0,0 +1 @@ +38 \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-multiple-arglists.flags b/tests/disabled/macro/run/macro-expand-multiple-arglists.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-multiple-arglists.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-multiple-arglists/Impls_1.scala b/tests/disabled/macro/run/macro-expand-multiple-arglists/Impls_1.scala new file mode 100644 index 000000000..9278633c1 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-multiple-arglists/Impls_1.scala @@ -0,0 +1,10 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context)(x: c.Expr[Int])(y: c.Expr[Int]) = { + import c.universe._ + val sum = Apply(Select(x.tree, TermName("$minus")), List(y.tree)) + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(sum)) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-multiple-arglists/Macros_Test_2.scala b/tests/disabled/macro/run/macro-expand-multiple-arglists/Macros_Test_2.scala new file mode 100644 index 000000000..09de5e02f --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-multiple-arglists/Macros_Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + def foo(x: Int)(y: Int): Unit = macro Impls.foo + foo(40)(2) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-nullary-generic.check b/tests/disabled/macro/run/macro-expand-nullary-generic.check new file mode 100644 index 000000000..0470d239d --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-nullary-generic.check @@ -0,0 +1,6 @@ +fooNullary[Int] +fooEmpty[Int] +fooEmpty[Int] +barNullary[Int] +barEmpty[Int] +kkthxbai diff --git a/tests/disabled/macro/run/macro-expand-nullary-generic.flags b/tests/disabled/macro/run/macro-expand-nullary-generic.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-nullary-generic.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-nullary-generic/Impls_1.scala b/tests/disabled/macro/run/macro-expand-nullary-generic/Impls_1.scala new file mode 100644 index 000000000..9362d6c17 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-nullary-generic/Impls_1.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.macros.blackbox.Context + +object Impls { + def impl[T: c.WeakTypeTag](c: Context)(meth: String) = { + import c.universe._ + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(s"$meth[${c.weakTypeOf[T]}]")))) + c.Expr[Unit](body) + } + + def fooNullary[T: c.WeakTypeTag](c: Context) = impl[T](c)("fooNullary") + def fooEmpty[T: c.WeakTypeTag](c: Context)() = impl[T](c)("fooEmpty") + def barNullary[T: c.WeakTypeTag](c: Context)(x: c.Expr[Int]) = impl[T](c)("barNullary") + def barEmpty[T: c.WeakTypeTag](c: Context)(x: c.Expr[Int])() = impl[T](c)("barEmpty") +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-nullary-generic/Macros_Test_2.scala b/tests/disabled/macro/run/macro-expand-nullary-generic/Macros_Test_2.scala new file mode 100644 index 000000000..da418c63c --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-nullary-generic/Macros_Test_2.scala @@ -0,0 +1,15 @@ +object Macros { + def foo1[T]: Unit = macro Impls.fooNullary[T] + def foo2[T](): Unit = macro Impls.fooEmpty[T] + def bar1[T](x: Int): Unit = macro Impls.barNullary[T] + def bar2[T](x: Int)(): Unit = macro Impls.barEmpty[T] +} + +object Test extends dotty.runtime.LegacyApp { + Macros.foo1[Int] + Macros.foo2[Int] + Macros.foo2[Int]() + Macros.bar1[Int](42) + Macros.bar2[Int](42)() + println("kkthxbai") +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-nullary-nongeneric.check b/tests/disabled/macro/run/macro-expand-nullary-nongeneric.check new file mode 100644 index 000000000..cb7e76639 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-nullary-nongeneric.check @@ -0,0 +1,6 @@ +fooNullary +fooEmpty +fooEmpty +barNullary +barEmpty +kkthxbai diff --git a/tests/disabled/macro/run/macro-expand-nullary-nongeneric.flags b/tests/disabled/macro/run/macro-expand-nullary-nongeneric.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-nullary-nongeneric.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-nullary-nongeneric/Impls_1.scala b/tests/disabled/macro/run/macro-expand-nullary-nongeneric/Impls_1.scala new file mode 100644 index 000000000..c8c3d255c --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-nullary-nongeneric/Impls_1.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.macros.blackbox.Context + +object Impls { + def impl(c: Context)(meth: String) = { + import c.universe._ + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(meth)))) + c.Expr[Unit](body) + } + + def fooNullary(c: Context) = impl(c)("fooNullary") + def fooEmpty(c: Context)() = impl(c)("fooEmpty") + def barNullary(c: Context)(x: c.Expr[Int]) = impl(c)("barNullary") + def barEmpty(c: Context)(x: c.Expr[Int])() = impl(c)("barEmpty") +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-nullary-nongeneric/Macros_Test_2.scala b/tests/disabled/macro/run/macro-expand-nullary-nongeneric/Macros_Test_2.scala new file mode 100644 index 000000000..a14d981ce --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-nullary-nongeneric/Macros_Test_2.scala @@ -0,0 +1,15 @@ +object Macros { + def foo1: Unit = macro Impls.fooNullary + def foo2(): Unit = macro Impls.fooEmpty + def bar1(x: Int): Unit = macro Impls.barNullary + def bar2(x: Int)(): Unit = macro Impls.barEmpty +} + +object Test extends dotty.runtime.LegacyApp { + Macros.foo1 + Macros.foo2 + Macros.foo2() + Macros.bar1(42) + Macros.bar2(42)() + println("kkthxbai") +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-overload.check b/tests/disabled/macro/run/macro-expand-overload.check new file mode 100644 index 000000000..a2b7b0e78 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-overload.check @@ -0,0 +1,6 @@ +(fooObjectString,Expr[Nothing](Macros),42) +(fooObjectInt,Expr[Nothing](Macros),42) +fooObjectBoolean +(fooClassString,Expr[Nothing](new Macros()),42) +(fooClassInt,Expr[Nothing](new Macros()),42) +fooClassBoolean diff --git a/tests/disabled/macro/run/macro-expand-overload.flags b/tests/disabled/macro/run/macro-expand-overload.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-overload.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-overload/Impls_1.scala b/tests/disabled/macro/run/macro-expand-overload/Impls_1.scala new file mode 100644 index 000000000..ef9d01d4e --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-overload/Impls_1.scala @@ -0,0 +1,15 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def impl(c: Context)(tag: String, x: c.Expr[_]) = { + import c.{prefix => prefix} + import c.universe._ + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(tag)), Literal(Constant(prefix.toString)), x.tree)) + c.Expr[Unit](body) + } + + def fooObjectString(c: Context)(x: c.Expr[_]) = impl(c)("fooObjectString", x) + def fooObjectInt(c: Context)(x: c.Expr[_]) = impl(c)("fooObjectInt", x) + def fooClassString(c: Context)(x: c.Expr[_]) = impl(c)("fooClassString", x) + def fooClassInt(c: Context)(x: c.Expr[_]) = impl(c)("fooClassInt", x) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-overload/Macros_Test_2.scala b/tests/disabled/macro/run/macro-expand-overload/Macros_Test_2.scala new file mode 100644 index 000000000..b367f35b7 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-overload/Macros_Test_2.scala @@ -0,0 +1,20 @@ +object Macros { + def foo(x: String): Unit = macro Impls.fooObjectString + def foo(x: Int): Unit = macro Impls.fooObjectInt + def foo(x: Boolean): Unit = println("fooObjectBoolean") +} + +class Macros { + def foo(x: String): Unit = macro Impls.fooClassString + def foo(x: Int): Unit = macro Impls.fooClassInt + def foo(x: Boolean): Unit = println("fooClassBoolean") +} + +object Test extends dotty.runtime.LegacyApp { + Macros.foo("42") + Macros.foo(42) + Macros.foo(true) + new Macros().foo("42") + new Macros().foo(42) + new Macros().foo(true) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-override.check b/tests/disabled/macro/run/macro-expand-override.check new file mode 100644 index 000000000..b41dc156c --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-override.check @@ -0,0 +1,15 @@ +(fooBString,Expr[Nothing](Test.this.dd),42) +(fooDInt,Expr[Nothing](Test.this.dd),42) +fooBBoolean +(fooBString,Expr[Nothing](Test.this.db),42) +(fooBInt,Expr[Nothing](Test.this.db),42) +fooBBoolean +(fooZString,Expr[Nothing](Test.this.zz),42) +(fooDInt,Expr[Nothing](Test.this.zz),42) +fooZBoolean +(fooBString,Expr[Nothing](Test.this.zd),42) +(fooDInt,Expr[Nothing](Test.this.zd),42) +fooZBoolean +(fooBString,Expr[Nothing](Test.this.zb),42) +(fooBInt,Expr[Nothing](Test.this.zb),42) +fooZBoolean diff --git a/tests/disabled/macro/run/macro-expand-override.flags b/tests/disabled/macro/run/macro-expand-override.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-override.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-override/Impls_1.scala b/tests/disabled/macro/run/macro-expand-override/Impls_1.scala new file mode 100644 index 000000000..e6ce18f17 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-override/Impls_1.scala @@ -0,0 +1,15 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def impl(c: Context)(tag: String, x: c.Expr[_]) = { + import c.{prefix => prefix} + import c.universe._ + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(tag)), Literal(Constant(prefix.toString)), x.tree)) + c.Expr[Unit](body) + } + + def fooBString(c: Context)(x: c.Expr[_]) = impl(c)("fooBString", x) + def fooBInt(c: Context)(x: c.Expr[_]) = impl(c)("fooBInt", x) + def fooDInt(c: Context)(x: c.Expr[_]) = impl(c)("fooDInt", x) + def fooZString(c: Context)(x: c.Expr[_]) = impl(c)("fooZString", x) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-override/Macros_Test_2.scala b/tests/disabled/macro/run/macro-expand-override/Macros_Test_2.scala new file mode 100644 index 000000000..46c1f49cc --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-override/Macros_Test_2.scala @@ -0,0 +1,43 @@ +class B { + def foo(x: String): Unit = macro Impls.fooBString + def foo(x: Int): Unit = macro Impls.fooBInt + def foo(x: Boolean): Unit = println("fooBBoolean") +} + +class D extends B { + //override def foo(x: String): Unit = println("fooDString") => method cannot override a macro + override def foo(x: Int): Unit = macro Impls.fooDInt +} + +class Z extends D { + override def foo(x: String): Unit = macro Impls.fooZString + override def foo(x: Boolean): Unit = println("fooZBoolean") +} + +object Test extends dotty.runtime.LegacyApp { + + val dd: D = new D() + dd.foo("42") + dd.foo(42) + dd.foo(true) + + val db: B = new D() + db.foo("42") + db.foo(42) + db.foo(true) + + val zz: Z = new Z() + zz.foo("42") + zz.foo(42) + zz.foo(true) + + val zd: D = new Z() + zd.foo("42") + zd.foo(42) + zd.foo(true) + + val zb: B = new Z() + zb.foo("42") + zb.foo(42) + zb.foo(true) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-recursive.check b/tests/disabled/macro/run/macro-expand-recursive.check new file mode 100644 index 000000000..7658ad2c2 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-recursive.check @@ -0,0 +1 @@ +it works diff --git a/tests/disabled/macro/run/macro-expand-recursive.flags b/tests/disabled/macro/run/macro-expand-recursive.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-recursive.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-recursive/Impls_1.scala b/tests/disabled/macro/run/macro-expand-recursive/Impls_1.scala new file mode 100644 index 000000000..3def2d2fb --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-recursive/Impls_1.scala @@ -0,0 +1,15 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context) = { + import c.universe._ + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works")))) + c.Expr[Unit](body) + } + + def fooFoo(c: Context) = { + import c.universe._ + val body = Select(Ident(TermName("Macros")), TermName("foo")) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-recursive/Macros_Test_2.scala b/tests/disabled/macro/run/macro-expand-recursive/Macros_Test_2.scala new file mode 100644 index 000000000..e8a88afc9 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-recursive/Macros_Test_2.scala @@ -0,0 +1,8 @@ +object Macros { + def foo: Unit = macro Impls.foo + def fooFoo: Unit = macro Impls.fooFoo +} + +object Test extends dotty.runtime.LegacyApp { + Macros.fooFoo +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-tparams-bounds.check b/tests/disabled/macro/run/macro-expand-tparams-bounds.check new file mode 100644 index 000000000..317e9677c --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-tparams-bounds.check @@ -0,0 +1,2 @@ +hello +hello diff --git a/tests/disabled/macro/run/macro-expand-tparams-bounds.flags b/tests/disabled/macro/run/macro-expand-tparams-bounds.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-tparams-bounds.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-tparams-bounds/Impls_1.scala b/tests/disabled/macro/run/macro-expand-tparams-bounds/Impls_1.scala new file mode 100644 index 000000000..95aaa1c3d --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-tparams-bounds/Impls_1.scala @@ -0,0 +1,12 @@ +import scala.reflect.macros.blackbox.Context + +object Impls1 { + def foo[U <: String](c: Context): c.Expr[Unit] = { import c.universe._; c.Expr[Unit](q"""println("hello")""") } +} + +class C +class D extends C + +object Impls2 { + def foo[U <: C](c: Context): c.Expr[Unit] = { import c.universe._; c.Expr[Unit](q"""println("hello")""") } +} diff --git a/tests/disabled/macro/run/macro-expand-tparams-bounds/Macros_Test_2.scala b/tests/disabled/macro/run/macro-expand-tparams-bounds/Macros_Test_2.scala new file mode 100644 index 000000000..f1cab82ec --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-tparams-bounds/Macros_Test_2.scala @@ -0,0 +1,12 @@ +object Macros1 { + def foo[U <: String]: Unit = macro Impls1.foo[U] +} + +object Macros2 { + def foo[T <: D]: Unit = macro Impls2.foo[T] +} + +object Test extends dotty.runtime.LegacyApp { + Macros1.foo[String] + Macros2.foo[D] +} diff --git a/tests/disabled/macro/run/macro-expand-tparams-explicit.check b/tests/disabled/macro/run/macro-expand-tparams-explicit.check new file mode 100644 index 000000000..b6b4f6fa3 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-tparams-explicit.check @@ -0,0 +1 @@ +WeakTypeTag[Int] diff --git a/tests/disabled/macro/run/macro-expand-tparams-explicit.flags b/tests/disabled/macro/run/macro-expand-tparams-explicit.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-tparams-explicit.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-tparams-explicit/Impls_1.scala b/tests/disabled/macro/run/macro-expand-tparams-explicit/Impls_1.scala new file mode 100644 index 000000000..c33ac6d1b --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-tparams-explicit/Impls_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo[U: c.WeakTypeTag](c: Context) = { + import c.universe._ + val U = implicitly[c.WeakTypeTag[U]] + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(U.toString)))) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-tparams-explicit/Macros_Test_2.scala b/tests/disabled/macro/run/macro-expand-tparams-explicit/Macros_Test_2.scala new file mode 100644 index 000000000..14154ee03 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-tparams-explicit/Macros_Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + def foo[U]: Unit = macro Impls.foo[U] + foo[Int] +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-tparams-implicit.check b/tests/disabled/macro/run/macro-expand-tparams-implicit.check new file mode 100644 index 000000000..a9bf55423 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-tparams-implicit.check @@ -0,0 +1,2 @@ +WeakTypeTag[Int] +WeakTypeTag[String] diff --git a/tests/disabled/macro/run/macro-expand-tparams-implicit.flags b/tests/disabled/macro/run/macro-expand-tparams-implicit.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-tparams-implicit.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-tparams-implicit/Impls_1.scala b/tests/disabled/macro/run/macro-expand-tparams-implicit/Impls_1.scala new file mode 100644 index 000000000..32cee0d5f --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-tparams-implicit/Impls_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo[U: c.WeakTypeTag](c: Context)(x: c.Expr[U]) = { + import c.universe._ + val U = implicitly[c.WeakTypeTag[U]] + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(U.toString)))) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-tparams-implicit/Macros_Test_2.scala b/tests/disabled/macro/run/macro-expand-tparams-implicit/Macros_Test_2.scala new file mode 100644 index 000000000..386817469 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-tparams-implicit/Macros_Test_2.scala @@ -0,0 +1,5 @@ +object Test extends dotty.runtime.LegacyApp { + def foo[U](x: U): Unit = macro Impls.foo[U] + foo(42) + foo("42") +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-tparams-prefix.check b/tests/disabled/macro/run/macro-expand-tparams-prefix.check new file mode 100644 index 000000000..739795806 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-tparams-prefix.check @@ -0,0 +1,20 @@ +===Macros1=== +WeakTypeTag[Int] +WeakTypeTag[Int] +WeakTypeTag[String] +WeakTypeTag[Boolean] +===Macros2=== +WeakTypeTag[Boolean] WeakTypeTag[Int] +WeakTypeTag[Boolean] WeakTypeTag[String] +===Macros3=== +WeakTypeTag[Int] +WeakTypeTag[String] +WeakTypeTag[Boolean] +===Macros4=== +WeakTypeTag[Int] +WeakTypeTag[String] +WeakTypeTag[Boolean] +===Macros5=== +WeakTypeTag[T] +WeakTypeTag[U] +WeakTypeTag[Boolean] diff --git a/tests/disabled/macro/run/macro-expand-tparams-prefix.flags b/tests/disabled/macro/run/macro-expand-tparams-prefix.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-tparams-prefix.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-tparams-prefix/Impls_1.scala b/tests/disabled/macro/run/macro-expand-tparams-prefix/Impls_1.scala new file mode 100644 index 000000000..289f07162 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-tparams-prefix/Impls_1.scala @@ -0,0 +1,39 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.macros.blackbox.Context + +object Impls1 { + def foo[U: c.WeakTypeTag](c: Context)(x: c.Expr[U]) = { + import c.universe._ + val U = implicitly[c.WeakTypeTag[U]] + c.Expr[Unit](q"println(${U.toString})") + } +} + +object Impls2 { + def foo[T: c.WeakTypeTag, U: c.WeakTypeTag](c: Context)(x: c.Expr[U]) = { + import c.universe._ + val T = implicitly[c.WeakTypeTag[T]] + val U = implicitly[c.WeakTypeTag[U]] + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(T.toString + " " + U.toString)))) + c.Expr[Unit](q"""println(${T.toString} + " " + ${U.toString})""") + } +} + +object Impls345 { + def foo[T, U: c.WeakTypeTag, V](c: Context)(implicit T: c.WeakTypeTag[T], V: c.WeakTypeTag[V]): c.Expr[Unit] = { + import c.universe._ + c.Expr(q""" + println(${T.toString}) + println(${implicitly[c.WeakTypeTag[U]].toString}) + println(${V.toString}) + """) + } +} + +object Macros4 { + class D[T] { + class C[U] { + def foo[V] = macro Impls345.foo[T, U, V] + } + } +} diff --git a/tests/disabled/macro/run/macro-expand-tparams-prefix/Macros_Test_2.scala b/tests/disabled/macro/run/macro-expand-tparams-prefix/Macros_Test_2.scala new file mode 100644 index 000000000..8916f03e4 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-tparams-prefix/Macros_Test_2.scala @@ -0,0 +1,57 @@ +object Macros1 { + class C[T] { + def foo[U](x: U): Unit = macro Impls1.foo[U] + } +} + +object Macros2 { + class C[T] { + def foo[U](x: U): Unit = macro Impls2.foo[T, U] + } +} + +object Macros3 { + class D[T] { + class C[U] { + def foo[V]: Unit = macro Impls345.foo[T, U, V] + } + } +} + +// object Macros4 is declared in Impls_1.scala + +object Macros5 { + class D[T] { + class C[U] { + def foo[V]: Unit = macro Impls345.foo[T, U, V] + foo[Boolean] + } + } +} + +object Test extends dotty.runtime.LegacyApp { + println("===Macros1===") + new Macros1.C[Int]().foo(42) + new Macros1.C[Boolean]().foo(42) + new Macros1.C[Int]().foo("42") + new Macros1.C[String]().foo(true) + + println("===Macros2===") + object D2 extends Macros2.C[Boolean] + D2.foo(42) + D2.foo("42") + + println("===Macros3===") + val outer31 = new Macros3.D[Int] + val outer32 = new outer31.C[String] + outer32.foo[Boolean] + + println("===Macros4===") + val outer41 = new Macros4.D[Int] + val outer42 = new outer41.C[String] + outer42.foo[Boolean] + + println("===Macros5===") + val outer1 = new Macros5.D[Int] + new outer1.C[String] +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-unapply-a.check b/tests/disabled/macro/run/macro-expand-unapply-a.check new file mode 100644 index 000000000..7c2976e51 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-unapply-a.check @@ -0,0 +1,2 @@ +(1,2) +(1,2,3) diff --git a/tests/disabled/macro/run/macro-expand-unapply-a.flags b/tests/disabled/macro/run/macro-expand-unapply-a.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-unapply-a.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-unapply-a/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-expand-unapply-a/Impls_Macros_1.scala new file mode 100644 index 000000000..64f16c6a8 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-unapply-a/Impls_Macros_1.scala @@ -0,0 +1,15 @@ +import scala.reflect.macros.whitebox.Context + +object Helper { + def unapplySeq[T](x: List[T]): Option[Seq[T]] = List.unapplySeq[T](x) +} + +object Macros { + def impl[T: c.WeakTypeTag](c: Context)(x: c.Expr[List[T]]) = { + c.universe.reify(Helper.unapplySeq(x.splice)) + } + + object UnapplyMacro { + def unapplySeq[T](x: List[T]): Option[Seq[T]] = macro impl[T] + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-unapply-a/Test_2.scala b/tests/disabled/macro/run/macro-expand-unapply-a/Test_2.scala new file mode 100644 index 000000000..ce52df802 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-unapply-a/Test_2.scala @@ -0,0 +1,6 @@ +import Macros._ + +object Test extends dotty.runtime.LegacyApp { + List(1, 2) match { case UnapplyMacro(x, y) => println((x, y)) } + List(1, 2, 3) match { case UnapplyMacro(x, y, z) => println((x, y, z)) } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-varargs-explicit-over-nonvarargs-bad.check b/tests/disabled/macro/run/macro-expand-varargs-explicit-over-nonvarargs-bad.check new file mode 100644 index 000000000..2709b5703 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-varargs-explicit-over-nonvarargs-bad.check @@ -0,0 +1,4 @@ +reflective compilation has failed: + +no `: _*' annotation allowed here +(such annotations are only allowed in arguments to *-parameters) diff --git a/tests/disabled/macro/run/macro-expand-varargs-explicit-over-nonvarargs-bad.flags b/tests/disabled/macro/run/macro-expand-varargs-explicit-over-nonvarargs-bad.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-varargs-explicit-over-nonvarargs-bad.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Impls_1.scala b/tests/disabled/macro/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Impls_1.scala new file mode 100644 index 000000000..18af84583 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Impls_1.scala @@ -0,0 +1,9 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context)(xs: c.Expr[Int]*) = { + import c.universe._ + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), xs.map(_.tree).toList) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Macros_Test_2.scala b/tests/disabled/macro/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Macros_Test_2.scala new file mode 100644 index 000000000..868fb8d91 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Macros_Test_2.scala @@ -0,0 +1,12 @@ +object Macros { + def foo(xs: Int*): Unit = macro Impls.foo +} + +object Test extends dotty.runtime.LegacyApp { + import scala.reflect.runtime.universe._ + import scala.reflect.runtime.{currentMirror => cm} + import scala.tools.reflect.ToolBox + val tree = Apply(Select(Ident(TermName("Macros")), TermName("foo")), List(Typed(Apply(Ident(definitions.ListModule), List(Literal(Constant(1)), Literal(Constant(2)))), Ident(typeNames.WILDCARD_STAR)))) + try cm.mkToolBox().eval(tree) + catch { case ex: Throwable => println(ex.getMessage) } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-varargs-explicit-over-nonvarargs-good.check b/tests/disabled/macro/run/macro-expand-varargs-explicit-over-nonvarargs-good.check new file mode 100644 index 000000000..fe90caed3 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-varargs-explicit-over-nonvarargs-good.check @@ -0,0 +1 @@ +List(1, 2, 3, 4, 5) diff --git a/tests/disabled/macro/run/macro-expand-varargs-explicit-over-nonvarargs-good.flags b/tests/disabled/macro/run/macro-expand-varargs-explicit-over-nonvarargs-good.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-varargs-explicit-over-nonvarargs-good.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-varargs-explicit-over-nonvarargs-good/Impls_1.scala b/tests/disabled/macro/run/macro-expand-varargs-explicit-over-nonvarargs-good/Impls_1.scala new file mode 100644 index 000000000..eb067c25a --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-varargs-explicit-over-nonvarargs-good/Impls_1.scala @@ -0,0 +1,13 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context)(xs: c.Expr[Int]*) = { + import c.universe._ + val stripped_xs = xs map (_.tree) toList match { + case List(Typed(stripped, Ident(wildstar))) if wildstar == typeNames.WILDCARD_STAR => List(stripped) + case _ => ??? + } + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), stripped_xs) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-varargs-explicit-over-nonvarargs-good/Macros_Test_2.scala b/tests/disabled/macro/run/macro-expand-varargs-explicit-over-nonvarargs-good/Macros_Test_2.scala new file mode 100644 index 000000000..7eba411cd --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-varargs-explicit-over-nonvarargs-good/Macros_Test_2.scala @@ -0,0 +1,8 @@ +object Macros { + def foo(xs: Int*): Unit = macro Impls.foo +} + +object Test extends dotty.runtime.LegacyApp { + val numbers = List(1, 2, 3, 4, 5) + Macros.foo(numbers: _*) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-varargs-explicit-over-varargs.check b/tests/disabled/macro/run/macro-expand-varargs-explicit-over-varargs.check new file mode 100644 index 000000000..fe90caed3 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-varargs-explicit-over-varargs.check @@ -0,0 +1 @@ +List(1, 2, 3, 4, 5) diff --git a/tests/disabled/macro/run/macro-expand-varargs-explicit-over-varargs.flags b/tests/disabled/macro/run/macro-expand-varargs-explicit-over-varargs.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-varargs-explicit-over-varargs.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-varargs-explicit-over-varargs/Impls_1.scala b/tests/disabled/macro/run/macro-expand-varargs-explicit-over-varargs/Impls_1.scala new file mode 100644 index 000000000..64ab7de02 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-varargs-explicit-over-varargs/Impls_1.scala @@ -0,0 +1,13 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def myprintln(xs: Int*) = { + println(xs) + } + + def foo(c: Context)(xs: c.Expr[Int]*) = { + import c.universe._ + val body = Apply(Select(Ident(TermName("Impls")), TermName("myprintln")), xs.map(_.tree).toList) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-varargs-explicit-over-varargs/Macros_Test_2.scala b/tests/disabled/macro/run/macro-expand-varargs-explicit-over-varargs/Macros_Test_2.scala new file mode 100644 index 000000000..7eba411cd --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-varargs-explicit-over-varargs/Macros_Test_2.scala @@ -0,0 +1,8 @@ +object Macros { + def foo(xs: Int*): Unit = macro Impls.foo +} + +object Test extends dotty.runtime.LegacyApp { + val numbers = List(1, 2, 3, 4, 5) + Macros.foo(numbers: _*) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-varargs-implicit-over-nonvarargs.check b/tests/disabled/macro/run/macro-expand-varargs-implicit-over-nonvarargs.check new file mode 100644 index 000000000..bcfab1984 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-varargs-implicit-over-nonvarargs.check @@ -0,0 +1 @@ +(1,2,3,4,5) diff --git a/tests/disabled/macro/run/macro-expand-varargs-implicit-over-nonvarargs.flags b/tests/disabled/macro/run/macro-expand-varargs-implicit-over-nonvarargs.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-varargs-implicit-over-nonvarargs.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-varargs-implicit-over-nonvarargs/Impls_1.scala b/tests/disabled/macro/run/macro-expand-varargs-implicit-over-nonvarargs/Impls_1.scala new file mode 100644 index 000000000..18af84583 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-varargs-implicit-over-nonvarargs/Impls_1.scala @@ -0,0 +1,9 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context)(xs: c.Expr[Int]*) = { + import c.universe._ + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), xs.map(_.tree).toList) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-varargs-implicit-over-nonvarargs/Macros_Test_2.scala b/tests/disabled/macro/run/macro-expand-varargs-implicit-over-nonvarargs/Macros_Test_2.scala new file mode 100644 index 000000000..f50a5d742 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-varargs-implicit-over-nonvarargs/Macros_Test_2.scala @@ -0,0 +1,7 @@ +object Macros { + def foo(xs: Int*): Unit = macro Impls.foo +} + +object Test extends dotty.runtime.LegacyApp { + Macros.foo(1, 2, 3, 4, 5) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-varargs-implicit-over-varargs.check b/tests/disabled/macro/run/macro-expand-varargs-implicit-over-varargs.check new file mode 100644 index 000000000..2c174a8a9 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-varargs-implicit-over-varargs.check @@ -0,0 +1 @@ +WrappedArray(1, 2, 3, 4, 5) diff --git a/tests/disabled/macro/run/macro-expand-varargs-implicit-over-varargs.flags b/tests/disabled/macro/run/macro-expand-varargs-implicit-over-varargs.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-varargs-implicit-over-varargs.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-varargs-implicit-over-varargs/Impls_1.scala b/tests/disabled/macro/run/macro-expand-varargs-implicit-over-varargs/Impls_1.scala new file mode 100644 index 000000000..64ab7de02 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-varargs-implicit-over-varargs/Impls_1.scala @@ -0,0 +1,13 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def myprintln(xs: Int*) = { + println(xs) + } + + def foo(c: Context)(xs: c.Expr[Int]*) = { + import c.universe._ + val body = Apply(Select(Ident(TermName("Impls")), TermName("myprintln")), xs.map(_.tree).toList) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-expand-varargs-implicit-over-varargs/Macros_Test_2.scala b/tests/disabled/macro/run/macro-expand-varargs-implicit-over-varargs/Macros_Test_2.scala new file mode 100644 index 000000000..f50a5d742 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-varargs-implicit-over-varargs/Macros_Test_2.scala @@ -0,0 +1,7 @@ +object Macros { + def foo(xs: Int*): Unit = macro Impls.foo +} + +object Test extends dotty.runtime.LegacyApp { + Macros.foo(1, 2, 3, 4, 5) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-impl-default-params.check b/tests/disabled/macro/run/macro-impl-default-params.check new file mode 100644 index 000000000..b32e34570 --- /dev/null +++ b/tests/disabled/macro/run/macro-impl-default-params.check @@ -0,0 +1,5 @@ +foo_targs: +invoking foo_targs... +type of prefix is: Nothing +type of prefix tree is: Macros[Int] +U is: String diff --git a/tests/disabled/macro/run/macro-impl-default-params.flags b/tests/disabled/macro/run/macro-impl-default-params.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-impl-default-params.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-impl-default-params/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-impl-default-params/Impls_Macros_1.scala new file mode 100644 index 000000000..9b1d0eed3 --- /dev/null +++ b/tests/disabled/macro/run/macro-impl-default-params/Impls_Macros_1.scala @@ -0,0 +1,20 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo_targs[T, U: c.WeakTypeTag](c: Context = null)(x: c.Expr[Int] = null) = { + import c.{prefix => prefix} + import c.universe._ + val U = implicitly[c.WeakTypeTag[U]] + c.Expr[Unit](q""" + println("invoking foo_targs...") + println("type of prefix is: " + ${prefix.staticType.toString}) + println("type of prefix tree is: " + ${prefix.tree.tpe.toString}) + println("U is: " + ${U.tpe.toString}) + """) + } +} + +class Macros[T] { + def foo_targs[U](x: Int) = macro Impls.foo_targs[T, U] +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-impl-default-params/Test_2.scala b/tests/disabled/macro/run/macro-impl-default-params/Test_2.scala new file mode 100644 index 000000000..476c881f8 --- /dev/null +++ b/tests/disabled/macro/run/macro-impl-default-params/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + println("foo_targs:") + new Macros[Int]().foo_targs[String](42) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-impl-relaxed.check b/tests/disabled/macro/run/macro-impl-relaxed.check new file mode 100644 index 000000000..487b11653 --- /dev/null +++ b/tests/disabled/macro/run/macro-impl-relaxed.check @@ -0,0 +1,4 @@ +2 +2 +2 +2 diff --git a/tests/disabled/macro/run/macro-impl-relaxed/Macros_1.scala b/tests/disabled/macro/run/macro-impl-relaxed/Macros_1.scala new file mode 100644 index 000000000..420eb2a39 --- /dev/null +++ b/tests/disabled/macro/run/macro-impl-relaxed/Macros_1.scala @@ -0,0 +1,14 @@ +import language.experimental.macros +import scala.reflect.macros.blackbox.Context + +object Macros { + def implUU(c: Context)(x: c.Tree): c.Tree = x + def implTU(c: Context)(x: c.Expr[Int]): c.Tree = x.tree + def implUT(c: Context)(x: c.Tree): c.Expr[Int] = c.Expr[Int](x) + def implTT(c: Context)(x: c.Expr[Int]): c.Expr[Int] = x + + def fooUU(x: Int): Int = macro implUU + def fooTU(x: Int): Int = macro implTU + def fooUT(x: Int): Int = macro implUT + def fooTT(x: Int): Int = macro implTT +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-impl-relaxed/Test_2.scala b/tests/disabled/macro/run/macro-impl-relaxed/Test_2.scala new file mode 100644 index 000000000..460626272 --- /dev/null +++ b/tests/disabled/macro/run/macro-impl-relaxed/Test_2.scala @@ -0,0 +1,6 @@ +object Test extends dotty.runtime.LegacyApp { + println(Macros.fooUU(2)) + println(Macros.fooTU(2)) + println(Macros.fooUT(2)) + println(Macros.fooTT(2)) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-impl-rename-context.check b/tests/disabled/macro/run/macro-impl-rename-context.check new file mode 100644 index 000000000..6a34e5fd8 --- /dev/null +++ b/tests/disabled/macro/run/macro-impl-rename-context.check @@ -0,0 +1,2 @@ +foo +invoking foo... diff --git a/tests/disabled/macro/run/macro-impl-rename-context.flags b/tests/disabled/macro/run/macro-impl-rename-context.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-impl-rename-context.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-impl-rename-context/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-impl-rename-context/Impls_Macros_1.scala new file mode 100644 index 000000000..acc47fcde --- /dev/null +++ b/tests/disabled/macro/run/macro-impl-rename-context/Impls_Macros_1.scala @@ -0,0 +1,12 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(unconventionalName: Context)(x: unconventionalName.Expr[Int]) = { + import unconventionalName.universe._ + unconventionalName.Expr[Unit](q"""println("invoking foo...")""") + } +} + +object Macros { + def foo(x: Int) = macro Impls.foo +} diff --git a/tests/disabled/macro/run/macro-impl-rename-context/Test_2.scala b/tests/disabled/macro/run/macro-impl-rename-context/Test_2.scala new file mode 100644 index 000000000..6b1cdecd0 --- /dev/null +++ b/tests/disabled/macro/run/macro-impl-rename-context/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + println("foo") + Macros.foo(42) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-impl-tparam-only-in-impl.check b/tests/disabled/macro/run/macro-impl-tparam-only-in-impl.check new file mode 100644 index 000000000..3b18e512d --- /dev/null +++ b/tests/disabled/macro/run/macro-impl-tparam-only-in-impl.check @@ -0,0 +1 @@ +hello world diff --git a/tests/disabled/macro/run/macro-impl-tparam-only-in-impl.flags b/tests/disabled/macro/run/macro-impl-tparam-only-in-impl.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-impl-tparam-only-in-impl.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-impl-tparam-only-in-impl/Impls_1.scala b/tests/disabled/macro/run/macro-impl-tparam-only-in-impl/Impls_1.scala new file mode 100644 index 000000000..705defb18 --- /dev/null +++ b/tests/disabled/macro/run/macro-impl-tparam-only-in-impl/Impls_1.scala @@ -0,0 +1,5 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo[U <: String](c: Context): c.Expr[Unit] = { import c.universe._; c.Expr[Unit](q"""println("hello world")""") } +} diff --git a/tests/disabled/macro/run/macro-impl-tparam-only-in-impl/Macros_Test_2.scala b/tests/disabled/macro/run/macro-impl-tparam-only-in-impl/Macros_Test_2.scala new file mode 100644 index 000000000..b626ce35e --- /dev/null +++ b/tests/disabled/macro/run/macro-impl-tparam-only-in-impl/Macros_Test_2.scala @@ -0,0 +1,8 @@ +object Macros { + def foo: Unit = macro Impls.foo[String] +} + +object Test extends dotty.runtime.LegacyApp { + import Macros._ + foo +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-impl-tparam-typetag-is-optional.check b/tests/disabled/macro/run/macro-impl-tparam-typetag-is-optional.check new file mode 100644 index 000000000..b4a0f394c --- /dev/null +++ b/tests/disabled/macro/run/macro-impl-tparam-typetag-is-optional.check @@ -0,0 +1 @@ +don't know U diff --git a/tests/disabled/macro/run/macro-impl-tparam-typetag-is-optional.flags b/tests/disabled/macro/run/macro-impl-tparam-typetag-is-optional.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-impl-tparam-typetag-is-optional.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-impl-tparam-typetag-is-optional/Impls_1.scala b/tests/disabled/macro/run/macro-impl-tparam-typetag-is-optional/Impls_1.scala new file mode 100644 index 000000000..fc72e7a97 --- /dev/null +++ b/tests/disabled/macro/run/macro-impl-tparam-typetag-is-optional/Impls_1.scala @@ -0,0 +1,9 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo[U](c: Context) = { + import c.universe._ + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("don't know U")))) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-impl-tparam-typetag-is-optional/Macros_Test_2.scala b/tests/disabled/macro/run/macro-impl-tparam-typetag-is-optional/Macros_Test_2.scala new file mode 100644 index 000000000..14154ee03 --- /dev/null +++ b/tests/disabled/macro/run/macro-impl-tparam-typetag-is-optional/Macros_Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + def foo[U]: Unit = macro Impls.foo[U] + foo[Int] +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-invalidret-doesnt-conform-to-def-rettype.check b/tests/disabled/macro/run/macro-invalidret-doesnt-conform-to-def-rettype.check new file mode 100644 index 000000000..1d531f6d8 --- /dev/null +++ b/tests/disabled/macro/run/macro-invalidret-doesnt-conform-to-def-rettype.check @@ -0,0 +1,5 @@ +reflective compilation has failed: + +type mismatch; + found : String("42") + required: Int diff --git a/tests/disabled/macro/run/macro-invalidret-doesnt-conform-to-def-rettype.flags b/tests/disabled/macro/run/macro-invalidret-doesnt-conform-to-def-rettype.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-invalidret-doesnt-conform-to-def-rettype.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-invalidret-doesnt-conform-to-def-rettype/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-invalidret-doesnt-conform-to-def-rettype/Impls_Macros_1.scala new file mode 100644 index 000000000..603500b59 --- /dev/null +++ b/tests/disabled/macro/run/macro-invalidret-doesnt-conform-to-def-rettype/Impls_Macros_1.scala @@ -0,0 +1,12 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context): c.Expr[Int] = { + import c.universe._ + c.Expr(Literal(Constant("42"))) + } +} + +object Macros { + def foo: Int = macro Impls.foo +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-invalidret-doesnt-conform-to-def-rettype/Test_2.scala b/tests/disabled/macro/run/macro-invalidret-doesnt-conform-to-def-rettype/Test_2.scala new file mode 100644 index 000000000..dea6e6d62 --- /dev/null +++ b/tests/disabled/macro/run/macro-invalidret-doesnt-conform-to-def-rettype/Test_2.scala @@ -0,0 +1,8 @@ +object Test extends dotty.runtime.LegacyApp { + import scala.reflect.runtime.universe._ + import scala.reflect.runtime.{currentMirror => cm} + import scala.tools.reflect.ToolBox + val tree = Select(Ident(TermName("Macros")), TermName("foo")) + try cm.mkToolBox().eval(tree) + catch { case ex: Throwable => println(ex.getMessage) } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-invalidret-nontypeable.check b/tests/disabled/macro/run/macro-invalidret-nontypeable.check new file mode 100644 index 000000000..25cef2c78 --- /dev/null +++ b/tests/disabled/macro/run/macro-invalidret-nontypeable.check @@ -0,0 +1,3 @@ +reflective compilation has failed: + +not found: value IDoNotExist diff --git a/tests/disabled/macro/run/macro-invalidret-nontypeable.flags b/tests/disabled/macro/run/macro-invalidret-nontypeable.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-invalidret-nontypeable.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-invalidret-nontypeable/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-invalidret-nontypeable/Impls_Macros_1.scala new file mode 100644 index 000000000..b6b961174 --- /dev/null +++ b/tests/disabled/macro/run/macro-invalidret-nontypeable/Impls_Macros_1.scala @@ -0,0 +1,13 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context) = { + import c.universe._ + val body = Ident(TermName("IDoNotExist")) + c.Expr[Int](body) + } +} + +object Macros { + def foo = macro Impls.foo +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-invalidret-nontypeable/Test_2.scala b/tests/disabled/macro/run/macro-invalidret-nontypeable/Test_2.scala new file mode 100644 index 000000000..26de1d9de --- /dev/null +++ b/tests/disabled/macro/run/macro-invalidret-nontypeable/Test_2.scala @@ -0,0 +1,8 @@ + object Test extends dotty.runtime.LegacyApp { + import scala.reflect.runtime.universe._ + import scala.reflect.runtime.{currentMirror => cm} + import scala.tools.reflect.ToolBox + val tree = Select(Ident(TermName("Macros")), TermName("foo")) + try cm.mkToolBox().eval(tree) + catch { case ex: Throwable => println(ex.getMessage) } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-invalidusage-badret.check b/tests/disabled/macro/run/macro-invalidusage-badret.check new file mode 100644 index 000000000..e79550043 --- /dev/null +++ b/tests/disabled/macro/run/macro-invalidusage-badret.check @@ -0,0 +1,5 @@ +reflective compilation has failed: + +type mismatch; + found : Int + required: String diff --git a/tests/disabled/macro/run/macro-invalidusage-badret.flags b/tests/disabled/macro/run/macro-invalidusage-badret.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-invalidusage-badret.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-invalidusage-badret/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-invalidusage-badret/Impls_Macros_1.scala new file mode 100644 index 000000000..0d4c5755f --- /dev/null +++ b/tests/disabled/macro/run/macro-invalidusage-badret/Impls_Macros_1.scala @@ -0,0 +1,9 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context)(x: c.Expr[Int]) = x +} + +object Macros { + def foo(x: Int) = macro Impls.foo +} diff --git a/tests/disabled/macro/run/macro-invalidusage-badret/Test_2.scala b/tests/disabled/macro/run/macro-invalidusage-badret/Test_2.scala new file mode 100644 index 000000000..1d208aeb1 --- /dev/null +++ b/tests/disabled/macro/run/macro-invalidusage-badret/Test_2.scala @@ -0,0 +1,8 @@ +object Test extends dotty.runtime.LegacyApp { + import scala.reflect.runtime.universe._ + import scala.reflect.runtime.{currentMirror => cm} + import scala.tools.reflect.ToolBox + val tree = Typed(Apply(Select(Ident(TermName("Macros")), TermName("foo")), List(Literal(Constant(42)))), Ident(TypeName("String"))) + try cm.mkToolBox().eval(tree) + catch { case ex: Throwable => println(ex.getMessage) } +} diff --git a/tests/disabled/macro/run/macro-invalidusage-partialapplication-with-tparams.check b/tests/disabled/macro/run/macro-invalidusage-partialapplication-with-tparams.check new file mode 100644 index 000000000..6cbcb9e5a --- /dev/null +++ b/tests/disabled/macro/run/macro-invalidusage-partialapplication-with-tparams.check @@ -0,0 +1,3 @@ +reflective compilation has failed: + +too few argument lists for macro invocation diff --git a/tests/disabled/macro/run/macro-invalidusage-partialapplication-with-tparams.flags b/tests/disabled/macro/run/macro-invalidusage-partialapplication-with-tparams.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-invalidusage-partialapplication-with-tparams.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-invalidusage-partialapplication-with-tparams/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-invalidusage-partialapplication-with-tparams/Impls_Macros_1.scala new file mode 100644 index 000000000..8b5c59bde --- /dev/null +++ b/tests/disabled/macro/run/macro-invalidusage-partialapplication-with-tparams/Impls_Macros_1.scala @@ -0,0 +1,13 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo[T: c.WeakTypeTag](c: Context)(x: c.Expr[T]) = { + import c.universe._ + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(x.tree.toString)))) + c.Expr[Unit](body) + } +} + +object Macros { + def foo[T](x: T) = macro Impls.foo[T] +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-invalidusage-partialapplication-with-tparams/Test_2.scala b/tests/disabled/macro/run/macro-invalidusage-partialapplication-with-tparams/Test_2.scala new file mode 100644 index 000000000..ba763eda5 --- /dev/null +++ b/tests/disabled/macro/run/macro-invalidusage-partialapplication-with-tparams/Test_2.scala @@ -0,0 +1,8 @@ +object Test extends dotty.runtime.LegacyApp { + import scala.reflect.runtime.universe._ + import scala.reflect.runtime.{currentMirror => cm} + import scala.tools.reflect.ToolBox + val tree = Select(Ident(TermName("Macros")), TermName("foo")) + try cm.mkToolBox().eval(tree) + catch { case ex: Throwable => println(ex.getMessage) } +} diff --git a/tests/disabled/macro/run/macro-invalidusage-partialapplication.check b/tests/disabled/macro/run/macro-invalidusage-partialapplication.check new file mode 100644 index 000000000..6cbcb9e5a --- /dev/null +++ b/tests/disabled/macro/run/macro-invalidusage-partialapplication.check @@ -0,0 +1,3 @@ +reflective compilation has failed: + +too few argument lists for macro invocation diff --git a/tests/disabled/macro/run/macro-invalidusage-partialapplication.flags b/tests/disabled/macro/run/macro-invalidusage-partialapplication.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-invalidusage-partialapplication.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-invalidusage-partialapplication/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-invalidusage-partialapplication/Impls_Macros_1.scala new file mode 100644 index 000000000..6970b4dd7 --- /dev/null +++ b/tests/disabled/macro/run/macro-invalidusage-partialapplication/Impls_Macros_1.scala @@ -0,0 +1,14 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context)(x: c.Expr[Int])(y: c.Expr[Int]) = { + import c.universe._ + val sum = Apply(Select(x.tree, TermName("$plus")), List(y.tree)) + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(sum)) + c.Expr[Unit](body) + } +} + +object Macros { + def foo(x: Int)(y: Int) = macro Impls.foo +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-invalidusage-partialapplication/Test_2.scala b/tests/disabled/macro/run/macro-invalidusage-partialapplication/Test_2.scala new file mode 100644 index 000000000..a0b90ee6b --- /dev/null +++ b/tests/disabled/macro/run/macro-invalidusage-partialapplication/Test_2.scala @@ -0,0 +1,8 @@ +object Test extends dotty.runtime.LegacyApp { + import scala.reflect.runtime.universe._ + import scala.reflect.runtime.{currentMirror => cm} + import scala.tools.reflect.ToolBox + val tree = Apply(Select(Ident(TermName("Macros")), TermName("foo")), List(Literal(Constant(40)))) + try cm.mkToolBox().eval(tree) + catch { case ex: Throwable => println(ex.getMessage) } +} diff --git a/tests/disabled/macro/run/macro-openmacros.check b/tests/disabled/macro/run/macro-openmacros.check new file mode 100644 index 000000000..ba0ae3ff4 --- /dev/null +++ b/tests/disabled/macro/run/macro-openmacros.check @@ -0,0 +1,3 @@ +List(MacroContext(foo@source-Test_2.scala,line-2,offset=35 +0)) +List(MacroContext(foo@source-Test_2.scala,line-2,offset=35 +1), MacroContext(foo@source-Test_2.scala,line-2,offset=35 +0)) +List(MacroContext(foo@source-Test_2.scala,line-2,offset=35 +2), MacroContext(foo@source-Test_2.scala,line-2,offset=35 +1), MacroContext(foo@source-Test_2.scala,line-2,offset=35 +0)) diff --git a/tests/disabled/macro/run/macro-openmacros.flags b/tests/disabled/macro/run/macro-openmacros.flags new file mode 100644 index 000000000..2433c055a --- /dev/null +++ b/tests/disabled/macro/run/macro-openmacros.flags @@ -0,0 +1,2 @@ +-Yrangepos:false +-language:experimental.macros diff --git a/tests/disabled/macro/run/macro-openmacros/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-openmacros/Impls_Macros_1.scala new file mode 100644 index 000000000..b60ca90d9 --- /dev/null +++ b/tests/disabled/macro/run/macro-openmacros/Impls_Macros_1.scala @@ -0,0 +1,25 @@ +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl(c: Context): c.Expr[Unit] = { + // we're macros, so we can reflect against our source path + // so we don't need any partests to clean up after us! + val dir = c.enclosingUnit.source.file.file.getCanonicalFile.getParentFile + def normalizePaths(s: String) = { + val base = (dir.getCanonicalPath + java.io.File.separator).replace('\\', '/') + var regex = """\Q%s\E""" format base + val isWin = System.getProperty("os.name", "") startsWith "Windows" + if (isWin) regex = "(?i)" + regex + s.replace('\\', '/').replaceAll(regex, "") + } + + import c.universe._ + val next = if (c.enclosingMacros.length < 3) c.Expr[Unit](Select(Ident(c.mirror.staticModule("Macros")), TermName("foo"))) else c.Expr[Unit](Literal(Constant(()))) + c.universe.reify { + println(c.Expr[String](Literal(Constant(normalizePaths(c.enclosingMacros.toString)))).splice) + next.splice + } + } + + def foo = macro impl +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-openmacros/Test_2.scala b/tests/disabled/macro/run/macro-openmacros/Test_2.scala new file mode 100644 index 000000000..d75fbd0db --- /dev/null +++ b/tests/disabled/macro/run/macro-openmacros/Test_2.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + Macros.foo +} diff --git a/tests/disabled/macro/run/macro-parse-position-malformed.check b/tests/disabled/macro/run/macro-parse-position-malformed.check new file mode 100644 index 000000000..00f0bc5b6 --- /dev/null +++ b/tests/disabled/macro/run/macro-parse-position-malformed.check @@ -0,0 +1 @@ +failed with 'source-,line-1,offset=7' position and '')' expected but eof found.' message diff --git a/tests/disabled/macro/run/macro-parse-position-malformed/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-parse-position-malformed/Impls_Macros_1.scala new file mode 100644 index 000000000..b623d8820 --- /dev/null +++ b/tests/disabled/macro/run/macro-parse-position-malformed/Impls_Macros_1.scala @@ -0,0 +1,18 @@ +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.Context +import scala.reflect.macros.ParseException + +object Macros { + def impl(c: Context)() = { + import c.universe._ + val out = try { + c.parse("foo(bar") + "didn't fail" + } catch { + case e: ParseException => + s"failed with '${e.pos}' position and '${e.msg}' message" + } + c.Expr[String](Literal(Constant(out))) + } + def foo(): String = macro impl +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-parse-position-malformed/Test_2.scala b/tests/disabled/macro/run/macro-parse-position-malformed/Test_2.scala new file mode 100644 index 000000000..1b04d2af2 --- /dev/null +++ b/tests/disabled/macro/run/macro-parse-position-malformed/Test_2.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + println(Macros.foo) +} diff --git a/tests/disabled/macro/run/macro-parse-position.check b/tests/disabled/macro/run/macro-parse-position.check new file mode 100644 index 000000000..3da032069 --- /dev/null +++ b/tests/disabled/macro/run/macro-parse-position.check @@ -0,0 +1,5 @@ +false +source-,line-1,offset=4 +8 +foo bar + diff --git a/tests/disabled/macro/run/macro-parse-position.flags b/tests/disabled/macro/run/macro-parse-position.flags new file mode 100644 index 000000000..ea7fc37e1 --- /dev/null +++ b/tests/disabled/macro/run/macro-parse-position.flags @@ -0,0 +1 @@ +-Yrangepos:false diff --git a/tests/disabled/macro/run/macro-parse-position/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-parse-position/Impls_Macros_1.scala new file mode 100644 index 000000000..dd20fd291 --- /dev/null +++ b/tests/disabled/macro/run/macro-parse-position/Impls_Macros_1.scala @@ -0,0 +1,12 @@ +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl(c: Context)() = { + import c.universe._ + val t = c.parse("foo bar") + val out = s"${t.pos == NoPosition}\n${t.pos}\n${t.pos.source.content.length}\n${new String(t.pos.source.content)}" + c.Expr[String](Literal(Constant(out))) + } + def foo(): String = macro impl +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-parse-position/Test_2.scala b/tests/disabled/macro/run/macro-parse-position/Test_2.scala new file mode 100644 index 000000000..1b04d2af2 --- /dev/null +++ b/tests/disabled/macro/run/macro-parse-position/Test_2.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + println(Macros.foo) +} diff --git a/tests/disabled/macro/run/macro-quasiinvalidbody-c.check b/tests/disabled/macro/run/macro-quasiinvalidbody-c.check new file mode 100644 index 000000000..f70d7bba4 --- /dev/null +++ b/tests/disabled/macro/run/macro-quasiinvalidbody-c.check @@ -0,0 +1 @@ +42 \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-quasiinvalidbody-c.flags b/tests/disabled/macro/run/macro-quasiinvalidbody-c.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-quasiinvalidbody-c.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-quasiinvalidbody-c/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-quasiinvalidbody-c/Impls_Macros_1.scala new file mode 100644 index 000000000..df189b70d --- /dev/null +++ b/tests/disabled/macro/run/macro-quasiinvalidbody-c/Impls_Macros_1.scala @@ -0,0 +1,9 @@ +import scala.reflect.macros.blackbox.Context + +object Macros { + object Impls { + def foo(c: Context)(x: c.Expr[Any]) = x + } + + def foo(x: Any) = macro Impls.foo +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-quasiinvalidbody-c/Test_2.scala b/tests/disabled/macro/run/macro-quasiinvalidbody-c/Test_2.scala new file mode 100644 index 000000000..91053843d --- /dev/null +++ b/tests/disabled/macro/run/macro-quasiinvalidbody-c/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + import Macros._ + println(foo(42)) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-quasiquotes.check b/tests/disabled/macro/run/macro-quasiquotes.check new file mode 100644 index 000000000..94ebaf900 --- /dev/null +++ b/tests/disabled/macro/run/macro-quasiquotes.check @@ -0,0 +1,4 @@ +1 +2 +3 +4 diff --git a/tests/disabled/macro/run/macro-quasiquotes/Macros_1.scala b/tests/disabled/macro/run/macro-quasiquotes/Macros_1.scala new file mode 100644 index 000000000..764542a87 --- /dev/null +++ b/tests/disabled/macro/run/macro-quasiquotes/Macros_1.scala @@ -0,0 +1,15 @@ +import language.experimental.macros +import scala.reflect.macros.blackbox.Context + +class Impls(val c: Context) { + import c.universe._ + def impl1 = q"println(1)" + def impl2 = q"{ println(2); println(3) }" + def impl3 = q"4" +} + +object Macros { + def m1: Unit = macro Impls.impl1 + def m2: Unit = macro Impls.impl2 + def m3: Int = macro Impls.impl3 +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-quasiquotes/Test_2.scala b/tests/disabled/macro/run/macro-quasiquotes/Test_2.scala new file mode 100644 index 000000000..b7d203197 --- /dev/null +++ b/tests/disabled/macro/run/macro-quasiquotes/Test_2.scala @@ -0,0 +1,5 @@ +object Test extends dotty.runtime.LegacyApp { + Macros.m1 + Macros.m2 + println(Macros.m3) +} diff --git a/tests/disabled/macro/run/macro-range.check b/tests/disabled/macro/run/macro-range.check new file mode 100644 index 000000000..071939893 --- /dev/null +++ b/tests/disabled/macro/run/macro-range.check @@ -0,0 +1,9 @@ +1 +2 +3 +4 +5 +6 +7 +8 +9 diff --git a/tests/disabled/macro/run/macro-range.flags b/tests/disabled/macro/run/macro-range.flags new file mode 100644 index 000000000..5e5dd6ce7 --- /dev/null +++ b/tests/disabled/macro/run/macro-range.flags @@ -0,0 +1 @@ +-language:experimental.macros diff --git a/tests/disabled/macro/run/macro-range/Common_1.scala b/tests/disabled/macro/run/macro-range/Common_1.scala new file mode 100644 index 000000000..35d2efd76 --- /dev/null +++ b/tests/disabled/macro/run/macro-range/Common_1.scala @@ -0,0 +1,48 @@ +import scala.reflect.macros.blackbox.Context + +abstract class RangeDefault { + val from, to: Int + def foreach(f: Int => Unit) = { + var i = from + while (i < to) { f(i); i += 1 } + } +} + +/** This class should go into reflect.macro once it is a bit more stable. */ +abstract class Utils { + val context: Context + import context.universe._ + import internal._ + + class TreeSubstituter(from: List[Symbol], to: List[Tree]) extends Transformer { + override def transform(tree: Tree): Tree = tree match { + case Ident(_) => + def subst(from: List[Symbol], to: List[Tree]): Tree = + if (from.isEmpty) tree + else if (tree.symbol == from.head) to.head.duplicate // TODO: does it ever make sense *not* to perform a shallowDuplicate on `to.head`? + else subst(from.tail, to.tail); + subst(from, to) + case _ => + val tree1 = super.transform(tree) + if (tree1 ne tree) setType(tree1, null) + tree1 + } + } + def makeApply(fn: Tree, args: List[Tree]): Tree = fn match { + case Function(vparams, body) => + new TreeSubstituter(vparams map (_.symbol), args) transform body + case Block(stats, expr) => + Block(stats, makeApply(expr, args)) + case _ => + // todo. read the compiler config and print if -Ydebug is set + //println("no beta on "+fn+" "+fn.getClass) + Apply(fn, args) + } + def makeWhile(lname: TermName, cond: Tree, body: Tree): Tree = { + val continu = Apply(Ident(lname), Nil) + val rhs = If(cond, Block(List(body), continu), Literal(Constant())) + LabelDef(lname, Nil, rhs) + } + def makeBinop(left: Tree, op: String, right: Tree): Tree = + Apply(Select(left, TermName(op)), List(right)) +} diff --git a/tests/disabled/macro/run/macro-range/Expansion_Impossible_2.scala b/tests/disabled/macro/run/macro-range/Expansion_Impossible_2.scala new file mode 100644 index 000000000..b3c2fa348 --- /dev/null +++ b/tests/disabled/macro/run/macro-range/Expansion_Impossible_2.scala @@ -0,0 +1,53 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foreach(c: Context)(f: c.Expr[Int => Unit]): c.Expr[Unit] = { + // todo. read the compiler config and print if -Ydebug is set + //println("macro-expand, _this = "+ _this) + object utils extends Utils { val context: c.type = c } + import utils._ + import c.universe._ + import Flag._ + + val initName = termNames.CONSTRUCTOR + // Either: + // scala"{ var i = $low; val h = $hi; while (i < h) { $f(i); i = i + 1 } } + // or: + // scala"($_this: RangeDefault).foreach($f)" + c.Expr(c.prefix.tree match { + case Apply(Select(New(tpt), initName), List(lo, hi)) if tpt.symbol.fullName == "Range" => + val iname = TermName("$i") + val hname = TermName("$h") + def iref = Ident(iname) + def href = Ident(hname) + val labelname = TermName("$while") + val cond = makeBinop(iref, "$less", href) + val body = Block( + List(makeApply(f.tree, List(iref))), + Assign(iref, makeBinop(iref, "$plus", Literal(Constant(1))))) + val generated = + Block( + List( + 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 + //tools.nsc.util.trace("generated: ")(generated) + generated + case _ => + Apply( + Select( + Typed(c.prefix.tree, Ident(TypeName("RangeDefault"))), + TermName("foreach")), + List(f.tree)) + }) + } +} + +class Range(val from: Int, val to: Int) extends RangeDefault { + override def foreach(f: Int => Unit): Unit = macro Impls.foreach +} + +object Test extends dotty.runtime.LegacyApp { + new Range(1, 10) foreach println +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-range/Expansion_Possible_3.scala b/tests/disabled/macro/run/macro-range/Expansion_Possible_3.scala new file mode 100644 index 000000000..b1fbba765 --- /dev/null +++ b/tests/disabled/macro/run/macro-range/Expansion_Possible_3.scala @@ -0,0 +1,7 @@ +class Range(val from: Int, val to: Int) extends RangeDefault { + override def foreach(f: Int => Unit): Unit = macro Impls.foreach +} + +object Test extends dotty.runtime.LegacyApp { + new Range(1, 10) foreach println +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-rangepos-args.check b/tests/disabled/macro/run/macro-rangepos-args.check new file mode 100644 index 000000000..d779505c6 --- /dev/null +++ b/tests/disabled/macro/run/macro-rangepos-args.check @@ -0,0 +1 @@ +Line: 3. Width: 5. diff --git a/tests/disabled/macro/run/macro-rangepos-args.flags b/tests/disabled/macro/run/macro-rangepos-args.flags new file mode 100644 index 000000000..fcf951d90 --- /dev/null +++ b/tests/disabled/macro/run/macro-rangepos-args.flags @@ -0,0 +1 @@ +-Yrangepos \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-rangepos-args/Macros_1.scala b/tests/disabled/macro/run/macro-rangepos-args/Macros_1.scala new file mode 100644 index 000000000..97b938613 --- /dev/null +++ b/tests/disabled/macro/run/macro-rangepos-args/Macros_1.scala @@ -0,0 +1,10 @@ +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl(c: Context)(x: c.Tree): c.Tree = { + import c.universe._ + Literal(Constant(s"Line: ${x.pos.line}. Width: ${x.pos.end - x.pos.start}.")) + } + def pos(x: Any): String = macro impl +} diff --git a/tests/disabled/macro/run/macro-rangepos-args/Test_2.scala b/tests/disabled/macro/run/macro-rangepos-args/Test_2.scala new file mode 100644 index 000000000..936b945c7 --- /dev/null +++ b/tests/disabled/macro/run/macro-rangepos-args/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + val x = 2 + println(Macros.pos(x + 2)) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-rangepos-subpatterns.check b/tests/disabled/macro/run/macro-rangepos-subpatterns.check new file mode 100644 index 000000000..760e15d01 --- /dev/null +++ b/tests/disabled/macro/run/macro-rangepos-subpatterns.check @@ -0,0 +1 @@ +The width of the subpattern is: 2 diff --git a/tests/disabled/macro/run/macro-rangepos-subpatterns.flags b/tests/disabled/macro/run/macro-rangepos-subpatterns.flags new file mode 100644 index 000000000..fcf951d90 --- /dev/null +++ b/tests/disabled/macro/run/macro-rangepos-subpatterns.flags @@ -0,0 +1 @@ +-Yrangepos \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-rangepos-subpatterns/Macros_1.scala b/tests/disabled/macro/run/macro-rangepos-subpatterns/Macros_1.scala new file mode 100644 index 000000000..0f3086234 --- /dev/null +++ b/tests/disabled/macro/run/macro-rangepos-subpatterns/Macros_1.scala @@ -0,0 +1,18 @@ +import scala.reflect.macros.whitebox.Context +import language.experimental.macros + +object Extractor { + def unapply(x: Any): Any = macro unapplyImpl + def unapplyImpl(c: Context)(x: c.Tree) = { + import c.universe._ + import internal._ + val pos = subpatterns(x).get.head.pos + q""" + new { + def isEmpty = false + def get = ${"The width of the subpattern is: " + (pos.end - pos.start + 1)} + def unapply(x: Any) = this + }.unapply($x) + """ + } +} diff --git a/tests/disabled/macro/run/macro-rangepos-subpatterns/Test_2.scala b/tests/disabled/macro/run/macro-rangepos-subpatterns/Test_2.scala new file mode 100644 index 000000000..b9b308cea --- /dev/null +++ b/tests/disabled/macro/run/macro-rangepos-subpatterns/Test_2.scala @@ -0,0 +1,5 @@ +object Test extends dotty.runtime.LegacyApp { + 42 match { + case Extractor(a) => println(a) + } +} diff --git a/tests/disabled/macro/run/macro-reflective-ma-normal-mdmi.check b/tests/disabled/macro/run/macro-reflective-ma-normal-mdmi.check new file mode 100644 index 000000000..ac4213d6e --- /dev/null +++ b/tests/disabled/macro/run/macro-reflective-ma-normal-mdmi.check @@ -0,0 +1 @@ +43 \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-reflective-ma-normal-mdmi.flags b/tests/disabled/macro/run/macro-reflective-ma-normal-mdmi.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-reflective-ma-normal-mdmi.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-reflective-ma-normal-mdmi/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-reflective-ma-normal-mdmi/Impls_Macros_1.scala new file mode 100644 index 000000000..e964da210 --- /dev/null +++ b/tests/disabled/macro/run/macro-reflective-ma-normal-mdmi/Impls_Macros_1.scala @@ -0,0 +1,13 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context)(x: c.Expr[Int]) = { + import c.universe._ + val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(1)))) + c.Expr[Int](body) + } +} + +object Macros { + def foo(x: Int) = macro Impls.foo +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-reflective-ma-normal-mdmi/Test_2.scala b/tests/disabled/macro/run/macro-reflective-ma-normal-mdmi/Test_2.scala new file mode 100644 index 000000000..b8d969b83 --- /dev/null +++ b/tests/disabled/macro/run/macro-reflective-ma-normal-mdmi/Test_2.scala @@ -0,0 +1,7 @@ +object Test extends dotty.runtime.LegacyApp { + import scala.reflect.runtime.universe._ + import scala.reflect.runtime.{currentMirror => cm} + import scala.tools.reflect.ToolBox + val tree = Apply(Select(Ident(TermName("Macros")), TermName("foo")), List(Literal(Constant(42)))) + println(cm.mkToolBox().eval(tree)) +} diff --git a/tests/disabled/macro/run/macro-reflective-mamd-normal-mi.check b/tests/disabled/macro/run/macro-reflective-mamd-normal-mi.check new file mode 100644 index 000000000..920a13966 --- /dev/null +++ b/tests/disabled/macro/run/macro-reflective-mamd-normal-mi.check @@ -0,0 +1 @@ +43 diff --git a/tests/disabled/macro/run/macro-reflective-mamd-normal-mi/Impls_1.scala b/tests/disabled/macro/run/macro-reflective-mamd-normal-mi/Impls_1.scala new file mode 100644 index 000000000..e62db783b --- /dev/null +++ b/tests/disabled/macro/run/macro-reflective-mamd-normal-mi/Impls_1.scala @@ -0,0 +1,9 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context)(x: c.Expr[Int]) = { + import c.universe._ + val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(1)))) + c.Expr[Int](body) + } +} diff --git a/tests/disabled/macro/run/macro-reflective-mamd-normal-mi/Macros_Test_2.scala b/tests/disabled/macro/run/macro-reflective-mamd-normal-mi/Macros_Test_2.scala new file mode 100644 index 000000000..0b867e787 --- /dev/null +++ b/tests/disabled/macro/run/macro-reflective-mamd-normal-mi/Macros_Test_2.scala @@ -0,0 +1,20 @@ +//object Macros { +// def foo(x: Int) = macro Impls.foo +//} + +object Test extends dotty.runtime.LegacyApp { + import scala.reflect.runtime.universe._ + import scala.reflect.runtime.universe.Flag._ + import scala.reflect.runtime.{currentMirror => cm} + import scala.tools.reflect.ToolBox + + val macrobody = Select(Ident(TermName("Impls")), TermName("foo")) + val macroparam = ValDef(NoMods, TermName("x"), TypeTree(definitions.IntClass.toType), EmptyTree) + val macrodef = DefDef(Modifiers(MACRO), TermName("foo"), Nil, List(List(macroparam)), Ident(TypeName("Int")), macrobody) + val modulector = DefDef(NoMods, termNames.CONSTRUCTOR, Nil, List(List()), TypeTree(), Block(List(Apply(Select(Super(This(typeNames.EMPTY), typeNames.EMPTY), termNames.CONSTRUCTOR), List())), Literal(Constant(())))) + val module = ModuleDef(NoMods, TermName("Macros"), Template(Nil, noSelfType, List(modulector, macrodef))) + val macroapp = Apply(Select(Ident(TermName("Macros")), TermName("foo")), List(Literal(Constant(42)))) + val tree = Block(List(macrodef, module), macroapp) + val toolbox = cm.mkToolBox(options = "-language:experimental.macros") + println(toolbox.eval(tree)) +} diff --git a/tests/disabled/macro/run/macro-reify-basic.check b/tests/disabled/macro/run/macro-reify-basic.check new file mode 100644 index 000000000..3b18e512d --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-basic.check @@ -0,0 +1 @@ +hello world diff --git a/tests/disabled/macro/run/macro-reify-basic.flags b/tests/disabled/macro/run/macro-reify-basic.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-basic.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-reify-basic/Macros_1.scala b/tests/disabled/macro/run/macro-reify-basic/Macros_1.scala new file mode 100644 index 000000000..1cf2a8a40 --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-basic/Macros_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.blackbox.Context + +object Macros { + def foo(s: String) = macro Impls.foo + + object Impls { + def foo(c: Context)(s: c.Expr[String]) = c.universe.reify { + println("hello " + s.splice) + } + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-reify-basic/Test_2.scala b/tests/disabled/macro/run/macro-reify-basic/Test_2.scala new file mode 100644 index 000000000..26b2c7d9f --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-basic/Test_2.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + Macros.foo("world") +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-reify-chained1/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-reify-chained1/Impls_Macros_1.scala new file mode 100644 index 000000000..7f877b272 --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-chained1/Impls_Macros_1.scala @@ -0,0 +1,47 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.macros.blackbox.Context +import scala.language.experimental.macros + +case class Utils[C <: Context]( c:C ) { + import c.universe._ + import c.{Tree=>_} + object removeDoubleReify extends c.universe.Transformer { + def apply( tree:Tree ) = transform(tree) + override def transform(tree: Tree): Tree = { + super.transform { + tree match { + case Apply(TypeApply(Select(_this, termname), _), reification::Nil ) + if termname.toString == "factory" => c.unreifyTree(reification) + case Apply(Select(_this, termname), reification::Nil ) + if termname.toString == "factory" => c.unreifyTree(reification) + case _ => tree + } + } + } + } +} +object QueryableMacros{ + def _helper[C <: Context,S:c.WeakTypeTag]( c:C )( name:String, projection:c.Expr[_] ) = { + import c.universe._ + import internal._ + val element_type = implicitly[c.WeakTypeTag[S]].tpe + val foo = c.Expr[ru.Expr[Queryable[S]]]( + c.reifyTree( gen.mkRuntimeUniverseRef, EmptyTree, c.typecheck( + Utils[c.type](c).removeDoubleReify( + Apply(Select(c.prefix.tree, TermName( name )), List( projection.tree )) + ).asInstanceOf[Tree] + ))) + c.universe.reify{ Queryable.factory[S]( foo.splice )} + } + def map[T:c.WeakTypeTag, S:c.WeakTypeTag] + (c: Context) + (projection: c.Expr[T => S]): c.Expr[Queryable[S]] = _helper[c.type,S]( c )( "_map", projection ) +} +class Queryable[T]{ + def _map[S]( projection: T => S ) : Queryable[S] = ??? + def map[S]( projection: T => S ) : Queryable[S] = macro QueryableMacros.map[T,S] +} +object Queryable{ + def factory[S]( projection:ru.Expr[Queryable[S]] ) : Queryable[S] = null +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-reify-chained1/Test_2.scala b/tests/disabled/macro/run/macro-reify-chained1/Test_2.scala new file mode 100644 index 000000000..01a021893 --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-chained1/Test_2.scala @@ -0,0 +1,9 @@ +object Test extends dotty.runtime.LegacyApp{ + val q : Queryable[Any] = new Queryable[Any] + q.map(x => x).map(x => x) + + locally { + val q : Queryable[Any] = new Queryable[Any] + q.map(x => x).map(x => x) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-reify-chained2/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-reify-chained2/Impls_Macros_1.scala new file mode 100644 index 000000000..965b19104 --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-chained2/Impls_Macros_1.scala @@ -0,0 +1,47 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.macros.whitebox.Context +import scala.language.experimental.macros + +case class Utils[C <: Context]( c:C ) { + import c.universe._ + import c.{Tree=>_} + object removeDoubleReify extends c.universe.Transformer { + def apply( tree:Tree ) = transform(tree) + override def transform(tree: Tree): Tree = { + super.transform { + tree match { + case Apply(TypeApply(Select(_this, termname), _), reification::Nil ) + if termname.toString == "factory" => c.unreifyTree(reification) + case Apply(Select(_this, termname), reification::Nil ) + if termname.toString == "factory" => c.unreifyTree(reification) + case _ => tree + } + } + } + } +} +object QueryableMacros{ + def _helper[C <: Context,S:c.WeakTypeTag]( c:C )( name:String, projection:c.Expr[_] ) = { + import c.universe._ + import internal._ + val element_type = implicitly[c.WeakTypeTag[S]].tpe + val foo = c.Expr[ru.Expr[Queryable[S]]]( + c.reifyTree( gen.mkRuntimeUniverseRef, EmptyTree, c.typecheck( + Utils[c.type](c).removeDoubleReify( + Apply(Select(c.prefix.tree, TermName( name )), List( projection.tree )) + ).asInstanceOf[Tree] + ))) + c.universe.reify{ Queryable.factory[S]( foo.splice )} + } + def map[T:c.WeakTypeTag, S:c.WeakTypeTag] + (c: Context) + (projection: c.Expr[T => S]): c.Expr[Queryable[S]] = _helper[c.type,S]( c )( "_map", projection ) +} +class Queryable[T]{ + def _map[S]( projection: T => S ) : Queryable[S] = ??? + def map[S]( projection: T => S ) : Queryable[S] = macro QueryableMacros.map[T,S] +} +object Queryable{ + def factory[S]( projection:ru.Expr[Queryable[S]] ) : Queryable[S] = null +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-reify-chained2/Test_2.scala b/tests/disabled/macro/run/macro-reify-chained2/Test_2.scala new file mode 100644 index 000000000..01a021893 --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-chained2/Test_2.scala @@ -0,0 +1,9 @@ +object Test extends dotty.runtime.LegacyApp{ + val q : Queryable[Any] = new Queryable[Any] + q.map(x => x).map(x => x) + + locally { + val q : Queryable[Any] = new Queryable[Any] + q.map(x => x).map(x => x) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-reify-freevars.check b/tests/disabled/macro/run/macro-reify-freevars.check new file mode 100644 index 000000000..f618e307b --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-freevars.check @@ -0,0 +1,3 @@ +reflective compilation has failed: + +Macro expansion contains free term variable code defined by map in Macros_1.scala:9:9. Have you forgotten to use splice when splicing this variable into a reifee? If you have troubles tracking free term variables, consider using -Xlog-free-terms diff --git a/tests/disabled/macro/run/macro-reify-freevars.flags b/tests/disabled/macro/run/macro-reify-freevars.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-freevars.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-reify-freevars/Macros_1.scala b/tests/disabled/macro/run/macro-reify-freevars/Macros_1.scala new file mode 100644 index 000000000..912f602c6 --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-freevars/Macros_1.scala @@ -0,0 +1,20 @@ +package scala.collection.slick + +object QueryableMacros{ + def map[T:c.WeakTypeTag, S:c.WeakTypeTag] + (c: scala.reflect.macros.blackbox.Context) + (projection: c.Expr[T => S]) + : c.Expr[scala.collection.slick.Queryable[S]] = { + import c.universe._ + val code = EmptyTree + c.universe.reify{ + Queryable.factory[S]( code.asInstanceOf[reflect.runtime.universe.Tree] ) + } + } +} +class Queryable[T]{ + def map[S]( projection: T => S ) : Queryable[S] = macro QueryableMacros.map[T,S] +} +object Queryable{ + def factory[S]( projection:reflect.runtime.universe.Tree ) : Queryable[S] = null +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-reify-freevars/Test_2.scala b/tests/disabled/macro/run/macro-reify-freevars/Test_2.scala new file mode 100644 index 000000000..11c8128cd --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-freevars/Test_2.scala @@ -0,0 +1,11 @@ +object Test extends dotty.runtime.LegacyApp { + import scala.reflect.runtime.universe._ + import scala.reflect.runtime.{currentMirror => cm} + import scala.tools.reflect.ToolBox + val q = New(AppliedTypeTree(Select(Select(Select(Ident(TermName("scala")), TermName("collection")), TermName("slick")), TypeName("Queryable")), List(Ident(TermName("Int"))))) + val x = ValDef(NoMods, TermName("x"), Ident(TermName("Int")), EmptyTree) + val fn = Function(List(x), Apply(Select(Ident(TermName("x")), TermName("$plus")), List(Literal(Constant("5"))))) + val tree = Apply(Select(q, TermName("map")), List(fn)) + try cm.mkToolBox().eval(tree) + catch { case ex: Throwable => println(ex.getMessage) } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-reify-nested-a1/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-reify-nested-a1/Impls_Macros_1.scala new file mode 100644 index 000000000..7f877b272 --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-nested-a1/Impls_Macros_1.scala @@ -0,0 +1,47 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.macros.blackbox.Context +import scala.language.experimental.macros + +case class Utils[C <: Context]( c:C ) { + import c.universe._ + import c.{Tree=>_} + object removeDoubleReify extends c.universe.Transformer { + def apply( tree:Tree ) = transform(tree) + override def transform(tree: Tree): Tree = { + super.transform { + tree match { + case Apply(TypeApply(Select(_this, termname), _), reification::Nil ) + if termname.toString == "factory" => c.unreifyTree(reification) + case Apply(Select(_this, termname), reification::Nil ) + if termname.toString == "factory" => c.unreifyTree(reification) + case _ => tree + } + } + } + } +} +object QueryableMacros{ + def _helper[C <: Context,S:c.WeakTypeTag]( c:C )( name:String, projection:c.Expr[_] ) = { + import c.universe._ + import internal._ + val element_type = implicitly[c.WeakTypeTag[S]].tpe + val foo = c.Expr[ru.Expr[Queryable[S]]]( + c.reifyTree( gen.mkRuntimeUniverseRef, EmptyTree, c.typecheck( + Utils[c.type](c).removeDoubleReify( + Apply(Select(c.prefix.tree, TermName( name )), List( projection.tree )) + ).asInstanceOf[Tree] + ))) + c.universe.reify{ Queryable.factory[S]( foo.splice )} + } + def map[T:c.WeakTypeTag, S:c.WeakTypeTag] + (c: Context) + (projection: c.Expr[T => S]): c.Expr[Queryable[S]] = _helper[c.type,S]( c )( "_map", projection ) +} +class Queryable[T]{ + def _map[S]( projection: T => S ) : Queryable[S] = ??? + def map[S]( projection: T => S ) : Queryable[S] = macro QueryableMacros.map[T,S] +} +object Queryable{ + def factory[S]( projection:ru.Expr[Queryable[S]] ) : Queryable[S] = null +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-reify-nested-a1/Test_2.scala b/tests/disabled/macro/run/macro-reify-nested-a1/Test_2.scala new file mode 100644 index 000000000..37282cad7 --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-nested-a1/Test_2.scala @@ -0,0 +1,9 @@ +object Test extends dotty.runtime.LegacyApp{ + val q : Queryable[Any] = new Queryable[Any] + q.map(e1 => q.map(e2=>e1)) + + locally { + val q : Queryable[Any] = new Queryable[Any] + q.map(e1 => q.map(e2=>e1)) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-reify-nested-a2/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-reify-nested-a2/Impls_Macros_1.scala new file mode 100644 index 000000000..965b19104 --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-nested-a2/Impls_Macros_1.scala @@ -0,0 +1,47 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.macros.whitebox.Context +import scala.language.experimental.macros + +case class Utils[C <: Context]( c:C ) { + import c.universe._ + import c.{Tree=>_} + object removeDoubleReify extends c.universe.Transformer { + def apply( tree:Tree ) = transform(tree) + override def transform(tree: Tree): Tree = { + super.transform { + tree match { + case Apply(TypeApply(Select(_this, termname), _), reification::Nil ) + if termname.toString == "factory" => c.unreifyTree(reification) + case Apply(Select(_this, termname), reification::Nil ) + if termname.toString == "factory" => c.unreifyTree(reification) + case _ => tree + } + } + } + } +} +object QueryableMacros{ + def _helper[C <: Context,S:c.WeakTypeTag]( c:C )( name:String, projection:c.Expr[_] ) = { + import c.universe._ + import internal._ + val element_type = implicitly[c.WeakTypeTag[S]].tpe + val foo = c.Expr[ru.Expr[Queryable[S]]]( + c.reifyTree( gen.mkRuntimeUniverseRef, EmptyTree, c.typecheck( + Utils[c.type](c).removeDoubleReify( + Apply(Select(c.prefix.tree, TermName( name )), List( projection.tree )) + ).asInstanceOf[Tree] + ))) + c.universe.reify{ Queryable.factory[S]( foo.splice )} + } + def map[T:c.WeakTypeTag, S:c.WeakTypeTag] + (c: Context) + (projection: c.Expr[T => S]): c.Expr[Queryable[S]] = _helper[c.type,S]( c )( "_map", projection ) +} +class Queryable[T]{ + def _map[S]( projection: T => S ) : Queryable[S] = ??? + def map[S]( projection: T => S ) : Queryable[S] = macro QueryableMacros.map[T,S] +} +object Queryable{ + def factory[S]( projection:ru.Expr[Queryable[S]] ) : Queryable[S] = null +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-reify-nested-a2/Test_2.scala b/tests/disabled/macro/run/macro-reify-nested-a2/Test_2.scala new file mode 100644 index 000000000..37282cad7 --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-nested-a2/Test_2.scala @@ -0,0 +1,9 @@ +object Test extends dotty.runtime.LegacyApp{ + val q : Queryable[Any] = new Queryable[Any] + q.map(e1 => q.map(e2=>e1)) + + locally { + val q : Queryable[Any] = new Queryable[Any] + q.map(e1 => q.map(e2=>e1)) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-reify-nested-b1/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-reify-nested-b1/Impls_Macros_1.scala new file mode 100644 index 000000000..7f877b272 --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-nested-b1/Impls_Macros_1.scala @@ -0,0 +1,47 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.macros.blackbox.Context +import scala.language.experimental.macros + +case class Utils[C <: Context]( c:C ) { + import c.universe._ + import c.{Tree=>_} + object removeDoubleReify extends c.universe.Transformer { + def apply( tree:Tree ) = transform(tree) + override def transform(tree: Tree): Tree = { + super.transform { + tree match { + case Apply(TypeApply(Select(_this, termname), _), reification::Nil ) + if termname.toString == "factory" => c.unreifyTree(reification) + case Apply(Select(_this, termname), reification::Nil ) + if termname.toString == "factory" => c.unreifyTree(reification) + case _ => tree + } + } + } + } +} +object QueryableMacros{ + def _helper[C <: Context,S:c.WeakTypeTag]( c:C )( name:String, projection:c.Expr[_] ) = { + import c.universe._ + import internal._ + val element_type = implicitly[c.WeakTypeTag[S]].tpe + val foo = c.Expr[ru.Expr[Queryable[S]]]( + c.reifyTree( gen.mkRuntimeUniverseRef, EmptyTree, c.typecheck( + Utils[c.type](c).removeDoubleReify( + Apply(Select(c.prefix.tree, TermName( name )), List( projection.tree )) + ).asInstanceOf[Tree] + ))) + c.universe.reify{ Queryable.factory[S]( foo.splice )} + } + def map[T:c.WeakTypeTag, S:c.WeakTypeTag] + (c: Context) + (projection: c.Expr[T => S]): c.Expr[Queryable[S]] = _helper[c.type,S]( c )( "_map", projection ) +} +class Queryable[T]{ + def _map[S]( projection: T => S ) : Queryable[S] = ??? + def map[S]( projection: T => S ) : Queryable[S] = macro QueryableMacros.map[T,S] +} +object Queryable{ + def factory[S]( projection:ru.Expr[Queryable[S]] ) : Queryable[S] = null +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-reify-nested-b1/Test_2.scala b/tests/disabled/macro/run/macro-reify-nested-b1/Test_2.scala new file mode 100644 index 000000000..b9d6846dc --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-nested-b1/Test_2.scala @@ -0,0 +1,9 @@ +object Test extends dotty.runtime.LegacyApp{ + val q : Queryable[Any] = new Queryable[Any] + q.map(e1 => q.map(e2=>e1).map(e2=>e1)) + + locally { + val q : Queryable[Any] = new Queryable[Any] + q.map(e1 => q.map(e2=>e1).map(e2=>e1)) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-reify-nested-b2/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-reify-nested-b2/Impls_Macros_1.scala new file mode 100644 index 000000000..965b19104 --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-nested-b2/Impls_Macros_1.scala @@ -0,0 +1,47 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.macros.whitebox.Context +import scala.language.experimental.macros + +case class Utils[C <: Context]( c:C ) { + import c.universe._ + import c.{Tree=>_} + object removeDoubleReify extends c.universe.Transformer { + def apply( tree:Tree ) = transform(tree) + override def transform(tree: Tree): Tree = { + super.transform { + tree match { + case Apply(TypeApply(Select(_this, termname), _), reification::Nil ) + if termname.toString == "factory" => c.unreifyTree(reification) + case Apply(Select(_this, termname), reification::Nil ) + if termname.toString == "factory" => c.unreifyTree(reification) + case _ => tree + } + } + } + } +} +object QueryableMacros{ + def _helper[C <: Context,S:c.WeakTypeTag]( c:C )( name:String, projection:c.Expr[_] ) = { + import c.universe._ + import internal._ + val element_type = implicitly[c.WeakTypeTag[S]].tpe + val foo = c.Expr[ru.Expr[Queryable[S]]]( + c.reifyTree( gen.mkRuntimeUniverseRef, EmptyTree, c.typecheck( + Utils[c.type](c).removeDoubleReify( + Apply(Select(c.prefix.tree, TermName( name )), List( projection.tree )) + ).asInstanceOf[Tree] + ))) + c.universe.reify{ Queryable.factory[S]( foo.splice )} + } + def map[T:c.WeakTypeTag, S:c.WeakTypeTag] + (c: Context) + (projection: c.Expr[T => S]): c.Expr[Queryable[S]] = _helper[c.type,S]( c )( "_map", projection ) +} +class Queryable[T]{ + def _map[S]( projection: T => S ) : Queryable[S] = ??? + def map[S]( projection: T => S ) : Queryable[S] = macro QueryableMacros.map[T,S] +} +object Queryable{ + def factory[S]( projection:ru.Expr[Queryable[S]] ) : Queryable[S] = null +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-reify-nested-b2/Test_2.scala b/tests/disabled/macro/run/macro-reify-nested-b2/Test_2.scala new file mode 100644 index 000000000..b9d6846dc --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-nested-b2/Test_2.scala @@ -0,0 +1,9 @@ +object Test extends dotty.runtime.LegacyApp{ + val q : Queryable[Any] = new Queryable[Any] + q.map(e1 => q.map(e2=>e1).map(e2=>e1)) + + locally { + val q : Queryable[Any] = new Queryable[Any] + q.map(e1 => q.map(e2=>e1).map(e2=>e1)) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-reify-ref-to-packageless.check b/tests/disabled/macro/run/macro-reify-ref-to-packageless.check new file mode 100644 index 000000000..d81cc0710 --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-ref-to-packageless.check @@ -0,0 +1 @@ +42 diff --git a/tests/disabled/macro/run/macro-reify-ref-to-packageless.flags b/tests/disabled/macro/run/macro-reify-ref-to-packageless.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-ref-to-packageless.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-reify-ref-to-packageless/Impls_1.scala b/tests/disabled/macro/run/macro-reify-ref-to-packageless/Impls_1.scala new file mode 100644 index 000000000..38ec6f022 --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-ref-to-packageless/Impls_1.scala @@ -0,0 +1,6 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + val `Answer to the Ultimate Question of Life, the Universe, and Everything` = 42 + def foo(c: Context) = c.universe.reify { `Answer to the Ultimate Question of Life, the Universe, and Everything` } +} diff --git a/tests/disabled/macro/run/macro-reify-ref-to-packageless/Test_2.scala b/tests/disabled/macro/run/macro-reify-ref-to-packageless/Test_2.scala new file mode 100644 index 000000000..ff5b60a6a --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-ref-to-packageless/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + def foo: Int = macro Impls.foo + println(foo) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-reify-splice-outside-reify.check b/tests/disabled/macro/run/macro-reify-splice-outside-reify.check new file mode 100644 index 000000000..d81cc0710 --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-splice-outside-reify.check @@ -0,0 +1 @@ +42 diff --git a/tests/disabled/macro/run/macro-reify-splice-outside-reify.flags b/tests/disabled/macro/run/macro-reify-splice-outside-reify.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-splice-outside-reify.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-reify-splice-outside-reify/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-reify-splice-outside-reify/Impls_Macros_1.scala new file mode 100644 index 000000000..f038d8714 --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-splice-outside-reify/Impls_Macros_1.scala @@ -0,0 +1,13 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context)(x: c.Expr[Int]) = { + import c.universe._ + val x1 = c.Expr[Int](c.untypecheck(x.tree)) + c.Expr[Int](Literal(Constant(c.eval(x1)))) + } +} + +object Macros { + def foo(x: Int) = macro Impls.foo +} diff --git a/tests/disabled/macro/run/macro-reify-splice-outside-reify/Test_2.scala b/tests/disabled/macro/run/macro-reify-splice-outside-reify/Test_2.scala new file mode 100644 index 000000000..f99d40dad --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-splice-outside-reify/Test_2.scala @@ -0,0 +1,8 @@ +object Test extends dotty.runtime.LegacyApp { + import scala.reflect.runtime.universe._ + import scala.reflect.runtime.{currentMirror => cm} + import scala.tools.reflect.ToolBox + val tree = Apply(Select(Ident(TermName("Macros")), TermName("foo")), List(Literal(Constant(42)))) + try println(cm.mkToolBox().eval(tree)) + catch { case ex: Throwable => println(ex.getMessage) } +} diff --git a/tests/disabled/macro/run/macro-reify-staticXXX.check b/tests/disabled/macro/run/macro-reify-staticXXX.check new file mode 100644 index 000000000..2894fa584 --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-staticXXX.check @@ -0,0 +1,12 @@ +object +class +object > object +object > class +package > object +package > class +object +class +object > object +object > class +package > object +package > class \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-reify-staticXXX.flags b/tests/disabled/macro/run/macro-reify-staticXXX.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-staticXXX.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-reify-staticXXX/Macros_1.scala b/tests/disabled/macro/run/macro-reify-staticXXX/Macros_1.scala new file mode 100644 index 000000000..2993218bb --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-staticXXX/Macros_1.scala @@ -0,0 +1,48 @@ +import scala.reflect.macros.blackbox.Context + +object B { override def toString = "object" } +class C { override def toString = "class" } + +package foo { + object B { override def toString = "package > object" } + class C { override def toString = "package > class" } +} + +object foo { + object B { override def toString = "object > object" } + class C { override def toString = "object > class" } +} + +object packageless { + def impl(c: Context) = { + import c.universe._ + reify { + println(B) + println(new C) + println(foo.B) + println(new foo.C) + println(_root_.foo.B) + println(new _root_.foo.C) + } + } + + def test = macro impl +} + +package packageful { + object Test { + def impl(c: Context) = { + import c.universe._ + reify { + println(B) + println(new C) + println(foo.B) + println(new foo.C) + println(_root_.foo.B) + println(new _root_.foo.C) + } + } + + def test = macro impl + } +} diff --git a/tests/disabled/macro/run/macro-reify-staticXXX/Test_2.scala b/tests/disabled/macro/run/macro-reify-staticXXX/Test_2.scala new file mode 100644 index 000000000..4c02e26f6 --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-staticXXX/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + packageless.test + packageful.Test.test +} diff --git a/tests/disabled/macro/run/macro-reify-tagful-a.check b/tests/disabled/macro/run/macro-reify-tagful-a.check new file mode 100644 index 000000000..3f4c71999 --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-tagful-a.check @@ -0,0 +1 @@ +List(hello world) diff --git a/tests/disabled/macro/run/macro-reify-tagful-a.flags b/tests/disabled/macro/run/macro-reify-tagful-a.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-tagful-a.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-reify-tagful-a/Macros_1.scala b/tests/disabled/macro/run/macro-reify-tagful-a/Macros_1.scala new file mode 100644 index 000000000..6f061fd26 --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-tagful-a/Macros_1.scala @@ -0,0 +1,12 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.macros.blackbox.Context + +object Macros { + def foo[T](s: T) = macro Impls.foo[T] + + object Impls { + def foo[T: c.WeakTypeTag](c: Context)(s: c.Expr[T]) = c.universe.reify { + List(s.splice) + } + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-reify-tagful-a/Test_2.scala b/tests/disabled/macro/run/macro-reify-tagful-a/Test_2.scala new file mode 100644 index 000000000..5095ddcaa --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-tagful-a/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + val list: List[String] = Macros.foo("hello world") + println(list) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-reify-tagless-a.check b/tests/disabled/macro/run/macro-reify-tagless-a.check new file mode 100644 index 000000000..d160e8043 --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-tagless-a.check @@ -0,0 +1,3 @@ +reflective compilation has failed: + +Macro expansion contains free type variable T defined by foo in Impls_Macros_1.scala:7:13. Have you forgotten to use c.WeakTypeTag annotation for this type parameter? If you have troubles tracking free type variables, consider using -Xlog-free-types diff --git a/tests/disabled/macro/run/macro-reify-tagless-a.flags b/tests/disabled/macro/run/macro-reify-tagless-a.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-tagless-a.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-reify-tagless-a/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-reify-tagless-a/Impls_Macros_1.scala new file mode 100644 index 000000000..faac3e3a3 --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-tagless-a/Impls_Macros_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.blackbox.Context + +object Macros { + def foo[T](s: T) = macro Impls.foo[T] + + object Impls { + def foo[T](c: Context)(s: c.Expr[T]) = c.universe.reify { + List[T](s.splice) + } + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-reify-tagless-a/Test_2.scala b/tests/disabled/macro/run/macro-reify-tagless-a/Test_2.scala new file mode 100644 index 000000000..af882664d --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-tagless-a/Test_2.scala @@ -0,0 +1,14 @@ +object Test extends dotty.runtime.LegacyApp { + //val list: List[String] = Macros.foo("hello world") + //println(list) + + import scala.reflect.runtime.universe._ + import scala.reflect.runtime.{currentMirror => cm} + import scala.tools.reflect.ToolBox + val tpt = AppliedTypeTree(Ident(definitions.ListClass), List(Ident(definitions.StringClass))) + val rhs = Apply(Select(Ident(TermName("Macros")), TermName("foo")), List(Literal(Constant("hello world")))) + val list = ValDef(NoMods, TermName("list"), tpt, rhs) + val tree = Block(List(list), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Ident(list.name)))) + try cm.mkToolBox().eval(tree) + catch { case ex: Throwable => println(ex.getMessage) } +} diff --git a/tests/disabled/macro/run/macro-reify-type.check b/tests/disabled/macro/run/macro-reify-type.check new file mode 100644 index 000000000..ea5e70e10 --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-type.check @@ -0,0 +1 @@ +[B, That](f: Int => B)(implicit bf: scala.collection.generic.CanBuildFrom[List[Int],B,That])That \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-reify-type.flags b/tests/disabled/macro/run/macro-reify-type.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-type.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-reify-type/Macros_1.scala b/tests/disabled/macro/run/macro-reify-type/Macros_1.scala new file mode 100644 index 000000000..c38cf8aa5 --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-type/Macros_1.scala @@ -0,0 +1,28 @@ +import scala.reflect.macros.blackbox.Context +import scala.reflect.runtime.{universe => ru} + +object StaticReflect { + def method[A](name: String): ru.Type = macro methodImpl[A] + + def methodImpl[A: c.WeakTypeTag](c: Context)(name: c.Expr[String]): c.Expr[ru.Type] = { + import c.universe._ + import internal._ + + val nameName: TermName = name.tree match { + case Literal(Constant(str: String)) => TermName(str) + case _ => c.error(c.enclosingPosition, s"Method name not constant.") ; return reify(ru.NoType) + } + val clazz = weakTypeOf[A] + + clazz member nameName match { + case NoSymbol => c.error(c.enclosingPosition, s"No member called $nameName in $clazz.") ; reify(ru.NoType) + case member => + val mtpe = member infoIn clazz + val mtag = c.reifyType(gen.mkRuntimeUniverseRef, Select(gen.mkRuntimeUniverseRef, TermName("rootMirror")), mtpe) + val mtree = Select(mtag, TermName("tpe")) + + c.Expr[ru.Type](mtree) + } + } + +} diff --git a/tests/disabled/macro/run/macro-reify-type/Test_2.scala b/tests/disabled/macro/run/macro-reify-type/Test_2.scala new file mode 100644 index 000000000..c9e56d718 --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-type/Test_2.scala @@ -0,0 +1,21 @@ +import StaticReflect._ + +object Test extends dotty.runtime.LegacyApp { + //println(method[List[Int]]("distinct")) + println(method[List[Int]]("map")) + //val $u: scala.reflect.runtime.universe.type = scala.reflect.runtime.universe; + //val $m: $u.Mirror = scala.reflect.runtime.universe.rootMirror; + //import $u._, $m._, Flag._, internal._ + //val tpe = { + // val symdef$B2 = reificationSupport.newNestedSymbol(reificationSupport.selectTerm(staticClass("scala.collection.TraversableLike"), "map"), TypeName("B"), NoPosition, DEFERRED | PARAM, false); + // val symdef$That2 = reificationSupport.newNestedSymbol(reificationSupport.selectTerm(staticClass("scala.collection.TraversableLike"), "map"), TypeName("That"), NoPosition, DEFERRED | PARAM, false); + // val symdef$f2 = reificationSupport.newNestedSymbol(reificationSupport.selectTerm(staticClass("scala.collection.TraversableLike"), "map"), TermName("f"), NoPosition, PARAM, false); + // val symdef$bf2 = reificationSupport.newNestedSymbol(reificationSupport.selectTerm(staticClass("scala.collection.TraversableLike"), "map"), TermName("bf"), NoPosition, IMPLICIT | PARAM, false); + // reificationSupport.setInfo(symdef$B2, TypeBounds(staticClass("scala.Nothing").asType.toTypeConstructor, staticClass("scala.Any").asType.toTypeConstructor)); + // reificationSupport.setInfo(symdef$That2, TypeBounds(staticClass("scala.Nothing").asType.toTypeConstructor, staticClass("scala.Any").asType.toTypeConstructor)); + // reificationSupport.setInfo(symdef$f2, TypeRef(ThisType(staticPackage("scala").asModule.moduleClass), staticClass("scala.Function1"), List(staticClass("scala.Int").asType.toTypeConstructor, TypeRef(NoPrefix, symdef$B2, List())))); + // reificationSupport.setInfo(symdef$bf2, TypeRef(ThisType(staticPackage("scala.collection.generic").asModule.moduleClass), staticClass("scala.collection.generic.CanBuildFrom"), List(TypeRef(ThisType(staticPackage("scala.collection.immutable").asModule.moduleClass), staticClass("scala.collection.immutable.List"), List(staticClass("scala.Int").asType.toTypeConstructor)), TypeRef(NoPrefix, symdef$B2, List()), TypeRef(NoPrefix, symdef$That2, List())))); + // PolyType(List(symdef$B2, symdef$That2), MethodType(List(symdef$f2), MethodType(List(symdef$bf2), TypeRef(NoPrefix, symdef$That2, List())))) + //} + //println(tpe) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-reify-typetag-notypeparams.check b/tests/disabled/macro/run/macro-reify-typetag-notypeparams.check new file mode 100644 index 000000000..7732c10d7 --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-typetag-notypeparams.check @@ -0,0 +1,2 @@ +TypeTag[Int] +TypeTag[List[Int]] diff --git a/tests/disabled/macro/run/macro-reify-typetag-notypeparams/Test.scala b/tests/disabled/macro/run/macro-reify-typetag-notypeparams/Test.scala new file mode 100644 index 000000000..1eff6e93f --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-typetag-notypeparams/Test.scala @@ -0,0 +1,6 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + println(implicitly[TypeTag[Int]]) + println(implicitly[TypeTag[List[Int]]]) +} diff --git a/tests/disabled/macro/run/macro-reify-typetag-typeparams-tags.check b/tests/disabled/macro/run/macro-reify-typetag-typeparams-tags.check new file mode 100644 index 000000000..7732c10d7 --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-typetag-typeparams-tags.check @@ -0,0 +1,2 @@ +TypeTag[Int] +TypeTag[List[Int]] diff --git a/tests/disabled/macro/run/macro-reify-typetag-typeparams-tags/Test.scala b/tests/disabled/macro/run/macro-reify-typetag-typeparams-tags/Test.scala new file mode 100644 index 000000000..4540bb6b3 --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-typetag-typeparams-tags/Test.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + def fooTypeTag[T: TypeTag] = { + println(implicitly[TypeTag[T]]) + println(implicitly[TypeTag[List[T]]]) + } + fooTypeTag[Int] +} diff --git a/tests/disabled/macro/run/macro-reify-unreify.check b/tests/disabled/macro/run/macro-reify-unreify.check new file mode 100644 index 000000000..7a6d53c47 --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-unreify.check @@ -0,0 +1 @@ +hello world = Expr[java.lang.String("hello world")]("hello world") diff --git a/tests/disabled/macro/run/macro-reify-unreify.flags b/tests/disabled/macro/run/macro-reify-unreify.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-unreify.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-reify-unreify/Macros_1.scala b/tests/disabled/macro/run/macro-reify-unreify/Macros_1.scala new file mode 100644 index 000000000..d92dfa3e2 --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-unreify/Macros_1.scala @@ -0,0 +1,20 @@ +import scala.reflect.macros.blackbox.Context + +object Macros { + def foo(s: String) = macro Impls.foo + + object Impls { + def foo(c: Context)(s: c.Expr[String]) = { + import c.universe._ + import internal._ + + val world = c.reifyTree(gen.mkRuntimeUniverseRef, EmptyTree, s.tree) + val greeting = c.reifyTree(gen.mkRuntimeUniverseRef, EmptyTree, c.typecheck(Apply(Select(Literal(Constant("hello ")), TermName("$plus")), List(c.unreifyTree(world))))) + val typedGreeting = c.Expr[String](greeting) + + c.universe.reify { + println("hello " + s.splice + " = " + typedGreeting.splice) + } + } + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-reify-unreify/Test_2.scala b/tests/disabled/macro/run/macro-reify-unreify/Test_2.scala new file mode 100644 index 000000000..26b2c7d9f --- /dev/null +++ b/tests/disabled/macro/run/macro-reify-unreify/Test_2.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + Macros.foo("world") +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-repl-basic.check b/tests/disabled/macro/run/macro-repl-basic.check new file mode 100644 index 000000000..fab03d155 --- /dev/null +++ b/tests/disabled/macro/run/macro-repl-basic.check @@ -0,0 +1,52 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> import language.experimental.macros +import language.experimental.macros + +scala> import scala.reflect.macros.blackbox.Context +import scala.reflect.macros.blackbox.Context + +scala> + +scala> object Impls { + def foo(c: Context)(x: c.Expr[Int]) = { + import c.universe._ + val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(1)))) + c.Expr[Int](body) + } + + def bar(c: Context)(x: c.Expr[Int]) = { + import c.universe._ + val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(2)))) + c.Expr[Int](body) + } + + def quux(c: Context)(x: c.Expr[Int]) = { + import c.universe._ + val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(3)))) + c.Expr[Int](body) + } +} +defined object Impls + +scala> object Macros { + object Shmacros { + def foo(x: Int): Int = macro Impls.foo + } + def bar(x: Int): Int = macro Impls.bar +}; class Macros { + def quux(x: Int): Int = macro Impls.quux +} +defined object Macros +defined class Macros + +scala> + +scala> import Macros.Shmacros._ +import Macros.Shmacros._ + +scala> println(foo(2) + Macros.bar(2) * new Macros().quux(4)) +31 + +scala> :quit diff --git a/tests/disabled/macro/run/macro-repl-basic.scala b/tests/disabled/macro/run/macro-repl-basic.scala new file mode 100644 index 000000000..217f3bc0e --- /dev/null +++ b/tests/disabled/macro/run/macro-repl-basic.scala @@ -0,0 +1,39 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ + |import language.experimental.macros + |import scala.reflect.macros.blackbox.Context + | + |object Impls { + | def foo(c: Context)(x: c.Expr[Int]) = { + | import c.universe._ + | val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(1)))) + | c.Expr[Int](body) + | } + | + | def bar(c: Context)(x: c.Expr[Int]) = { + | import c.universe._ + | val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(2)))) + | c.Expr[Int](body) + | } + | + | def quux(c: Context)(x: c.Expr[Int]) = { + | import c.universe._ + | val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(3)))) + | c.Expr[Int](body) + | } + |} + |object Macros { + | object Shmacros { + | def foo(x: Int): Int = macro Impls.foo + | } + | def bar(x: Int): Int = macro Impls.bar + |}; class Macros { + | def quux(x: Int): Int = macro Impls.quux + |} + | + |import Macros.Shmacros._ + |println(foo(2) + Macros.bar(2) * new Macros().quux(4)) + |""".stripMargin +} diff --git a/tests/disabled/macro/run/macro-repl-dontexpand.check b/tests/disabled/macro/run/macro-repl-dontexpand.check new file mode 100644 index 000000000..6ecc9245f --- /dev/null +++ b/tests/disabled/macro/run/macro-repl-dontexpand.check @@ -0,0 +1,16 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> def bar1(c: scala.reflect.macros.blackbox.Context) = ??? +bar1: (c: scala.reflect.macros.blackbox.Context)Nothing + +scala> def foo1 = macro bar1 +defined term macro foo1: Nothing + +scala> def bar2(c: scala.reflect.macros.whitebox.Context) = ??? +bar2: (c: scala.reflect.macros.whitebox.Context)Nothing + +scala> def foo2 = macro bar2 +defined term macro foo2: Nothing + +scala> :quit diff --git a/tests/disabled/macro/run/macro-repl-dontexpand.scala b/tests/disabled/macro/run/macro-repl-dontexpand.scala new file mode 100644 index 000000000..920f40084 --- /dev/null +++ b/tests/disabled/macro/run/macro-repl-dontexpand.scala @@ -0,0 +1,11 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + override def extraSettings = "-language:experimental.macros" + def code = """ + |def bar1(c: scala.reflect.macros.blackbox.Context) = ??? + |def foo1 = macro bar1 + |def bar2(c: scala.reflect.macros.whitebox.Context) = ??? + |def foo2 = macro bar2 + |""".stripMargin +} diff --git a/tests/disabled/macro/run/macro-settings.check b/tests/disabled/macro/run/macro-settings.check new file mode 100644 index 000000000..050d53cdb --- /dev/null +++ b/tests/disabled/macro/run/macro-settings.check @@ -0,0 +1 @@ +List(hello=1) diff --git a/tests/disabled/macro/run/macro-settings.flags b/tests/disabled/macro/run/macro-settings.flags new file mode 100644 index 000000000..15479e30b --- /dev/null +++ b/tests/disabled/macro/run/macro-settings.flags @@ -0,0 +1 @@ +-language:experimental.macros -Xmacro-settings:hello=1 \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-settings/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-settings/Impls_Macros_1.scala new file mode 100644 index 000000000..851a98720 --- /dev/null +++ b/tests/disabled/macro/run/macro-settings/Impls_Macros_1.scala @@ -0,0 +1,14 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def impl(c: Context) = { + import c.universe._ + reify { + println(c.Expr[String](Literal(Constant(c.settings.toString))).splice) + } + } +} + +object Macros { + def foo = macro Impls.impl +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-settings/Test_2.scala b/tests/disabled/macro/run/macro-settings/Test_2.scala new file mode 100644 index 000000000..0fc472aa6 --- /dev/null +++ b/tests/disabled/macro/run/macro-settings/Test_2.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + Macros.foo +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-sip19-revised.check b/tests/disabled/macro/run/macro-sip19-revised.check new file mode 100644 index 000000000..86c3d819b --- /dev/null +++ b/tests/disabled/macro/run/macro-sip19-revised.check @@ -0,0 +1,5 @@ +hey, i've been called from SourceLocation1(null,Test_2.scala,11,251) +hey, i've been called from SourceLocation1(SourceLocation1(null,Test_2.scala,11,251),Test_2.scala,8,222) +hey, i've been called from SourceLocation1(SourceLocation1(SourceLocation1(null,Test_2.scala,11,251),Test_2.scala,8,222),Test_2.scala,8,222) +hey, i've been called from SourceLocation1(SourceLocation1(SourceLocation1(SourceLocation1(null,Test_2.scala,11,251),Test_2.scala,8,222),Test_2.scala,8,222),Test_2.scala,6,180) +2 diff --git a/tests/disabled/macro/run/macro-sip19-revised.flags b/tests/disabled/macro/run/macro-sip19-revised.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-sip19-revised.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-sip19-revised/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-sip19-revised/Impls_Macros_1.scala new file mode 100644 index 000000000..ded4d85cf --- /dev/null +++ b/tests/disabled/macro/run/macro-sip19-revised/Impls_Macros_1.scala @@ -0,0 +1,35 @@ +import scala.reflect.macros.whitebox.Context + +object Macros { + def impl(c: Context) = { + import c.universe._ + + val inscope = c.inferImplicitValue(c.mirror.staticClass("SourceLocation").toType) + val outer = c.Expr[SourceLocation](if (!inscope.isEmpty) inscope else Literal(Constant(null))) + + val Apply(fun, args) = c.enclosingImplicits(0).tree + val fileName = fun.pos.source.file.file.getName + val line = fun.pos.line + val charOffset = fun.pos.point + def literal[T](x: T) = c.Expr[T](Literal(Constant(x))) + c.universe.reify { SourceLocation1(outer.splice, literal(fileName).splice, literal(line).splice, literal(charOffset).splice) } + } + + implicit def sourceLocation: SourceLocation1 = macro impl +} + +trait SourceLocation { + /** Source location of the outermost call */ + val outer: SourceLocation + + /** The name of the source file */ + val fileName: String + + /** The line number */ + val line: Int + + /** The character offset */ + val charOffset: Int +} + +case class SourceLocation1(val outer: SourceLocation, val fileName: String, val line: Int, val charOffset: Int) extends SourceLocation \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-sip19-revised/Test_2.scala b/tests/disabled/macro/run/macro-sip19-revised/Test_2.scala new file mode 100644 index 000000000..483665ae4 --- /dev/null +++ b/tests/disabled/macro/run/macro-sip19-revised/Test_2.scala @@ -0,0 +1,12 @@ +import Macros._ + +object Test extends dotty.runtime.LegacyApp { + def foo(x: Int, y: Int)(implicit loc: SourceLocation): Int = { + println("hey, i've been called from %s".format(loc)) + if (x < y) foo(y, x) + else if (y == 0) x + else foo(x - y, y) + } + + println(foo(4, 2)) +} diff --git a/tests/disabled/macro/run/macro-sip19.check b/tests/disabled/macro/run/macro-sip19.check new file mode 100644 index 000000000..07cfd8c1e --- /dev/null +++ b/tests/disabled/macro/run/macro-sip19.check @@ -0,0 +1,5 @@ +hey, i've been called from SourceLocation(Test_2.scala,15,366) +hey, i've been called from SourceLocation(Test_2.scala,11,331) +hey, i've been called from SourceLocation(Test_2.scala,11,331) +hey, i've been called from SourceLocation(Test_2.scala,9,285) +2 diff --git a/tests/disabled/macro/run/macro-sip19.flags b/tests/disabled/macro/run/macro-sip19.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-sip19.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-sip19/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-sip19/Impls_Macros_1.scala new file mode 100644 index 000000000..f66ab7147 --- /dev/null +++ b/tests/disabled/macro/run/macro-sip19/Impls_Macros_1.scala @@ -0,0 +1,26 @@ +import scala.reflect.macros.whitebox.Context + +object Macros { + def impl(c: Context) = { + import c.universe._ + val Apply(fun, args) = c.enclosingImplicits(0).tree + val fileName = fun.pos.source.file.file.getName + val line = fun.pos.line + val charOffset = fun.pos.point + def literal[T](x: T) = c.Expr[T](Literal(Constant(x))) + c.universe.reify { SourceLocation(literal(fileName).splice, literal(line).splice, literal(charOffset).splice) } + } + + implicit def sourceLocation: SourceLocation = macro impl +} + +case class SourceLocation( + /** The name of the source file */ + val fileName: String, + + /** The line number */ + val line: Int, + + /** The character offset */ + val charOffset: Int +) \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-sip19/Test_2.scala b/tests/disabled/macro/run/macro-sip19/Test_2.scala new file mode 100644 index 000000000..0255f1381 --- /dev/null +++ b/tests/disabled/macro/run/macro-sip19/Test_2.scala @@ -0,0 +1,16 @@ +import Macros._ + +object Test extends dotty.runtime.LegacyApp { + def foo(x: Int, y: Int)(implicit loc0: SourceLocation): Int = { + var loc = loc0; + { + var loc0 = 0 // shadow loc0 to disambiguate with the implicit macro + println("hey, i've been called from %s".format(loc)) + if (x < y) foo(y, x) + else if (y == 0) x + else foo(x - y, y) + } + } + + println(foo(4, 2)) +} diff --git a/tests/disabled/macro/run/macro-subpatterns.check b/tests/disabled/macro/run/macro-subpatterns.check new file mode 100644 index 000000000..4997146cf --- /dev/null +++ b/tests/disabled/macro/run/macro-subpatterns.check @@ -0,0 +1,3 @@ +Some(List((a @ Extractor((b @ Extractor((c @ _))))))) +Some(List((b @ Extractor((c @ _))))) +Some(List((c @ _))) diff --git a/tests/disabled/macro/run/macro-subpatterns/Macro_1.scala b/tests/disabled/macro/run/macro-subpatterns/Macro_1.scala new file mode 100644 index 000000000..e009e411a --- /dev/null +++ b/tests/disabled/macro/run/macro-subpatterns/Macro_1.scala @@ -0,0 +1,17 @@ +import scala.reflect.macros.whitebox.Context +import language.experimental.macros + +object Extractor { + def unapply(x: Any): Any = macro unapplyImpl + def unapplyImpl(c: Context)(x: c.Tree) = { + import c.universe._ + import internal._ + q""" + new { + def isEmpty = false + def get = ${subpatterns(x).toString} + def unapply(x: Any) = this + }.unapply($x) + """ + } +} diff --git a/tests/disabled/macro/run/macro-subpatterns/Test_2.scala b/tests/disabled/macro/run/macro-subpatterns/Test_2.scala new file mode 100644 index 000000000..b19bd9b9b --- /dev/null +++ b/tests/disabled/macro/run/macro-subpatterns/Test_2.scala @@ -0,0 +1,5 @@ +object Test extends dotty.runtime.LegacyApp { + 42 match { + case Extractor(a @ Extractor(b @ Extractor(c))) => println(a); println(b); println(c) + } +} diff --git a/tests/disabled/macro/run/macro-system-properties.check b/tests/disabled/macro/run/macro-system-properties.check new file mode 100644 index 000000000..e2e2bd32b --- /dev/null +++ b/tests/disabled/macro/run/macro-system-properties.check @@ -0,0 +1,22 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> import scala.language.experimental._, scala.reflect.macros.blackbox.Context +import scala.language.experimental._ +import scala.reflect.macros.blackbox.Context + +scala> object GrabContext { + def lastContext = Option(System.getProperties.get("lastContext").asInstanceOf[reflect.macros.runtime.Context]) + // System.properties lets you stash true globals (unlike statics which are classloader scoped) + def impl(c: Context)() = { import c.universe._; System.getProperties.put("lastContext", c); c.Expr[Unit](q"()") } + def grab(): Unit = macro impl + } +defined object GrabContext + +scala> object Test { class C(implicit a: Any) { GrabContext.grab } } +defined object Test + +scala> object Test { class C(implicit a: Any) { GrabContext.grab } } +defined object Test + +scala> :quit diff --git a/tests/disabled/macro/run/macro-system-properties.scala b/tests/disabled/macro/run/macro-system-properties.scala new file mode 100644 index 000000000..db88eb7df --- /dev/null +++ b/tests/disabled/macro/run/macro-system-properties.scala @@ -0,0 +1,16 @@ +import scala.tools.nsc._ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ + import scala.language.experimental._, scala.reflect.macros.blackbox.Context + object GrabContext { + def lastContext = Option(System.getProperties.get("lastContext").asInstanceOf[reflect.macros.runtime.Context]) + // System.properties lets you stash true globals (unlike statics which are classloader scoped) + def impl(c: Context)() = { import c.universe._; System.getProperties.put("lastContext", c); c.Expr[Unit](q"()") } + def grab(): Unit = macro impl + } + object Test { class C(implicit a: Any) { GrabContext.grab } } + object Test { class C(implicit a: Any) { GrabContext.grab } } + """ +} diff --git a/tests/disabled/macro/run/macro-term-declared-in-annotation.check b/tests/disabled/macro/run/macro-term-declared-in-annotation.check new file mode 100644 index 000000000..7658ad2c2 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-annotation.check @@ -0,0 +1 @@ +it works diff --git a/tests/disabled/macro/run/macro-term-declared-in-annotation.flags b/tests/disabled/macro/run/macro-term-declared-in-annotation.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-annotation.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-annotation/Impls_1.scala b/tests/disabled/macro/run/macro-term-declared-in-annotation/Impls_1.scala new file mode 100644 index 000000000..c4bcfbc1b --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-annotation/Impls_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context) = { + import c.{prefix => prefix} + import c.universe._ + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + val body = Block(List(printPrefix), Literal(Constant("this is deprecated"))) + c.Expr[String](body) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-annotation/Macros_2.scala b/tests/disabled/macro/run/macro-term-declared-in-annotation/Macros_2.scala new file mode 100644 index 000000000..40d71c62f --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-annotation/Macros_2.scala @@ -0,0 +1,8 @@ +class foo(val bar: String) extends annotation.StaticAnnotation + +object Api { + // foo in ann must have a different name + // otherwise, we get bitten by https://issues.scala-lang.org/browse/SI-5544 + @foo({def fooInAnn = macro Impls.foo; fooInAnn}) + def foo = println("it works") +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-annotation/Test_3.scala b/tests/disabled/macro/run/macro-term-declared-in-annotation/Test_3.scala new file mode 100644 index 000000000..322ef9eb1 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-annotation/Test_3.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + Api.foo +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-anonymous.check b/tests/disabled/macro/run/macro-term-declared-in-anonymous.check new file mode 100644 index 000000000..09b8d015a --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-anonymous.check @@ -0,0 +1,2 @@ +prefix = Expr[Nothing](Test.this.macros) +it works diff --git a/tests/disabled/macro/run/macro-term-declared-in-anonymous.flags b/tests/disabled/macro/run/macro-term-declared-in-anonymous.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-anonymous.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-anonymous/Impls_1.scala b/tests/disabled/macro/run/macro-term-declared-in-anonymous/Impls_1.scala new file mode 100644 index 000000000..c43f5f3f5 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-anonymous/Impls_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context) = { + import c.{prefix => prefix} + import c.universe._ + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-anonymous/Macros_Test_2.scala b/tests/disabled/macro/run/macro-term-declared-in-anonymous/Macros_Test_2.scala new file mode 100644 index 000000000..894947e1e --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-anonymous/Macros_Test_2.scala @@ -0,0 +1,6 @@ +import scala.language.reflectiveCalls + +object Test extends dotty.runtime.LegacyApp { + val macros = new { def foo: Unit = macro Impls.foo } + macros.foo +} diff --git a/tests/disabled/macro/run/macro-term-declared-in-block.check b/tests/disabled/macro/run/macro-term-declared-in-block.check new file mode 100644 index 000000000..5e687db8b --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-block.check @@ -0,0 +1,2 @@ +prefix = Expr[Nothing]() +it works diff --git a/tests/disabled/macro/run/macro-term-declared-in-block.flags b/tests/disabled/macro/run/macro-term-declared-in-block.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-block.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-block/Impls_1.scala b/tests/disabled/macro/run/macro-term-declared-in-block/Impls_1.scala new file mode 100644 index 000000000..c43f5f3f5 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-block/Impls_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context) = { + import c.{prefix => prefix} + import c.universe._ + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-block/Macros_Test_2.scala b/tests/disabled/macro/run/macro-term-declared-in-block/Macros_Test_2.scala new file mode 100644 index 000000000..eba5e4961 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-block/Macros_Test_2.scala @@ -0,0 +1,6 @@ +object Test extends dotty.runtime.LegacyApp { + { + def foo: Unit = macro Impls.foo + foo + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-class-class.check b/tests/disabled/macro/run/macro-term-declared-in-class-class.check new file mode 100644 index 000000000..47248d7af --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-class-class.check @@ -0,0 +1,2 @@ +prefix = Expr[Nothing](new Test.this.outer.Macros()) +it works diff --git a/tests/disabled/macro/run/macro-term-declared-in-class-class.flags b/tests/disabled/macro/run/macro-term-declared-in-class-class.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-class-class.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-class-class/Impls_1.scala b/tests/disabled/macro/run/macro-term-declared-in-class-class/Impls_1.scala new file mode 100644 index 000000000..c43f5f3f5 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-class-class/Impls_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context) = { + import c.{prefix => prefix} + import c.universe._ + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-class-class/Macros_Test_2.scala b/tests/disabled/macro/run/macro-term-declared-in-class-class/Macros_Test_2.scala new file mode 100644 index 000000000..7f813a30d --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-class-class/Macros_Test_2.scala @@ -0,0 +1,10 @@ +class Macros { + class Macros { + def foo: Unit = macro Impls.foo + } +} + +object Test extends dotty.runtime.LegacyApp { + val outer = new Macros() + new outer.Macros().foo +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-class-object.check b/tests/disabled/macro/run/macro-term-declared-in-class-object.check new file mode 100644 index 000000000..35af59e40 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-class-object.check @@ -0,0 +1,2 @@ +prefix = Expr[Nothing](Test.this.outer.Macros) +it works diff --git a/tests/disabled/macro/run/macro-term-declared-in-class-object.flags b/tests/disabled/macro/run/macro-term-declared-in-class-object.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-class-object.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-class-object/Impls_1.scala b/tests/disabled/macro/run/macro-term-declared-in-class-object/Impls_1.scala new file mode 100644 index 000000000..c43f5f3f5 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-class-object/Impls_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context) = { + import c.{prefix => prefix} + import c.universe._ + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-class-object/Macros_Test_2.scala b/tests/disabled/macro/run/macro-term-declared-in-class-object/Macros_Test_2.scala new file mode 100644 index 000000000..12c6328c9 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-class-object/Macros_Test_2.scala @@ -0,0 +1,10 @@ +class Macros { + object Macros { + def foo: Unit = macro Impls.foo + } +} + +object Test extends dotty.runtime.LegacyApp { + val outer = new Macros() + outer.Macros.foo +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-class.check b/tests/disabled/macro/run/macro-term-declared-in-class.check new file mode 100644 index 000000000..a1c1d7af8 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-class.check @@ -0,0 +1,2 @@ +prefix = Expr[Nothing](new Macros()) +it works diff --git a/tests/disabled/macro/run/macro-term-declared-in-class.flags b/tests/disabled/macro/run/macro-term-declared-in-class.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-class.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-class/Impls_1.scala b/tests/disabled/macro/run/macro-term-declared-in-class/Impls_1.scala new file mode 100644 index 000000000..c43f5f3f5 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-class/Impls_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context) = { + import c.{prefix => prefix} + import c.universe._ + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-class/Macros_Test_2.scala b/tests/disabled/macro/run/macro-term-declared-in-class/Macros_Test_2.scala new file mode 100644 index 000000000..0c9a7ccf0 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-class/Macros_Test_2.scala @@ -0,0 +1,7 @@ +class Macros { + def foo: Unit = macro Impls.foo +} + +object Test extends dotty.runtime.LegacyApp { + new Macros().foo +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-default-param.check b/tests/disabled/macro/run/macro-term-declared-in-default-param.check new file mode 100644 index 000000000..6decd7aa4 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-default-param.check @@ -0,0 +1,5 @@ +prefix = Expr[Nothing]() +it works +it works +prefix = Expr[Nothing]() +it works diff --git a/tests/disabled/macro/run/macro-term-declared-in-default-param.flags b/tests/disabled/macro/run/macro-term-declared-in-default-param.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-default-param.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-default-param/Impls_1.scala b/tests/disabled/macro/run/macro-term-declared-in-default-param/Impls_1.scala new file mode 100644 index 000000000..ef0f13613 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-default-param/Impls_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context) = { + import c.{prefix => prefix} + import c.universe._ + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + val body = Block(List(printPrefix), Literal(Constant("it works"))) + c.Expr[String](body) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-default-param/Macros_Test_2.scala b/tests/disabled/macro/run/macro-term-declared-in-default-param/Macros_Test_2.scala new file mode 100644 index 000000000..856a4e44f --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-default-param/Macros_Test_2.scala @@ -0,0 +1,7 @@ +object Test extends dotty.runtime.LegacyApp { + def foo(bar: String = { def foo: String = macro Impls.foo; foo }) = println(bar) + + foo() + foo("it works") + foo() +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-implicit-class.check b/tests/disabled/macro/run/macro-term-declared-in-implicit-class.check new file mode 100644 index 000000000..5dc968c08 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-implicit-class.check @@ -0,0 +1,2 @@ +prefix = Expr[Nothing](Macros.foo("2")) +Some(2) diff --git a/tests/disabled/macro/run/macro-term-declared-in-implicit-class.flags b/tests/disabled/macro/run/macro-term-declared-in-implicit-class.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-implicit-class.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-implicit-class/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-term-declared-in-implicit-class/Impls_Macros_1.scala new file mode 100644 index 000000000..ef00f6ff3 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-implicit-class/Impls_Macros_1.scala @@ -0,0 +1,19 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def toOptionOfInt(c: Context) = { + import c.{prefix => prefix} + import c.universe._ + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + val body = Block(List(printPrefix), Apply(Ident(definitions.SomeModule), List(Select(Select(prefix.tree, TermName("x")), TermName("toInt"))))) + c.Expr[Option[Int]](body) + } +} + +object Macros { + implicit def foo(x: String): Foo = new Foo(x) + + class Foo(val x: String) { + def toOptionOfInt = macro Impls.toOptionOfInt + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-implicit-class/Test_2.scala b/tests/disabled/macro/run/macro-term-declared-in-implicit-class/Test_2.scala new file mode 100644 index 000000000..fd67062be --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-implicit-class/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + import Macros._ + println("2".toOptionOfInt) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-method.check b/tests/disabled/macro/run/macro-term-declared-in-method.check new file mode 100644 index 000000000..5e687db8b --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-method.check @@ -0,0 +1,2 @@ +prefix = Expr[Nothing]() +it works diff --git a/tests/disabled/macro/run/macro-term-declared-in-method.flags b/tests/disabled/macro/run/macro-term-declared-in-method.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-method.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-method/Impls_1.scala b/tests/disabled/macro/run/macro-term-declared-in-method/Impls_1.scala new file mode 100644 index 000000000..c43f5f3f5 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-method/Impls_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context) = { + import c.{prefix => prefix} + import c.universe._ + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-method/Macros_Test_2.scala b/tests/disabled/macro/run/macro-term-declared-in-method/Macros_Test_2.scala new file mode 100644 index 000000000..d40eb4c60 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-method/Macros_Test_2.scala @@ -0,0 +1,8 @@ +object Test extends dotty.runtime.LegacyApp { + def bar() = { + def foo: Unit = macro Impls.foo + foo + } + + bar() +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-object-class.check b/tests/disabled/macro/run/macro-term-declared-in-object-class.check new file mode 100644 index 000000000..47248d7af --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-object-class.check @@ -0,0 +1,2 @@ +prefix = Expr[Nothing](new Test.this.outer.Macros()) +it works diff --git a/tests/disabled/macro/run/macro-term-declared-in-object-class.flags b/tests/disabled/macro/run/macro-term-declared-in-object-class.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-object-class.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-object-class/Impls_1.scala b/tests/disabled/macro/run/macro-term-declared-in-object-class/Impls_1.scala new file mode 100644 index 000000000..c43f5f3f5 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-object-class/Impls_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context) = { + import c.{prefix => prefix} + import c.universe._ + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-object-class/Macros_Test_2.scala b/tests/disabled/macro/run/macro-term-declared-in-object-class/Macros_Test_2.scala new file mode 100644 index 000000000..89aed84c7 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-object-class/Macros_Test_2.scala @@ -0,0 +1,10 @@ +object Macros { + class Macros { + def foo: Unit = macro Impls.foo + } +} + +object Test extends dotty.runtime.LegacyApp { + val outer = Macros + new outer.Macros().foo +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-object-object.check b/tests/disabled/macro/run/macro-term-declared-in-object-object.check new file mode 100644 index 000000000..35af59e40 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-object-object.check @@ -0,0 +1,2 @@ +prefix = Expr[Nothing](Test.this.outer.Macros) +it works diff --git a/tests/disabled/macro/run/macro-term-declared-in-object-object.flags b/tests/disabled/macro/run/macro-term-declared-in-object-object.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-object-object.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-object-object/Impls_1.scala b/tests/disabled/macro/run/macro-term-declared-in-object-object/Impls_1.scala new file mode 100644 index 000000000..c43f5f3f5 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-object-object/Impls_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context) = { + import c.{prefix => prefix} + import c.universe._ + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-object-object/Macros_Test_2.scala b/tests/disabled/macro/run/macro-term-declared-in-object-object/Macros_Test_2.scala new file mode 100644 index 000000000..c5950fe61 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-object-object/Macros_Test_2.scala @@ -0,0 +1,10 @@ +object Macros { + object Macros { + def foo: Unit = macro Impls.foo + } +} + +object Test extends dotty.runtime.LegacyApp { + val outer = Macros + outer.Macros.foo +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-object.check b/tests/disabled/macro/run/macro-term-declared-in-object.check new file mode 100644 index 000000000..4d955a96b --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-object.check @@ -0,0 +1,2 @@ +prefix = Expr[Nothing](Macros) +it works diff --git a/tests/disabled/macro/run/macro-term-declared-in-object.flags b/tests/disabled/macro/run/macro-term-declared-in-object.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-object.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-object/Impls_1.scala b/tests/disabled/macro/run/macro-term-declared-in-object/Impls_1.scala new file mode 100644 index 000000000..c43f5f3f5 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-object/Impls_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context) = { + import c.{prefix => prefix} + import c.universe._ + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-object/Macros_Test_2.scala b/tests/disabled/macro/run/macro-term-declared-in-object/Macros_Test_2.scala new file mode 100644 index 000000000..f89a21d92 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-object/Macros_Test_2.scala @@ -0,0 +1,7 @@ +object Macros { + def foo: Unit = macro Impls.foo +} + +object Test extends dotty.runtime.LegacyApp { + Macros.foo +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-package-object.check b/tests/disabled/macro/run/macro-term-declared-in-package-object.check new file mode 100644 index 000000000..bc0069178 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-package-object.check @@ -0,0 +1,2 @@ +prefix = Expr[Nothing](Macros.`package`) +it works diff --git a/tests/disabled/macro/run/macro-term-declared-in-package-object.flags b/tests/disabled/macro/run/macro-term-declared-in-package-object.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-package-object.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-package-object/Impls_1.scala b/tests/disabled/macro/run/macro-term-declared-in-package-object/Impls_1.scala new file mode 100644 index 000000000..c43f5f3f5 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-package-object/Impls_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context) = { + import c.{prefix => prefix} + import c.universe._ + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-package-object/Macros_Test_2.scala b/tests/disabled/macro/run/macro-term-declared-in-package-object/Macros_Test_2.scala new file mode 100644 index 000000000..69f3803ba --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-package-object/Macros_Test_2.scala @@ -0,0 +1,8 @@ +package object Macros { + def foo: Unit = macro Impls.foo +} + +object Test extends dotty.runtime.LegacyApp { + import Macros._ + foo +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-refinement.check b/tests/disabled/macro/run/macro-term-declared-in-refinement.check new file mode 100644 index 000000000..09b8d015a --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-refinement.check @@ -0,0 +1,2 @@ +prefix = Expr[Nothing](Test.this.macros) +it works diff --git a/tests/disabled/macro/run/macro-term-declared-in-refinement.flags b/tests/disabled/macro/run/macro-term-declared-in-refinement.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-refinement.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-refinement/Impls_1.scala b/tests/disabled/macro/run/macro-term-declared-in-refinement/Impls_1.scala new file mode 100644 index 000000000..c43f5f3f5 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-refinement/Impls_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context) = { + import c.{prefix => prefix} + import c.universe._ + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-refinement/Macros_Test_2.scala b/tests/disabled/macro/run/macro-term-declared-in-refinement/Macros_Test_2.scala new file mode 100644 index 000000000..49192291e --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-refinement/Macros_Test_2.scala @@ -0,0 +1,8 @@ +import scala.language.reflectiveCalls + +class Base + +object Test extends dotty.runtime.LegacyApp { + val macros = new Base { def foo: Unit = macro Impls.foo } + macros.foo +} diff --git a/tests/disabled/macro/run/macro-term-declared-in-trait.check b/tests/disabled/macro/run/macro-term-declared-in-trait.check new file mode 100644 index 000000000..0f3756ddb --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-trait.check @@ -0,0 +1,15 @@ +prefix = Expr[Nothing]({ + final class $anon extends AnyRef with Base { + def (): <$anon: Base> = { + $anon.super.(); + () + }; + + }; + new $anon() +}) +it works +prefix = Expr[Nothing](Macros) +it works +prefix = Expr[Nothing](new Macros()) +it works diff --git a/tests/disabled/macro/run/macro-term-declared-in-trait.flags b/tests/disabled/macro/run/macro-term-declared-in-trait.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-trait.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-trait/Impls_1.scala b/tests/disabled/macro/run/macro-term-declared-in-trait/Impls_1.scala new file mode 100644 index 000000000..c43f5f3f5 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-trait/Impls_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context) = { + import c.{prefix => prefix} + import c.universe._ + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-term-declared-in-trait/Macros_Test_2.scala b/tests/disabled/macro/run/macro-term-declared-in-trait/Macros_Test_2.scala new file mode 100644 index 000000000..5780aba45 --- /dev/null +++ b/tests/disabled/macro/run/macro-term-declared-in-trait/Macros_Test_2.scala @@ -0,0 +1,13 @@ +trait Base { + def foo: Unit = macro Impls.foo +} + +object Macros extends Base + +class Macros extends Base + +object Test extends dotty.runtime.LegacyApp { + (new Base {}).foo + Macros.foo + new Macros().foo +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-typecheck-implicitsdisabled.check b/tests/disabled/macro/run/macro-typecheck-implicitsdisabled.check new file mode 100644 index 000000000..91d8fabd7 --- /dev/null +++ b/tests/disabled/macro/run/macro-typecheck-implicitsdisabled.check @@ -0,0 +1,2 @@ +scala.this.Predef.ArrowAssoc[Int](1).->[Int](2) +scala.reflect.macros.TypecheckException: value -> is not a member of Int diff --git a/tests/disabled/macro/run/macro-typecheck-implicitsdisabled.flags b/tests/disabled/macro/run/macro-typecheck-implicitsdisabled.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-typecheck-implicitsdisabled.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-typecheck-implicitsdisabled/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-typecheck-implicitsdisabled/Impls_Macros_1.scala new file mode 100644 index 000000000..956331cfa --- /dev/null +++ b/tests/disabled/macro/run/macro-typecheck-implicitsdisabled/Impls_Macros_1.scala @@ -0,0 +1,28 @@ +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl_with_implicits_enabled(c: Context) = { + import c.universe._ + + val tree1 = Apply(Select(Literal(Constant(1)), TermName("$minus$greater")), List(Literal(Constant(2)))) + val ttree1 = c.typecheck(tree1, withImplicitViewsDisabled = false) + c.Expr[String](Literal(Constant(ttree1.toString))) + } + + def foo_with_implicits_enabled = macro impl_with_implicits_enabled + + def impl_with_implicits_disabled(c: Context) = { + import c.universe._ + + try { + val tree2 = Apply(Select(Literal(Constant(1)), TermName("$minus$greater")), List(Literal(Constant(2)))) + val ttree2 = c.typecheck(tree2, withImplicitViewsDisabled = true) + c.Expr[String](Literal(Constant(ttree2.toString))) + } catch { + case ex: Throwable => + c.Expr[String](Literal(Constant(ex.toString))) + } + } + + def foo_with_implicits_disabled = macro impl_with_implicits_disabled +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-typecheck-implicitsdisabled/Test_2.scala b/tests/disabled/macro/run/macro-typecheck-implicitsdisabled/Test_2.scala new file mode 100644 index 000000000..87d3148e9 --- /dev/null +++ b/tests/disabled/macro/run/macro-typecheck-implicitsdisabled/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + println(Macros.foo_with_implicits_enabled) + println(Macros.foo_with_implicits_disabled) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-typecheck-macrosdisabled.check b/tests/disabled/macro/run/macro-typecheck-macrosdisabled.check new file mode 100644 index 000000000..c618d22d8 --- /dev/null +++ b/tests/disabled/macro/run/macro-typecheck-macrosdisabled.check @@ -0,0 +1,32 @@ +({ + val $u: reflect.runtime.universe.type = scala.reflect.runtime.`package`.universe; + val $m: $u.Mirror = scala.reflect.runtime.`package`.universe.runtimeMirror(this.getClass().getClassLoader()); + $u.Expr.apply[Int(2)]($m, { + final class $treecreator1 extends TreeCreator { + def (): $treecreator1 = { + $treecreator1.super.(); + () + }; + def apply[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Tree = { + val $u: U = $m$untyped.universe; + val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror]; + $u.Literal.apply($u.Constant.apply(2)) + } + }; + new $treecreator1() + })($u.TypeTag.apply[Int(2)]($m, { + final class $typecreator2 extends TypeCreator { + def (): $typecreator2 = { + $typecreator2.super.(); + () + }; + def apply[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Type = { + val $u: U = $m$untyped.universe; + val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror]; + $u.internal.reificationSupport.ConstantType($u.Constant.apply(2)) + } + }; + new $typecreator2() + })) +}: reflect.runtime.universe.Expr[Int]) +ru.reify[Int](2) diff --git a/tests/disabled/macro/run/macro-typecheck-macrosdisabled.flags b/tests/disabled/macro/run/macro-typecheck-macrosdisabled.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-typecheck-macrosdisabled.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-typecheck-macrosdisabled/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-typecheck-macrosdisabled/Impls_Macros_1.scala new file mode 100644 index 000000000..0e549f4ab --- /dev/null +++ b/tests/disabled/macro/run/macro-typecheck-macrosdisabled/Impls_Macros_1.scala @@ -0,0 +1,31 @@ +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl_with_macros_enabled(c: Context) = { + import c.universe._ + + val ru = Select(Select(Select(Select(Ident(TermName("scala")), TermName("reflect")), TermName("runtime")), TermName("package")), TermName("universe")) + val tree1 = Apply(Select(ru, TermName("reify")), List(Literal(Constant(2)))) + val ttree1 = c.typecheck(tree1, withMacrosDisabled = false) + c.Expr[String](Literal(Constant(ttree1.toString))) + } + + def foo_with_macros_enabled = macro impl_with_macros_enabled + + def impl_with_macros_disabled(c: Context) = { + import c.universe._ + import internal._ + + val rupkg = c.mirror.staticModule("scala.reflect.runtime.package") + val rusym = reificationSupport.selectTerm(rupkg, "universe") + val NullaryMethodType(rutpe) = rusym.info + val ru = reificationSupport.newFreeTerm("ru", scala.reflect.runtime.universe) + reificationSupport.setInfo(ru, rutpe) + + val tree2 = Apply(Select(Ident(ru), TermName("reify")), List(Literal(Constant(2)))) + val ttree2 = c.typecheck(tree2, withMacrosDisabled = true) + c.Expr[String](Literal(Constant(ttree2.toString))) + } + + def foo_with_macros_disabled = macro impl_with_macros_disabled +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-typecheck-macrosdisabled/Test_2.scala b/tests/disabled/macro/run/macro-typecheck-macrosdisabled/Test_2.scala new file mode 100644 index 000000000..887f28c8c --- /dev/null +++ b/tests/disabled/macro/run/macro-typecheck-macrosdisabled/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + println(Macros.foo_with_macros_enabled) + println(Macros.foo_with_macros_disabled) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-typecheck-macrosdisabled2.check b/tests/disabled/macro/run/macro-typecheck-macrosdisabled2.check new file mode 100644 index 000000000..2e862a608 --- /dev/null +++ b/tests/disabled/macro/run/macro-typecheck-macrosdisabled2.check @@ -0,0 +1,32 @@ +({ + val $u: reflect.runtime.universe.type = scala.reflect.runtime.`package`.universe; + val $m: $u.Mirror = scala.reflect.runtime.`package`.universe.runtimeMirror(this.getClass().getClassLoader()); + $u.Expr.apply[Array[Int]]($m, { + final class $treecreator1 extends TreeCreator { + def (): $treecreator1 = { + $treecreator1.super.(); + () + }; + def apply[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Tree = { + val $u: U = $m$untyped.universe; + val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror]; + $u.Apply.apply($u.Select.apply($u.internal.reificationSupport.mkIdent($m.staticModule("scala.Array")), $u.TermName.apply("apply")), scala.collection.immutable.List.apply[$u.Literal]($u.Literal.apply($u.Constant.apply(2)))) + } + }; + new $treecreator1() + })($u.TypeTag.apply[Array[Int]]($m, { + final class $typecreator2 extends TypeCreator { + def (): $typecreator2 = { + $typecreator2.super.(); + () + }; + def apply[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Type = { + val $u: U = $m$untyped.universe; + val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror]; + $u.internal.reificationSupport.TypeRef($u.internal.reificationSupport.ThisType($m.staticPackage("scala").asModule.moduleClass), $m.staticClass("scala.Array"), scala.collection.immutable.List.apply[$u.Type]($m.staticClass("scala.Int").asType.toTypeConstructor)) + } + }; + new $typecreator2() + })) +}: reflect.runtime.universe.Expr[Array[Int]]) +ru.reify[Array[Int]](scala.Array.apply(2)) diff --git a/tests/disabled/macro/run/macro-typecheck-macrosdisabled2.flags b/tests/disabled/macro/run/macro-typecheck-macrosdisabled2.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-typecheck-macrosdisabled2.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-typecheck-macrosdisabled2/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-typecheck-macrosdisabled2/Impls_Macros_1.scala new file mode 100644 index 000000000..f99f5d2f8 --- /dev/null +++ b/tests/disabled/macro/run/macro-typecheck-macrosdisabled2/Impls_Macros_1.scala @@ -0,0 +1,31 @@ +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl_with_macros_enabled(c: Context) = { + import c.universe._ + + val ru = Select(Select(Select(Select(Ident(TermName("scala")), TermName("reflect")), TermName("runtime")), TermName("package")), TermName("universe")) + val tree1 = Apply(Select(ru, TermName("reify")), List(Apply(Select(Ident(TermName("scala")), TermName("Array")), List(Literal(Constant(2)))))) + val ttree1 = c.typecheck(tree1, withMacrosDisabled = false) + c.Expr[String](Literal(Constant(ttree1.toString))) + } + + def foo_with_macros_enabled = macro impl_with_macros_enabled + + def impl_with_macros_disabled(c: Context) = { + import c.universe._ + import internal._ + + val rupkg = c.mirror.staticModule("scala.reflect.runtime.package") + val rusym = reificationSupport.selectTerm(rupkg, "universe") + val NullaryMethodType(rutpe) = rusym.info + val ru = reificationSupport.newFreeTerm("ru", scala.reflect.runtime.universe) + reificationSupport.setInfo(ru, rutpe) + + val tree2 = Apply(Select(Ident(ru), TermName("reify")), List(Apply(Select(Ident(TermName("scala")), TermName("Array")), List(Literal(Constant(2)))))) + val ttree2 = c.typecheck(tree2, withMacrosDisabled = true) + c.Expr[String](Literal(Constant(ttree2.toString))) + } + + def foo_with_macros_disabled = macro impl_with_macros_disabled +} diff --git a/tests/disabled/macro/run/macro-typecheck-macrosdisabled2/Test_2.scala b/tests/disabled/macro/run/macro-typecheck-macrosdisabled2/Test_2.scala new file mode 100644 index 000000000..887f28c8c --- /dev/null +++ b/tests/disabled/macro/run/macro-typecheck-macrosdisabled2/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + println(Macros.foo_with_macros_enabled) + println(Macros.foo_with_macros_disabled) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-undetparams-consfromsls.check b/tests/disabled/macro/run/macro-undetparams-consfromsls.check new file mode 100644 index 000000000..3fee58d9c --- /dev/null +++ b/tests/disabled/macro/run/macro-undetparams-consfromsls.check @@ -0,0 +1,5 @@ +A = WeakTypeTag[Int] +B = WeakTypeTag[Nothing] +List(1) +A = WeakTypeTag[Any] +List(abc, 1) diff --git a/tests/disabled/macro/run/macro-undetparams-consfromsls.flags b/tests/disabled/macro/run/macro-undetparams-consfromsls.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-undetparams-consfromsls.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-undetparams-consfromsls/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-undetparams-consfromsls/Impls_Macros_1.scala new file mode 100644 index 000000000..5df5f96aa --- /dev/null +++ b/tests/disabled/macro/run/macro-undetparams-consfromsls/Impls_Macros_1.scala @@ -0,0 +1,24 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.macros.blackbox.Context + +object Macros { + def cons_impl[A: c.WeakTypeTag](c: Context)(x: c.Expr[A], xs: c.Expr[List[A]]): c.Expr[List[A]] = { + import c.universe._ + reify { + println("A = " + c.Expr[String](Literal(Constant(implicitly[c.WeakTypeTag[A]].toString))).splice) + x.splice :: xs.splice + } + } + + def nil_impl[B: c.WeakTypeTag](c: Context): c.Expr[List[B]] = { + import c.universe._ + reify { + println("B = " + c.Expr[String](Literal(Constant(implicitly[c.WeakTypeTag[B]].toString))).splice) + Nil + } + } + + def cons[A](x: A, xs: List[A]): List[A] = macro cons_impl[A] + + def nil[B]: List[B] = macro nil_impl[B] +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-undetparams-consfromsls/Test_2.scala b/tests/disabled/macro/run/macro-undetparams-consfromsls/Test_2.scala new file mode 100644 index 000000000..338684401 --- /dev/null +++ b/tests/disabled/macro/run/macro-undetparams-consfromsls/Test_2.scala @@ -0,0 +1,7 @@ +object Test extends dotty.runtime.LegacyApp { + import Macros._ + val xs = cons(1, nil) + println(xs) + val ys = cons("abc", xs) + println(ys) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-undetparams-macroitself.check b/tests/disabled/macro/run/macro-undetparams-macroitself.check new file mode 100644 index 000000000..a9bf55423 --- /dev/null +++ b/tests/disabled/macro/run/macro-undetparams-macroitself.check @@ -0,0 +1,2 @@ +WeakTypeTag[Int] +WeakTypeTag[String] diff --git a/tests/disabled/macro/run/macro-undetparams-macroitself.flags b/tests/disabled/macro/run/macro-undetparams-macroitself.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/macro-undetparams-macroitself.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-undetparams-macroitself/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-undetparams-macroitself/Impls_Macros_1.scala new file mode 100644 index 000000000..1eb257e1d --- /dev/null +++ b/tests/disabled/macro/run/macro-undetparams-macroitself/Impls_Macros_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl[T: c.WeakTypeTag](c: Context)(foo: c.Expr[T]): c.Expr[Unit] = { + import c.universe._ + reify { println(c.Expr[String](Literal(Constant(implicitly[c.WeakTypeTag[T]].toString))).splice) } + } + + def foo[T](foo: T) = macro impl[T] +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-undetparams-macroitself/Test_2.scala b/tests/disabled/macro/run/macro-undetparams-macroitself/Test_2.scala new file mode 100644 index 000000000..c315f3508 --- /dev/null +++ b/tests/disabled/macro/run/macro-undetparams-macroitself/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + Macros.foo(42) + Macros.foo("42") +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-vampire-false-warning.check b/tests/disabled/macro/run/macro-vampire-false-warning.check new file mode 100644 index 000000000..4792e70f3 --- /dev/null +++ b/tests/disabled/macro/run/macro-vampire-false-warning.check @@ -0,0 +1,2 @@ +2 +3 diff --git a/tests/disabled/macro/run/macro-vampire-false-warning.flags b/tests/disabled/macro/run/macro-vampire-false-warning.flags new file mode 100644 index 000000000..e8fb65d50 --- /dev/null +++ b/tests/disabled/macro/run/macro-vampire-false-warning.flags @@ -0,0 +1 @@ +-Xfatal-warnings \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-vampire-false-warning/Macros_1.scala b/tests/disabled/macro/run/macro-vampire-false-warning/Macros_1.scala new file mode 100644 index 000000000..63c34b3ab --- /dev/null +++ b/tests/disabled/macro/run/macro-vampire-false-warning/Macros_1.scala @@ -0,0 +1,52 @@ +// As per http://meta.plasm.us/posts/2013/08/31/feeding-our-vampires/ + +import scala.annotation.StaticAnnotation +import scala.reflect.macros.whitebox.Context +import scala.language.experimental.macros + +class body(tree: Any) extends StaticAnnotation + +object Macros { + def selFieldImpl(c: Context) = { + import c.universe._ + val field = c.macroApplication.symbol + val bodyAnn = field.annotations.filter(_.tree.tpe <:< typeOf[body]).head + c.Expr[Any](bodyAnn.tree.children(1)) + } + + def mkObjectImpl(c: Context)(xs: c.Expr[Any]*) = { + import c.universe._ + import Flag._ + // val kvps = xs.toList map { case q"${_}(${Literal(Constant(name: String))}).->[${_}]($value)" => name -> value } + val kvps = xs.map(_.tree).toList map { case Apply(TypeApply(Select(Apply(_, List(Literal(Constant(name: String)))), _), _), List(value)) => name -> value } + // val fields = kvps map { case (k, v) => q"@body($v) def ${TermName(k)} = macro Macros.selFieldImpl" } + val fields = kvps map { case (k, v) => DefDef( + Modifiers(MACRO, typeNames.EMPTY, List(Apply(Select(New(Ident(TypeName("body"))), termNames.CONSTRUCTOR), List(v)))), + TermName(k), Nil, Nil, Ident(TypeName("Any")), Select(Ident(TermName("Macros")), TermName("selFieldImpl"))) } + // q"import scala.language.experimental.macros; class Workaround { ..$fields }; new Workaround{}" + c.Expr[Any](Block( + List( + Import(Select(Select(Ident(TermName("scala")), TermName("language")), TermName("experimental")), List(ImportSelector(TermName("macros"), 51, TermName("macros"), 51))), + ClassDef( + NoMods, TypeName("Workaround"), Nil, + Template( + List(Select(Ident(TermName("scala")), TypeName("AnyRef"))), noSelfType, + DefDef( + NoMods, termNames.CONSTRUCTOR, Nil, List(Nil), TypeTree(), + Block(List(Apply(Select(Super(This(typeNames.EMPTY), typeNames.EMPTY), termNames.CONSTRUCTOR), List())), Literal(Constant(())))) + +: fields)), + ClassDef( + Modifiers(FINAL), TypeName("$anon"), Nil, + Template( + List(Ident(TypeName("Workaround"))), noSelfType, + List( + DefDef( + NoMods, termNames.CONSTRUCTOR, Nil, List(Nil), TypeTree(), + Block(List(Apply(Select(Super(This(typeNames.EMPTY), typeNames.EMPTY), termNames.CONSTRUCTOR), List())), Literal(Constant(())))))))), + Apply(Select(New(Ident(TypeName("$anon"))), termNames.CONSTRUCTOR), List()))) + } +} + +object mkObject { + def apply(xs: Any*): Any = macro Macros.mkObjectImpl +} diff --git a/tests/disabled/macro/run/macro-vampire-false-warning/Test_2.scala b/tests/disabled/macro/run/macro-vampire-false-warning/Test_2.scala new file mode 100644 index 000000000..d28849b88 --- /dev/null +++ b/tests/disabled/macro/run/macro-vampire-false-warning/Test_2.scala @@ -0,0 +1,6 @@ +object Test extends dotty.runtime.LegacyApp { + val foo = mkObject("x" -> "2", "y" -> 3) + println(foo.x) + println(foo.y) + // println(foo.z) => will result in a compilation error +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-whitebox-dynamic-materialization.check b/tests/disabled/macro/run/macro-whitebox-dynamic-materialization.check new file mode 100644 index 000000000..ccec8e5b2 --- /dev/null +++ b/tests/disabled/macro/run/macro-whitebox-dynamic-materialization.check @@ -0,0 +1,2 @@ +null +C2 diff --git a/tests/disabled/macro/run/macro-whitebox-dynamic-materialization/Macros_1.scala b/tests/disabled/macro/run/macro-whitebox-dynamic-materialization/Macros_1.scala new file mode 100644 index 000000000..aaf27c289 --- /dev/null +++ b/tests/disabled/macro/run/macro-whitebox-dynamic-materialization/Macros_1.scala @@ -0,0 +1,25 @@ +import scala.reflect.macros.whitebox.Context +import scala.language.experimental.macros + +trait Foo[T] + +class C1(val x: Int) +class C2(val x: String) + +trait LowPriority { + implicit def lessSpecific[T]: Foo[T] = null +} + +object Foo extends LowPriority { + implicit def moreSpecific[T]: Foo[T] = macro Macros.impl[T] +} + +object Macros { + def impl[T: c.WeakTypeTag](c: Context) = { + import c.universe._ + val tpe = weakTypeOf[T] + if (tpe.members.exists(_.info =:= typeOf[Int])) + c.abort(c.enclosingPosition, "I don't like classes that contain integers") + q"new Foo[$tpe]{ override def toString = ${tpe.toString} }" + } +} diff --git a/tests/disabled/macro/run/macro-whitebox-dynamic-materialization/Test_2.scala b/tests/disabled/macro/run/macro-whitebox-dynamic-materialization/Test_2.scala new file mode 100644 index 000000000..10d89dd3c --- /dev/null +++ b/tests/disabled/macro/run/macro-whitebox-dynamic-materialization/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + println(implicitly[Foo[C1]]) + println(implicitly[Foo[C2]]) +} diff --git a/tests/disabled/macro/run/macro-whitebox-extractor.check b/tests/disabled/macro/run/macro-whitebox-extractor.check new file mode 100644 index 000000000..d81cc0710 --- /dev/null +++ b/tests/disabled/macro/run/macro-whitebox-extractor.check @@ -0,0 +1 @@ +42 diff --git a/tests/disabled/macro/run/macro-whitebox-extractor/Macros_1.scala b/tests/disabled/macro/run/macro-whitebox-extractor/Macros_1.scala new file mode 100644 index 000000000..d394c0241 --- /dev/null +++ b/tests/disabled/macro/run/macro-whitebox-extractor/Macros_1.scala @@ -0,0 +1,21 @@ +import scala.reflect.macros.whitebox.Context +import language.experimental.macros + +object Extractor { + def unapply(x: Int): Any = macro Macros.unapplyImpl +} + +object Macros { + def unapplyImpl(c: Context)(x: c.Tree) = { + import c.universe._ + q""" + new { + class Match(x: Int) { + def isEmpty = false + def get = x + } + def unapply(x: Int) = new Match(x) + }.unapply($x) + """ + } +} diff --git a/tests/disabled/macro/run/macro-whitebox-extractor/Test_2.scala b/tests/disabled/macro/run/macro-whitebox-extractor/Test_2.scala new file mode 100644 index 000000000..7c354ecd6 --- /dev/null +++ b/tests/disabled/macro/run/macro-whitebox-extractor/Test_2.scala @@ -0,0 +1,5 @@ +object Test extends dotty.runtime.LegacyApp { + 42 match { + case Extractor(x) => println(x) + } +} diff --git a/tests/disabled/macro/run/macro-whitebox-fundep-materialization.check b/tests/disabled/macro/run/macro-whitebox-fundep-materialization.check new file mode 100644 index 000000000..bed742910 --- /dev/null +++ b/tests/disabled/macro/run/macro-whitebox-fundep-materialization.check @@ -0,0 +1 @@ +(23,foo,true) diff --git a/tests/disabled/macro/run/macro-whitebox-fundep-materialization/Macros_1.scala b/tests/disabled/macro/run/macro-whitebox-fundep-materialization/Macros_1.scala new file mode 100644 index 000000000..5e89e6b2f --- /dev/null +++ b/tests/disabled/macro/run/macro-whitebox-fundep-materialization/Macros_1.scala @@ -0,0 +1,39 @@ +import scala.language.experimental.macros +import scala.reflect.macros.whitebox.Context + +trait Iso[T, U] { + def to(t : T) : U + // def from(u : U) : T +} + +object Iso { + implicit def materializeIso[T, U]: Iso[T, U] = macro impl[T, U] + def impl[T: c.WeakTypeTag, U: c.WeakTypeTag](c: Context): c.Expr[Iso[T, U]] = { + import c.universe._ + import definitions._ + import Flag._ + + val sym = c.weakTypeOf[T].typeSymbol + if (!sym.isClass || !sym.asClass.isCaseClass) c.abort(c.enclosingPosition, s"$sym is not a case class") + val fields = sym.info.decls.toList.collect{ case x: TermSymbol if x.isVal && x.isCaseAccessor => x } + + def mkTpt() = { + val core = Ident(TupleClass(fields.length) orElse UnitClass) + if (fields.length == 0) core + else AppliedTypeTree(core, fields map (f => TypeTree(f.info))) + } + + def mkFrom() = { + if (fields.length == 0) Literal(Constant(Unit)) + else Apply(Ident(newTermName("Tuple" + fields.length)), fields map (f => Select(Ident(newTermName("f")), newTermName(f.name.toString.trim)))) + } + + val evidenceClass = ClassDef(Modifiers(FINAL), newTypeName("$anon"), List(), Template( + List(AppliedTypeTree(Ident(newTypeName("Iso")), List(Ident(sym), mkTpt()))), + emptyValDef, + List( + DefDef(Modifiers(), termNames.CONSTRUCTOR, List(), List(List()), TypeTree(), Block(List(Apply(Select(Super(This(typeNames.EMPTY), typeNames.EMPTY), termNames.CONSTRUCTOR), List())), Literal(Constant(())))), + DefDef(Modifiers(), newTermName("to"), List(), List(List(ValDef(Modifiers(PARAM), newTermName("f"), Ident(sym), EmptyTree))), TypeTree(), mkFrom())))) + c.Expr[Iso[T, U]](Block(List(evidenceClass), Apply(Select(New(Ident(newTypeName("$anon"))), termNames.CONSTRUCTOR), List()))) + } +} diff --git a/tests/disabled/macro/run/macro-whitebox-fundep-materialization/Test_2.scala b/tests/disabled/macro/run/macro-whitebox-fundep-materialization/Test_2.scala new file mode 100644 index 000000000..72183ba86 --- /dev/null +++ b/tests/disabled/macro/run/macro-whitebox-fundep-materialization/Test_2.scala @@ -0,0 +1,12 @@ +// see the comments for macroExpand.onDelayed for an explanation of what's tested here +object Test extends dotty.runtime.LegacyApp { + case class Foo(i: Int, s: String, b: Boolean) + def foo[C, L](c: C)(implicit iso: Iso[C, L]): L = iso.to(c) + + { + val equiv = foo(Foo(23, "foo", true)) + def typed[T](t: => T) {} + typed[(Int, String, Boolean)](equiv) + println(equiv) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-whitebox-structural.check b/tests/disabled/macro/run/macro-whitebox-structural.check new file mode 100644 index 000000000..0cfbf0888 --- /dev/null +++ b/tests/disabled/macro/run/macro-whitebox-structural.check @@ -0,0 +1 @@ +2 diff --git a/tests/disabled/macro/run/macro-whitebox-structural/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-whitebox-structural/Impls_Macros_1.scala new file mode 100644 index 000000000..45fdb79c3 --- /dev/null +++ b/tests/disabled/macro/run/macro-whitebox-structural/Impls_Macros_1.scala @@ -0,0 +1,16 @@ +import scala.reflect.macros.whitebox.Context +import scala.language.experimental.macros + +object Macros { + def impl(c: Context) = { + import c.universe._ + q""" + trait Foo { + def x = 2 + } + new Foo {} + """ + } + + def foo: Any = macro impl +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macro-whitebox-structural/Test_2.scala b/tests/disabled/macro/run/macro-whitebox-structural/Test_2.scala new file mode 100644 index 000000000..6fa47e1dd --- /dev/null +++ b/tests/disabled/macro/run/macro-whitebox-structural/Test_2.scala @@ -0,0 +1,5 @@ +import Macros._ + +object Test extends dotty.runtime.LegacyApp { + println(Macros.foo.x) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macroPlugins-isBlackbox/Macros_2.scala b/tests/disabled/macro/run/macroPlugins-isBlackbox/Macros_2.scala new file mode 100644 index 000000000..a90dd702d --- /dev/null +++ b/tests/disabled/macro/run/macroPlugins-isBlackbox/Macros_2.scala @@ -0,0 +1,11 @@ +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl(c: Context) = { + import c.universe._ + q"42" + } + + def foo: Any = macro impl +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macroPlugins-isBlackbox/Plugin_1.scala b/tests/disabled/macro/run/macroPlugins-isBlackbox/Plugin_1.scala new file mode 100644 index 000000000..b78a18ea6 --- /dev/null +++ b/tests/disabled/macro/run/macroPlugins-isBlackbox/Plugin_1.scala @@ -0,0 +1,21 @@ +package isblackbox + +import scala.tools.nsc.Global +import scala.tools.nsc.plugins.{Plugin => NscPlugin} + +class Plugin(val global: Global) extends NscPlugin { + import global._ + import analyzer._ + import scala.reflect.internal.Mode + + val name = "isBlackbox" + val description = "A sample analyzer plugin that overrides isBlackbox." + val components = Nil + addMacroPlugin(MacroPlugin) + + object MacroPlugin extends MacroPlugin { + override def pluginsIsBlackbox(macroDef: Symbol): Option[Boolean] = { + Some(false) + } + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macroPlugins-isBlackbox/Test_3.flags b/tests/disabled/macro/run/macroPlugins-isBlackbox/Test_3.flags new file mode 100644 index 000000000..966df731d --- /dev/null +++ b/tests/disabled/macro/run/macroPlugins-isBlackbox/Test_3.flags @@ -0,0 +1 @@ +-Xplugin:. \ No newline at end of file diff --git a/tests/disabled/macro/run/macroPlugins-isBlackbox/Test_3.scala b/tests/disabled/macro/run/macroPlugins-isBlackbox/Test_3.scala new file mode 100644 index 000000000..f191e5de3 --- /dev/null +++ b/tests/disabled/macro/run/macroPlugins-isBlackbox/Test_3.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + val x: Int = Macros.foo +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macroPlugins-isBlackbox/scalac-plugin.xml b/tests/disabled/macro/run/macroPlugins-isBlackbox/scalac-plugin.xml new file mode 100644 index 000000000..09b9c1464 --- /dev/null +++ b/tests/disabled/macro/run/macroPlugins-isBlackbox/scalac-plugin.xml @@ -0,0 +1,4 @@ + + is-blackbox + isblackbox.Plugin + \ No newline at end of file diff --git a/tests/disabled/macro/run/macroPlugins-macroArgs.check b/tests/disabled/macro/run/macroPlugins-macroArgs.check new file mode 100644 index 000000000..a68f8069b --- /dev/null +++ b/tests/disabled/macro/run/macroPlugins-macroArgs.check @@ -0,0 +1,2 @@ +hijacked 1 +hijacked 2 diff --git a/tests/disabled/macro/run/macroPlugins-macroArgs/Macros_2.scala b/tests/disabled/macro/run/macroPlugins-macroArgs/Macros_2.scala new file mode 100644 index 000000000..b19b8f18d --- /dev/null +++ b/tests/disabled/macro/run/macroPlugins-macroArgs/Macros_2.scala @@ -0,0 +1,11 @@ +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl(c: Context)(arg: c.Tree) = { + import c.universe._ + q"""println($arg)""" + } + + def foo(arg: String): Unit = macro impl +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macroPlugins-macroArgs/Plugin_1.scala b/tests/disabled/macro/run/macroPlugins-macroArgs/Plugin_1.scala new file mode 100644 index 000000000..23e80ced3 --- /dev/null +++ b/tests/disabled/macro/run/macroPlugins-macroArgs/Plugin_1.scala @@ -0,0 +1,21 @@ +package macroArgs + +import scala.tools.nsc.Global +import scala.tools.nsc.plugins.{Plugin => NscPlugin} + +class Plugin(val global: Global) extends NscPlugin { + import global._ + import analyzer._ + + val name = "macroArgs" + val description = "A sample analyzer plugin that overrides macroArgs." + val components = Nil + addMacroPlugin(MacroPlugin) + + object MacroPlugin extends MacroPlugin { + override def pluginsMacroArgs(typer: Typer, expandee: Tree): Option[MacroArgs] = { + val MacroArgs(c, List(Literal(Constant(s: String)))) = standardMacroArgs(typer, expandee) + Some(MacroArgs(c, List(Literal(Constant("hijacked " + s))))) + } + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macroPlugins-macroArgs/Test_3.flags b/tests/disabled/macro/run/macroPlugins-macroArgs/Test_3.flags new file mode 100644 index 000000000..966df731d --- /dev/null +++ b/tests/disabled/macro/run/macroPlugins-macroArgs/Test_3.flags @@ -0,0 +1 @@ +-Xplugin:. \ No newline at end of file diff --git a/tests/disabled/macro/run/macroPlugins-macroArgs/Test_3.scala b/tests/disabled/macro/run/macroPlugins-macroArgs/Test_3.scala new file mode 100644 index 000000000..8d3be78bb --- /dev/null +++ b/tests/disabled/macro/run/macroPlugins-macroArgs/Test_3.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + Macros.foo("1") + Macros.foo("2") +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macroPlugins-macroArgs/scalac-plugin.xml b/tests/disabled/macro/run/macroPlugins-macroArgs/scalac-plugin.xml new file mode 100644 index 000000000..0849f0f4e --- /dev/null +++ b/tests/disabled/macro/run/macroPlugins-macroArgs/scalac-plugin.xml @@ -0,0 +1,4 @@ + + macro-args + macroArgs.Plugin + \ No newline at end of file diff --git a/tests/disabled/macro/run/macroPlugins-macroExpand.check b/tests/disabled/macro/run/macroPlugins-macroExpand.check new file mode 100644 index 000000000..6f685c2af --- /dev/null +++ b/tests/disabled/macro/run/macroPlugins-macroExpand.check @@ -0,0 +1,2 @@ +expanded into println("impl1") +expanded into println("impl2") diff --git a/tests/disabled/macro/run/macroPlugins-macroExpand.flags b/tests/disabled/macro/run/macroPlugins-macroExpand.flags new file mode 100644 index 000000000..ea7fc37e1 --- /dev/null +++ b/tests/disabled/macro/run/macroPlugins-macroExpand.flags @@ -0,0 +1 @@ +-Yrangepos:false diff --git a/tests/disabled/macro/run/macroPlugins-macroExpand/Macros_2.scala b/tests/disabled/macro/run/macroPlugins-macroExpand/Macros_2.scala new file mode 100644 index 000000000..c9c88ad2f --- /dev/null +++ b/tests/disabled/macro/run/macroPlugins-macroExpand/Macros_2.scala @@ -0,0 +1,18 @@ +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl1(c: Context) = { + import c.universe._ + q"""println("impl1")""" + } + + def impl2(c: Context) = { + import c.universe._ + q"""println("impl2")""" + } + + def foo1: Unit = macro impl1 + + def foo2: Unit = macro impl2 +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macroPlugins-macroExpand/Plugin_1.scala b/tests/disabled/macro/run/macroPlugins-macroExpand/Plugin_1.scala new file mode 100644 index 000000000..13df85cb2 --- /dev/null +++ b/tests/disabled/macro/run/macroPlugins-macroExpand/Plugin_1.scala @@ -0,0 +1,27 @@ +package macroExpand + +import scala.tools.nsc.Global +import scala.tools.nsc.plugins.{Plugin => NscPlugin} + +class Plugin(val global: Global) extends NscPlugin { + import global._ + import analyzer._ + import scala.reflect.internal.Mode + + val name = "macroExpand" + val description = "A sample analyzer plugin that overrides macroExpand." + val components = Nil + addMacroPlugin(MacroPlugin) + + object MacroPlugin extends MacroPlugin { + override def pluginsMacroExpand(typer: Typer, expandee: Tree, mode: Mode, pt: Type): Option[Tree] = { + object expander extends DefMacroExpander(typer, expandee, mode, pt) { + override def onSuccess(expanded: Tree) = { + val message = s"expanded into ${expanded.toString}" + typer.typed(q"println($message)") + } + } + Some(expander(expandee)) + } + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macroPlugins-macroExpand/Test_3.flags b/tests/disabled/macro/run/macroPlugins-macroExpand/Test_3.flags new file mode 100644 index 000000000..966df731d --- /dev/null +++ b/tests/disabled/macro/run/macroPlugins-macroExpand/Test_3.flags @@ -0,0 +1 @@ +-Xplugin:. \ No newline at end of file diff --git a/tests/disabled/macro/run/macroPlugins-macroExpand/Test_3.scala b/tests/disabled/macro/run/macroPlugins-macroExpand/Test_3.scala new file mode 100644 index 000000000..a730821f2 --- /dev/null +++ b/tests/disabled/macro/run/macroPlugins-macroExpand/Test_3.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + Macros.foo1 + Macros.foo2 +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macroPlugins-macroExpand/scalac-plugin.xml b/tests/disabled/macro/run/macroPlugins-macroExpand/scalac-plugin.xml new file mode 100644 index 000000000..860150865 --- /dev/null +++ b/tests/disabled/macro/run/macroPlugins-macroExpand/scalac-plugin.xml @@ -0,0 +1,4 @@ + + macro-expand + macroExpand.Plugin + \ No newline at end of file diff --git a/tests/disabled/macro/run/macroPlugins-macroRuntime.check b/tests/disabled/macro/run/macroPlugins-macroRuntime.check new file mode 100644 index 000000000..af16d1ac3 --- /dev/null +++ b/tests/disabled/macro/run/macroPlugins-macroRuntime.check @@ -0,0 +1,2 @@ +hijacked +hijacked diff --git a/tests/disabled/macro/run/macroPlugins-macroRuntime/Macros_2.scala b/tests/disabled/macro/run/macroPlugins-macroRuntime/Macros_2.scala new file mode 100644 index 000000000..b19b8f18d --- /dev/null +++ b/tests/disabled/macro/run/macroPlugins-macroRuntime/Macros_2.scala @@ -0,0 +1,11 @@ +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl(c: Context)(arg: c.Tree) = { + import c.universe._ + q"""println($arg)""" + } + + def foo(arg: String): Unit = macro impl +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macroPlugins-macroRuntime/Plugin_1.scala b/tests/disabled/macro/run/macroPlugins-macroRuntime/Plugin_1.scala new file mode 100644 index 000000000..a55adadb4 --- /dev/null +++ b/tests/disabled/macro/run/macroPlugins-macroRuntime/Plugin_1.scala @@ -0,0 +1,20 @@ +package macroRuntime + +import scala.tools.nsc.Global +import scala.tools.nsc.plugins.{Plugin => NscPlugin} + +class Plugin(val global: Global) extends NscPlugin { + import global._ + import analyzer._ + + val name = "macroRuntime" + val description = "A sample analyzer plugin that overrides macroRuntime." + val components = Nil + addMacroPlugin(MacroPlugin) + + object MacroPlugin extends MacroPlugin { + override def pluginsMacroRuntime(expandee: Tree): Option[MacroRuntime] = Some({ + case MacroArgs(_, List(msg)) => q"""println("hijacked")""" + }) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macroPlugins-macroRuntime/Test_3.flags b/tests/disabled/macro/run/macroPlugins-macroRuntime/Test_3.flags new file mode 100644 index 000000000..966df731d --- /dev/null +++ b/tests/disabled/macro/run/macroPlugins-macroRuntime/Test_3.flags @@ -0,0 +1 @@ +-Xplugin:. \ No newline at end of file diff --git a/tests/disabled/macro/run/macroPlugins-macroRuntime/Test_3.scala b/tests/disabled/macro/run/macroPlugins-macroRuntime/Test_3.scala new file mode 100644 index 000000000..8d3be78bb --- /dev/null +++ b/tests/disabled/macro/run/macroPlugins-macroRuntime/Test_3.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + Macros.foo("1") + Macros.foo("2") +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macroPlugins-macroRuntime/scalac-plugin.xml b/tests/disabled/macro/run/macroPlugins-macroRuntime/scalac-plugin.xml new file mode 100644 index 000000000..8001af105 --- /dev/null +++ b/tests/disabled/macro/run/macroPlugins-macroRuntime/scalac-plugin.xml @@ -0,0 +1,4 @@ + + macro-runtime + macroRuntime.Plugin + \ No newline at end of file diff --git a/tests/disabled/macro/run/macroPlugins-namerHooks.check b/tests/disabled/macro/run/macroPlugins-namerHooks.check new file mode 100644 index 000000000..c2db5935d --- /dev/null +++ b/tests/disabled/macro/run/macroPlugins-namerHooks.check @@ -0,0 +1,45 @@ +enterSym(package { case class C extends scala.Product with scala.Serializable { val x: Int = _; val y: Int = _; def (x: Int, y: Int) = { super.(); () } } }) +enterSym(case class C extends scala.Product with scala.Serializable { val x: Int = _; val y: Int = _; def (x: Int, y: Int) = { super.(); () } }) +ensureCompanionObject(case class C extends scala.Product with scala.Serializable { val x: Int = _; val y: Int = _; def (x: Int, y: Int) = { super.(); () } }, ...) +enterSym( object C extends runtime.this.AbstractFunction2[Int, Int, C] { def () = { super.(); () }; final override def toString() = "C" }) +enterStat(case class C extends scala.Product with scala.Serializable { val x: Int = _; val y: Int = _; def (x: Int, y: Int) = { super.(); () } }) +enterSym( val x: Int = _) +enterSym( val y: Int = _) +enterSym(def (x: Int, y: Int) = { super.(); () }) +enterSym( def copy(x = x, y = y) = new C(x, y)) +enterStat( private[this] val x: Int = _) +enterStat( private[this] val y: Int = _) +enterStat(def (x: Int, y: Int) = { super.(); () }) +enterSym( private[this] val x: Int = _) +enterSym( private[this] val y: Int = _) +enterSym(def (x: Int, y: Int) = { super.(); () }) +enterSym(super.()) +enterStat(super.()) +enterSym( def copy$default$1 = x) +enterSym( def copy$default$2 = y) +enterSym( var acc: Int = -889275714) +enterSym(acc = Statics.this.mix(acc, x)) +enterSym(acc = Statics.this.mix(acc, y)) +enterStat( var acc: Int = -889275714) +enterStat(acc = Statics.this.mix(acc, x)) +enterStat(acc = Statics.this.mix(acc, y)) +enterSym( val C$1: C = x$1.asInstanceOf[C]) +enterStat( val C$1: C = x$1.asInstanceOf[C]) +enterSym(def () = { super.(); () }) +enterSym(final override def toString() = "C") +enterSym(case def apply(x: Int, y: Int): C = new C(x, y)) +enterSym(case def unapply(x$0: C) = if (x$0.==(null)) scala.this.None else Some(scala.Tuple2(x$0.x, x$0.y))) +enterStat(def () = { super.(); () }) +enterStat(final override def toString() = "C") +enterSym(def () = { super.(); () }) +enterSym(final override def toString() = "C") +enterSym(super.()) +enterStat(super.()) +enterSym(case val x1: Int = x$1) +enterStat(case val x1: Int = x$1) +enterSym(case val x1: Any = x$1) +enterSym(case5(){ if (x1.isInstanceOf[C]) matchEnd4(true) else case6() }) +enterSym(case6(){ matchEnd4(false) }) +enterStat(case val x1: Any = x$1) +enterStat(case5(){ if (x1.isInstanceOf[C]) matchEnd4(true) else case6() }) +enterStat(case6(){ matchEnd4(false) }) diff --git a/tests/disabled/macro/run/macroPlugins-namerHooks.scala b/tests/disabled/macro/run/macroPlugins-namerHooks.scala new file mode 100644 index 000000000..302429b19 --- /dev/null +++ b/tests/disabled/macro/run/macroPlugins-namerHooks.scala @@ -0,0 +1,39 @@ +import scala.tools.partest._ +import scala.tools.nsc._ + +object Test extends DirectTest { + override def extraSettings: String = "-usejavacp" + + def code = """ + case class C(x: Int, y: Int) + """.trim + + def show() { + val global = newCompiler() + import global._ + import analyzer._ + + val output = collection.mutable.ListBuffer[String]() + def log(what: String) = output += what.replace(String.format("%n"), " ") + + object macroPlugin extends MacroPlugin { + override def pluginsEnterSym(namer: Namer, tree: Tree): Boolean = { + log(s"enterSym($tree)") + namer.standardEnterSym(tree) + true + } + override def pluginsEnsureCompanionObject(namer: Namer, cdef: ClassDef, creator: ClassDef => Tree = companionModuleDef(_)): Option[Symbol] = { + log(s"ensureCompanionObject($cdef, ...)") + Some(namer.standardEnsureCompanionObject(cdef, creator)) + } + override def pluginsEnterStats(typer: Typer, stats: List[Tree]): List[Tree] = { + stats.foreach(stat => log(s"enterStat($stat)")) + stats + } + } + + addMacroPlugin(macroPlugin) + compileString(global)(code) + println(output.mkString("\n")) + } +} diff --git a/tests/disabled/macro/run/macroPlugins-typedMacroBody.check b/tests/disabled/macro/run/macroPlugins-typedMacroBody.check new file mode 100644 index 000000000..b6f843618 --- /dev/null +++ b/tests/disabled/macro/run/macroPlugins-typedMacroBody.check @@ -0,0 +1,2 @@ +impl1 +impl2 diff --git a/tests/disabled/macro/run/macroPlugins-typedMacroBody.flags b/tests/disabled/macro/run/macroPlugins-typedMacroBody.flags new file mode 100644 index 000000000..ea7fc37e1 --- /dev/null +++ b/tests/disabled/macro/run/macroPlugins-typedMacroBody.flags @@ -0,0 +1 @@ +-Yrangepos:false diff --git a/tests/disabled/macro/run/macroPlugins-typedMacroBody/Macros_2.flags b/tests/disabled/macro/run/macroPlugins-typedMacroBody/Macros_2.flags new file mode 100644 index 000000000..966df731d --- /dev/null +++ b/tests/disabled/macro/run/macroPlugins-typedMacroBody/Macros_2.flags @@ -0,0 +1 @@ +-Xplugin:. \ No newline at end of file diff --git a/tests/disabled/macro/run/macroPlugins-typedMacroBody/Macros_2.scala b/tests/disabled/macro/run/macroPlugins-typedMacroBody/Macros_2.scala new file mode 100644 index 000000000..80acfec65 --- /dev/null +++ b/tests/disabled/macro/run/macroPlugins-typedMacroBody/Macros_2.scala @@ -0,0 +1,18 @@ +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl1(c: Context) = { + import c.universe._ + q"""println("impl1")""" + } + + def impl2(c: Context) = { + import c.universe._ + q"""println("impl2")""" + } + + def foo1: Unit = macro 1 + + def foo2: Unit = macro 2 +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macroPlugins-typedMacroBody/Plugin_1.scala b/tests/disabled/macro/run/macroPlugins-typedMacroBody/Plugin_1.scala new file mode 100644 index 000000000..e99cf7f75 --- /dev/null +++ b/tests/disabled/macro/run/macroPlugins-typedMacroBody/Plugin_1.scala @@ -0,0 +1,21 @@ +package typedMacroBody + +import scala.tools.nsc.Global +import scala.tools.nsc.plugins.{Plugin => NscPlugin} + +class Plugin(val global: Global) extends NscPlugin { + import global._ + import analyzer._ + + val name = "typedMacroBody" + val description = "A sample analyzer plugin that overrides typedMacroBody." + val components = Nil + addMacroPlugin(MacroPlugin) + + object MacroPlugin extends MacroPlugin { + override def pluginsTypedMacroBody(typer: Typer, ddef: DefDef): Option[Tree] = { + val DefDef(_, _, _, _, _, Literal(Constant(num: Int))) = ddef + Some(standardTypedMacroBody(typer, copyDefDef(ddef)(rhs = Ident(TermName("impl" + num))))) + } + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macroPlugins-typedMacroBody/Test_3.scala b/tests/disabled/macro/run/macroPlugins-typedMacroBody/Test_3.scala new file mode 100644 index 000000000..a730821f2 --- /dev/null +++ b/tests/disabled/macro/run/macroPlugins-typedMacroBody/Test_3.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + Macros.foo1 + Macros.foo2 +} \ No newline at end of file diff --git a/tests/disabled/macro/run/macroPlugins-typedMacroBody/scalac-plugin.xml b/tests/disabled/macro/run/macroPlugins-typedMacroBody/scalac-plugin.xml new file mode 100644 index 000000000..e223fa5dc --- /dev/null +++ b/tests/disabled/macro/run/macroPlugins-typedMacroBody/scalac-plugin.xml @@ -0,0 +1,4 @@ + + typed-macro-body + typedMacroBody.Plugin + \ No newline at end of file diff --git a/tests/disabled/macro/run/reflection-magicsymbols-invoke.check b/tests/disabled/macro/run/reflection-magicsymbols-invoke.check new file mode 100644 index 000000000..f580296ae --- /dev/null +++ b/tests/disabled/macro/run/reflection-magicsymbols-invoke.check @@ -0,0 +1,119 @@ +============ +Any +it's important to print the list of Any's members +if some of them change (possibly, adding and/or removing magic symbols), we must update this test +method !=: (x$1: Any)Boolean +method ##: ()Int +method ==: (x$1: Any)Boolean +method asInstanceOf: [T0]=> T0 +method equals: (x$1: Any)Boolean +method getClass: ()java.lang.Class[_] +method hashCode: ()Int +method isInstanceOf: [T0]=> Boolean +method toString: ()java.lang.String +testing Any.!=: false +testing Any.##: 50 +testing Any.==: true +testing Any.asInstanceOf: class scala.ScalaReflectionException: Any.asInstanceOf requires a type argument, it cannot be invoked with mirrors +testing Any.asInstanceOf: class scala.ScalaReflectionException: final def asInstanceOf[T0]: T0 takes 0 arguments +testing Any.equals: true +testing Any.getClass: class java.lang.String +testing Any.hashCode: 50 +testing Any.isInstanceOf: class scala.ScalaReflectionException: Any.isInstanceOf requires a type argument, it cannot be invoked with mirrors +testing Any.isInstanceOf: class scala.ScalaReflectionException: final def isInstanceOf[T0]: Boolean takes 0 arguments +testing Any.toString: 2 +============ +AnyVal +it's important to print the list of AnyVal's members +if some of them change (possibly, adding and/or removing magic symbols), we must update this test +constructor AnyVal: ()AnyVal +method getClass: ()Class[_ <: AnyVal] +testing AnyVal.: class scala.ScalaReflectionException: unsupported symbol constructor AnyVal when invoking bytecodeless method mirror for def (): AnyVal (bound to null) +testing AnyVal.getClass: class scala.ScalaReflectionException: expected a member of class Integer, you provided method scala.AnyVal.getClass +============ +AnyRef +it's important to print the list of AnyRef's members +if some of them change (possibly, adding and/or removing magic symbols), we must update this test +constructor Object: ()java.lang.Object +method !=: (x$1: Any)Boolean +method ##: ()Int +method $asInstanceOf: [T0]()T0 +method $isInstanceOf: [T0]()Boolean +method ==: (x$1: Any)Boolean +method asInstanceOf: [T0]=> T0 +method clone: ()java.lang.Object +method eq: (x$1: AnyRef)Boolean +method equals: (x$1: Any)Boolean +method finalize: ()Unit +method getClass: ()java.lang.Class[_] +method hashCode: ()Int +method isInstanceOf: [T0]=> Boolean +method ne: (x$1: AnyRef)Boolean +method notify: ()Unit +method notifyAll: ()Unit +method synchronized: [T0](x$1: T0)T0 +method toString: ()java.lang.String +method wait: ()Unit +method wait: (x$1: Long)Unit +method wait: (x$1: Long, x$2: Int)Unit +testing Object.!=: false +testing Object.##: 50 +testing Object.$asInstanceOf: class scala.ScalaReflectionException: AnyRef.$asInstanceOf is an internal method, it cannot be invoked with mirrors +testing Object.$asInstanceOf: class scala.ScalaReflectionException: final def $asInstanceOf[T0](): T0 takes 0 arguments +testing Object.$isInstanceOf: class scala.ScalaReflectionException: AnyRef.$isInstanceOf is an internal method, it cannot be invoked with mirrors +testing Object.$isInstanceOf: class scala.ScalaReflectionException: final def $isInstanceOf[T0](): Boolean takes 0 arguments +testing Object.==: true +testing Object.clone: class java.lang.CloneNotSupportedException: java.lang.String +testing Object.eq: true +testing Object.equals: true +testing Object.finalize: () +testing Object.getClass: class java.lang.String +testing Object.hashCode: 50 +testing Object.ne: false +testing Object.notify: class java.lang.IllegalMonitorStateException: null +testing Object.notifyAll: class java.lang.IllegalMonitorStateException: null +testing Object.synchronized: 2 +testing Object.toString: 2 +TODO: also test AnyRef.wait overloads +============ +Array +it's important to print the list of Array's members +if some of them change (possibly, adding and/or removing magic symbols), we must update this test +constructor Array: (_length: Int)Array[T] +method !=: (x$1: Any)Boolean +method ##: ()Int +method $asInstanceOf: [T0]()T0 +method $isInstanceOf: [T0]()Boolean +method ==: (x$1: Any)Boolean +method apply: (i: Int)T +method asInstanceOf: [T0]=> T0 +method clone: ()Array[T] +method eq: (x$1: AnyRef)Boolean +method equals: (x$1: Any)Boolean +method finalize: ()Unit +method getClass: ()java.lang.Class[_] +method hashCode: ()Int +method isInstanceOf: [T0]=> Boolean +method length: => Int +method ne: (x$1: AnyRef)Boolean +method notify: ()Unit +method notifyAll: ()Unit +method synchronized: [T0](x$1: T0)T0 +method toString: ()java.lang.String +method update: (i: Int, x: T)Unit +method wait: ()Unit +method wait: (x$1: Long)Unit +method wait: (x$1: Long, x$2: Int)Unit +value _length: Int +testing Array.length: 2 +testing Array.apply: 1 +testing Array.update: () +testing Array.clone: List(1, 2) +============ +Other +testing String.+: 23 +============ +CTM +testing Predef.classOf: class scala.ScalaReflectionException: Predef.classOf is a compile-time function, it cannot be invoked with mirrors +testing Predef.classOf: class scala.ScalaReflectionException: def classOf[T]: Class[T] takes 0 arguments +testing Universe.reify: class scala.ScalaReflectionException: scala.reflect.api.Universe.reify is a macro, i.e. a compile-time function, it cannot be invoked with mirrors diff --git a/tests/disabled/macro/run/reflection-magicsymbols-invoke.scala b/tests/disabled/macro/run/reflection-magicsymbols-invoke.scala new file mode 100644 index 000000000..bbcf8f524 --- /dev/null +++ b/tests/disabled/macro/run/reflection-magicsymbols-invoke.scala @@ -0,0 +1,100 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.universe.definitions._ +import scala.reflect.runtime.{currentMirror => cm} + +package scala { + object ExceptionUtils { + def unwrapThrowable(ex: Throwable): Throwable = scala.reflect.runtime.ReflectionUtils.unwrapThrowable(ex) + } +} + +object Test extends dotty.runtime.LegacyApp { + def key(sym: Symbol) = sym + ": " + sym.info + def test(tpe: Type, receiver: Any, method: String, args: Any*): Unit = { + def wrap[T](op: => T) = + try { + var result = op.asInstanceOf[AnyRef] + if (scala.runtime.ScalaRunTime.isArray(result)) + result = scala.runtime.ScalaRunTime.toObjectArray(result).toList + println(result) + } catch { + case ex: Throwable => + val realex = scala.ExceptionUtils.unwrapThrowable(ex) + println(realex.getClass + ": " + realex.getMessage) + } + print(s"testing ${tpe.typeSymbol.name}.$method: ") + wrap({ + if (method == termNames.CONSTRUCTOR.toString) { + val ctor = tpe.decl(termNames.CONSTRUCTOR).asMethod + cm.reflectClass(ctor.owner.asClass).reflectConstructor(ctor)(args: _*) + } else { + val meth = tpe.decl(TermName(method).encodedName.toTermName).asMethod + cm.reflect(receiver).reflectMethod(meth)(args: _*) + } + }) + } + + println("============\nAny") + println("it's important to print the list of Any's members") + println("if some of them change (possibly, adding and/or removing magic symbols), we must update this test") + typeOf[Any].members.toList.sortBy(key).foreach(sym => println(key(sym))) + test(typeOf[Any], "2", "!=", "2") + test(typeOf[Any], "2", "##") + test(typeOf[Any], "2", "==", "2") + test(typeOf[Any], "2", "asInstanceOf") + test(typeOf[Any], "2", "asInstanceOf", typeOf[String]) + test(typeOf[Any], "2", "equals", "2") + test(typeOf[Any], "2", "getClass") + test(typeOf[Any], "2", "hashCode") + test(typeOf[Any], "2", "isInstanceOf") + test(typeOf[Any], "2", "isInstanceOf", typeOf[String]) + test(typeOf[Any], "2", "toString") + + println("============\nAnyVal") + println("it's important to print the list of AnyVal's members") + println("if some of them change (possibly, adding and/or removing magic symbols), we must update this test") + typeOf[AnyVal].decls.toList.sortBy(key).foreach(sym => println(key(sym))) + test(typeOf[AnyVal], null, termNames.CONSTRUCTOR.toString) + test(typeOf[AnyVal], 2, "getClass") + + println("============\nAnyRef") + println("it's important to print the list of AnyRef's members") + println("if some of them change (possibly, adding and/or removing magic symbols), we must update this test") + typeOf[AnyRef].members.toList.sortBy(key).foreach(sym => println(key(sym))) + test(typeOf[AnyRef], "2", "!=", "2") + test(typeOf[AnyRef], "2", "##") + test(typeOf[AnyRef], "2", "$asInstanceOf") + test(typeOf[AnyRef], "2", "$asInstanceOf", typeOf[String]) + test(typeOf[AnyRef], "2", "$isInstanceOf") + test(typeOf[AnyRef], "2", "$isInstanceOf", typeOf[String]) + test(typeOf[AnyRef], "2", "==", "2") + test(typeOf[AnyRef], "2", "clone") + test(typeOf[AnyRef], "2", "eq", "2") + test(typeOf[AnyRef], "2", "equals", "2") + test(typeOf[AnyRef], "2", "finalize") + test(typeOf[AnyRef], "2", "getClass") + test(typeOf[AnyRef], "2", "hashCode") + test(typeOf[AnyRef], "2", "ne", "2") + test(typeOf[AnyRef], "2", "notify") + test(typeOf[AnyRef], "2", "notifyAll") + test(typeOf[AnyRef], "2", "synchronized", "2") + test(typeOf[AnyRef], "2", "toString") + println("TODO: also test AnyRef.wait overloads") + + println("============\nArray") + println("it's important to print the list of Array's members") + println("if some of them change (possibly, adding and/or removing magic symbols), we must update this test") + ArrayClass.info.members.toList.sortBy(key).foreach(sym => println(key(sym))) + test(ArrayClass.info, Array(1, 2), "length") + test(ArrayClass.info, Array(1, 2), "apply", 0) + test(ArrayClass.info, Array(1, 2), "update", 0, 0) + test(ArrayClass.info, Array(1, 2), "clone") + + println("============\nOther") + test(typeOf[String], "2", "+", 3) + + println("============\nCTM") + test(PredefModule.moduleClass.info, Predef, "classOf") + test(PredefModule.moduleClass.info, Predef, "classOf", typeOf[String]) + test(typeOf[scala.reflect.api.Universe], scala.reflect.runtime.universe, "reify", "2") +} diff --git a/tests/disabled/macro/run/reify-each-node-type.check b/tests/disabled/macro/run/reify-each-node-type.check new file mode 100644 index 000000000..afc65add7 --- /dev/null +++ b/tests/disabled/macro/run/reify-each-node-type.check @@ -0,0 +1,35 @@ + 1 s Ident + 2 r.List Select + 3 r.List.apply() Apply + 4 r.List.apply(1) Literal + 5 r.List.apply[Int]() TypeApply + 6 (1: Int) Typed + 7 (null: r.List[Int]) AppliedTypeTree + 8 { (); () } Block + 9 { val x: Int = 0; () } ValDef +10 { val x = 0; () } TypeTree +11 if (true) () else () If +12 { def f: Unit = (); () } DefDef +13 { def m = NN.super.q; () } Super +14 { abstract trait A extends AnyRef; () } ClassDef Template +15 { def f(x: Any): Unit = (); () } EmptyTree +16 (null: r.D with r.E) CompoundTypeTree +17 { type T = Int; () } TypeDef +18 { type CC[T <: r.D] = r.C[T]; () } TypeBoundsTree +19 try { 0 } finally Predef.println("") Try +20 ((x: Int) => x) Function +21 { var v = 1; v = 2 } Assign +22 { class A extends AnyRef { def () = { super.(); This +23 new r.List[Int]() New +24 0: @unchecked Annotated +25 (null: r.Outer#Inner) SelectFromTypeTree +26 (null: Nil.type) SingletonTypeTree +27 (null: T forSome { type T }) ExistentialTypeTree +28 { import r.{A, B=>C}; () } Import +29 { def f: Int = return 0; () } Return +30 { object x extends AnyRef { def () = { super.(); ModuleDef +31 throw new Exception() Throw +32 0 match { case _ => 0 } Match CaseDef +33 0 match { case (1| 2) => 0 } Alternative +34 NN.q match { case (x @ r.List) => 0 } Bind +35 NN.q match { case r.UnSeq(1, (_)*) => 0 } Star diff --git a/tests/disabled/macro/run/reify-each-node-type.scala b/tests/disabled/macro/run/reify-each-node-type.scala new file mode 100644 index 000000000..43d32e59d --- /dev/null +++ b/tests/disabled/macro/run/reify-each-node-type.scala @@ -0,0 +1,110 @@ + +import scala.language.{ existentials, postfixOps } +import scala.reflect.runtime.universe._ + +object r { + class A + class B + class List[+A] + object List { def apply[A](xs: A*): List[A] = new List[A] } + object Nil extends List[Nothing] + + trait OuterP[A] { + trait Inner + trait InnerP[B] + } + trait Outer { + trait Inner + trait InnerP[B] + } + object Un { def unapply(x: Any) = Some(5) } + object UnSeq { def unapplySeq(x: Any) = Some(Seq(5)) } + class C[T] + class D + trait E + + trait SN { + def q: Any = null + } +} + +object s { + import r._ + + trait NN extends SN { + def act[T](expr: Expr[T]): Unit + + act(reify { s /* Ident */ }) + act(reify { r.List /* Select */ }) + act(reify { List() /* Apply */ }) + act(reify { List(1) /* Literal */ }) + act(reify { List[Int]() /* TypeApply */ }) + act(reify { 1: Int /* Typed */ }) + act(reify { null: List[Int] /* AppliedTypeTree */ }) + act(reify { () ; () /* Block */ }) + act(reify { val x: Int = 0 /* ValDef */ }) + act(reify { val x = 0 /* TypeTree */ }) + act(reify { if (true) () /* If */ }) + act(reify { def f: Unit = { } /* DefDef */ }) + act(reify { def m = super.q /* Super */ }) + act(reify { trait A /* ClassDef Template */ }) + act(reify { def f(x: Any): Unit = { } /* EmptyTree */ }) + act(reify { null: D with E /* CompoundTypeTree */ }) + act(reify { type T = Int /* TypeDef */ }) + act(reify { type CC[T <: D] = C[T] /* TypeBoundsTree */ }) + act(reify { try 0 finally println("") /* Try */ }) + act(reify { (x: Int) => x /* Function */ }) + act(reify { var v = 1 ; v = 2 /* Assign */ }) + act(reify { class A() { def this(x: A) = this() } /* This */ }) + act(reify { new List[Int] /* New */ }) + act(reify { 0: @unchecked /* Annotated */ }) + act(reify { null: Outer#Inner /* SelectFromTypeTree */ }) + act(reify { null: Nil.type /* SingletonTypeTree */ }) + act(reify { null: (T forSome { type T }) /* ExistentialTypeTree */ }) + act(reify { import r.{ A, B => C }; /* Import */ }) + act(reify { def f: Int = return 0 /* Return */ }) + act(reify { object x /* ModuleDef */ }) + act(reify { throw new java.lang.Exception /* Throw */ }) + act(reify { 0 match { case _ => 0 } /* Match CaseDef */ }) + act(reify { 0 match { case 1 | 2 => 0 } /* Alternative */ }) + act(reify { q match { case x @ List => 0 } /* Bind */ }) + act(reify { q match { case UnSeq(1, _*) => 0 } /* Star */ }) + + // ``unexpected: bound type that doesn't have a tpe: Ident(newTypeName("Int"))'' + // act(reify { r.List[T forSome { type T <: Int }]() }) // Was crashing , no longer + // + // error: exception during macro expansion: + // scala.MatchError: collection.this.Seq.unapplySeq[A] (of class scala.reflect.internal.Trees$TypeApply) + // at scala.reflect.reify.phases.Reshape$$anon$1.extractExtractor$1(Reshape.scala:73) + // at scala.reflect.reify.phases.Reshape$$anon$1.transform(Reshape.scala:82) + // at scala.reflect.reify.phases.Reshape$$anon$1.transform(Reshape.scala:24) + // at scala.reflect.internal.Trees$class.itransform(Trees.scala:1290) + // + // act(reify { r.List[Any]() match { case Seq(1, _*) => 1 } } ) + + // act(reify { List[OuterP[Int]#InnerP[Byte]]() }) + // + // SI-7243 + // + // test/files/run/reify-each-node-type.scala:85: error: Cannot materialize r.List.apply[r.OuterP[Int]#InnerP[Byte]]() as { ... } because: + // scala.reflect.macros.TypecheckException: value TypeTreeWithDeferredRefCheck is not a member of type parameter U + // act(reify { List[OuterP[Int]#InnerP[Byte]]() }) + // ^ + // one error found + } +} + +object Test { + var idx = 0 + val seen = scala.collection.mutable.Set[String]() + + object N extends s.NN { + def act[T](expr: Expr[T]): Unit = { + idx += 1 + val ts = expr.tree filter (_ => true) map (_.getClass.getName split "[.$]" last) filterNot seen distinct; + println("%2d %60s %s".format(idx, expr.tree.toString.replaceAll("""\s+""", " ").take(60), ts mkString " ")) + seen ++= ts + } + } + def main(args: Array[String]): Unit = N +} diff --git a/tests/disabled/macro/run/reify-repl-fail-gracefully.check b/tests/disabled/macro/run/reify-repl-fail-gracefully.check new file mode 100644 index 000000000..c9e69744d --- /dev/null +++ b/tests/disabled/macro/run/reify-repl-fail-gracefully.check @@ -0,0 +1,17 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> import language.experimental.macros +import language.experimental.macros + +scala> import scala.reflect.runtime.universe._ +import scala.reflect.runtime.universe._ + +scala> + +scala> reify +:12: error: too few argument lists for macro invocation + reify + ^ + +scala> :quit diff --git a/tests/disabled/macro/run/reify-repl-fail-gracefully.scala b/tests/disabled/macro/run/reify-repl-fail-gracefully.scala new file mode 100644 index 000000000..ed6d6cb6c --- /dev/null +++ b/tests/disabled/macro/run/reify-repl-fail-gracefully.scala @@ -0,0 +1,10 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ + |import language.experimental.macros + |import scala.reflect.runtime.universe._ + | + |reify + """.stripMargin +} diff --git a/tests/disabled/macro/run/reify-staticXXX.check b/tests/disabled/macro/run/reify-staticXXX.check new file mode 100644 index 000000000..37102b29e --- /dev/null +++ b/tests/disabled/macro/run/reify-staticXXX.check @@ -0,0 +1,24 @@ +object +object +class +class +object > object +object > object +object > class +object > class +package > object +package > object +package > class +package > class +object +object +class +class +object > object +object > object +object > class +object > class +package > object +package > object +package > class +package > class diff --git a/tests/disabled/macro/run/reify-staticXXX.scala b/tests/disabled/macro/run/reify-staticXXX.scala new file mode 100644 index 000000000..cfbd756ec --- /dev/null +++ b/tests/disabled/macro/run/reify-staticXXX.scala @@ -0,0 +1,56 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object B { override def toString = "object" } +class C { override def toString = "class" } + +package foo1 { + object B { override def toString = "package > object" } + class C { override def toString = "package > class" } +} + +object Foo2 { + object B { override def toString = "object > object" } + class C { override def toString = "object > class" } +} + +object packageless { + def test = { + println(B) + println(reify(B).eval) + println(new C) + println(reify(new C).eval) + println(Foo2.B) + println(reify(Foo2.B).eval) + println(new Foo2.C) + println(reify(new Foo2.C).eval) + println(_root_.foo1.B) + println(reify(_root_.foo1.B).eval) + println(new _root_.foo1.C) + println(reify(new _root_.foo1.C).eval) + } +} + +package packageful { + object Test { + def test = { + println(B) + println(reify(B).eval) + println(new C) + println(reify(new C).eval) + println(Foo2.B) + println(reify(Foo2.B).eval) + println(new Foo2.C) + println(reify(new Foo2.C).eval) + println(_root_.foo1.B) + println(reify(_root_.foo1.B).eval) + println(new _root_.foo1.C) + println(reify(new _root_.foo1.C).eval) + } + } +} + +object Test extends dotty.runtime.LegacyApp { + packageless.test + packageful.Test.test +} diff --git a/tests/disabled/macro/run/reify_ann1a.check b/tests/disabled/macro/run/reify_ann1a.check new file mode 100644 index 000000000..71841ff83 --- /dev/null +++ b/tests/disabled/macro/run/reify_ann1a.check @@ -0,0 +1,30 @@ +{ + @new ann(List.apply("1a")) @new ann(List.apply("1b")) class C[@new ann(List.apply("2a")) @new ann(List.apply("2b")) T] extends AnyRef { + @new ann(List.apply("3a")) @new ann(List.apply("3b")) private[this] val x: T @ann(List.apply("4a")) @ann(List.apply("4b")) = _; + def (@new ann(List.apply("3a")) @new ann(List.apply("3b")) x: T @ann(List.apply("4a")) @ann(List.apply("4b"))) = { + super.(); + () + }; + @new ann(List.apply("5a")) @new ann(List.apply("5b")) def f(x: Int @ann(List.apply("6a")) @ann(List.apply("6b"))) = { + @new ann(List.apply("7a")) @new ann(List.apply("7b")) val r = x.$plus(3): @ann(List.apply("8a")): @ann(List.apply("8b")); + val s = (4: Int @ann(List.apply("9a")) @ann(List.apply("9b"))); + r.$plus(s) + } + }; + () +} +{ + @ann(List.apply[String]("1a")) @ann(List.apply[String]("1b")) class C[@ann(List.apply[String]("2a")) @ann(List.apply[String]("2b")) T] extends AnyRef { + @ann(List.apply[String]("3a")) @ann(List.apply[String]("3b")) private[this] val x: T @ann(List.apply[String]("4b")) @ann(List.apply[String]("4a")) = _; + def (@ann(List.apply[String]("3a")) @ann(List.apply[String]("3b")) x: T @ann(List.apply[String]("4b")) @ann(List.apply[String]("4a"))): C[T] = { + C.super.(); + () + }; + @ann(List.apply[String]("5a")) @ann(List.apply[String]("5b")) def f(x: Int @ann(List.apply[String]("6b")) @ann(List.apply[String]("6a"))): Int = { + @ann(List.apply[String]("7a")) @ann(List.apply[String]("7b")) val r: Int @ann(List.apply[String]("8b")) @ann(List.apply[String]("8a")) = ((x.+(3): Int @ann(List.apply[String]("8a"))): Int @ann(List.apply[String]("8b")) @ann(List.apply[String]("8a"))); + val s: Int @ann(List.apply[String]("9b")) @ann(List.apply[String]("9a")) = (4: Int @ann(List.apply[String]("9b")) @ann(List.apply[String]("9a"))); + r.+(s) + } + }; + () +} diff --git a/tests/disabled/macro/run/reify_ann1a.scala b/tests/disabled/macro/run/reify_ann1a.scala new file mode 100644 index 000000000..9252ddcf7 --- /dev/null +++ b/tests/disabled/macro/run/reify_ann1a.scala @@ -0,0 +1,28 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +class ann(bar: List[String]) extends annotation.StaticAnnotation + +object Test extends dotty.runtime.LegacyApp { + // test 1: reify + val tree = reify{ + @ann(bar=List("1a")) @ann(bar=List("1b")) class C[@ann(bar=List("2a")) @ann(bar=List("2b")) T](@ann(bar=List("3a")) @ann(bar=List("3b")) x: T @ann(bar=List("4a")) @ann(bar=List("4b"))) { + @ann(bar=List("5a")) @ann(bar=List("5b")) def f(x: Int @ann(bar=List("6a")) @ann(bar=List("6b"))) = { + @ann(bar=List("7a")) @ann(bar=List("7b")) val r = (x + 3): @ann(bar=List("8a")) @ann(bar=List("8b")) + val s = 4: Int @ann(bar=List("9a")) @ann(bar=List("9b")) + r + s + } + } + }.tree + println(tree.toString) + + // test 2: import and typecheck + val toolbox = cm.mkToolBox() + val ttree = toolbox.typecheck(tree) + println(ttree.toString) + + // test 3: import and compile + toolbox.eval(tree) +} diff --git a/tests/disabled/macro/run/reify_ann1b.check b/tests/disabled/macro/run/reify_ann1b.check new file mode 100644 index 000000000..a046dafea --- /dev/null +++ b/tests/disabled/macro/run/reify_ann1b.check @@ -0,0 +1,35 @@ +reify_ann1b.scala:6: warning: Implementation restriction: subclassing Classfile does not +make your annotation visible at runtime. If that is what +you want, you must write the annotation class in Java. +class ann(bar: String) extends annotation.ClassfileAnnotation + ^ +{ + @new ann(bar = "1a") @new ann(bar = "1b") class C[@new ann(bar = "2a") @new ann(bar = "2b") T] extends AnyRef { + @new ann(bar = "3a") @new ann(bar = "3b") private[this] val x: T @ann(bar = "4a") @ann(bar = "4b") = _; + def (@new ann(bar = "3a") @new ann(bar = "3b") x: T @ann(bar = "4a") @ann(bar = "4b")) = { + super.(); + () + }; + @new ann(bar = "5a") @new ann(bar = "5b") def f(x: Int @ann(bar = "6a") @ann(bar = "6b")) = { + @new ann(bar = "7a") @new ann(bar = "7b") val r = x.$plus(3): @ann(bar = "8a"): @ann(bar = "8b"); + val s = (4: Int @ann(bar = "9a") @ann(bar = "9b")); + r.$plus(s) + } + }; + () +} +{ + @ann(bar = "1a") @ann(bar = "1b") class C[@ann(bar = "2a") @ann(bar = "2b") T] extends AnyRef { + @ann(bar = "3a") @ann(bar = "3b") private[this] val x: T @ann(bar = "4b") @ann(bar = "4a") = _; + def (@ann(bar = "3a") @ann(bar = "3b") x: T @ann(bar = "4b") @ann(bar = "4a")): C[T] = { + C.super.(); + () + }; + @ann(bar = "5a") @ann(bar = "5b") def f(x: Int @ann(bar = "6b") @ann(bar = "6a")): Int = { + @ann(bar = "7a") @ann(bar = "7b") val r: Int @ann(bar = "8b") @ann(bar = "8a") = ((x.+(3): Int @ann(bar = "8a")): Int @ann(bar = "8b") @ann(bar = "8a")); + val s: Int @ann(bar = "9b") @ann(bar = "9a") = (4: Int @ann(bar = "9b") @ann(bar = "9a")); + r.+(s) + } + }; + () +} diff --git a/tests/disabled/macro/run/reify_ann1b.scala b/tests/disabled/macro/run/reify_ann1b.scala new file mode 100644 index 000000000..d3c6a4da3 --- /dev/null +++ b/tests/disabled/macro/run/reify_ann1b.scala @@ -0,0 +1,28 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +class ann(bar: String) extends annotation.ClassfileAnnotation + +object Test extends dotty.runtime.LegacyApp { + // test 1: reify + val tree = reify{ + @ann(bar="1a") @ann(bar="1b") class C[@ann(bar="2a") @ann(bar="2b") T](@ann(bar="3a") @ann(bar="3b") x: T @ann(bar="4a") @ann(bar="4b")) { + @ann(bar="5a") @ann(bar="5b") def f(x: Int @ann(bar="6a") @ann(bar="6b")) = { + @ann(bar="7a") @ann(bar="7b") val r = (x + 3): @ann(bar="8a") @ann(bar="8b") + val s = 4: Int @ann(bar="9a") @ann(bar="9b") + r + s + } + } + }.tree + println(tree.toString) + + // test 2: import and typecheck + val toolbox = cm.mkToolBox() + val ttree = toolbox.typecheck(tree) + println(ttree.toString) + + // test 3: import and compile + toolbox.eval(tree) +} diff --git a/tests/disabled/macro/run/reify_ann2a.check b/tests/disabled/macro/run/reify_ann2a.check new file mode 100644 index 000000000..a26fa4204 --- /dev/null +++ b/tests/disabled/macro/run/reify_ann2a.check @@ -0,0 +1,44 @@ +{ + class ann extends StaticAnnotation { + private[this] val bar: `package`.List[Predef.String] = _; + def (bar: `package`.List[Predef.String]) = { + super.(); + () + } + }; + @new ann(List.apply("1a")) @new ann(List.apply("1b")) class C[@new ann(List.apply("2a")) @new ann(List.apply("2b")) T] extends AnyRef { + @new ann(List.apply("3a")) @new ann(List.apply("3b")) private[this] val x: T @ann(List.apply("4a")) @ann(List.apply("4b")) = _; + def (@new ann(List.apply("3a")) @new ann(List.apply("3b")) x: T @ann(List.apply("4a")) @ann(List.apply("4b"))) = { + super.(); + () + }; + @new ann(List.apply("5a")) @new ann(List.apply("5b")) def f(x: Int @ann(List.apply("6a")) @ann(List.apply("6b"))) = { + @new ann(List.apply("7a")) @new ann(List.apply("7b")) val r = x.$plus(3): @ann(List.apply("8a")): @ann(List.apply("8b")); + val s = (4: Int @ann(List.apply("9a")) @ann(List.apply("9b"))); + r.$plus(s) + } + }; + () +} +{ + class ann extends scala.annotation.Annotation with scala.annotation.StaticAnnotation { + private[this] val bar: List[String] = _; + def (bar: List[String]): ann = { + ann.super.(); + () + } + }; + @ann(List.apply[String]("1a")) @ann(List.apply[String]("1b")) class C[@ann(List.apply[String]("2a")) @ann(List.apply[String]("2b")) T] extends AnyRef { + @ann(List.apply[String]("3a")) @ann(List.apply[String]("3b")) private[this] val x: T @ann(List.apply[String]("4b")) @ann(List.apply[String]("4a")) = _; + def (@ann(List.apply[String]("3a")) @ann(List.apply[String]("3b")) x: T @ann(List.apply[String]("4b")) @ann(List.apply[String]("4a"))): C[T] = { + C.super.(); + () + }; + @ann(List.apply[String]("5a")) @ann(List.apply[String]("5b")) def f(x: Int @ann(List.apply[String]("6b")) @ann(List.apply[String]("6a"))): Int = { + @ann(List.apply[String]("7a")) @ann(List.apply[String]("7b")) val r: Int @ann(List.apply[String]("8b")) @ann(List.apply[String]("8a")) = ((x.+(3): Int @ann(List.apply[String]("8a"))): Int @ann(List.apply[String]("8b")) @ann(List.apply[String]("8a"))); + val s: Int @ann(List.apply[String]("9b")) @ann(List.apply[String]("9a")) = (4: Int @ann(List.apply[String]("9b")) @ann(List.apply[String]("9a"))); + r.+(s) + } + }; + () +} diff --git a/tests/disabled/macro/run/reify_ann2a.scala b/tests/disabled/macro/run/reify_ann2a.scala new file mode 100644 index 000000000..861cb6297 --- /dev/null +++ b/tests/disabled/macro/run/reify_ann2a.scala @@ -0,0 +1,28 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + // test 1: reify + val tree = reify{ + class ann(bar: List[String]) extends annotation.StaticAnnotation + + @ann(bar=List("1a")) @ann(bar=List("1b")) class C[@ann(bar=List("2a")) @ann(bar=List("2b")) T](@ann(bar=List("3a")) @ann(bar=List("3b")) x: T @ann(bar=List("4a")) @ann(bar=List("4b"))) { + @ann(bar=List("5a")) @ann(bar=List("5b")) def f(x: Int @ann(bar=List("6a")) @ann(bar=List("6b"))) = { + @ann(bar=List("7a")) @ann(bar=List("7b")) val r = (x + 3): @ann(bar=List("8a")) @ann(bar=List("8b")) + val s = 4: Int @ann(bar=List("9a")) @ann(bar=List("9b")) + r + s + } + } + }.tree + println(tree.toString) + + // test 2: import and typecheck + val toolbox = cm.mkToolBox() + val ttree = toolbox.typecheck(tree) + println(ttree.toString) + + // test 3: import and compile + toolbox.eval(tree) +} diff --git a/tests/disabled/macro/run/reify_ann3.check b/tests/disabled/macro/run/reify_ann3.check new file mode 100644 index 000000000..4f1c61cf0 --- /dev/null +++ b/tests/disabled/macro/run/reify_ann3.check @@ -0,0 +1,21 @@ +{ + class Tree[A, +B] extends AnyRef { + @new inline @getter() final val key: A = _; + def (key: A) = { + super.(); + () + } + }; + () +} +{ + class Tree[A, +B] extends AnyRef { + final private[this] val key: A = _; + @inline @scala.annotation.meta.getter final def key: A = Tree.this.key; + def (key: A): Tree[A,B] = { + Tree.super.(); + () + } + }; + () +} diff --git a/tests/disabled/macro/run/reify_ann3.scala b/tests/disabled/macro/run/reify_ann3.scala new file mode 100644 index 000000000..7eadd569b --- /dev/null +++ b/tests/disabled/macro/run/reify_ann3.scala @@ -0,0 +1,22 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox +import scala.annotation._ +import scala.annotation.meta._ + +object Test extends dotty.runtime.LegacyApp { + // test 1: reify + val tree = reify{ + class Tree[A, +B](@(inline @getter) final val key: A) + }.tree + println(tree.toString) + + // test 2: import and typecheck + val toolbox = cm.mkToolBox() + val ttree = toolbox.typecheck(tree) + println(ttree.toString) + + // test 3: import and compile + toolbox.eval(tree) +} diff --git a/tests/disabled/macro/run/reify_ann4.check b/tests/disabled/macro/run/reify_ann4.check new file mode 100644 index 000000000..8bf5fe324 --- /dev/null +++ b/tests/disabled/macro/run/reify_ann4.check @@ -0,0 +1,32 @@ +{ + class D extends StaticAnnotation { + def () = { + super.(); + () + } + }; + class C extends AnyRef { + def () = { + super.(); + () + } + }; + val c1 = new C @D(); + () +} +{ + class D extends scala.annotation.Annotation with scala.annotation.StaticAnnotation { + def (): D = { + D.super.(); + () + } + }; + class C extends AnyRef { + def (): C = { + C.super.(); + () + } + }; + val c1: C = new C @D(); + () +} diff --git a/tests/disabled/macro/run/reify_ann4.scala b/tests/disabled/macro/run/reify_ann4.scala new file mode 100644 index 000000000..074ceb815 --- /dev/null +++ b/tests/disabled/macro/run/reify_ann4.scala @@ -0,0 +1,26 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox +import scala.annotation._ +import scala.annotation.meta._ + +object Test extends dotty.runtime.LegacyApp { + // test 1: reify + val tree = reify{ + class D extends StaticAnnotation + class C + val c1 = new C @D + //val c2 = (new C) @D // illegal syntax + //val c3 = c1 @D // illegal syntax + }.tree + println(tree.toString) + + // test 2: import and typecheck + val toolbox = cm.mkToolBox() + val ttree = toolbox.typecheck(tree) + println(ttree.toString) + + // test 3: import and compile + toolbox.eval(tree) +} diff --git a/tests/disabled/macro/run/reify_ann5.check b/tests/disabled/macro/run/reify_ann5.check new file mode 100644 index 000000000..1ec0457e5 --- /dev/null +++ b/tests/disabled/macro/run/reify_ann5.check @@ -0,0 +1,22 @@ +{ + class C extends AnyRef { + @new inline @beanGetter() @new BeanProperty() val x: Int = _; + def (x: Int) = { + super.(); + () + } + }; + () +} +{ + class C extends AnyRef { + @scala.beans.BeanProperty private[this] val x: Int = _; + def x: Int = C.this.x; + def (x: Int): C = { + C.super.(); + () + }; + @inline @scala.annotation.meta.beanGetter def getX(): Int = C.this.x + }; + () +} diff --git a/tests/disabled/macro/run/reify_ann5.scala b/tests/disabled/macro/run/reify_ann5.scala new file mode 100644 index 000000000..84e5bda9c --- /dev/null +++ b/tests/disabled/macro/run/reify_ann5.scala @@ -0,0 +1,23 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox +import scala.annotation._ +import scala.annotation.meta._ +import scala.beans._ + +object Test extends dotty.runtime.LegacyApp { + // test 1: reify + val tree = reify{ + class C(@BeanProperty @(inline @beanGetter) val x: Int) + }.tree + println(tree.toString) + + // test 2: import and typecheck + val toolbox = cm.mkToolBox() + val ttree = toolbox.typecheck(tree) + println(ttree.toString) + + // test 3: import and compile + toolbox.eval(tree) +} diff --git a/tests/disabled/macro/run/reify_anonymous.check b/tests/disabled/macro/run/reify_anonymous.check new file mode 100644 index 000000000..b8626c4cf --- /dev/null +++ b/tests/disabled/macro/run/reify_anonymous.check @@ -0,0 +1 @@ +4 diff --git a/tests/disabled/macro/run/reify_anonymous.scala b/tests/disabled/macro/run/reify_anonymous.scala new file mode 100644 index 000000000..a7aad4065 --- /dev/null +++ b/tests/disabled/macro/run/reify_anonymous.scala @@ -0,0 +1,8 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + println(new {def x = 2; def y = x * x}.y) + }.eval +} diff --git a/tests/disabled/macro/run/reify_classfileann_a.check b/tests/disabled/macro/run/reify_classfileann_a.check new file mode 100644 index 000000000..51f255b23 --- /dev/null +++ b/tests/disabled/macro/run/reify_classfileann_a.check @@ -0,0 +1,23 @@ +reify_classfileann_a.scala:6: warning: Implementation restriction: subclassing Classfile does not +make your annotation visible at runtime. If that is what +you want, you must write the annotation class in Java. +class ann(bar: String, quux: Array[String] = Array(), baz: ann = null) extends annotation.ClassfileAnnotation + ^ +{ + @new ann(bar = "1", quux = Array("2", "3"), baz = new ann(bar = "4")) class C extends AnyRef { + def () = { + super.(); + () + } + }; + () +} +{ + @ann(bar = "1", quux = ["2", "3"], baz = ann(bar = "4")) class C extends AnyRef { + def (): C = { + C.super.(); + () + } + }; + () +} diff --git a/tests/disabled/macro/run/reify_classfileann_a.scala b/tests/disabled/macro/run/reify_classfileann_a.scala new file mode 100644 index 000000000..74546df37 --- /dev/null +++ b/tests/disabled/macro/run/reify_classfileann_a.scala @@ -0,0 +1,22 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +class ann(bar: String, quux: Array[String] = Array(), baz: ann = null) extends annotation.ClassfileAnnotation + +object Test extends dotty.runtime.LegacyApp { + // test 1: reify + val tree = reify{ + @ann(bar="1", quux=Array("2", "3"), baz = new ann(bar = "4")) class C + }.tree + println(tree.toString) + + // test 2: import and typecheck + val toolbox = cm.mkToolBox() + val ttree = toolbox.typecheck(tree) + println(ttree.toString) + + // test 3: import and compile + toolbox.eval(tree) +} diff --git a/tests/disabled/macro/run/reify_classfileann_b.check b/tests/disabled/macro/run/reify_classfileann_b.check new file mode 100644 index 000000000..05f2e5bfc --- /dev/null +++ b/tests/disabled/macro/run/reify_classfileann_b.check @@ -0,0 +1,25 @@ +reify_classfileann_b.scala:6: warning: Implementation restriction: subclassing Classfile does not +make your annotation visible at runtime. If that is what +you want, you must write the annotation class in Java. +class ann(bar: String, quux: Array[String] = Array(), baz: ann = null) extends annotation.ClassfileAnnotation + ^ +{ + class C extends AnyRef { + def () = { + super.(); + () + }; + def x: Int = 2: @ann(bar = "1",quux = Array("2", "3"),baz = new ann(bar = "4")) + }; + () +} +{ + class C extends AnyRef { + def (): C = { + C.super.(); + () + }; + def x: Int = (2: Int(2) @ann(bar = "1", quux = ["2", "3"], baz = ann(bar = "4"))) + }; + () +} diff --git a/tests/disabled/macro/run/reify_classfileann_b.scala b/tests/disabled/macro/run/reify_classfileann_b.scala new file mode 100644 index 000000000..920d671f9 --- /dev/null +++ b/tests/disabled/macro/run/reify_classfileann_b.scala @@ -0,0 +1,26 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +class ann(bar: String, quux: Array[String] = Array(), baz: ann = null) extends annotation.ClassfileAnnotation + +object Test extends dotty.runtime.LegacyApp { + // test 1: reify + val tree = reify{ + class C { + def x: Int = { + 2: @ann(bar="1", quux=Array("2", "3"), baz = new ann(bar = "4")) + } + } + }.tree + println(tree.toString) + + // test 2: import and typecheck + val toolbox = cm.mkToolBox() + val ttree = toolbox.typecheck(tree) + println(ttree.toString) + + // test 3: import and compile + toolbox.eval(tree) +} diff --git a/tests/disabled/macro/run/reify_closure1.check b/tests/disabled/macro/run/reify_closure1.check new file mode 100644 index 000000000..b2f7f08c1 --- /dev/null +++ b/tests/disabled/macro/run/reify_closure1.check @@ -0,0 +1,2 @@ +10 +10 diff --git a/tests/disabled/macro/run/reify_closure1.scala b/tests/disabled/macro/run/reify_closure1.scala new file mode 100644 index 000000000..6a5684b2a --- /dev/null +++ b/tests/disabled/macro/run/reify_closure1.scala @@ -0,0 +1,19 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + def foo[T](ys: List[T]): Int => Int = { + val fun = reify{(x: Int) => { + x + }} + + val toolbox = cm.mkToolBox() + val dyn = toolbox.eval(fun.tree) + dyn.asInstanceOf[Int => Int] + } + + println(foo(List(1, 2, 3))(10)) + println(foo(List(1, 2, 3, 4))(10)) +} diff --git a/tests/disabled/macro/run/reify_closure2a.check b/tests/disabled/macro/run/reify_closure2a.check new file mode 100644 index 000000000..c1f3abd7e --- /dev/null +++ b/tests/disabled/macro/run/reify_closure2a.check @@ -0,0 +1,2 @@ +11 +12 diff --git a/tests/disabled/macro/run/reify_closure2a.scala b/tests/disabled/macro/run/reify_closure2a.scala new file mode 100644 index 000000000..cc194bc6d --- /dev/null +++ b/tests/disabled/macro/run/reify_closure2a.scala @@ -0,0 +1,19 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + def foo(y: Int): Int => Int = { + val fun = reify{(x: Int) => { + x + y + }} + + val toolbox = cm.mkToolBox() + val dyn = toolbox.eval(fun.tree) + dyn.asInstanceOf[Int => Int] + } + + println(foo(1)(10)) + println(foo(2)(10)) +} diff --git a/tests/disabled/macro/run/reify_closure3a.check b/tests/disabled/macro/run/reify_closure3a.check new file mode 100644 index 000000000..c1f3abd7e --- /dev/null +++ b/tests/disabled/macro/run/reify_closure3a.check @@ -0,0 +1,2 @@ +11 +12 diff --git a/tests/disabled/macro/run/reify_closure3a.scala b/tests/disabled/macro/run/reify_closure3a.scala new file mode 100644 index 000000000..0d540d1dd --- /dev/null +++ b/tests/disabled/macro/run/reify_closure3a.scala @@ -0,0 +1,21 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + def foo(y: Int): Int => Int = { + def y1 = y + + val fun = reify{(x: Int) => { + x + y1 + }} + + val toolbox = cm.mkToolBox() + val dyn = toolbox.eval(fun.tree) + dyn.asInstanceOf[Int => Int] + } + + println(foo(1)(10)) + println(foo(2)(10)) +} diff --git a/tests/disabled/macro/run/reify_closure4a.check b/tests/disabled/macro/run/reify_closure4a.check new file mode 100644 index 000000000..c1f3abd7e --- /dev/null +++ b/tests/disabled/macro/run/reify_closure4a.check @@ -0,0 +1,2 @@ +11 +12 diff --git a/tests/disabled/macro/run/reify_closure4a.scala b/tests/disabled/macro/run/reify_closure4a.scala new file mode 100644 index 000000000..373c3b2fa --- /dev/null +++ b/tests/disabled/macro/run/reify_closure4a.scala @@ -0,0 +1,21 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + def foo(y: Int): Int => Int = { + val y1 = y + + val fun = reify{(x: Int) => { + x + y1 + }} + + val toolbox = cm.mkToolBox() + val dyn = toolbox.eval(fun.tree) + dyn.asInstanceOf[Int => Int] + } + + println(foo(1)(10)) + println(foo(2)(10)) +} diff --git a/tests/disabled/macro/run/reify_closure5a.check b/tests/disabled/macro/run/reify_closure5a.check new file mode 100644 index 000000000..df9e19c59 --- /dev/null +++ b/tests/disabled/macro/run/reify_closure5a.check @@ -0,0 +1,2 @@ +13 +14 diff --git a/tests/disabled/macro/run/reify_closure5a.scala b/tests/disabled/macro/run/reify_closure5a.scala new file mode 100644 index 000000000..e2bd24ad2 --- /dev/null +++ b/tests/disabled/macro/run/reify_closure5a.scala @@ -0,0 +1,21 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + def foo[T: TypeTag](ys: List[T]): Int => Int = { + val fun = reify{(x: Int) => { + x + ys.length + }} + + val toolbox = cm.mkToolBox() + val dyn = toolbox.eval(fun.tree) + dyn.asInstanceOf[Int => Int] + } + + var fun1 = foo(List(1, 2, 3)) + println(fun1(10)) + var fun2 = foo(List(1, 2, 3, 4)) + println(fun2(10)) +} diff --git a/tests/disabled/macro/run/reify_closure6.check b/tests/disabled/macro/run/reify_closure6.check new file mode 100644 index 000000000..b9de4c6ba --- /dev/null +++ b/tests/disabled/macro/run/reify_closure6.check @@ -0,0 +1,7 @@ +q = 1 +y = 1 +first invocation = 15 +q = 2 +y = 1 +second invocation = 17 +q after second invocation = 2 \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_closure6.scala b/tests/disabled/macro/run/reify_closure6.scala new file mode 100644 index 000000000..1c3589cdf --- /dev/null +++ b/tests/disabled/macro/run/reify_closure6.scala @@ -0,0 +1,29 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + var q = 0 + def foo[T: TypeTag](ys: List[T]): Int => Int = { + val z = 1 + var y = 0 + val fun = reify{(x: Int) => { + y += 1 + q += 1 + println("q = " + q) + println("y = " + y) + x + ys.length * z + q + y + }} + + val toolbox = cm.mkToolBox() + val dyn = toolbox.eval(fun.tree) + dyn.asInstanceOf[Int => Int] + } + + val fun1 = foo(List(1, 2, 3)) + println("first invocation = " + fun1(10)) + val fun2 = foo(List(1, 2, 3, 4)) + println("second invocation = " + fun2(10)) + println("q after second invocation = " + q) +} diff --git a/tests/disabled/macro/run/reify_closure7.check b/tests/disabled/macro/run/reify_closure7.check new file mode 100644 index 000000000..bf58b52bc --- /dev/null +++ b/tests/disabled/macro/run/reify_closure7.check @@ -0,0 +1,6 @@ +q = 1 +y = 1 +first invocation = 15 +q = 2 +y = 2 +second invocation = 17 diff --git a/tests/disabled/macro/run/reify_closure7.scala b/tests/disabled/macro/run/reify_closure7.scala new file mode 100644 index 000000000..93f2f22a4 --- /dev/null +++ b/tests/disabled/macro/run/reify_closure7.scala @@ -0,0 +1,33 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + var q = 0 + var clo: Int => Int = null + def foo[T: TypeTag](ys: List[T]): Int => Int = { + val z = 1 + var y = 0 + val fun = reify{(x: Int) => { + y += 1 + q += 1 + println("q = " + q) + println("y = " + y) + x + ys.length * z + q + y + }} + + if (clo == null) { + val toolbox = cm.mkToolBox() + val dyn = toolbox.eval(fun.tree) + clo = dyn.asInstanceOf[Int => Int] + } + + clo + } + + val fun1 = foo(List(1, 2, 3)) + println("first invocation = " + fun1(10)) + val fun2 = foo(List(1, 2, 3, 4)) + println("second invocation = " + fun2(10)) +} diff --git a/tests/disabled/macro/run/reify_closure8a.check b/tests/disabled/macro/run/reify_closure8a.check new file mode 100644 index 000000000..9a037142a --- /dev/null +++ b/tests/disabled/macro/run/reify_closure8a.check @@ -0,0 +1 @@ +10 \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_closure8a.scala b/tests/disabled/macro/run/reify_closure8a.scala new file mode 100644 index 000000000..ad343dd15 --- /dev/null +++ b/tests/disabled/macro/run/reify_closure8a.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + class Foo(val y: Int) { + def fun = reify{y} + } + + val toolbox = cm.mkToolBox() + val dyn = toolbox.eval(new Foo(10).fun.tree) + val foo = dyn.asInstanceOf[Int] + println(foo) +} diff --git a/tests/disabled/macro/run/reify_closure8b.check b/tests/disabled/macro/run/reify_closure8b.check new file mode 100644 index 000000000..5d48d3ab3 --- /dev/null +++ b/tests/disabled/macro/run/reify_closure8b.check @@ -0,0 +1,3 @@ +scala.tools.reflect.ToolBoxError: reflective compilation has failed: + +value y is not a member of Test.Foo diff --git a/tests/disabled/macro/run/reify_closure8b.scala b/tests/disabled/macro/run/reify_closure8b.scala new file mode 100644 index 000000000..f28b18e01 --- /dev/null +++ b/tests/disabled/macro/run/reify_closure8b.scala @@ -0,0 +1,21 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + // will fail because y is a private field + // reification doesn't magically make unavailable stuff available + class Foo(y: Int) { + def fun = reify{y} + } + + try { + val dyn = cm.mkToolBox().eval(new Foo(10).fun.tree) + val foo = dyn.asInstanceOf[Int] + println(foo) + } catch { + case ex: Throwable => + println(ex) + } +} diff --git a/tests/disabled/macro/run/reify_closures10.check b/tests/disabled/macro/run/reify_closures10.check new file mode 100644 index 000000000..fd3c81a4d --- /dev/null +++ b/tests/disabled/macro/run/reify_closures10.check @@ -0,0 +1,2 @@ +5 +5 diff --git a/tests/disabled/macro/run/reify_closures10.scala b/tests/disabled/macro/run/reify_closures10.scala new file mode 100644 index 000000000..9c486e436 --- /dev/null +++ b/tests/disabled/macro/run/reify_closures10.scala @@ -0,0 +1,13 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val x = 2 + val y = 3 + val code = reify{println(x + y); x + y} + + val toolbox = cm.mkToolBox() + println(toolbox.eval(code.tree)) +} diff --git a/tests/disabled/macro/run/reify_complex.check b/tests/disabled/macro/run/reify_complex.check new file mode 100644 index 000000000..7df35e33a --- /dev/null +++ b/tests/disabled/macro/run/reify_complex.check @@ -0,0 +1 @@ +3.0+4.0*i diff --git a/tests/disabled/macro/run/reify_complex.scala b/tests/disabled/macro/run/reify_complex.scala new file mode 100644 index 000000000..45b72d899 --- /dev/null +++ b/tests/disabled/macro/run/reify_complex.scala @@ -0,0 +1,25 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + class Complex(val re: Double, val im: Double) { + def + (that: Complex) = + new Complex(re + that.re, im + that.im) + def - (that: Complex) = + new Complex(re - that.re, im - that.im) + def * (that: Complex) = + new Complex(re * that.re - im * that.im, + re * that.im + im * that.re) + def / (that: Complex) = { + val denom = that.re * that.re + that.im * that.im + new Complex((re * that.re + im * that.im) / denom, + (im * that.re - re * that.im) / denom) + } + override def toString = + re + (if (im < 0) "-" + (-im) else "+" + im) + "*i" + } + val x = new Complex(2, 1); val y = new Complex(1, 3) + println(x + y) + }.eval +} diff --git a/tests/disabled/macro/run/reify_copypaste1.check b/tests/disabled/macro/run/reify_copypaste1.check new file mode 100644 index 000000000..b204f9c45 --- /dev/null +++ b/tests/disabled/macro/run/reify_copypaste1.check @@ -0,0 +1,2 @@ +List(1, 2) + diff --git a/tests/disabled/macro/run/reify_copypaste1.scala b/tests/disabled/macro/run/reify_copypaste1.scala new file mode 100644 index 000000000..e255403ad --- /dev/null +++ b/tests/disabled/macro/run/reify_copypaste1.scala @@ -0,0 +1,19 @@ +import scala.reflect.runtime._ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.universe.definitions._ +import scala.reflect.runtime.universe.Flag._ +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val stdout = System.out + val output = new java.io.ByteArrayOutputStream() + System.setOut(new java.io.PrintStream(output)) + val toolBox = currentMirror.mkToolBox(options = "-Yreify-copypaste") + val reify = Select(Select(Select(Select(Ident(ScalaPackage), TermName("reflect")), TermName("runtime")), TermName("universe")), TermName("reify")) + val reifee = Block(List(ValDef(Modifiers(LAZY), TermName("x"), TypeTree(), Apply(Ident(ListModule), List(Literal(Constant(1)), Literal(Constant(2)))))), Ident(TermName("x"))) + toolBox.eval(Apply(reify, List(reifee))) + val Block(List(tpeCopypaste, exprCopypaste @ ModuleDef(_, _, Template(_, _, (_ :: stats) :+ expr))), Literal(Constant(()))) = toolBox.parse(output.toString()) + output.reset() + toolBox.eval(Block(stats, expr)) + stdout.println(output.toString) +} diff --git a/tests/disabled/macro/run/reify_copypaste2.check b/tests/disabled/macro/run/reify_copypaste2.check new file mode 100644 index 000000000..f5c107696 --- /dev/null +++ b/tests/disabled/macro/run/reify_copypaste2.check @@ -0,0 +1 @@ +`package`.universe.reify(Test.this.x) diff --git a/tests/disabled/macro/run/reify_copypaste2.scala b/tests/disabled/macro/run/reify_copypaste2.scala new file mode 100644 index 000000000..2f9bea1fe --- /dev/null +++ b/tests/disabled/macro/run/reify_copypaste2.scala @@ -0,0 +1,10 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val x = 2 + val outer = reify{reify{x}} + println(outer.tree) +} diff --git a/tests/disabled/macro/run/reify_csv.check b/tests/disabled/macro/run/reify_csv.check new file mode 100644 index 000000000..b56f4bb50 --- /dev/null +++ b/tests/disabled/macro/run/reify_csv.check @@ -0,0 +1,10 @@ +List(phase name, id, description) +record(parser,1,parse source into ASTs, perform simple desugaring) +record(namer,2,resolve names, attach symbols to named trees) +record(packageobjects,3,load package objects) +record(typer,4,the meat and potatoes: type the trees) +record(superaccessors,5,add super accessors in traits and nested classes) +record(pickler,6,serialize symbol tables) +record(refchecks,7,reference/override checking, translate nested objects) +record(selectiveanf,8,) +record(liftcode,9,reify trees) diff --git a/tests/disabled/macro/run/reify_csv.scala b/tests/disabled/macro/run/reify_csv.scala new file mode 100644 index 000000000..1c567c904 --- /dev/null +++ b/tests/disabled/macro/run/reify_csv.scala @@ -0,0 +1,36 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + val csv = """ + | phase name; id; description + | parser; 1; parse source into ASTs, perform simple desugaring + | namer; 2; resolve names, attach symbols to named trees + |packageobjects; 3; load package objects + | typer; 4; the meat and potatoes: type the trees + |superaccessors; 5; add super accessors in traits and nested classes + | pickler; 6; serialize symbol tables + | refchecks; 7; reference/override checking, translate nested objects + | selectiveanf; 8; + | liftcode; 9; reify trees""".stripMargin.split("\n").map{_.trim()}.drop(1).toList + + val fields = csv.head.split(";").map{_.trim()}.toList + println(fields) + + reify({ + object Csv { + case class record(`phase name`: String, id: String, description: String) + + object record { + def parse(lines: List[String]) = { + lines drop(1) map { line => line.split(";", -1).toList match { + case phase$whitespace$name :: id :: description :: _ => record(phase$whitespace$name.trim(), id.trim(), description.trim()) + case _ => throw new Exception("format error") + }} + } + } + } + + Csv.record.parse(csv) foreach println + }).eval +} diff --git a/tests/disabled/macro/run/reify_extendbuiltins.check b/tests/disabled/macro/run/reify_extendbuiltins.check new file mode 100644 index 000000000..a48033a30 --- /dev/null +++ b/tests/disabled/macro/run/reify_extendbuiltins.check @@ -0,0 +1 @@ +10! = 3628800 diff --git a/tests/disabled/macro/run/reify_extendbuiltins.scala b/tests/disabled/macro/run/reify_extendbuiltins.scala new file mode 100644 index 000000000..3056db6e4 --- /dev/null +++ b/tests/disabled/macro/run/reify_extendbuiltins.scala @@ -0,0 +1,17 @@ + +import scala.language.{ implicitConversions, postfixOps } +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + def fact(n: Int): BigInt = + if (n == 0) 1 else fact(n-1) * n + class Factorizer(n: Int) { + def ! = fact(n) + } + implicit def int2fact(n: Int) = new Factorizer(n) + + println("10! = " + (10!)) + }.eval +} diff --git a/tests/disabled/macro/run/reify_for1.scala b/tests/disabled/macro/run/reify_for1.scala new file mode 100644 index 000000000..1233782ad --- /dev/null +++ b/tests/disabled/macro/run/reify_for1.scala @@ -0,0 +1,10 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + val sumOfSquares1 = (for (i <- 1 to 100; if (i % 3 == 0)) yield Math.pow(i, 2)).sum + val sumOfSquares2 = (1 to 100).filter(_ % 3 == 0).map(Math.pow(_, 2)).sum + assert(sumOfSquares1 == sumOfSquares2) + }.eval +} diff --git a/tests/disabled/macro/run/reify_fors_newpatmat.check b/tests/disabled/macro/run/reify_fors_newpatmat.check new file mode 100644 index 000000000..eefddedc2 --- /dev/null +++ b/tests/disabled/macro/run/reify_fors_newpatmat.check @@ -0,0 +1,5 @@ +Persons over 20: John Richard +divisors(34) = List(1, 2, 17, 34) +findNums(15) = (4,1) (5,2) (6,1) (7,4) (8,3) (8,5) (9,2) (9,4) (10,1) (10,3) (10,7) (11,2) (11,6) (11,8) (12,1) (12,5) (12,7) (13,4) (13,6) (13,10) (14,3) (14,5) (14,9) +average(List(3.5, 5.0, 4.5)) = 4.333333333333333 +scalProd(List(3.5, 5.0, 4.5), List(2.0, 1.0, 3.0)) = 25.5 diff --git a/tests/disabled/macro/run/reify_fors_newpatmat.scala b/tests/disabled/macro/run/reify_fors_newpatmat.scala new file mode 100644 index 000000000..d366169a4 --- /dev/null +++ b/tests/disabled/macro/run/reify_fors_newpatmat.scala @@ -0,0 +1,101 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + object Persons { + /** A list of persons. To create a list, we use Predef.List + * which takes a variable number of arguments and constructs + * a list out of them. + */ + val persons = List( + new Person("Bob", 17), + new Person("John", 40), + new Person("Richard", 68) + ) + + /** A Person class. 'val' constructor parameters become + * public members of the class. + */ + class Person(val name: String, val age: Int) + + /** Return an iterator over persons that are older than 20. + */ + def olderThan20(xs: Seq[Person]): Iterator[String] = + olderThan20(xs.iterator) + + /** Return an iterator over persons older than 20, given + * an iterator over persons. + */ + def olderThan20(xs: Iterator[Person]): Iterator[String] = { + + // The first expression is called a 'generator' and makes + // 'p' take values from 'xs'. The second expression is + // called a 'filter' and it is a boolean expression which + // selects only persons older than 20. There can be more than + // one generator and filter. The 'yield' expression is evaluated + // for each 'p' which satisfies the filters and used to assemble + // the resulting iterator + for (p <- xs if p.age > 20) yield p.name + } + } + + /** Some functions over lists of numbers which demonstrate + * the use of for comprehensions. + */ + object Numeric { + + /** Return the divisors of n. */ + def divisors(n: Int): List[Int] = + for (i <- List.range(1, n+1) if n % i == 0) yield i + + /** Is 'n' a prime number? */ + def isPrime(n: Int) = divisors(n).length == 2 + + /** Return pairs of numbers whose sum is prime. */ + def findNums(n: Int): Iterable[(Int, Int)] = { + + // a for comprehension using two generators + for (i <- 1 until n; + j <- 1 until (i-1); + if isPrime(i + j)) yield (i, j) + } + + /** Return the sum of the elements of 'xs'. */ + def sum(xs: List[Double]): Double = + xs.foldLeft(0.0) { (x, y) => x + y } + + /** Return the sum of pairwise product of the two lists. */ + def scalProd(xs: List[Double], ys: List[Double]) = + sum(for((x, y) <- xs zip ys) yield x * y); + + /** Remove duplicate elements in 'xs'. */ + def removeDuplicates[A](xs: List[A]): List[A] = + if (xs.isEmpty) + xs + else + xs.head :: removeDuplicates(for (x <- xs.tail if x != xs.head) yield x) + } + + // import all members of object 'persons' in the current scope + import Persons._ + + print("Persons over 20:") + olderThan20(persons) foreach { x => print(" " + x) } + println + + import Numeric._ + + println("divisors(34) = " + divisors(34)) + + print("findNums(15) =") + findNums(15) foreach { x => print(" " + x) } + println + + val xs = List(3.5, 5.0, 4.5) + println("average(" + xs + ") = " + sum(xs) / xs.length) + + val ys = List(2.0, 1.0, 3.0) + println("scalProd(" + xs + ", " + ys +") = " + scalProd(xs, ys)) + }.eval +} diff --git a/tests/disabled/macro/run/reify_fors_oldpatmat.check b/tests/disabled/macro/run/reify_fors_oldpatmat.check new file mode 100644 index 000000000..eefddedc2 --- /dev/null +++ b/tests/disabled/macro/run/reify_fors_oldpatmat.check @@ -0,0 +1,5 @@ +Persons over 20: John Richard +divisors(34) = List(1, 2, 17, 34) +findNums(15) = (4,1) (5,2) (6,1) (7,4) (8,3) (8,5) (9,2) (9,4) (10,1) (10,3) (10,7) (11,2) (11,6) (11,8) (12,1) (12,5) (12,7) (13,4) (13,6) (13,10) (14,3) (14,5) (14,9) +average(List(3.5, 5.0, 4.5)) = 4.333333333333333 +scalProd(List(3.5, 5.0, 4.5), List(2.0, 1.0, 3.0)) = 25.5 diff --git a/tests/disabled/macro/run/reify_fors_oldpatmat.scala b/tests/disabled/macro/run/reify_fors_oldpatmat.scala new file mode 100644 index 000000000..d366169a4 --- /dev/null +++ b/tests/disabled/macro/run/reify_fors_oldpatmat.scala @@ -0,0 +1,101 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + object Persons { + /** A list of persons. To create a list, we use Predef.List + * which takes a variable number of arguments and constructs + * a list out of them. + */ + val persons = List( + new Person("Bob", 17), + new Person("John", 40), + new Person("Richard", 68) + ) + + /** A Person class. 'val' constructor parameters become + * public members of the class. + */ + class Person(val name: String, val age: Int) + + /** Return an iterator over persons that are older than 20. + */ + def olderThan20(xs: Seq[Person]): Iterator[String] = + olderThan20(xs.iterator) + + /** Return an iterator over persons older than 20, given + * an iterator over persons. + */ + def olderThan20(xs: Iterator[Person]): Iterator[String] = { + + // The first expression is called a 'generator' and makes + // 'p' take values from 'xs'. The second expression is + // called a 'filter' and it is a boolean expression which + // selects only persons older than 20. There can be more than + // one generator and filter. The 'yield' expression is evaluated + // for each 'p' which satisfies the filters and used to assemble + // the resulting iterator + for (p <- xs if p.age > 20) yield p.name + } + } + + /** Some functions over lists of numbers which demonstrate + * the use of for comprehensions. + */ + object Numeric { + + /** Return the divisors of n. */ + def divisors(n: Int): List[Int] = + for (i <- List.range(1, n+1) if n % i == 0) yield i + + /** Is 'n' a prime number? */ + def isPrime(n: Int) = divisors(n).length == 2 + + /** Return pairs of numbers whose sum is prime. */ + def findNums(n: Int): Iterable[(Int, Int)] = { + + // a for comprehension using two generators + for (i <- 1 until n; + j <- 1 until (i-1); + if isPrime(i + j)) yield (i, j) + } + + /** Return the sum of the elements of 'xs'. */ + def sum(xs: List[Double]): Double = + xs.foldLeft(0.0) { (x, y) => x + y } + + /** Return the sum of pairwise product of the two lists. */ + def scalProd(xs: List[Double], ys: List[Double]) = + sum(for((x, y) <- xs zip ys) yield x * y); + + /** Remove duplicate elements in 'xs'. */ + def removeDuplicates[A](xs: List[A]): List[A] = + if (xs.isEmpty) + xs + else + xs.head :: removeDuplicates(for (x <- xs.tail if x != xs.head) yield x) + } + + // import all members of object 'persons' in the current scope + import Persons._ + + print("Persons over 20:") + olderThan20(persons) foreach { x => print(" " + x) } + println + + import Numeric._ + + println("divisors(34) = " + divisors(34)) + + print("findNums(15) =") + findNums(15) foreach { x => print(" " + x) } + println + + val xs = List(3.5, 5.0, 4.5) + println("average(" + xs + ") = " + sum(xs) / xs.length) + + val ys = List(2.0, 1.0, 3.0) + println("scalProd(" + xs + ", " + ys +") = " + scalProd(xs, ys)) + }.eval +} diff --git a/tests/disabled/macro/run/reify_generic.check b/tests/disabled/macro/run/reify_generic.check new file mode 100644 index 000000000..b8626c4cf --- /dev/null +++ b/tests/disabled/macro/run/reify_generic.check @@ -0,0 +1 @@ +4 diff --git a/tests/disabled/macro/run/reify_generic.scala b/tests/disabled/macro/run/reify_generic.scala new file mode 100644 index 000000000..4221dbf6c --- /dev/null +++ b/tests/disabled/macro/run/reify_generic.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + val product = List(1, 2, 3).head * List[Any](4, 2, 0).head.asInstanceOf[Int] + println(product) + }.eval +} diff --git a/tests/disabled/macro/run/reify_generic2.check b/tests/disabled/macro/run/reify_generic2.check new file mode 100644 index 000000000..b8626c4cf --- /dev/null +++ b/tests/disabled/macro/run/reify_generic2.check @@ -0,0 +1 @@ +4 diff --git a/tests/disabled/macro/run/reify_generic2.scala b/tests/disabled/macro/run/reify_generic2.scala new file mode 100644 index 000000000..6941d9ff7 --- /dev/null +++ b/tests/disabled/macro/run/reify_generic2.scala @@ -0,0 +1,10 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + class C + val product = List(new C, new C).length * List[C](new C, new C).length + println(product) + }.eval +} diff --git a/tests/disabled/macro/run/reify_getter.check b/tests/disabled/macro/run/reify_getter.check new file mode 100644 index 000000000..5ef4ff4d0 --- /dev/null +++ b/tests/disabled/macro/run/reify_getter.check @@ -0,0 +1 @@ +evaluated = 2 diff --git a/tests/disabled/macro/run/reify_getter.scala b/tests/disabled/macro/run/reify_getter.scala new file mode 100644 index 000000000..18c9a1a32 --- /dev/null +++ b/tests/disabled/macro/run/reify_getter.scala @@ -0,0 +1,18 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + class C { + val x = 2 + } + + new C().x + } + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/disabled/macro/run/reify_implicits-new.check b/tests/disabled/macro/run/reify_implicits-new.check new file mode 100644 index 000000000..e3aeb20f6 --- /dev/null +++ b/tests/disabled/macro/run/reify_implicits-new.check @@ -0,0 +1 @@ +x = List(1, 2, 3, 4) diff --git a/tests/disabled/macro/run/reify_implicits-new.scala b/tests/disabled/macro/run/reify_implicits-new.scala new file mode 100644 index 000000000..5ff90871a --- /dev/null +++ b/tests/disabled/macro/run/reify_implicits-new.scala @@ -0,0 +1,18 @@ + +import scala.language.{ implicitConversions, reflectiveCalls } +import scala.reflect.{ClassTag, classTag} +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + implicit def arrayWrapper[A : ClassTag](x: Array[A]) = + new { + def sort(p: (A, A) => Boolean) = { + util.Sorting.stableSort(x, p); x + } + } + val x = Array(2, 3, 1, 4) + println("x = "+ x.sort((x: Int, y: Int) => x < y).toList) + }.eval +} diff --git a/tests/disabled/macro/run/reify_implicits-old.check b/tests/disabled/macro/run/reify_implicits-old.check new file mode 100644 index 000000000..e3aeb20f6 --- /dev/null +++ b/tests/disabled/macro/run/reify_implicits-old.check @@ -0,0 +1 @@ +x = List(1, 2, 3, 4) diff --git a/tests/disabled/macro/run/reify_implicits-old.scala b/tests/disabled/macro/run/reify_implicits-old.scala new file mode 100644 index 000000000..ccd9375d6 --- /dev/null +++ b/tests/disabled/macro/run/reify_implicits-old.scala @@ -0,0 +1,17 @@ + +import scala.language.{ implicitConversions, reflectiveCalls } +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + implicit def arrayWrapper[A : ClassManifest](x: Array[A]) = + new { + def sort(p: (A, A) => Boolean) = { + util.Sorting.stableSort(x, p); x + } + } + val x = Array(2, 3, 1, 4) + println("x = "+ x.sort((x: Int, y: Int) => x < y).toList) + }.eval +} diff --git a/tests/disabled/macro/run/reify_inheritance.check b/tests/disabled/macro/run/reify_inheritance.check new file mode 100644 index 000000000..25bf17fc5 --- /dev/null +++ b/tests/disabled/macro/run/reify_inheritance.check @@ -0,0 +1 @@ +18 \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_inheritance.scala b/tests/disabled/macro/run/reify_inheritance.scala new file mode 100644 index 000000000..f4fb49edc --- /dev/null +++ b/tests/disabled/macro/run/reify_inheritance.scala @@ -0,0 +1,17 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + class C { + def x = 2 + def y = x * x + } + + class D extends C { + override def x = 3 + } + + println(new D().y * new C().x) + }.eval +} diff --git a/tests/disabled/macro/run/reify_inner1.check b/tests/disabled/macro/run/reify_inner1.check new file mode 100644 index 000000000..d8263ee98 --- /dev/null +++ b/tests/disabled/macro/run/reify_inner1.check @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_inner1.scala b/tests/disabled/macro/run/reify_inner1.scala new file mode 100644 index 000000000..bae49f910 --- /dev/null +++ b/tests/disabled/macro/run/reify_inner1.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + class C { + class D { + val x = 2 + } + } + + val outer = new C() + val inner = new outer.D() + println(inner.x) + }.eval +} diff --git a/tests/disabled/macro/run/reify_inner2.check b/tests/disabled/macro/run/reify_inner2.check new file mode 100644 index 000000000..d8263ee98 --- /dev/null +++ b/tests/disabled/macro/run/reify_inner2.check @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_inner2.scala b/tests/disabled/macro/run/reify_inner2.scala new file mode 100644 index 000000000..fbe54b072 --- /dev/null +++ b/tests/disabled/macro/run/reify_inner2.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + class C { + object D { + val x = 2 + } + } + + val outer = new C() + val inner = outer.D + println(inner.x) + }.eval +} diff --git a/tests/disabled/macro/run/reify_inner3.check b/tests/disabled/macro/run/reify_inner3.check new file mode 100644 index 000000000..d8263ee98 --- /dev/null +++ b/tests/disabled/macro/run/reify_inner3.check @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_inner3.scala b/tests/disabled/macro/run/reify_inner3.scala new file mode 100644 index 000000000..004041b7d --- /dev/null +++ b/tests/disabled/macro/run/reify_inner3.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + object C { + class D { + val x = 2 + } + } + + val outer = C + val inner = new outer.D + println(inner.x) + }.eval +} diff --git a/tests/disabled/macro/run/reify_inner4.check b/tests/disabled/macro/run/reify_inner4.check new file mode 100644 index 000000000..d8263ee98 --- /dev/null +++ b/tests/disabled/macro/run/reify_inner4.check @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_inner4.scala b/tests/disabled/macro/run/reify_inner4.scala new file mode 100644 index 000000000..5292cf040 --- /dev/null +++ b/tests/disabled/macro/run/reify_inner4.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + object C { + object D { + val x = 2 + } + } + + val outer = C + val inner = outer.D + println(inner.x) + }.eval +} diff --git a/tests/disabled/macro/run/reify_lazyevaluation.check b/tests/disabled/macro/run/reify_lazyevaluation.check new file mode 100644 index 000000000..1c7f96cd9 --- /dev/null +++ b/tests/disabled/macro/run/reify_lazyevaluation.check @@ -0,0 +1,8 @@ +s = Susp(?) +evaluating... +s() = 3 +s = Susp(3) +2 + s = 5 +sl2 = Susp(?) +sl2() = Some(3) +sl2 = Susp(Some(3)) diff --git a/tests/disabled/macro/run/reify_lazyevaluation.scala b/tests/disabled/macro/run/reify_lazyevaluation.scala new file mode 100644 index 000000000..564e7f1cd --- /dev/null +++ b/tests/disabled/macro/run/reify_lazyevaluation.scala @@ -0,0 +1,61 @@ + +import scala.language.{ implicitConversions } +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + object lazyLib { + + /** Delay the evaluation of an expression until it is needed. */ + def delay[A](value: => A): Susp[A] = new SuspImpl[A](value) + + /** Get the value of a delayed expression. */ + implicit def force[A](s: Susp[A]): A = s() + + /** + * Data type of suspended computations. (The name froms from ML.) + */ + abstract class Susp[+A] extends Function0[A] + + /** + * Implementation of suspended computations, separated from the + * abstract class so that the type parameter can be invariant. + */ + class SuspImpl[A](lazyValue: => A) extends Susp[A] { + private var maybeValue: Option[A] = None + + override def apply() = maybeValue match { + case None => + val value = lazyValue + maybeValue = Some(value) + value + case Some(value) => + value + } + + override def toString() = maybeValue match { + case None => "Susp(?)" + case Some(value) => "Susp(" + value + ")" + } + } + } + + import lazyLib._ + + val s: Susp[Int] = delay { println("evaluating..."); 3 } + + println("s = " + s) // show that s is unevaluated + println("s() = " + s()) // evaluate s + println("s = " + s) // show that the value is saved + println("2 + s = " + (2 + s)) // implicit call to force() + + val sl = delay { Some(3) } + val sl1: Susp[Some[Int]] = sl + val sl2: Susp[Option[Int]] = sl1 // the type is covariant + + println("sl2 = " + sl2) + println("sl2() = " + sl2()) + println("sl2 = " + sl2) + }.eval +} diff --git a/tests/disabled/macro/run/reify_lazyunit.check b/tests/disabled/macro/run/reify_lazyunit.check new file mode 100644 index 000000000..579ecfe8a --- /dev/null +++ b/tests/disabled/macro/run/reify_lazyunit.check @@ -0,0 +1,6 @@ +reify_lazyunit.scala:6: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + lazy val x = { 0; println("12")} + ^ +12 +one +two diff --git a/tests/disabled/macro/run/reify_lazyunit.scala b/tests/disabled/macro/run/reify_lazyunit.scala new file mode 100644 index 000000000..70caf4f33 --- /dev/null +++ b/tests/disabled/macro/run/reify_lazyunit.scala @@ -0,0 +1,13 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + lazy val x = { 0; println("12")} + x + println("one") + x + println("two") + }.eval +} + diff --git a/tests/disabled/macro/run/reify_maps_newpatmat.check b/tests/disabled/macro/run/reify_maps_newpatmat.check new file mode 100644 index 000000000..08cbbb135 --- /dev/null +++ b/tests/disabled/macro/run/reify_maps_newpatmat.check @@ -0,0 +1,4 @@ +red has code: 16711680 +Unknown color: green +Unknown color: blue +turquoise has code: 65535 diff --git a/tests/disabled/macro/run/reify_maps_newpatmat.scala b/tests/disabled/macro/run/reify_maps_newpatmat.scala new file mode 100644 index 000000000..18adb5c36 --- /dev/null +++ b/tests/disabled/macro/run/reify_maps_newpatmat.scala @@ -0,0 +1,20 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + val colors = Map("red" -> 0xFF0000, + "turquoise" -> 0x00FFFF, + "black" -> 0x000000, + "orange" -> 0xFF8040, + "brown" -> 0x804000) + for (name <- List("red", "green", "blue", "turquoise")) println( + colors.get(name) match { + case Some(code) => + name + " has code: " + code + case None => + "Unknown color: " + name + } + ) + }.eval +} diff --git a/tests/disabled/macro/run/reify_maps_oldpatmat.check b/tests/disabled/macro/run/reify_maps_oldpatmat.check new file mode 100644 index 000000000..08cbbb135 --- /dev/null +++ b/tests/disabled/macro/run/reify_maps_oldpatmat.check @@ -0,0 +1,4 @@ +red has code: 16711680 +Unknown color: green +Unknown color: blue +turquoise has code: 65535 diff --git a/tests/disabled/macro/run/reify_maps_oldpatmat.scala b/tests/disabled/macro/run/reify_maps_oldpatmat.scala new file mode 100644 index 000000000..18adb5c36 --- /dev/null +++ b/tests/disabled/macro/run/reify_maps_oldpatmat.scala @@ -0,0 +1,20 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + val colors = Map("red" -> 0xFF0000, + "turquoise" -> 0x00FFFF, + "black" -> 0x000000, + "orange" -> 0xFF8040, + "brown" -> 0x804000) + for (name <- List("red", "green", "blue", "turquoise")) println( + colors.get(name) match { + case Some(code) => + name + " has code: " + code + case None => + "Unknown color: " + name + } + ) + }.eval +} diff --git a/tests/disabled/macro/run/reify_metalevel_breach_+0_refers_to_1.check b/tests/disabled/macro/run/reify_metalevel_breach_+0_refers_to_1.check new file mode 100644 index 000000000..5bfed17f8 --- /dev/null +++ b/tests/disabled/macro/run/reify_metalevel_breach_+0_refers_to_1.check @@ -0,0 +1 @@ +evaluated = 2 \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_metalevel_breach_+0_refers_to_1.scala b/tests/disabled/macro/run/reify_metalevel_breach_+0_refers_to_1.scala new file mode 100644 index 000000000..2f930c25e --- /dev/null +++ b/tests/disabled/macro/run/reify_metalevel_breach_+0_refers_to_1.scala @@ -0,0 +1,18 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + val code = reify{ + val x = 2 + val inner = reify{x} +// was: inner.splice + inner.eval + }; + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/disabled/macro/run/reify_metalevel_breach_-1_refers_to_0_a.check b/tests/disabled/macro/run/reify_metalevel_breach_-1_refers_to_0_a.check new file mode 100644 index 000000000..5bfed17f8 --- /dev/null +++ b/tests/disabled/macro/run/reify_metalevel_breach_-1_refers_to_0_a.check @@ -0,0 +1 @@ +evaluated = 2 \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_metalevel_breach_-1_refers_to_0_a.scala b/tests/disabled/macro/run/reify_metalevel_breach_-1_refers_to_0_a.scala new file mode 100644 index 000000000..526ed3d13 --- /dev/null +++ b/tests/disabled/macro/run/reify_metalevel_breach_-1_refers_to_0_a.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + val x = 2 + val outer = reify{reify{x}} +// was: val code = reify{outer.splice.splice} + val code = reify{outer.eval.eval} + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/disabled/macro/run/reify_metalevel_breach_-1_refers_to_0_b.check b/tests/disabled/macro/run/reify_metalevel_breach_-1_refers_to_0_b.check new file mode 100644 index 000000000..5bfed17f8 --- /dev/null +++ b/tests/disabled/macro/run/reify_metalevel_breach_-1_refers_to_0_b.check @@ -0,0 +1 @@ +evaluated = 2 \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_metalevel_breach_-1_refers_to_0_b.scala b/tests/disabled/macro/run/reify_metalevel_breach_-1_refers_to_0_b.scala new file mode 100644 index 000000000..96793c634 --- /dev/null +++ b/tests/disabled/macro/run/reify_metalevel_breach_-1_refers_to_0_b.scala @@ -0,0 +1,21 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + val x = 2 + val code = reify{ + { + val inner = reify{reify{x}} +// was: inner.splice + inner.eval +// was: }.splice + }.eval + } + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/disabled/macro/run/reify_metalevel_breach_-1_refers_to_1.check b/tests/disabled/macro/run/reify_metalevel_breach_-1_refers_to_1.check new file mode 100644 index 000000000..5bfed17f8 --- /dev/null +++ b/tests/disabled/macro/run/reify_metalevel_breach_-1_refers_to_1.check @@ -0,0 +1 @@ +evaluated = 2 \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_metalevel_breach_-1_refers_to_1.scala b/tests/disabled/macro/run/reify_metalevel_breach_-1_refers_to_1.scala new file mode 100644 index 000000000..0fc985b6a --- /dev/null +++ b/tests/disabled/macro/run/reify_metalevel_breach_-1_refers_to_1.scala @@ -0,0 +1,18 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + val code = reify{ + val x = 2 + val inner = reify{reify{x}} +// was: inner.splice.splice + inner.eval.eval + }; + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/disabled/macro/run/reify_nested_inner_refers_to_global.check b/tests/disabled/macro/run/reify_nested_inner_refers_to_global.check new file mode 100644 index 000000000..5ef4ff4d0 --- /dev/null +++ b/tests/disabled/macro/run/reify_nested_inner_refers_to_global.check @@ -0,0 +1 @@ +evaluated = 2 diff --git a/tests/disabled/macro/run/reify_nested_inner_refers_to_global.scala b/tests/disabled/macro/run/reify_nested_inner_refers_to_global.scala new file mode 100644 index 000000000..41d378e91 --- /dev/null +++ b/tests/disabled/macro/run/reify_nested_inner_refers_to_global.scala @@ -0,0 +1,17 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val code = { + val x = 2 + reify{ + reify{x}.splice + } + } + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/disabled/macro/run/reify_nested_inner_refers_to_local.check b/tests/disabled/macro/run/reify_nested_inner_refers_to_local.check new file mode 100644 index 000000000..5bfed17f8 --- /dev/null +++ b/tests/disabled/macro/run/reify_nested_inner_refers_to_local.check @@ -0,0 +1 @@ +evaluated = 2 \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_nested_inner_refers_to_local.scala b/tests/disabled/macro/run/reify_nested_inner_refers_to_local.scala new file mode 100644 index 000000000..102278c84 --- /dev/null +++ b/tests/disabled/macro/run/reify_nested_inner_refers_to_local.scala @@ -0,0 +1,17 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + val code = reify{ + val x = 2 +// was: reify{x}.eval + reify{x}.eval + }; + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/disabled/macro/run/reify_nested_outer_refers_to_global.check b/tests/disabled/macro/run/reify_nested_outer_refers_to_global.check new file mode 100644 index 000000000..5ef4ff4d0 --- /dev/null +++ b/tests/disabled/macro/run/reify_nested_outer_refers_to_global.check @@ -0,0 +1 @@ +evaluated = 2 diff --git a/tests/disabled/macro/run/reify_nested_outer_refers_to_global.scala b/tests/disabled/macro/run/reify_nested_outer_refers_to_global.scala new file mode 100644 index 000000000..bff5dc407 --- /dev/null +++ b/tests/disabled/macro/run/reify_nested_outer_refers_to_global.scala @@ -0,0 +1,19 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val code = { + val x = 2 + val outer = reify{x} + reify{ + val x = 42 + outer.splice + }; + } + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/disabled/macro/run/reify_nested_outer_refers_to_local.check b/tests/disabled/macro/run/reify_nested_outer_refers_to_local.check new file mode 100644 index 000000000..5ef4ff4d0 --- /dev/null +++ b/tests/disabled/macro/run/reify_nested_outer_refers_to_local.check @@ -0,0 +1 @@ +evaluated = 2 diff --git a/tests/disabled/macro/run/reify_nested_outer_refers_to_local.scala b/tests/disabled/macro/run/reify_nested_outer_refers_to_local.scala new file mode 100644 index 000000000..70c400bc2 --- /dev/null +++ b/tests/disabled/macro/run/reify_nested_outer_refers_to_local.scala @@ -0,0 +1,19 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val outer = { + val x = 2 + reify{x} + } + val code = reify{ + val x = 42 + outer.splice + }; + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/disabled/macro/run/reify_newimpl_01.check b/tests/disabled/macro/run/reify_newimpl_01.check new file mode 100644 index 000000000..d8263ee98 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_01.check @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_newimpl_01.scala b/tests/disabled/macro/run/reify_newimpl_01.scala new file mode 100644 index 000000000..1a5f96b53 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_01.scala @@ -0,0 +1,13 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + val x = 2 + val code = reify { + x + } + println(code.eval) + } +} diff --git a/tests/disabled/macro/run/reify_newimpl_02.check b/tests/disabled/macro/run/reify_newimpl_02.check new file mode 100644 index 000000000..d8263ee98 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_02.check @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_newimpl_02.scala b/tests/disabled/macro/run/reify_newimpl_02.scala new file mode 100644 index 000000000..1ef3f03ed --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_02.scala @@ -0,0 +1,13 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + var x = 2 + val code = reify { + x + } + println(code.eval) + } +} diff --git a/tests/disabled/macro/run/reify_newimpl_03.check b/tests/disabled/macro/run/reify_newimpl_03.check new file mode 100644 index 000000000..d8263ee98 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_03.check @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_newimpl_03.scala b/tests/disabled/macro/run/reify_newimpl_03.scala new file mode 100644 index 000000000..531bc76fe --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_03.scala @@ -0,0 +1,13 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + val code = reify { + val x = 2 + reify{x}.eval + } + println(code.eval) + } +} diff --git a/tests/disabled/macro/run/reify_newimpl_04.check b/tests/disabled/macro/run/reify_newimpl_04.check new file mode 100644 index 000000000..d8263ee98 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_04.check @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_newimpl_04.scala b/tests/disabled/macro/run/reify_newimpl_04.scala new file mode 100644 index 000000000..b6071f843 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_04.scala @@ -0,0 +1,13 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + val code = reify { + var x = 2 + reify{x}.eval + } + println(code.eval) + } +} diff --git a/tests/disabled/macro/run/reify_newimpl_05.check b/tests/disabled/macro/run/reify_newimpl_05.check new file mode 100644 index 000000000..d8263ee98 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_05.check @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_newimpl_05.scala b/tests/disabled/macro/run/reify_newimpl_05.scala new file mode 100644 index 000000000..0ff5bb07c --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_05.scala @@ -0,0 +1,14 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + val code = reify { + var x = 2 + def y = x // forcibly captures x + reify{x}.eval + } + println(code.eval) + } +} diff --git a/tests/disabled/macro/run/reify_newimpl_06.check b/tests/disabled/macro/run/reify_newimpl_06.check new file mode 100644 index 000000000..d8263ee98 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_06.check @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_newimpl_06.scala b/tests/disabled/macro/run/reify_newimpl_06.scala new file mode 100644 index 000000000..8743da100 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_06.scala @@ -0,0 +1,13 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + class C(val y: Int) { + val code = reify { + reify{y}.eval + } + } + + println(new C(2).code.eval) +} diff --git a/tests/disabled/macro/run/reify_newimpl_11.check b/tests/disabled/macro/run/reify_newimpl_11.check new file mode 100644 index 000000000..c019c6db2 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_11.check @@ -0,0 +1,4 @@ +scala.tools.reflect.ToolBoxError: reflective toolbox failed due to unresolved free type variables: + T defined by C in reify_newimpl_11.scala:6:11 +have you forgotten to use TypeTag annotations for type parameters external to a reifee? +if you have troubles tracking free type variables, consider using -Xlog-free-types diff --git a/tests/disabled/macro/run/reify_newimpl_11.scala b/tests/disabled/macro/run/reify_newimpl_11.scala new file mode 100644 index 000000000..bb08808c2 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_11.scala @@ -0,0 +1,19 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + class C[T] { + val code = reify { + List[T](2.asInstanceOf[T]) + } + println(code.eval) + } + + try { + new C[Int] + } catch { + case ex: Throwable => + println(ex) + } +} diff --git a/tests/disabled/macro/run/reify_newimpl_12.check b/tests/disabled/macro/run/reify_newimpl_12.check new file mode 100644 index 000000000..220bd6875 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_12.check @@ -0,0 +1 @@ +List(2) \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_newimpl_12.scala b/tests/disabled/macro/run/reify_newimpl_12.scala new file mode 100644 index 000000000..c2b9d42ca --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_12.scala @@ -0,0 +1,14 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + class C[T: TypeTag] { + val code = reify { + List[T](2.asInstanceOf[T]) + } + println(code.eval) + } + + new C[Int] +} diff --git a/tests/disabled/macro/run/reify_newimpl_13.check b/tests/disabled/macro/run/reify_newimpl_13.check new file mode 100644 index 000000000..13e3c9af1 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_13.check @@ -0,0 +1,4 @@ +scala.tools.reflect.ToolBoxError: reflective toolbox failed due to unresolved free type variables: + T defined by C in reify_newimpl_13.scala:7:13 +have you forgotten to use TypeTag annotations for type parameters external to a reifee? +if you have troubles tracking free type variables, consider using -Xlog-free-types diff --git a/tests/disabled/macro/run/reify_newimpl_13.scala b/tests/disabled/macro/run/reify_newimpl_13.scala new file mode 100644 index 000000000..79a99c334 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_13.scala @@ -0,0 +1,21 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + class C[T] { + val code = reify { + List[T](2.asInstanceOf[T]) + } + println(code.eval) + } + + try { + new C[Int] + } catch { + case ex: Throwable => + println(ex) + } + } +} diff --git a/tests/disabled/macro/run/reify_newimpl_14.check b/tests/disabled/macro/run/reify_newimpl_14.check new file mode 100644 index 000000000..220bd6875 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_14.check @@ -0,0 +1 @@ +List(2) \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_newimpl_14.scala b/tests/disabled/macro/run/reify_newimpl_14.scala new file mode 100644 index 000000000..af2c7f136 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_14.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + class C[T: TypeTag] { + val code = reify { + List[T](2.asInstanceOf[T]) + } + println(code.eval) + } + + new C[Int] + } +} diff --git a/tests/disabled/macro/run/reify_newimpl_15.check b/tests/disabled/macro/run/reify_newimpl_15.check new file mode 100644 index 000000000..220bd6875 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_15.check @@ -0,0 +1 @@ +List(2) \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_newimpl_15.scala b/tests/disabled/macro/run/reify_newimpl_15.scala new file mode 100644 index 000000000..4bcfc7107 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_15.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + class C { + type T = Int + val code = reify { + List[T](2) + } + println(code.eval) + } + + new C +} diff --git a/tests/disabled/macro/run/reify_newimpl_18.check b/tests/disabled/macro/run/reify_newimpl_18.check new file mode 100644 index 000000000..c23af69b0 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_18.check @@ -0,0 +1 @@ +List(2) diff --git a/tests/disabled/macro/run/reify_newimpl_18.scala b/tests/disabled/macro/run/reify_newimpl_18.scala new file mode 100644 index 000000000..e60bed8c7 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_18.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + class C[U: TypeTag] { + type T = U + val code = reify { + List[T](2.asInstanceOf[T]) + } + println(code.eval) + } + + new C[Int] +} diff --git a/tests/disabled/macro/run/reify_newimpl_19.check b/tests/disabled/macro/run/reify_newimpl_19.check new file mode 100644 index 000000000..c749d4f10 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_19.check @@ -0,0 +1,4 @@ +scala.tools.reflect.ToolBoxError: reflective toolbox failed due to unresolved free type variables: + T defined by C in reify_newimpl_19.scala:7:10 +have you forgotten to use TypeTag annotations for type parameters external to a reifee? +if you have troubles tracking free type variables, consider using -Xlog-free-types diff --git a/tests/disabled/macro/run/reify_newimpl_19.scala b/tests/disabled/macro/run/reify_newimpl_19.scala new file mode 100644 index 000000000..eaa6ca206 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_19.scala @@ -0,0 +1,20 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + class C { + type T + val code = reify { + List[T](2.asInstanceOf[T]) + } + println(code.eval) + } + + try { + new C { val T = Int } + } catch { + case ex: Throwable => + println(ex) + } +} diff --git a/tests/disabled/macro/run/reify_newimpl_20.check b/tests/disabled/macro/run/reify_newimpl_20.check new file mode 100644 index 000000000..c23af69b0 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_20.check @@ -0,0 +1 @@ +List(2) diff --git a/tests/disabled/macro/run/reify_newimpl_20.scala b/tests/disabled/macro/run/reify_newimpl_20.scala new file mode 100644 index 000000000..c483e0b7e --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_20.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + class C { + type T + implicit val tt: TypeTag[T] = implicitly[TypeTag[Int]].asInstanceOf[TypeTag[T]] + val code = reify { + List[T](2.asInstanceOf[T]) + } + println(code.eval) + } + + new C { type T = String } // this "mistake" is made for a reason! +} diff --git a/tests/disabled/macro/run/reify_newimpl_21.check b/tests/disabled/macro/run/reify_newimpl_21.check new file mode 100644 index 000000000..c23af69b0 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_21.check @@ -0,0 +1 @@ +List(2) diff --git a/tests/disabled/macro/run/reify_newimpl_21.scala b/tests/disabled/macro/run/reify_newimpl_21.scala new file mode 100644 index 000000000..0875ede6b --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_21.scala @@ -0,0 +1,20 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + trait C { + type T + implicit val tt: TypeTag[T] + lazy val code = reify { + List[T](2.asInstanceOf[T]) + } + } + + class D extends C { + type T = String // this "mistake" is made for a reason! + override val tt: TypeTag[T] = implicitly[TypeTag[Int]].asInstanceOf[TypeTag[T]] + } + + println((new D).code.eval) +} diff --git a/tests/disabled/macro/run/reify_newimpl_22.check b/tests/disabled/macro/run/reify_newimpl_22.check new file mode 100644 index 000000000..952f384a1 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_22.check @@ -0,0 +1,25 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> import scala.reflect.runtime.universe._ +import scala.reflect.runtime.universe._ + +scala> import scala.tools.reflect.ToolBox +import scala.tools.reflect.ToolBox + +scala> import scala.tools.reflect.Eval +import scala.tools.reflect.Eval + +scala> { + val x = 2 + val code = reify { + x + } + println(code.eval) +} +:15: free term: Ident(TermName("x")) defined by res0 in :14:21 + val code = reify { + ^ +2 + +scala> :quit diff --git a/tests/disabled/macro/run/reify_newimpl_22.scala b/tests/disabled/macro/run/reify_newimpl_22.scala new file mode 100644 index 000000000..8512620a1 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_22.scala @@ -0,0 +1,17 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + override def extraSettings = "-Xlog-free-terms" + def code = """ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval +{ + val x = 2 + val code = reify { + x + } + println(code.eval) +} + """ +} \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_newimpl_23.check b/tests/disabled/macro/run/reify_newimpl_23.check new file mode 100644 index 000000000..b7e9bfdfb --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_23.check @@ -0,0 +1,24 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> import scala.reflect.runtime.universe._ +import scala.reflect.runtime.universe._ + +scala> import scala.tools.reflect.ToolBox +import scala.tools.reflect.ToolBox + +scala> import scala.tools.reflect.Eval +import scala.tools.reflect.Eval + +scala> def foo[T]{ + val code = reify { + List[T]() + } + println(code.eval) +} +:13: free type: Ident(TypeName("T")) defined by foo in :12:16 + val code = reify { + ^ +foo: [T]=> Unit + +scala> :quit diff --git a/tests/disabled/macro/run/reify_newimpl_23.scala b/tests/disabled/macro/run/reify_newimpl_23.scala new file mode 100644 index 000000000..d4c2a68ce --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_23.scala @@ -0,0 +1,16 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + override def extraSettings = "-Xlog-free-types" + def code = """ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval +def foo[T]{ + val code = reify { + List[T]() + } + println(code.eval) +} + """ +} \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_newimpl_27.check b/tests/disabled/macro/run/reify_newimpl_27.check new file mode 100644 index 000000000..c23af69b0 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_27.check @@ -0,0 +1 @@ +List(2) diff --git a/tests/disabled/macro/run/reify_newimpl_27.scala b/tests/disabled/macro/run/reify_newimpl_27.scala new file mode 100644 index 000000000..332dbec91 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_27.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + object C { + type T = Int + val code = reify { + List[T](2) + } + println(code.eval) + } + + C +} diff --git a/tests/disabled/macro/run/reify_newimpl_29.check b/tests/disabled/macro/run/reify_newimpl_29.check new file mode 100644 index 000000000..c23af69b0 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_29.check @@ -0,0 +1 @@ +List(2) diff --git a/tests/disabled/macro/run/reify_newimpl_29.scala b/tests/disabled/macro/run/reify_newimpl_29.scala new file mode 100644 index 000000000..1865075f4 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_29.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + class C { + type T = Int + val code = reify { + List[C#T](2) + } + println(code.eval) + } + + new C +} diff --git a/tests/disabled/macro/run/reify_newimpl_30.check b/tests/disabled/macro/run/reify_newimpl_30.check new file mode 100644 index 000000000..7557c750a --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_30.check @@ -0,0 +1,4 @@ +reflective toolbox failed due to unresolved free type variables: + C defined by in reify_newimpl_30.scala:7:11 +have you forgotten to use TypeTag annotations for type parameters external to a reifee? +if you have troubles tracking free type variables, consider using -Xlog-free-types diff --git a/tests/disabled/macro/run/reify_newimpl_30.scala b/tests/disabled/macro/run/reify_newimpl_30.scala new file mode 100644 index 000000000..afc199d50 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_30.scala @@ -0,0 +1,18 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.{ ToolBox, ToolBoxError } +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + class C { + type T = Int + val code = reify { + List[C#T](2) + } + try { println(code.eval) } + catch { case e: ToolBoxError => println(e.getMessage) } + } + + new C + } +} diff --git a/tests/disabled/macro/run/reify_newimpl_31.check b/tests/disabled/macro/run/reify_newimpl_31.check new file mode 100644 index 000000000..c23af69b0 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_31.check @@ -0,0 +1 @@ +List(2) diff --git a/tests/disabled/macro/run/reify_newimpl_31.scala b/tests/disabled/macro/run/reify_newimpl_31.scala new file mode 100644 index 000000000..535c9b67b --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_31.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + object C { + type T = Int + val code = reify { + List[C.T](2) + } + println(code.eval) + } + + C +} diff --git a/tests/disabled/macro/run/reify_newimpl_33.check b/tests/disabled/macro/run/reify_newimpl_33.check new file mode 100644 index 000000000..c23af69b0 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_33.check @@ -0,0 +1 @@ +List(2) diff --git a/tests/disabled/macro/run/reify_newimpl_33.scala b/tests/disabled/macro/run/reify_newimpl_33.scala new file mode 100644 index 000000000..55a808eda --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_33.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + object C { + type T = Int + val c = C + val code = reify { + List[c.T](2) + } + println(code.eval) + } + + C +} diff --git a/tests/disabled/macro/run/reify_newimpl_35.check b/tests/disabled/macro/run/reify_newimpl_35.check new file mode 100644 index 000000000..bd9b3a2fb --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_35.check @@ -0,0 +1,13 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> import scala.reflect.runtime.universe._ +import scala.reflect.runtime.universe._ + +scala> def foo[T: TypeTag] = reify{List[T]()} +foo: [T](implicit evidence$1: reflect.runtime.universe.TypeTag[T])reflect.runtime.universe.Expr[List[T]] + +scala> println(foo) +Expr[List[Nothing]](Nil) + +scala> :quit diff --git a/tests/disabled/macro/run/reify_newimpl_35.scala b/tests/disabled/macro/run/reify_newimpl_35.scala new file mode 100644 index 000000000..f2ebf5181 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_35.scala @@ -0,0 +1,10 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + override def extraSettings = "-Xlog-free-types" + def code = """ +import scala.reflect.runtime.universe._ +def foo[T: TypeTag] = reify{List[T]()} +println(foo) + """ +} diff --git a/tests/disabled/macro/run/reify_newimpl_36.check b/tests/disabled/macro/run/reify_newimpl_36.check new file mode 100644 index 000000000..d81cc0710 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_36.check @@ -0,0 +1 @@ +42 diff --git a/tests/disabled/macro/run/reify_newimpl_36.scala b/tests/disabled/macro/run/reify_newimpl_36.scala new file mode 100644 index 000000000..19f8617c6 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_36.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + val x = 42 + def foo() = reify(reify(x)); + { + val x = 2 + val code1 = foo() + val code2 = code1.eval + println(code2.eval) + } + } +} diff --git a/tests/disabled/macro/run/reify_newimpl_37.check b/tests/disabled/macro/run/reify_newimpl_37.check new file mode 100644 index 000000000..d81cc0710 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_37.check @@ -0,0 +1 @@ +42 diff --git a/tests/disabled/macro/run/reify_newimpl_37.scala b/tests/disabled/macro/run/reify_newimpl_37.scala new file mode 100644 index 000000000..5eeda2125 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_37.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + val x = 42 + def foo() = reify(reify(reify(x))); + { + val x = 2 + val code1 = foo() + val code2 = code1.eval + val code3 = code2.eval + println(code3.eval) + } + } +} diff --git a/tests/disabled/macro/run/reify_newimpl_38.check b/tests/disabled/macro/run/reify_newimpl_38.check new file mode 100644 index 000000000..d81cc0710 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_38.check @@ -0,0 +1 @@ +42 diff --git a/tests/disabled/macro/run/reify_newimpl_38.scala b/tests/disabled/macro/run/reify_newimpl_38.scala new file mode 100644 index 000000000..a313b7d8d --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_38.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + val x = 42 + def foo() = reify{ val y = x; reify(y) }; + { + val x = 2 + val code1 = foo() + val code2 = code1.eval + println(code2.eval) + } + } +} diff --git a/tests/disabled/macro/run/reify_newimpl_39.check b/tests/disabled/macro/run/reify_newimpl_39.check new file mode 100644 index 000000000..d81cc0710 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_39.check @@ -0,0 +1 @@ +42 diff --git a/tests/disabled/macro/run/reify_newimpl_39.scala b/tests/disabled/macro/run/reify_newimpl_39.scala new file mode 100644 index 000000000..4b779fc07 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_39.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + val x = 42 + def foo() = reify{ val y = x; reify{ val z = y; reify(z) } }; + { + val x = 2 + val code1 = foo() + val code2 = code1.eval + val code3 = code2.eval + println(code3.eval) + } + } +} diff --git a/tests/disabled/macro/run/reify_newimpl_40.check b/tests/disabled/macro/run/reify_newimpl_40.check new file mode 100644 index 000000000..cc0001ab3 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_40.check @@ -0,0 +1 @@ +74088 diff --git a/tests/disabled/macro/run/reify_newimpl_40.scala b/tests/disabled/macro/run/reify_newimpl_40.scala new file mode 100644 index 000000000..1bc37973f --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_40.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + val x = 42 + def foo() = reify{ val y = x; reify{ val z = y * x; reify(z * x) } }; + { + val x = 2 + val code1 = foo() + val code2 = code1.eval + val code3 = code2.eval + println(code3.eval) + } + } +} diff --git a/tests/disabled/macro/run/reify_newimpl_41.check b/tests/disabled/macro/run/reify_newimpl_41.check new file mode 100644 index 000000000..0b427f2ee --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_41.check @@ -0,0 +1,3 @@ +42 +44 +43 \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_newimpl_41.scala b/tests/disabled/macro/run/reify_newimpl_41.scala new file mode 100644 index 000000000..514e206a3 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_41.scala @@ -0,0 +1,18 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + var _x = 42 + def x = { val x0 = _x; _x += 1; x0 } + var _y = 1 + def y = { val y0 = _y + _x; _y += y0; y0 } + val code = reify { + def foo = y // ensures that y is the first freevar we find + println(x) + println(y) + println(x) + } + code.eval + } +} diff --git a/tests/disabled/macro/run/reify_newimpl_42.check b/tests/disabled/macro/run/reify_newimpl_42.check new file mode 100644 index 000000000..0b427f2ee --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_42.check @@ -0,0 +1,3 @@ +42 +44 +43 \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_newimpl_42.scala b/tests/disabled/macro/run/reify_newimpl_42.scala new file mode 100644 index 000000000..64c1cf345 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_42.scala @@ -0,0 +1,17 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + var _x = 42 + def x = { val x0 = _x; _x += 1; x0 } + var _y = 1 + def y = { val y0 = _y + _x; _y += y0; y0 } + val code = reify { + println(x) + println(y) + println(x) + } + code.eval + } +} diff --git a/tests/disabled/macro/run/reify_newimpl_43.check b/tests/disabled/macro/run/reify_newimpl_43.check new file mode 100644 index 000000000..7a754f414 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_43.check @@ -0,0 +1,2 @@ +1 +2 \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_newimpl_43.scala b/tests/disabled/macro/run/reify_newimpl_43.scala new file mode 100644 index 000000000..736536cb3 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_43.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + var counter = 0 + lazy val x = { counter += 1; counter } + lazy val y = { counter += 1; counter } + val code = reify { + def foo = y // ensures that y is the first freevar we find + println(x) + println(y) + } + code.eval + } +} diff --git a/tests/disabled/macro/run/reify_newimpl_44.check b/tests/disabled/macro/run/reify_newimpl_44.check new file mode 100644 index 000000000..7a754f414 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_44.check @@ -0,0 +1,2 @@ +1 +2 \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_newimpl_44.scala b/tests/disabled/macro/run/reify_newimpl_44.scala new file mode 100644 index 000000000..736536cb3 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_44.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + var counter = 0 + lazy val x = { counter += 1; counter } + lazy val y = { counter += 1; counter } + val code = reify { + def foo = y // ensures that y is the first freevar we find + println(x) + println(y) + } + code.eval + } +} diff --git a/tests/disabled/macro/run/reify_newimpl_45.check b/tests/disabled/macro/run/reify_newimpl_45.check new file mode 100644 index 000000000..6e14f71e2 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_45.check @@ -0,0 +1,2 @@ +List(free type T) +ima worx: 2 \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_newimpl_45.scala b/tests/disabled/macro/run/reify_newimpl_45.scala new file mode 100644 index 000000000..cfda46a6a --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_45.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox +import internal._ + +object Test extends dotty.runtime.LegacyApp { + class C[T >: Null] { + val code = reify{val x: T = "2".asInstanceOf[T]; println("ima worx: %s".format(x)); x} + println(freeTypes(code.tree)) + val tree = substituteSymbols(code.tree, freeTypes(code.tree), List(definitions.StringClass)) + cm.mkToolBox().eval(tree) + } + + new C[String] +} diff --git a/tests/disabled/macro/run/reify_newimpl_47.check b/tests/disabled/macro/run/reify_newimpl_47.check new file mode 100644 index 000000000..d8263ee98 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_47.check @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_newimpl_47.scala b/tests/disabled/macro/run/reify_newimpl_47.scala new file mode 100644 index 000000000..c0ad6cbe5 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_47.scala @@ -0,0 +1,17 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + val outer = { + val x = 2 + reify{x} + } + + val code = reify{ + val x = 42 + outer.splice + } + + println(code.eval) +} diff --git a/tests/disabled/macro/run/reify_newimpl_48.check b/tests/disabled/macro/run/reify_newimpl_48.check new file mode 100644 index 000000000..f11c82a4c --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_48.check @@ -0,0 +1 @@ +9 \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_newimpl_48.scala b/tests/disabled/macro/run/reify_newimpl_48.scala new file mode 100644 index 000000000..7d1c1d642 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_48.scala @@ -0,0 +1,22 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + val outer1 = { + val x = 2 + reify{x} + } + + val outer2 = { + val x = 3 + reify{x} + } + + val code = reify{ + val x = 4 + x + outer1.splice + outer2.splice + } + + println(code.eval) +} diff --git a/tests/disabled/macro/run/reify_newimpl_49.check b/tests/disabled/macro/run/reify_newimpl_49.check new file mode 100644 index 000000000..d8a621df0 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_49.check @@ -0,0 +1,3 @@ +3 +3 +5 \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_newimpl_49.scala b/tests/disabled/macro/run/reify_newimpl_49.scala new file mode 100644 index 000000000..61ddfafa3 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_49.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + var y = 1 + def x = { y += 2; y } + val code = reify { + def foo = y // ensures that y is the first freevar we find + println(x) + println(y) + println(x) + } + code.eval + } +} diff --git a/tests/disabled/macro/run/reify_newimpl_50.check b/tests/disabled/macro/run/reify_newimpl_50.check new file mode 100644 index 000000000..d8a621df0 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_50.check @@ -0,0 +1,3 @@ +3 +3 +5 \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_newimpl_50.scala b/tests/disabled/macro/run/reify_newimpl_50.scala new file mode 100644 index 000000000..8ecdeb55c --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_50.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + var y = 1 + def x = { y += 2; y } + val code = reify { + println(x) + println(y) + println(x) + } + code.eval + } +} diff --git a/tests/disabled/macro/run/reify_newimpl_51.check b/tests/disabled/macro/run/reify_newimpl_51.check new file mode 100644 index 000000000..9a4ddeacd --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_51.check @@ -0,0 +1,3 @@ +2 +1 +2 \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_newimpl_51.scala b/tests/disabled/macro/run/reify_newimpl_51.scala new file mode 100644 index 000000000..8a4a325f0 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_51.scala @@ -0,0 +1,18 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + var counter = 0 + lazy val x = { counter += 1; counter } + lazy val y = { counter += 1; counter } + val code = reify { + def foo = y // ensures that y is the first freevar we find + val bar = reify { println(x * y) } + bar.eval + println(x) + println(y) + } + code.eval + } +} diff --git a/tests/disabled/macro/run/reify_newimpl_52.check b/tests/disabled/macro/run/reify_newimpl_52.check new file mode 100644 index 000000000..9359a2b21 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_52.check @@ -0,0 +1,3 @@ +2 +2 +1 \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_newimpl_52.scala b/tests/disabled/macro/run/reify_newimpl_52.scala new file mode 100644 index 000000000..4dc82b145 --- /dev/null +++ b/tests/disabled/macro/run/reify_newimpl_52.scala @@ -0,0 +1,18 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + var counter = 0 + lazy val x = { counter += 1; counter } + lazy val y = { counter += 1; counter } + val code = reify { + def foo = y // ensures that y is the first freevar we find + val bar = reify { println(y * x) } + bar.eval + println(x) + println(y) + } + code.eval + } +} diff --git a/tests/disabled/macro/run/reify_printf.check b/tests/disabled/macro/run/reify_printf.check new file mode 100644 index 000000000..3b18e512d --- /dev/null +++ b/tests/disabled/macro/run/reify_printf.check @@ -0,0 +1 @@ +hello world diff --git a/tests/disabled/macro/run/reify_printf.scala b/tests/disabled/macro/run/reify_printf.scala new file mode 100644 index 000000000..b957c41bb --- /dev/null +++ b/tests/disabled/macro/run/reify_printf.scala @@ -0,0 +1,71 @@ +import java.io.{ ByteArrayOutputStream, PrintStream } +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox +import scala.reflect.api._ +import scala.reflect.api.Trees +import scala.reflect.internal.Types +import scala.util.matching.Regex + +object Test extends dotty.runtime.LegacyApp { + //val output = new ByteArrayOutputStream() + //Console.setOut(new PrintStream(output)) + val toolbox = cm.mkToolBox() + + val tree = tree_printf(reify("hello %s").tree, reify("world").tree) + val evaluated = toolbox.eval(tree) + //assert(output.toString() == "hello world", output.toString() +" == hello world") + + /* + // upd. Oh, good old times, our very-very first experiments with macros :) + macro def printf(format: String, params: Any*) : String = tree_printf(format: Tree, (params: Seq[Tree]): _*) + */ + + var i = 0 + def gensym(name: String) = { i += 1; TermName(name + i) } + + def createTempValDef( value : Tree, tpe : Type ) : (Option[Tree],Tree) = { + val local = gensym("temp") + ( + Some( + ValDef( + NoMods + , local + , TypeTree(tpe) + , value + ) + ) + , Ident(local) + ) + } + + def tree_printf(format: Tree, params: Tree*) = { + val Literal(Constant(s_format: String)) = format + val paramsStack = scala.collection.mutable.Stack(params: _*) + val parsed = s_format.split("(?<=%[\\w%])|(?=%[\\w%])") map { + case "%d" => createTempValDef( paramsStack.pop, typeOf[Int] ) + case "%s" => createTempValDef( paramsStack.pop, typeOf[String] ) + case "%%" => { + (None:Option[Tree], Literal(Constant("%"))) + } + case part => { + (None:Option[Tree], Literal(Constant(part))) + } + } + + val evals = for ((Some(eval), _) <- parsed if eval != None) yield (eval: Tree) + val prints = for ((_, ref) <- parsed) yield + Apply( + Select( + Select( + Ident( TermName("scala") ) + , TermName("Predef") + ) + , TermName("print") + ) + , List(ref) + ): Tree + Block((evals ++ prints).toList, Literal(Constant(()))) + } +} diff --git a/tests/disabled/macro/run/reify_properties.check b/tests/disabled/macro/run/reify_properties.check new file mode 100644 index 000000000..d769bea4b --- /dev/null +++ b/tests/disabled/macro/run/reify_properties.check @@ -0,0 +1,2 @@ +user1: MR. ROBERT +user2: MR. BOB KUZ diff --git a/tests/disabled/macro/run/reify_properties.scala b/tests/disabled/macro/run/reify_properties.scala new file mode 100644 index 000000000..b6ce5f305 --- /dev/null +++ b/tests/disabled/macro/run/reify_properties.scala @@ -0,0 +1,57 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + /** A mutable property whose getter and setter may be customized. */ + case class Property[T](init: T) { + private var value: T = init + + /** The getter function, defaults to identity. */ + private var setter: T => T = identity[T] + + /** The setter function, defaults to identity. */ + private var getter: T => T = identity[T] + + /** Retrive the value held in this property. */ + def apply(): T = getter(value) + + /** Update the value held in this property, through the setter. */ + def update(newValue: T) = value = setter(newValue) + + /** Change the getter. */ + def get(newGetter: T => T) = { getter = newGetter; this } + + /** Change the setter */ + def set(newSetter: T => T) = { setter = newSetter; this } + } + + class User { + // Create a property with custom getter and setter + val firstname = Property("") + .get { v => v.toUpperCase() } + .set { v => "Mr. " + v } + val lastname = Property("") + + /** Scala provides syntactic sugar for calling 'apply'. Simply + * adding a list of arguments between parenthesis (in this case, + * an empty list) is translated to a call to 'apply' with those + * arguments. + */ + override def toString() = firstname() + " " + lastname() + } + + val user1 = new User + + // Syntactic sugar for 'update': an assignment is translated to a + // call to method 'update' + user1.firstname() = "Robert" + + val user2 = new User + user2.firstname() = "bob" + user2.lastname() = "KUZ" + + println("user1: " + user1) + println("user2: " + user2) + }.eval +} diff --git a/tests/disabled/macro/run/reify_renamed_term_basic.check b/tests/disabled/macro/run/reify_renamed_term_basic.check new file mode 100644 index 000000000..e78f94fff --- /dev/null +++ b/tests/disabled/macro/run/reify_renamed_term_basic.check @@ -0,0 +1 @@ +((),(),()) diff --git a/tests/disabled/macro/run/reify_renamed_term_basic.scala b/tests/disabled/macro/run/reify_renamed_term_basic.scala new file mode 100644 index 000000000..7971d3d11 --- /dev/null +++ b/tests/disabled/macro/run/reify_renamed_term_basic.scala @@ -0,0 +1,20 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object A { + object B { + val c = () + } +} + +object Test extends dotty.runtime.LegacyApp { + import A.{B => X} + import A.B.{c => y} + import X.{c => z} + + val expr = reify ( + X.c, y, z + ) + + println(expr.eval) +} diff --git a/tests/disabled/macro/run/reify_renamed_term_local_to_reifee.check b/tests/disabled/macro/run/reify_renamed_term_local_to_reifee.check new file mode 100644 index 000000000..e78f94fff --- /dev/null +++ b/tests/disabled/macro/run/reify_renamed_term_local_to_reifee.check @@ -0,0 +1 @@ +((),(),()) diff --git a/tests/disabled/macro/run/reify_renamed_term_local_to_reifee.scala b/tests/disabled/macro/run/reify_renamed_term_local_to_reifee.scala new file mode 100644 index 000000000..b93279376 --- /dev/null +++ b/tests/disabled/macro/run/reify_renamed_term_local_to_reifee.scala @@ -0,0 +1,20 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object A { + object B { + val c = () + } +} + +object Test extends dotty.runtime.LegacyApp { + val expr = reify { + import A.{B => X} + import A.B.{c => y} + import X.{c => z} + + (X.c, y, z) + } + + println(expr.eval) +} diff --git a/tests/disabled/macro/run/reify_renamed_term_overloaded_method.check b/tests/disabled/macro/run/reify_renamed_term_overloaded_method.check new file mode 100644 index 000000000..48082f72f --- /dev/null +++ b/tests/disabled/macro/run/reify_renamed_term_overloaded_method.check @@ -0,0 +1 @@ +12 diff --git a/tests/disabled/macro/run/reify_renamed_term_overloaded_method.scala b/tests/disabled/macro/run/reify_renamed_term_overloaded_method.scala new file mode 100644 index 000000000..1f7897679 --- /dev/null +++ b/tests/disabled/macro/run/reify_renamed_term_overloaded_method.scala @@ -0,0 +1,17 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object O { + def show(i: Int) = i.toString + def show(s: String) = s +} + +object Test extends dotty.runtime.LegacyApp { + import O.{show => s} + + val expr = reify { + s("1") + s(2) + } + + println(expr.eval) +} diff --git a/tests/disabled/macro/run/reify_renamed_term_t5841.check b/tests/disabled/macro/run/reify_renamed_term_t5841.check new file mode 100644 index 000000000..6031277b7 --- /dev/null +++ b/tests/disabled/macro/run/reify_renamed_term_t5841.check @@ -0,0 +1 @@ +class scala.reflect.runtime.JavaUniverse diff --git a/tests/disabled/macro/run/reify_renamed_term_t5841.scala b/tests/disabled/macro/run/reify_renamed_term_t5841.scala new file mode 100644 index 000000000..d4c051c1b --- /dev/null +++ b/tests/disabled/macro/run/reify_renamed_term_t5841.scala @@ -0,0 +1,7 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + println(reify{ru}.eval.getClass) +} diff --git a/tests/disabled/macro/run/reify_renamed_type_basic.check b/tests/disabled/macro/run/reify_renamed_type_basic.check new file mode 100644 index 000000000..6a452c185 --- /dev/null +++ b/tests/disabled/macro/run/reify_renamed_type_basic.check @@ -0,0 +1 @@ +() diff --git a/tests/disabled/macro/run/reify_renamed_type_basic.scala b/tests/disabled/macro/run/reify_renamed_type_basic.scala new file mode 100644 index 000000000..50506e144 --- /dev/null +++ b/tests/disabled/macro/run/reify_renamed_type_basic.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object O { + type A = Unit +} + +object Test extends dotty.runtime.LegacyApp { + import O.{A => X} + + def expr = reify { + val a: X = () + } + + println(expr.eval) +} diff --git a/tests/disabled/macro/run/reify_renamed_type_local_to_reifee.check b/tests/disabled/macro/run/reify_renamed_type_local_to_reifee.check new file mode 100644 index 000000000..6a452c185 --- /dev/null +++ b/tests/disabled/macro/run/reify_renamed_type_local_to_reifee.check @@ -0,0 +1 @@ +() diff --git a/tests/disabled/macro/run/reify_renamed_type_local_to_reifee.scala b/tests/disabled/macro/run/reify_renamed_type_local_to_reifee.scala new file mode 100644 index 000000000..01280e993 --- /dev/null +++ b/tests/disabled/macro/run/reify_renamed_type_local_to_reifee.scala @@ -0,0 +1,24 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object O { + type A = Unit +} + +object Test extends dotty.runtime.LegacyApp { + val expr = reify { + import O.{A => X} + + val a: X = () + + object P { + type B = Unit + } + + import P.{B => Y} + + val b: Y = () + } + + println(expr.eval) +} diff --git a/tests/disabled/macro/run/reify_renamed_type_spliceable.check b/tests/disabled/macro/run/reify_renamed_type_spliceable.check new file mode 100644 index 000000000..6a452c185 --- /dev/null +++ b/tests/disabled/macro/run/reify_renamed_type_spliceable.check @@ -0,0 +1 @@ +() diff --git a/tests/disabled/macro/run/reify_renamed_type_spliceable.scala b/tests/disabled/macro/run/reify_renamed_type_spliceable.scala new file mode 100644 index 000000000..6a34d1722 --- /dev/null +++ b/tests/disabled/macro/run/reify_renamed_type_spliceable.scala @@ -0,0 +1,21 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +abstract class C { + type T >: Null +} + +object Test extends dotty.runtime.LegacyApp { + def foo(c: C) = { + import c.{T => U} + reify { + val x: U = null + } + } + + val expr = foo(new C { + type T = AnyRef + }) + + println(expr.eval) +} diff --git a/tests/disabled/macro/run/reify_sort.check b/tests/disabled/macro/run/reify_sort.check new file mode 100644 index 000000000..375536cc2 --- /dev/null +++ b/tests/disabled/macro/run/reify_sort.check @@ -0,0 +1,2 @@ +[6,2,8,5,1] +[1,2,5,6,8] diff --git a/tests/disabled/macro/run/reify_sort.scala b/tests/disabled/macro/run/reify_sort.scala new file mode 100644 index 000000000..b484111ed --- /dev/null +++ b/tests/disabled/macro/run/reify_sort.scala @@ -0,0 +1,51 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + /** Nested methods can use and even update everything + * visible in their scope (including local variables or + * arguments of enclosing methods). + */ + def sort(a: Array[Int]): Unit = { + + def swap(i: Int, j: Int): Unit = { + val t = a(i); a(i) = a(j); a(j) = t + } + + def sort1(l: Int, r: Int): Unit = { + val pivot = a((l + r) / 2) + var i = l + var j = r + while (i <= j) { + while (a(i) < pivot) i += 1 + while (a(j) > pivot) j -= 1 + if (i <= j) { + swap(i, j) + i += 1 + j -= 1 + } + } + if (l < j) sort1(l, j) + if (j < r) sort1(i, r) + } + + if (a.length > 0) + sort1(0, a.length - 1) + } + + def println(ar: Array[Int]): Unit = { + def print1 = { + def iter(i: Int): String = + ar(i) + (if (i < ar.length-1) "," + iter(i+1) else "") + if (ar.length == 0) "" else iter(0) + } + Console.println("[" + print1 + "]") + } + + val ar = Array(6, 2, 8, 5, 1) + println(ar) + sort(ar) + println(ar) + }.eval +} diff --git a/tests/disabled/macro/run/reify_sort1.check b/tests/disabled/macro/run/reify_sort1.check new file mode 100644 index 000000000..0d3080514 --- /dev/null +++ b/tests/disabled/macro/run/reify_sort1.check @@ -0,0 +1,2 @@ +List(6, 2, 8, 5, 1) +List(1, 2, 5, 6, 8) diff --git a/tests/disabled/macro/run/reify_sort1.scala b/tests/disabled/macro/run/reify_sort1.scala new file mode 100644 index 000000000..24ca06283 --- /dev/null +++ b/tests/disabled/macro/run/reify_sort1.scala @@ -0,0 +1,21 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + def sort(a: List[Int]): List[Int] = { + if (a.length < 2) + a + else { + val pivot = a(a.length / 2) + sort(a.filter(_ < pivot)) ::: + a.filter(_ == pivot) ::: + sort(a.filter(_ > pivot)) + } + } + + val xs = List(6, 2, 8, 5, 1) + println(xs) + println(sort(xs)) + }.eval +} diff --git a/tests/disabled/macro/run/reify_this.check b/tests/disabled/macro/run/reify_this.check new file mode 100644 index 000000000..af3d0652a --- /dev/null +++ b/tests/disabled/macro/run/reify_this.check @@ -0,0 +1,5 @@ +foo +false +2 +bar +2 \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_this.scala b/tests/disabled/macro/run/reify_this.scala new file mode 100644 index 000000000..339fcca54 --- /dev/null +++ b/tests/disabled/macro/run/reify_this.scala @@ -0,0 +1,20 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +trait Transvaal { + def eval(tree: Expr[_]) = tree.eval +} + +object Test extends dotty.runtime.LegacyApp with Transvaal { + // select a value from package + eval(reify{println("foo")}) + eval(reify{println((new Object).toString == (new Object).toString)}) + + // select a type from package + eval(reify{val x: Any = 2; println(x)}) + eval(reify{val x: Object = "bar"; println(x)}) + + // select a value from module + val x = 2 + eval(reify{println(x)}) +} diff --git a/tests/disabled/macro/run/reify_timeofday.check b/tests/disabled/macro/run/reify_timeofday.check new file mode 100644 index 000000000..3fd3b76a6 --- /dev/null +++ b/tests/disabled/macro/run/reify_timeofday.check @@ -0,0 +1 @@ +DateError diff --git a/tests/disabled/macro/run/reify_timeofday.scala b/tests/disabled/macro/run/reify_timeofday.scala new file mode 100644 index 000000000..ff30a962b --- /dev/null +++ b/tests/disabled/macro/run/reify_timeofday.scala @@ -0,0 +1,42 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + class DateError extends Exception + + /** Simulating properties in Scala + * (example 4.2.1 in ScalaReference.pdf) + */ + class TimeOfDayVar { + private var h, m, s: Int = 0 + + def hours = h + + /** A method 'ident_=' is a setter for 'ident'. 'code.ident = ...' will + * be translated to a call to 'ident_=' + */ + def hours_= (h: Int) = + if (0 <= h && h < 24) this.h = h + else throw new DateError() + + def minutes = m + def minutes_= (m: Int) = + if (0 <= m && m < 60) this.m = m + else throw new DateError() + + def seconds = s + def seconds_= (s: Int) = + if (0 <= s && s < 60) this.s = s + else throw new DateError() + } + + val d = new TimeOfDayVar + d.hours = 8; d.minutes = 30; d.seconds = 0 + try { d.hours = 25 // throws a DateError exception + } catch { + case de: DateError => println("DateError") + case e: Exception => println("Exception") + } + }.eval +} diff --git a/tests/disabled/macro/run/reify_typerefs_1a.check b/tests/disabled/macro/run/reify_typerefs_1a.check new file mode 100644 index 000000000..919c298ba --- /dev/null +++ b/tests/disabled/macro/run/reify_typerefs_1a.check @@ -0,0 +1 @@ +evaluated = List(Expression, Expression) \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_typerefs_1a.scala b/tests/disabled/macro/run/reify_typerefs_1a.scala new file mode 100644 index 000000000..b4f608a95 --- /dev/null +++ b/tests/disabled/macro/run/reify_typerefs_1a.scala @@ -0,0 +1,18 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +class Expression { + override def toString = "Expression" +} + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + List(new Expression, new Expression) + }; + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/disabled/macro/run/reify_typerefs_1b.check b/tests/disabled/macro/run/reify_typerefs_1b.check new file mode 100644 index 000000000..919c298ba --- /dev/null +++ b/tests/disabled/macro/run/reify_typerefs_1b.check @@ -0,0 +1 @@ +evaluated = List(Expression, Expression) \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_typerefs_1b.scala b/tests/disabled/macro/run/reify_typerefs_1b.scala new file mode 100644 index 000000000..7c4d025f0 --- /dev/null +++ b/tests/disabled/macro/run/reify_typerefs_1b.scala @@ -0,0 +1,18 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Expression { + override def toString = "Expression" +} + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + List(Expression, Expression) + }; + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/disabled/macro/run/reify_typerefs_2a.check b/tests/disabled/macro/run/reify_typerefs_2a.check new file mode 100644 index 000000000..919c298ba --- /dev/null +++ b/tests/disabled/macro/run/reify_typerefs_2a.check @@ -0,0 +1 @@ +evaluated = List(Expression, Expression) \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_typerefs_2a.scala b/tests/disabled/macro/run/reify_typerefs_2a.scala new file mode 100644 index 000000000..a2d5676c0 --- /dev/null +++ b/tests/disabled/macro/run/reify_typerefs_2a.scala @@ -0,0 +1,20 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +package foo { + class Expression { + override def toString = "Expression" + } +} + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + List(new foo.Expression, new foo.Expression) + }; + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/disabled/macro/run/reify_typerefs_2b.check b/tests/disabled/macro/run/reify_typerefs_2b.check new file mode 100644 index 000000000..919c298ba --- /dev/null +++ b/tests/disabled/macro/run/reify_typerefs_2b.check @@ -0,0 +1 @@ +evaluated = List(Expression, Expression) \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_typerefs_2b.scala b/tests/disabled/macro/run/reify_typerefs_2b.scala new file mode 100644 index 000000000..f5543eaf6 --- /dev/null +++ b/tests/disabled/macro/run/reify_typerefs_2b.scala @@ -0,0 +1,20 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +package foo { + object Expression { + override def toString = "Expression" + } +} + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + List(foo.Expression, foo.Expression) + }; + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/disabled/macro/run/reify_typerefs_3a.check b/tests/disabled/macro/run/reify_typerefs_3a.check new file mode 100644 index 000000000..919c298ba --- /dev/null +++ b/tests/disabled/macro/run/reify_typerefs_3a.check @@ -0,0 +1 @@ +evaluated = List(Expression, Expression) \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_typerefs_3a.scala b/tests/disabled/macro/run/reify_typerefs_3a.scala new file mode 100644 index 000000000..8d81721f1 --- /dev/null +++ b/tests/disabled/macro/run/reify_typerefs_3a.scala @@ -0,0 +1,20 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object foo { + class Expression { + override def toString = "Expression" + } +} + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + List(new foo.Expression, new foo.Expression) + }; + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/disabled/macro/run/reify_typerefs_3b.check b/tests/disabled/macro/run/reify_typerefs_3b.check new file mode 100644 index 000000000..919c298ba --- /dev/null +++ b/tests/disabled/macro/run/reify_typerefs_3b.check @@ -0,0 +1 @@ +evaluated = List(Expression, Expression) \ No newline at end of file diff --git a/tests/disabled/macro/run/reify_typerefs_3b.scala b/tests/disabled/macro/run/reify_typerefs_3b.scala new file mode 100644 index 000000000..212f40fc0 --- /dev/null +++ b/tests/disabled/macro/run/reify_typerefs_3b.scala @@ -0,0 +1,20 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object foo { + object Expression { + override def toString = "Expression" + } +} + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + List(foo.Expression, foo.Expression) + }; + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/disabled/macro/run/reify_varargs.check b/tests/disabled/macro/run/reify_varargs.check new file mode 100644 index 000000000..e300a570a --- /dev/null +++ b/tests/disabled/macro/run/reify_varargs.check @@ -0,0 +1 @@ +Message=On the fifth of August there was a disturbance in the Force on planet Hoth. diff --git a/tests/disabled/macro/run/reify_varargs.scala b/tests/disabled/macro/run/reify_varargs.scala new file mode 100644 index 000000000..36777fe98 --- /dev/null +++ b/tests/disabled/macro/run/reify_varargs.scala @@ -0,0 +1,11 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + val msg = java.text.MessageFormat.format( + "On {1} there was {2} on planet {0}.", + "Hoth", "the fifth of August", "a disturbance in the Force") + println("Message="+msg) + }.eval +} diff --git a/tests/disabled/macro/run/repl-term-macros.check b/tests/disabled/macro/run/repl-term-macros.check new file mode 100644 index 000000000..2cd0b93cd --- /dev/null +++ b/tests/disabled/macro/run/repl-term-macros.check @@ -0,0 +1,40 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> import scala.reflect.macros.blackbox.Context +import scala.reflect.macros.blackbox.Context + +scala> import language.experimental.macros +import language.experimental.macros + +scala> + +scala> def impl1(c: Context) = { import c.universe._; c.Expr[Unit](q"()") } +impl1: (c: scala.reflect.macros.blackbox.Context)c.Expr[Unit] + +scala> def foo1: Unit = macro impl1 +defined term macro foo1: Unit + +scala> foo1 + +scala> + +scala> def impl2(c: Context)() = { import c.universe._; c.Expr[Unit](q"()") } +impl2: (c: scala.reflect.macros.blackbox.Context)()c.Expr[Unit] + +scala> def foo2(): Unit = macro impl2 +defined term macro foo2: ()Unit + +scala> foo2() + +scala> + +scala> def impl3(c: Context)(x: c.Expr[Int])(y: c.Expr[Int]) = { import c.universe._; c.Expr[Unit](q"()") } +impl3: (c: scala.reflect.macros.blackbox.Context)(x: c.Expr[Int])(y: c.Expr[Int])c.Expr[Unit] + +scala> def foo3(x: Int)(y: Int): Unit = macro impl3 +defined term macro foo3: (x: Int)(y: Int)Unit + +scala> foo3(2)(3) + +scala> :quit diff --git a/tests/disabled/macro/run/repl-term-macros.scala b/tests/disabled/macro/run/repl-term-macros.scala new file mode 100644 index 000000000..32892b731 --- /dev/null +++ b/tests/disabled/macro/run/repl-term-macros.scala @@ -0,0 +1,20 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ + import scala.reflect.macros.blackbox.Context +import language.experimental.macros + +def impl1(c: Context) = { import c.universe._; c.Expr[Unit](q"()") } +def foo1: Unit = macro impl1 +foo1 + +def impl2(c: Context)() = { import c.universe._; c.Expr[Unit](q"()") } +def foo2(): Unit = macro impl2 +foo2() + +def impl3(c: Context)(x: c.Expr[Int])(y: c.Expr[Int]) = { import c.universe._; c.Expr[Unit](q"()") } +def foo3(x: Int)(y: Int): Unit = macro impl3 +foo3(2)(3) + """ +} \ No newline at end of file diff --git a/tests/disabled/macro/run/runtimeEval1.check b/tests/disabled/macro/run/runtimeEval1.check new file mode 100644 index 000000000..d8263ee98 --- /dev/null +++ b/tests/disabled/macro/run/runtimeEval1.check @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/tests/disabled/macro/run/runtimeEval1.scala b/tests/disabled/macro/run/runtimeEval1.scala new file mode 100644 index 000000000..0202dfd06 --- /dev/null +++ b/tests/disabled/macro/run/runtimeEval1.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + val x = 2 + println(x) + }.eval +} diff --git a/tests/disabled/macro/run/runtimeEval2.check b/tests/disabled/macro/run/runtimeEval2.check new file mode 100644 index 000000000..0cfbf0888 --- /dev/null +++ b/tests/disabled/macro/run/runtimeEval2.check @@ -0,0 +1 @@ +2 diff --git a/tests/disabled/macro/run/runtimeEval2.scala b/tests/disabled/macro/run/runtimeEval2.scala new file mode 100644 index 000000000..2708f9dbc --- /dev/null +++ b/tests/disabled/macro/run/runtimeEval2.scala @@ -0,0 +1,11 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + val x = 2 + val outer = reify{reify{x}} + println(outer.eval.eval) +} diff --git a/tests/disabled/macro/run/showdecl.check b/tests/disabled/macro/run/showdecl.check new file mode 100644 index 000000000..b8d7f94c5 --- /dev/null +++ b/tests/disabled/macro/run/showdecl.check @@ -0,0 +1,34 @@ +compile-time +uninitialized D: class D extends +initialized D: class D extends C +uninitialized x: val x: +initialized x: val x: Int +uninitialized y: lazy val y: +initialized y: lazy val y: Int +uninitialized z: def z: +initialized z: def z: Int +uninitialized t: def t: +initialized t: def t[T <: Int](x: D)(y: x.W): Int +uninitialized W: type W = String +initialized W: type W = String +uninitialized C: class C extends +initialized C: class C extends D +uninitialized O: object O +initialized O: object O +runtime +autoinitialized D: class D extends C +autoinitialized D: class D extends C +autoinitialized x: val x: Int +autoinitialized x: val x: Int +autoinitialized y: lazy val y: Int +autoinitialized y: lazy val y: Int +autoinitialized z: def z: Int +autoinitialized z: def z: Int +autoinitialized t: def t[T <: Int](x: D)(y: x.W): Int +autoinitialized t: def t[T <: Int](x: D)(y: x.W): Int +autoinitialized W: type W = String +autoinitialized W: type W = String +autoinitialized C: class C extends D +autoinitialized C: class C extends D +autoinitialized O: object O +autoinitialized O: object O diff --git a/tests/disabled/macro/run/showdecl/Macros_1.scala b/tests/disabled/macro/run/showdecl/Macros_1.scala new file mode 100644 index 000000000..c68dd275d --- /dev/null +++ b/tests/disabled/macro/run/showdecl/Macros_1.scala @@ -0,0 +1,30 @@ +import scala.reflect.macros.whitebox._ +import scala.language.experimental.macros + +object Macros { + def impl(c: Context) = { + var messages = List[String]() + def println(msg: String) = messages :+= msg + + import c.universe._ + def test(sym: Symbol): Unit = { + println(s"uninitialized ${sym.name}: ${showDecl(sym)}") + sym.info + println(s"initialized ${sym.name}: ${showDecl(sym)}") + } + + println("compile-time") + test(c.mirror.staticClass("D")) + test(c.mirror.staticClass("D").info.member(TermName("x"))) + test(c.mirror.staticClass("D").info.member(TermName("y"))) + test(c.mirror.staticClass("D").info.member(TermName("z"))) + test(c.mirror.staticClass("D").info.member(TermName("t"))) + test(c.mirror.staticClass("D").info.member(TypeName("W"))) + test(c.mirror.staticClass("D").info.member(TypeName("C"))) + test(c.mirror.staticClass("D").info.member(TermName("O"))) + + q"..${messages.map(msg => q"println($msg)")}" + } + + def foo: Any = macro impl +} \ No newline at end of file diff --git a/tests/disabled/macro/run/showdecl/Test_2.scala b/tests/disabled/macro/run/showdecl/Test_2.scala new file mode 100644 index 000000000..fc212ab05 --- /dev/null +++ b/tests/disabled/macro/run/showdecl/Test_2.scala @@ -0,0 +1,32 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} + +object Test extends dotty.runtime.LegacyApp { + def test(sym: Symbol): Unit = { + println(s"autoinitialized ${sym.name}: ${showDecl(sym)}") + sym.info + println(s"autoinitialized ${sym.name}: ${showDecl(sym)}") + } + + Macros.foo + println("runtime") + test(symbolOf[D]) + test(typeOf[D].member(TermName("x"))) + test(typeOf[D].member(TermName("y"))) + test(typeOf[D].member(TermName("z"))) + test(typeOf[D].member(TermName("t"))) + test(typeOf[D].member(TypeName("W"))) + test(typeOf[D].member(TypeName("C"))) + test(typeOf[D].member(TermName("O"))) +} + +class C +class D extends C { + val x = 2 + lazy val y = 3 + var z = 4 + def t[T <: Int](x: D)(y: x.W) = 5 + type W = String + class C extends D + object O extends C +} diff --git a/tests/disabled/macro/run/showraw_mods.check b/tests/disabled/macro/run/showraw_mods.check new file mode 100644 index 000000000..4d3416042 --- /dev/null +++ b/tests/disabled/macro/run/showraw_mods.check @@ -0,0 +1 @@ +Block(List(ClassDef(Modifiers(ABSTRACT | DEFAULTPARAM/TRAIT), TypeName("C"), List(), Template(List(Ident(TypeName("AnyRef"))), noSelfType, List(DefDef(Modifiers(), TermName("$init$"), List(), List(List()), TypeTree(), Block(List(), Literal(Constant(())))), ValDef(Modifiers(PRIVATE | LOCAL), TermName("x"), TypeTree(), Literal(Constant(2))), ValDef(Modifiers(MUTABLE), TermName("y"), TypeTree(), Select(This(TypeName("C")), TermName("x"))), ValDef(Modifiers(LAZY), TermName("z"), TypeTree(), Select(This(TypeName("C")), TermName("y"))))))), Literal(Constant(()))) diff --git a/tests/disabled/macro/run/showraw_mods.scala b/tests/disabled/macro/run/showraw_mods.scala new file mode 100644 index 000000000..872685c37 --- /dev/null +++ b/tests/disabled/macro/run/showraw_mods.scala @@ -0,0 +1,6 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + val tree = reify{trait C { private[this] val x = 2; var y = x; lazy val z = y }} + println(showRaw(tree.tree)) +} diff --git a/tests/disabled/macro/run/showraw_tree.check b/tests/disabled/macro/run/showraw_tree.check new file mode 100644 index 000000000..d8cb1fde0 --- /dev/null +++ b/tests/disabled/macro/run/showraw_tree.check @@ -0,0 +1,2 @@ +Apply(Select(New(AppliedTypeTree(Ident(scala.collection.immutable.HashMap), List(Select(Ident(scala.Predef), TypeName("String")), Select(Ident(scala.Predef), TypeName("String"))))), termNames.CONSTRUCTOR), List()) +Apply(Select(New(AppliedTypeTree(Ident(scala.collection.mutable.HashMap), List(Select(Ident(scala.Predef), TypeName("String")), Select(Ident(scala.Predef), TypeName("String"))))), termNames.CONSTRUCTOR), List()) diff --git a/tests/disabled/macro/run/showraw_tree.scala b/tests/disabled/macro/run/showraw_tree.scala new file mode 100644 index 000000000..fbd4c1dfa --- /dev/null +++ b/tests/disabled/macro/run/showraw_tree.scala @@ -0,0 +1,8 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + val tree1 = reify(new collection.immutable.HashMap[String, String]) + val tree2 = reify(new collection.mutable.HashMap[String, String]) + println(showRaw(tree1.tree)) + println(showRaw(tree2.tree)) +} diff --git a/tests/disabled/macro/run/showraw_tree_ids.check b/tests/disabled/macro/run/showraw_tree_ids.check new file mode 100644 index 000000000..d7a7aa595 --- /dev/null +++ b/tests/disabled/macro/run/showraw_tree_ids.check @@ -0,0 +1,2 @@ +Apply(Select(New(AppliedTypeTree(Ident(scala.collection.immutable.HashMap#), List(Select(Ident(scala.Predef#), TypeName("String")), Select(Ident(scala.Predef#), TypeName("String"))))), termNames.CONSTRUCTOR), List()) +Apply(Select(New(AppliedTypeTree(Ident(scala.collection.mutable.HashMap#), List(Select(Ident(scala.Predef#), TypeName("String")), Select(Ident(scala.Predef#), TypeName("String"))))), termNames.CONSTRUCTOR), List()) diff --git a/tests/disabled/macro/run/showraw_tree_ids.scala b/tests/disabled/macro/run/showraw_tree_ids.scala new file mode 100644 index 000000000..739ea55b5 --- /dev/null +++ b/tests/disabled/macro/run/showraw_tree_ids.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + val tree1 = reify(new collection.immutable.HashMap[String, String]) + val tree2 = reify(new collection.mutable.HashMap[String, String]) + def stabilize(s: String) = """#\d+""".r.replaceAllIn(s, "#") + println(stabilize(showRaw(tree1.tree, printIds = true))) + println(stabilize(showRaw(tree2.tree, printIds = true))) +} diff --git a/tests/disabled/macro/run/showraw_tree_kinds.check b/tests/disabled/macro/run/showraw_tree_kinds.check new file mode 100644 index 000000000..85939b02f --- /dev/null +++ b/tests/disabled/macro/run/showraw_tree_kinds.check @@ -0,0 +1,2 @@ +Apply(Select(New(AppliedTypeTree(Ident(scala.collection.immutable.HashMap#CLS), List(Select(Ident(scala.Predef#MOD), TypeName("String")), Select(Ident(scala.Predef#MOD), TypeName("String"))))), termNames.CONSTRUCTOR), List()) +Apply(Select(New(AppliedTypeTree(Ident(scala.collection.mutable.HashMap#CLS), List(Select(Ident(scala.Predef#MOD), TypeName("String")), Select(Ident(scala.Predef#MOD), TypeName("String"))))), termNames.CONSTRUCTOR), List()) diff --git a/tests/disabled/macro/run/showraw_tree_kinds.scala b/tests/disabled/macro/run/showraw_tree_kinds.scala new file mode 100644 index 000000000..0891015ac --- /dev/null +++ b/tests/disabled/macro/run/showraw_tree_kinds.scala @@ -0,0 +1,8 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + val tree1 = reify(new collection.immutable.HashMap[String, String]) + val tree2 = reify(new collection.mutable.HashMap[String, String]) + println(showRaw(tree1.tree, printKinds = true)) + println(showRaw(tree2.tree, printKinds = true)) +} diff --git a/tests/disabled/macro/run/showraw_tree_types_ids.check b/tests/disabled/macro/run/showraw_tree_types_ids.check new file mode 100644 index 000000000..75347463c --- /dev/null +++ b/tests/disabled/macro/run/showraw_tree_types_ids.check @@ -0,0 +1,12 @@ +Apply[1](Select[2](New[1](TypeTree[1]().setOriginal(AppliedTypeTree(Ident[3](scala.collection.immutable.HashMap#), List(TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef#), TypeName("String")#)), TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef#), TypeName("String")#)))))), termNames.CONSTRUCTOR#), List()) +[1] TypeRef(ThisType(scala.collection.immutable#), scala.collection.immutable.HashMap#, List(TypeRef(SingleType(ThisType(scala#), scala.Predef#), TypeName("String")#, List()), TypeRef(SingleType(ThisType(scala#), scala.Predef#), TypeName("String")#, List()))) +[2] MethodType(List(), TypeRef(ThisType(scala.collection.immutable#), scala.collection.immutable.HashMap#, List(TypeRef(SingleType(ThisType(scala#), scala.Predef#), TypeName("String")#, List()), TypeRef(SingleType(ThisType(scala#), scala.Predef#), TypeName("String")#, List())))) +[3] TypeRef(ThisType(scala.collection.immutable#), scala.collection.immutable.HashMap#, List()) +[4] TypeRef(SingleType(ThisType(scala#), scala.Predef#), TypeName("String")#, List()) +[5] SingleType(ThisType(scala#), scala.Predef#) +Apply[6](Select[7](New[6](TypeTree[6]().setOriginal(AppliedTypeTree(Ident[8](scala.collection.mutable.HashMap#), List(TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef#), TypeName("String")#)), TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef#), TypeName("String")#)))))), termNames.CONSTRUCTOR#), List()) +[4] TypeRef(SingleType(ThisType(scala#), scala.Predef#), TypeName("String")#, List()) +[5] SingleType(ThisType(scala#), scala.Predef#) +[6] TypeRef(ThisType(scala.collection.mutable#), scala.collection.mutable.HashMap#, List(TypeRef(SingleType(ThisType(scala#), scala.Predef#), TypeName("String")#, List()), TypeRef(SingleType(ThisType(scala#), scala.Predef#), TypeName("String")#, List()))) +[7] MethodType(List(), TypeRef(ThisType(scala.collection.mutable#), scala.collection.mutable.HashMap#, List(TypeRef(SingleType(ThisType(scala#), scala.Predef#), TypeName("String")#, List()), TypeRef(SingleType(ThisType(scala#), scala.Predef#), TypeName("String")#, List())))) +[8] TypeRef(ThisType(scala.collection.mutable#), scala.collection.mutable.HashMap#, List()) diff --git a/tests/disabled/macro/run/showraw_tree_types_ids.scala b/tests/disabled/macro/run/showraw_tree_types_ids.scala new file mode 100644 index 000000000..30f51c549 --- /dev/null +++ b/tests/disabled/macro/run/showraw_tree_types_ids.scala @@ -0,0 +1,11 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val tb = runtimeMirror(getClass.getClassLoader).mkToolBox() + val tree1 = reify(new collection.immutable.HashMap[String, String]) + val tree2 = reify(new collection.mutable.HashMap[String, String]) + def stabilize(s: String) = """#\d+""".r.replaceAllIn(s, "#") + println(stabilize(showRaw(tb.typecheck(tree1.tree), printIds = true, printTypes = true))) + println(stabilize(showRaw(tb.typecheck(tree2.tree), printIds = true, printTypes = true))) +} diff --git a/tests/disabled/macro/run/showraw_tree_types_typed.check b/tests/disabled/macro/run/showraw_tree_types_typed.check new file mode 100644 index 000000000..de691e369 --- /dev/null +++ b/tests/disabled/macro/run/showraw_tree_types_typed.check @@ -0,0 +1,12 @@ +Apply[1](Select[2](New[1](TypeTree[1]().setOriginal(AppliedTypeTree(Ident[3](scala.collection.immutable.HashMap), List(TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef), TypeName("String"))), TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef), TypeName("String"))))))), termNames.CONSTRUCTOR), List()) +[1] TypeRef(ThisType(scala.collection.immutable), scala.collection.immutable.HashMap, List(TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List()), TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List()))) +[2] MethodType(List(), TypeRef(ThisType(scala.collection.immutable), scala.collection.immutable.HashMap, List(TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List()), TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List())))) +[3] TypeRef(ThisType(scala.collection.immutable), scala.collection.immutable.HashMap, List()) +[4] TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List()) +[5] SingleType(ThisType(scala), scala.Predef) +Apply[6](Select[7](New[6](TypeTree[6]().setOriginal(AppliedTypeTree(Ident[8](scala.collection.mutable.HashMap), List(TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef), TypeName("String"))), TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef), TypeName("String"))))))), termNames.CONSTRUCTOR), List()) +[4] TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List()) +[5] SingleType(ThisType(scala), scala.Predef) +[6] TypeRef(ThisType(scala.collection.mutable), scala.collection.mutable.HashMap, List(TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List()), TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List()))) +[7] MethodType(List(), TypeRef(ThisType(scala.collection.mutable), scala.collection.mutable.HashMap, List(TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List()), TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List())))) +[8] TypeRef(ThisType(scala.collection.mutable), scala.collection.mutable.HashMap, List()) diff --git a/tests/disabled/macro/run/showraw_tree_types_typed.scala b/tests/disabled/macro/run/showraw_tree_types_typed.scala new file mode 100644 index 000000000..e24eac9f8 --- /dev/null +++ b/tests/disabled/macro/run/showraw_tree_types_typed.scala @@ -0,0 +1,10 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val tb = runtimeMirror(getClass.getClassLoader).mkToolBox() + val tree1 = reify(new collection.immutable.HashMap[String, String]) + val tree2 = reify(new collection.mutable.HashMap[String, String]) + println(showRaw(tb.typecheck(tree1.tree), printTypes = true)) + println(showRaw(tb.typecheck(tree2.tree), printTypes = true)) +} diff --git a/tests/disabled/macro/run/showraw_tree_types_untyped.check b/tests/disabled/macro/run/showraw_tree_types_untyped.check new file mode 100644 index 000000000..d8cb1fde0 --- /dev/null +++ b/tests/disabled/macro/run/showraw_tree_types_untyped.check @@ -0,0 +1,2 @@ +Apply(Select(New(AppliedTypeTree(Ident(scala.collection.immutable.HashMap), List(Select(Ident(scala.Predef), TypeName("String")), Select(Ident(scala.Predef), TypeName("String"))))), termNames.CONSTRUCTOR), List()) +Apply(Select(New(AppliedTypeTree(Ident(scala.collection.mutable.HashMap), List(Select(Ident(scala.Predef), TypeName("String")), Select(Ident(scala.Predef), TypeName("String"))))), termNames.CONSTRUCTOR), List()) diff --git a/tests/disabled/macro/run/showraw_tree_types_untyped.scala b/tests/disabled/macro/run/showraw_tree_types_untyped.scala new file mode 100644 index 000000000..87dfd7242 --- /dev/null +++ b/tests/disabled/macro/run/showraw_tree_types_untyped.scala @@ -0,0 +1,8 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + val tree1 = reify(new collection.immutable.HashMap[String, String]) + val tree2 = reify(new collection.mutable.HashMap[String, String]) + println(showRaw(tree1.tree, printTypes = true)) + println(showRaw(tree2.tree, printTypes = true)) +} diff --git a/tests/disabled/macro/run/showraw_tree_ultimate.check b/tests/disabled/macro/run/showraw_tree_ultimate.check new file mode 100644 index 000000000..81efcc05a --- /dev/null +++ b/tests/disabled/macro/run/showraw_tree_ultimate.check @@ -0,0 +1,12 @@ +Apply[1](Select[2](New[1](TypeTree[1]().setOriginal(AppliedTypeTree(Ident[3](scala.collection.immutable.HashMap##CLS), List(TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef##MOD), TypeName("String")##TPE)), TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef##MOD), TypeName("String")##TPE)))))), termNames.CONSTRUCTOR##PCTOR), List()) +[1] TypeRef(ThisType(scala.collection.immutable##PKC), scala.collection.immutable.HashMap##CLS, List(TypeRef(SingleType(ThisType(scala##PKC), scala.Predef##MOD), TypeName("String")##TPE, List()), TypeRef(SingleType(ThisType(scala##PKC), scala.Predef##MOD), TypeName("String")##TPE, List()))) +[2] MethodType(List(), TypeRef(ThisType(scala.collection.immutable##PKC), scala.collection.immutable.HashMap##CLS, List(TypeRef(SingleType(ThisType(scala##PKC), scala.Predef##MOD), TypeName("String")##TPE, List()), TypeRef(SingleType(ThisType(scala##PKC), scala.Predef##MOD), TypeName("String")##TPE, List())))) +[3] TypeRef(ThisType(scala.collection.immutable##PKC), scala.collection.immutable.HashMap##CLS, List()) +[4] TypeRef(SingleType(ThisType(scala##PKC), scala.Predef##MOD), TypeName("String")##TPE, List()) +[5] SingleType(ThisType(scala##PKC), scala.Predef##MOD) +Apply[6](Select[7](New[6](TypeTree[6]().setOriginal(AppliedTypeTree(Ident[8](scala.collection.mutable.HashMap##CLS), List(TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef##MOD), TypeName("String")##TPE)), TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef##MOD), TypeName("String")##TPE)))))), termNames.CONSTRUCTOR##CTOR), List()) +[4] TypeRef(SingleType(ThisType(scala##PKC), scala.Predef##MOD), TypeName("String")##TPE, List()) +[5] SingleType(ThisType(scala##PKC), scala.Predef##MOD) +[6] TypeRef(ThisType(scala.collection.mutable##PKC), scala.collection.mutable.HashMap##CLS, List(TypeRef(SingleType(ThisType(scala##PKC), scala.Predef##MOD), TypeName("String")##TPE, List()), TypeRef(SingleType(ThisType(scala##PKC), scala.Predef##MOD), TypeName("String")##TPE, List()))) +[7] MethodType(List(), TypeRef(ThisType(scala.collection.mutable##PKC), scala.collection.mutable.HashMap##CLS, List(TypeRef(SingleType(ThisType(scala##PKC), scala.Predef##MOD), TypeName("String")##TPE, List()), TypeRef(SingleType(ThisType(scala##PKC), scala.Predef##MOD), TypeName("String")##TPE, List())))) +[8] TypeRef(ThisType(scala.collection.mutable##PKC), scala.collection.mutable.HashMap##CLS, List()) diff --git a/tests/disabled/macro/run/showraw_tree_ultimate.scala b/tests/disabled/macro/run/showraw_tree_ultimate.scala new file mode 100644 index 000000000..0a97622ad --- /dev/null +++ b/tests/disabled/macro/run/showraw_tree_ultimate.scala @@ -0,0 +1,11 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val tb = runtimeMirror(getClass.getClassLoader).mkToolBox() + val tree1 = reify(new collection.immutable.HashMap[String, String]) + val tree2 = reify(new collection.mutable.HashMap[String, String]) + def stabilize(s: String) = """#\d+""".r.replaceAllIn(s, "#") + println(stabilize(showRaw(tb.typecheck(tree1.tree), printIds = true, printKinds = true, printTypes = true))) + println(stabilize(showRaw(tb.typecheck(tree2.tree), printIds = true, printKinds = true, printTypes = true))) +} diff --git a/tests/disabled/macro/run/t2886.check b/tests/disabled/macro/run/t2886.check new file mode 100644 index 000000000..61e36948b --- /dev/null +++ b/tests/disabled/macro/run/t2886.check @@ -0,0 +1,5 @@ +((x: Predef.String) => { + val x$1 = x; + val x$2 = x; + Test.this.test(x$2, x$1) +}) diff --git a/tests/disabled/macro/run/t2886.scala b/tests/disabled/macro/run/t2886.scala new file mode 100644 index 000000000..44783a5d8 --- /dev/null +++ b/tests/disabled/macro/run/t2886.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ + +object Test { + def test(name: String, address: String) = null + def main(args: Array[String]) = { + val tree = reify((x:String) => test(address=x,name=x)).tree + println(tree) + } +} diff --git a/tests/disabled/macro/run/t5224.check b/tests/disabled/macro/run/t5224.check new file mode 100644 index 000000000..b11480acd --- /dev/null +++ b/tests/disabled/macro/run/t5224.check @@ -0,0 +1,14 @@ +t5224.scala:3: warning: Implementation restriction: subclassing Classfile does not +make your annotation visible at runtime. If that is what +you want, you must write the annotation class in Java. +class Foo(bar: String) extends annotation.ClassfileAnnotation + ^ +{ + @new Foo(bar = "qwe") class C extends AnyRef { + def () = { + super.(); + () + } + }; + () +} diff --git a/tests/disabled/macro/run/t5224.scala b/tests/disabled/macro/run/t5224.scala new file mode 100644 index 000000000..d0cd9a455 --- /dev/null +++ b/tests/disabled/macro/run/t5224.scala @@ -0,0 +1,8 @@ +import scala.reflect.runtime.universe._ + +class Foo(bar: String) extends annotation.ClassfileAnnotation + +object Test extends dotty.runtime.LegacyApp { + val tree = reify{@Foo(bar = "qwe") class C}.tree + println(tree.toString) +} diff --git a/tests/disabled/macro/run/t5225_1.check b/tests/disabled/macro/run/t5225_1.check new file mode 100644 index 000000000..1a47aacfd --- /dev/null +++ b/tests/disabled/macro/run/t5225_1.check @@ -0,0 +1,4 @@ +{ + @new transient() @new volatile() var x = 2; + () +} diff --git a/tests/disabled/macro/run/t5225_1.scala b/tests/disabled/macro/run/t5225_1.scala new file mode 100644 index 000000000..a553e83ce --- /dev/null +++ b/tests/disabled/macro/run/t5225_1.scala @@ -0,0 +1,6 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + val tree = reify{@transient @volatile var x = 2}.tree + println(tree.toString) +} diff --git a/tests/disabled/macro/run/t5225_2.check b/tests/disabled/macro/run/t5225_2.check new file mode 100644 index 000000000..477ea4eb6 --- /dev/null +++ b/tests/disabled/macro/run/t5225_2.check @@ -0,0 +1,4 @@ +{ + def foo(@new elidable(0) x: Int) = ""; + () +} diff --git a/tests/disabled/macro/run/t5225_2.scala b/tests/disabled/macro/run/t5225_2.scala new file mode 100644 index 000000000..54e7fec1f --- /dev/null +++ b/tests/disabled/macro/run/t5225_2.scala @@ -0,0 +1,6 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + val tree = reify{def foo(@annotation.elidable(0) x: Int) = ""}.tree + println(tree.toString) +} diff --git a/tests/disabled/macro/run/t5229_1.scala b/tests/disabled/macro/run/t5229_1.scala new file mode 100644 index 000000000..62341fdbb --- /dev/null +++ b/tests/disabled/macro/run/t5229_1.scala @@ -0,0 +1,8 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + object C + }.eval +} diff --git a/tests/disabled/macro/run/t5229_2.check b/tests/disabled/macro/run/t5229_2.check new file mode 100644 index 000000000..43c25b96a --- /dev/null +++ b/tests/disabled/macro/run/t5229_2.check @@ -0,0 +1,2 @@ +2 +evaluated = () diff --git a/tests/disabled/macro/run/t5229_2.scala b/tests/disabled/macro/run/t5229_2.scala new file mode 100644 index 000000000..a9cd08947 --- /dev/null +++ b/tests/disabled/macro/run/t5229_2.scala @@ -0,0 +1,18 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + object C { + val x = 2 + } + + println(C.x) + }; + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/disabled/macro/run/t5230.check b/tests/disabled/macro/run/t5230.check new file mode 100644 index 000000000..43c25b96a --- /dev/null +++ b/tests/disabled/macro/run/t5230.check @@ -0,0 +1,2 @@ +2 +evaluated = () diff --git a/tests/disabled/macro/run/t5230.scala b/tests/disabled/macro/run/t5230.scala new file mode 100644 index 000000000..5c934c345 --- /dev/null +++ b/tests/disabled/macro/run/t5230.scala @@ -0,0 +1,18 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + class C { + val x = 2 + } + + println(new C().x) + }; + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/disabled/macro/run/t5258a.check b/tests/disabled/macro/run/t5258a.check new file mode 100644 index 000000000..4e0b2da04 --- /dev/null +++ b/tests/disabled/macro/run/t5258a.check @@ -0,0 +1 @@ +int \ No newline at end of file diff --git a/tests/disabled/macro/run/t5258a.scala b/tests/disabled/macro/run/t5258a.scala new file mode 100644 index 000000000..5a22a251c --- /dev/null +++ b/tests/disabled/macro/run/t5258a.scala @@ -0,0 +1,8 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + println(classOf[Int]) + }.eval +} diff --git a/tests/disabled/macro/run/t5266_1.check b/tests/disabled/macro/run/t5266_1.check new file mode 100644 index 000000000..35f20802e --- /dev/null +++ b/tests/disabled/macro/run/t5266_1.check @@ -0,0 +1,2 @@ +2 +evaluated = () \ No newline at end of file diff --git a/tests/disabled/macro/run/t5266_1.scala b/tests/disabled/macro/run/t5266_1.scala new file mode 100644 index 000000000..5ed943ee6 --- /dev/null +++ b/tests/disabled/macro/run/t5266_1.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + def x = 2 + println(x) + }; + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/disabled/macro/run/t5266_2.check b/tests/disabled/macro/run/t5266_2.check new file mode 100644 index 000000000..35f20802e --- /dev/null +++ b/tests/disabled/macro/run/t5266_2.check @@ -0,0 +1,2 @@ +2 +evaluated = () \ No newline at end of file diff --git a/tests/disabled/macro/run/t5266_2.scala b/tests/disabled/macro/run/t5266_2.scala new file mode 100644 index 000000000..c8c3ab824 --- /dev/null +++ b/tests/disabled/macro/run/t5266_2.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + def x = 2 + def y = x + println(y) + }; + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/disabled/macro/run/t5269.check b/tests/disabled/macro/run/t5269.check new file mode 100644 index 000000000..0cfbf0888 --- /dev/null +++ b/tests/disabled/macro/run/t5269.check @@ -0,0 +1 @@ +2 diff --git a/tests/disabled/macro/run/t5269.scala b/tests/disabled/macro/run/t5269.scala new file mode 100644 index 000000000..dbaa1d1d8 --- /dev/null +++ b/tests/disabled/macro/run/t5269.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + trait Z { + val z = 2 + } + + class X extends Z { + def println() = Predef.println(z) + } + + new X().println() + }.eval +} diff --git a/tests/disabled/macro/run/t5270.check b/tests/disabled/macro/run/t5270.check new file mode 100644 index 000000000..08839f6bb --- /dev/null +++ b/tests/disabled/macro/run/t5270.check @@ -0,0 +1 @@ +200 diff --git a/tests/disabled/macro/run/t5270.scala b/tests/disabled/macro/run/t5270.scala new file mode 100644 index 000000000..03ba765fd --- /dev/null +++ b/tests/disabled/macro/run/t5270.scala @@ -0,0 +1,20 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + class Y { + def y = 100 + } + + trait Z { this: Y => + val z = 2 * y + } + + class X extends Y with Z { + def println() = Predef.println(z) + } + + new X().println() + }.eval +} diff --git a/tests/disabled/macro/run/t5271_1.check b/tests/disabled/macro/run/t5271_1.check new file mode 100644 index 000000000..544b4d276 --- /dev/null +++ b/tests/disabled/macro/run/t5271_1.check @@ -0,0 +1,12 @@ +{ + case class C extends Product with Serializable { + val foo: Int = _; + val bar: Int = _; + def (foo: Int, bar: Int) = { + super.(); + () + } + }; + () +} +() diff --git a/tests/disabled/macro/run/t5271_1.scala b/tests/disabled/macro/run/t5271_1.scala new file mode 100644 index 000000000..cdae3df58 --- /dev/null +++ b/tests/disabled/macro/run/t5271_1.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + case class C(foo: Int, bar: Int) + }; + + val toolbox = cm.mkToolBox() + println(code.tree) + println(code.eval) +} diff --git a/tests/disabled/macro/run/t5271_2.check b/tests/disabled/macro/run/t5271_2.check new file mode 100644 index 000000000..1df88872a --- /dev/null +++ b/tests/disabled/macro/run/t5271_2.check @@ -0,0 +1,14 @@ +{ + case class C extends Product with Serializable { + val foo: Int = _; + val bar: Int = _; + def (foo: Int, bar: Int) = { + super.(); + () + } + }; + val c = C.apply(2, 2); + Predef.println(c.foo.$times(c.bar)) +} +4 +() diff --git a/tests/disabled/macro/run/t5271_2.scala b/tests/disabled/macro/run/t5271_2.scala new file mode 100644 index 000000000..654fa7b30 --- /dev/null +++ b/tests/disabled/macro/run/t5271_2.scala @@ -0,0 +1,17 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + case class C(foo: Int, bar: Int) + val c = C(2, 2) + println(c.foo * c.bar) + }; + + val toolbox = cm.mkToolBox() + println(code.tree) + println(code.eval) +} diff --git a/tests/disabled/macro/run/t5271_3.check b/tests/disabled/macro/run/t5271_3.check new file mode 100644 index 000000000..99aacc2ce --- /dev/null +++ b/tests/disabled/macro/run/t5271_3.check @@ -0,0 +1,21 @@ +{ + object C extends AnyRef { + def () = { + super.(); + () + }; + def qwe = 4 + }; + case class C extends Product with Serializable { + val foo: Int = _; + val bar: Int = _; + def (foo: Int, bar: Int) = { + super.(); + () + } + }; + val c = C.apply(2, 2); + Predef.println(c.foo.$times(c.bar).$eq$eq(C.qwe)) +} +true +() diff --git a/tests/disabled/macro/run/t5271_3.scala b/tests/disabled/macro/run/t5271_3.scala new file mode 100644 index 000000000..2fa4cea77 --- /dev/null +++ b/tests/disabled/macro/run/t5271_3.scala @@ -0,0 +1,18 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + object C { def qwe = 4 } + case class C(foo: Int, bar: Int) + val c = C(2, 2) + println(c.foo * c.bar == C.qwe) + }; + + val toolbox = cm.mkToolBox() + println(code.tree) + println(code.eval) +} diff --git a/tests/disabled/macro/run/t5271_4.scala b/tests/disabled/macro/run/t5271_4.scala new file mode 100644 index 000000000..03cca7c48 --- /dev/null +++ b/tests/disabled/macro/run/t5271_4.scala @@ -0,0 +1,8 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + case object C + }.eval +} diff --git a/tests/disabled/macro/run/t5272_1_newpatmat.check b/tests/disabled/macro/run/t5272_1_newpatmat.check new file mode 100644 index 000000000..9f8d6f24e --- /dev/null +++ b/tests/disabled/macro/run/t5272_1_newpatmat.check @@ -0,0 +1 @@ +okay \ No newline at end of file diff --git a/tests/disabled/macro/run/t5272_1_newpatmat.scala b/tests/disabled/macro/run/t5272_1_newpatmat.scala new file mode 100644 index 000000000..30d0c875d --- /dev/null +++ b/tests/disabled/macro/run/t5272_1_newpatmat.scala @@ -0,0 +1,11 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + 2 match { + case 2 => println("okay") + case _ => println("not okay") + } + }.eval +} diff --git a/tests/disabled/macro/run/t5272_1_oldpatmat.check b/tests/disabled/macro/run/t5272_1_oldpatmat.check new file mode 100644 index 000000000..9f8d6f24e --- /dev/null +++ b/tests/disabled/macro/run/t5272_1_oldpatmat.check @@ -0,0 +1 @@ +okay \ No newline at end of file diff --git a/tests/disabled/macro/run/t5272_1_oldpatmat.scala b/tests/disabled/macro/run/t5272_1_oldpatmat.scala new file mode 100644 index 000000000..30d0c875d --- /dev/null +++ b/tests/disabled/macro/run/t5272_1_oldpatmat.scala @@ -0,0 +1,11 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + 2 match { + case 2 => println("okay") + case _ => println("not okay") + } + }.eval +} diff --git a/tests/disabled/macro/run/t5272_2_newpatmat.check b/tests/disabled/macro/run/t5272_2_newpatmat.check new file mode 100644 index 000000000..549f3f3af --- /dev/null +++ b/tests/disabled/macro/run/t5272_2_newpatmat.check @@ -0,0 +1 @@ +okay2 \ No newline at end of file diff --git a/tests/disabled/macro/run/t5272_2_newpatmat.scala b/tests/disabled/macro/run/t5272_2_newpatmat.scala new file mode 100644 index 000000000..436f0fd4f --- /dev/null +++ b/tests/disabled/macro/run/t5272_2_newpatmat.scala @@ -0,0 +1,10 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + 2 match { + case x => println("okay" + x) + } + }.eval +} diff --git a/tests/disabled/macro/run/t5272_2_oldpatmat.check b/tests/disabled/macro/run/t5272_2_oldpatmat.check new file mode 100644 index 000000000..549f3f3af --- /dev/null +++ b/tests/disabled/macro/run/t5272_2_oldpatmat.check @@ -0,0 +1 @@ +okay2 \ No newline at end of file diff --git a/tests/disabled/macro/run/t5272_2_oldpatmat.scala b/tests/disabled/macro/run/t5272_2_oldpatmat.scala new file mode 100644 index 000000000..436f0fd4f --- /dev/null +++ b/tests/disabled/macro/run/t5272_2_oldpatmat.scala @@ -0,0 +1,10 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + 2 match { + case x => println("okay" + x) + } + }.eval +} diff --git a/tests/disabled/macro/run/t5273_1_newpatmat.check b/tests/disabled/macro/run/t5273_1_newpatmat.check new file mode 100644 index 000000000..0cfbf0888 --- /dev/null +++ b/tests/disabled/macro/run/t5273_1_newpatmat.check @@ -0,0 +1 @@ +2 diff --git a/tests/disabled/macro/run/t5273_1_newpatmat.scala b/tests/disabled/macro/run/t5273_1_newpatmat.scala new file mode 100644 index 000000000..1ed2ce79a --- /dev/null +++ b/tests/disabled/macro/run/t5273_1_newpatmat.scala @@ -0,0 +1,11 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + List(1, 2, 3) match { + case foo :: bar :: _ => println(foo * bar) + case _ => println("this is getting out of hand!") + } + }.eval +} diff --git a/tests/disabled/macro/run/t5273_1_oldpatmat.check b/tests/disabled/macro/run/t5273_1_oldpatmat.check new file mode 100644 index 000000000..0cfbf0888 --- /dev/null +++ b/tests/disabled/macro/run/t5273_1_oldpatmat.check @@ -0,0 +1 @@ +2 diff --git a/tests/disabled/macro/run/t5273_1_oldpatmat.scala b/tests/disabled/macro/run/t5273_1_oldpatmat.scala new file mode 100644 index 000000000..1ed2ce79a --- /dev/null +++ b/tests/disabled/macro/run/t5273_1_oldpatmat.scala @@ -0,0 +1,11 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + List(1, 2, 3) match { + case foo :: bar :: _ => println(foo * bar) + case _ => println("this is getting out of hand!") + } + }.eval +} diff --git a/tests/disabled/macro/run/t5273_2a_newpatmat.check b/tests/disabled/macro/run/t5273_2a_newpatmat.check new file mode 100644 index 000000000..d8263ee98 --- /dev/null +++ b/tests/disabled/macro/run/t5273_2a_newpatmat.check @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/tests/disabled/macro/run/t5273_2a_newpatmat.scala b/tests/disabled/macro/run/t5273_2a_newpatmat.scala new file mode 100644 index 000000000..cb4c15146 --- /dev/null +++ b/tests/disabled/macro/run/t5273_2a_newpatmat.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + val foo :: bar :: _ = List(1, 2, 3) + println(foo * bar) + }.eval +} diff --git a/tests/disabled/macro/run/t5273_2a_oldpatmat.check b/tests/disabled/macro/run/t5273_2a_oldpatmat.check new file mode 100644 index 000000000..d8263ee98 --- /dev/null +++ b/tests/disabled/macro/run/t5273_2a_oldpatmat.check @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/tests/disabled/macro/run/t5273_2a_oldpatmat.scala b/tests/disabled/macro/run/t5273_2a_oldpatmat.scala new file mode 100644 index 000000000..cb4c15146 --- /dev/null +++ b/tests/disabled/macro/run/t5273_2a_oldpatmat.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + val foo :: bar :: _ = List(1, 2, 3) + println(foo * bar) + }.eval +} diff --git a/tests/disabled/macro/run/t5273_2b_newpatmat.check b/tests/disabled/macro/run/t5273_2b_newpatmat.check new file mode 100644 index 000000000..c551774ca --- /dev/null +++ b/tests/disabled/macro/run/t5273_2b_newpatmat.check @@ -0,0 +1 @@ +name = American Dollar, shortname = USD, value = 2,8567 diff --git a/tests/disabled/macro/run/t5273_2b_newpatmat.scala b/tests/disabled/macro/run/t5273_2b_newpatmat.scala new file mode 100644 index 000000000..ca4a31566 --- /dev/null +++ b/tests/disabled/macro/run/t5273_2b_newpatmat.scala @@ -0,0 +1,10 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + val RegexParser = """(.*) \d+([A-Z]+) \| (.*) \|.*""".r + val RegexParser(name, shortname, value) = "American Dollar 1USD | 2,8567 | sometext" + println("name = %s, shortname = %s, value = %s".format(name, shortname, value)) + }.eval +} diff --git a/tests/disabled/macro/run/t5273_2b_oldpatmat.check b/tests/disabled/macro/run/t5273_2b_oldpatmat.check new file mode 100644 index 000000000..c551774ca --- /dev/null +++ b/tests/disabled/macro/run/t5273_2b_oldpatmat.check @@ -0,0 +1 @@ +name = American Dollar, shortname = USD, value = 2,8567 diff --git a/tests/disabled/macro/run/t5273_2b_oldpatmat.scala b/tests/disabled/macro/run/t5273_2b_oldpatmat.scala new file mode 100644 index 000000000..ca4a31566 --- /dev/null +++ b/tests/disabled/macro/run/t5273_2b_oldpatmat.scala @@ -0,0 +1,10 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + val RegexParser = """(.*) \d+([A-Z]+) \| (.*) \|.*""".r + val RegexParser(name, shortname, value) = "American Dollar 1USD | 2,8567 | sometext" + println("name = %s, shortname = %s, value = %s".format(name, shortname, value)) + }.eval +} diff --git a/tests/disabled/macro/run/t5274_1.check b/tests/disabled/macro/run/t5274_1.check new file mode 100644 index 000000000..fca8bc3d3 --- /dev/null +++ b/tests/disabled/macro/run/t5274_1.check @@ -0,0 +1,3 @@ +50! = 30414093201713378043612608166064768844377641568960512000000000000 +49! = 608281864034267560872252163321295376887552831379210240000000000 +50!/49! = 50 diff --git a/tests/disabled/macro/run/t5274_1.scala b/tests/disabled/macro/run/t5274_1.scala new file mode 100644 index 000000000..bc0ba99e4 --- /dev/null +++ b/tests/disabled/macro/run/t5274_1.scala @@ -0,0 +1,14 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + def factorial(n: BigInt): BigInt = + if (n == 0) 1 else n * factorial(n-1) + + val f50 = factorial(50); val f49 = factorial(49) + println("50! = " + f50) + println("49! = " + f49) + println("50!/49! = " + (f50 / f49)) + }.eval +} diff --git a/tests/disabled/macro/run/t5274_2.check b/tests/disabled/macro/run/t5274_2.check new file mode 100644 index 000000000..375536cc2 --- /dev/null +++ b/tests/disabled/macro/run/t5274_2.check @@ -0,0 +1,2 @@ +[6,2,8,5,1] +[1,2,5,6,8] diff --git a/tests/disabled/macro/run/t5274_2.scala b/tests/disabled/macro/run/t5274_2.scala new file mode 100644 index 000000000..b484111ed --- /dev/null +++ b/tests/disabled/macro/run/t5274_2.scala @@ -0,0 +1,51 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + /** Nested methods can use and even update everything + * visible in their scope (including local variables or + * arguments of enclosing methods). + */ + def sort(a: Array[Int]): Unit = { + + def swap(i: Int, j: Int): Unit = { + val t = a(i); a(i) = a(j); a(j) = t + } + + def sort1(l: Int, r: Int): Unit = { + val pivot = a((l + r) / 2) + var i = l + var j = r + while (i <= j) { + while (a(i) < pivot) i += 1 + while (a(j) > pivot) j -= 1 + if (i <= j) { + swap(i, j) + i += 1 + j -= 1 + } + } + if (l < j) sort1(l, j) + if (j < r) sort1(i, r) + } + + if (a.length > 0) + sort1(0, a.length - 1) + } + + def println(ar: Array[Int]): Unit = { + def print1 = { + def iter(i: Int): String = + ar(i) + (if (i < ar.length-1) "," + iter(i+1) else "") + if (ar.length == 0) "" else iter(0) + } + Console.println("[" + print1 + "]") + } + + val ar = Array(6, 2, 8, 5, 1) + println(ar) + sort(ar) + println(ar) + }.eval +} diff --git a/tests/disabled/macro/run/t5275.check b/tests/disabled/macro/run/t5275.check new file mode 100644 index 000000000..0cfbf0888 --- /dev/null +++ b/tests/disabled/macro/run/t5275.check @@ -0,0 +1 @@ +2 diff --git a/tests/disabled/macro/run/t5275.scala b/tests/disabled/macro/run/t5275.scala new file mode 100644 index 000000000..38b77abab --- /dev/null +++ b/tests/disabled/macro/run/t5275.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + class C(val foo: Int) + println(new C(2).foo) + }.eval +} diff --git a/tests/disabled/macro/run/t5276_1a.check b/tests/disabled/macro/run/t5276_1a.check new file mode 100644 index 000000000..d8263ee98 --- /dev/null +++ b/tests/disabled/macro/run/t5276_1a.check @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/tests/disabled/macro/run/t5276_1a.scala b/tests/disabled/macro/run/t5276_1a.scala new file mode 100644 index 000000000..ad76b2e69 --- /dev/null +++ b/tests/disabled/macro/run/t5276_1a.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + lazy val x = 2 + println(x) + }.eval +} diff --git a/tests/disabled/macro/run/t5276_1b.check b/tests/disabled/macro/run/t5276_1b.check new file mode 100644 index 000000000..d8263ee98 --- /dev/null +++ b/tests/disabled/macro/run/t5276_1b.check @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/tests/disabled/macro/run/t5276_1b.scala b/tests/disabled/macro/run/t5276_1b.scala new file mode 100644 index 000000000..8f11bdc6e --- /dev/null +++ b/tests/disabled/macro/run/t5276_1b.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + implicit lazy val x = 2 + println(implicitly[Int]) + }.eval +} diff --git a/tests/disabled/macro/run/t5276_2a.check b/tests/disabled/macro/run/t5276_2a.check new file mode 100644 index 000000000..d8263ee98 --- /dev/null +++ b/tests/disabled/macro/run/t5276_2a.check @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/tests/disabled/macro/run/t5276_2a.scala b/tests/disabled/macro/run/t5276_2a.scala new file mode 100644 index 000000000..7086fc983 --- /dev/null +++ b/tests/disabled/macro/run/t5276_2a.scala @@ -0,0 +1,12 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + class C { + lazy val x = 2 + } + + println(new C().x) + }.eval +} diff --git a/tests/disabled/macro/run/t5276_2b.check b/tests/disabled/macro/run/t5276_2b.check new file mode 100644 index 000000000..d8263ee98 --- /dev/null +++ b/tests/disabled/macro/run/t5276_2b.check @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/tests/disabled/macro/run/t5276_2b.scala b/tests/disabled/macro/run/t5276_2b.scala new file mode 100644 index 000000000..cccc76a2d --- /dev/null +++ b/tests/disabled/macro/run/t5276_2b.scala @@ -0,0 +1,13 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + class C { + implicit lazy val x = 2 + def y = implicitly[Int] + } + + println(new C().y) + }.eval +} diff --git a/tests/disabled/macro/run/t5277_1.check b/tests/disabled/macro/run/t5277_1.check new file mode 100644 index 000000000..a48033a30 --- /dev/null +++ b/tests/disabled/macro/run/t5277_1.check @@ -0,0 +1 @@ +10! = 3628800 diff --git a/tests/disabled/macro/run/t5277_1.scala b/tests/disabled/macro/run/t5277_1.scala new file mode 100644 index 000000000..580098666 --- /dev/null +++ b/tests/disabled/macro/run/t5277_1.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +import scala.language.{ implicitConversions, postfixOps } +object Test extends dotty.runtime.LegacyApp { + reify { + def fact(n: Int): BigInt = + if (n == 0) 1 else fact(n-1) * n + class Factorizer(n: Int) { + def ! = fact(n) + } + implicit def int2fact(n: Int) = new Factorizer(n) + + println("10! = " + (10!)) + }.eval +} diff --git a/tests/disabled/macro/run/t5277_2.check b/tests/disabled/macro/run/t5277_2.check new file mode 100644 index 000000000..ca017e2a4 --- /dev/null +++ b/tests/disabled/macro/run/t5277_2.check @@ -0,0 +1,2 @@ +2() +1() diff --git a/tests/disabled/macro/run/t5277_2.scala b/tests/disabled/macro/run/t5277_2.scala new file mode 100644 index 000000000..33e31da27 --- /dev/null +++ b/tests/disabled/macro/run/t5277_2.scala @@ -0,0 +1,12 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + def p(implicit i: Int) = print(i) + implicit val v = 2 + + println(p) + println(p(1)) + }.eval +} diff --git a/tests/disabled/macro/run/t5279.check b/tests/disabled/macro/run/t5279.check new file mode 100644 index 000000000..f599e28b8 --- /dev/null +++ b/tests/disabled/macro/run/t5279.check @@ -0,0 +1 @@ +10 diff --git a/tests/disabled/macro/run/t5279.scala b/tests/disabled/macro/run/t5279.scala new file mode 100644 index 000000000..ed1510204 --- /dev/null +++ b/tests/disabled/macro/run/t5279.scala @@ -0,0 +1,8 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + println(new Integer(10)) + }.eval +} diff --git a/tests/disabled/macro/run/t5334_1.check b/tests/disabled/macro/run/t5334_1.check new file mode 100644 index 000000000..96d80cd6c --- /dev/null +++ b/tests/disabled/macro/run/t5334_1.check @@ -0,0 +1 @@ +C \ No newline at end of file diff --git a/tests/disabled/macro/run/t5334_1.scala b/tests/disabled/macro/run/t5334_1.scala new file mode 100644 index 000000000..58954c2f9 --- /dev/null +++ b/tests/disabled/macro/run/t5334_1.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + class C { override def toString = "C" } + val ret = new C + ret.asInstanceOf[Object] + }; + + val toolbox = cm.mkToolBox() + println(toolbox.eval(code.tree)) +} diff --git a/tests/disabled/macro/run/t5334_2.check b/tests/disabled/macro/run/t5334_2.check new file mode 100644 index 000000000..613d286a1 --- /dev/null +++ b/tests/disabled/macro/run/t5334_2.check @@ -0,0 +1 @@ +List((C,C)) \ No newline at end of file diff --git a/tests/disabled/macro/run/t5334_2.scala b/tests/disabled/macro/run/t5334_2.scala new file mode 100644 index 000000000..105819405 --- /dev/null +++ b/tests/disabled/macro/run/t5334_2.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + class C { override def toString() = "C" } + val ret = List((new C, new C)) + ret.asInstanceOf[List[Any]] + }; + + val toolbox = cm.mkToolBox() + println(toolbox.eval(code.tree)) +} diff --git a/tests/disabled/macro/run/t5335.check b/tests/disabled/macro/run/t5335.check new file mode 100644 index 000000000..0cfbf0888 --- /dev/null +++ b/tests/disabled/macro/run/t5335.check @@ -0,0 +1 @@ +2 diff --git a/tests/disabled/macro/run/t5335.scala b/tests/disabled/macro/run/t5335.scala new file mode 100644 index 000000000..c85c5730e --- /dev/null +++ b/tests/disabled/macro/run/t5335.scala @@ -0,0 +1,8 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + println(new {def x = 2}.x) + }.eval +} diff --git a/tests/disabled/macro/run/t5415.scala b/tests/disabled/macro/run/t5415.scala new file mode 100644 index 000000000..cdc90b8ae --- /dev/null +++ b/tests/disabled/macro/run/t5415.scala @@ -0,0 +1,12 @@ +object Test extends dotty.runtime.LegacyApp{ + case class Queryable2[T]() { def filter(predicate: T => Boolean) = ??? } + trait CoffeesTable{ def sales : Int } + val q = Queryable2[CoffeesTable]() + import scala.reflect.runtime.universe._ + import scala.reflect.runtime.{universe => ru} + val code = reify{q.filter(_.sales > 5)} + import scala.reflect.runtime.{currentMirror => cm} + import scala.tools.reflect.ToolBox + val toolbox = cm.mkToolBox() + val ttree = toolbox.typecheck(code.tree) +} diff --git a/tests/disabled/macro/run/t5418.scala b/tests/disabled/macro/run/t5418.scala new file mode 100644 index 000000000..beec4370d --- /dev/null +++ b/tests/disabled/macro/run/t5418.scala @@ -0,0 +1,8 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + new Object().getClass + }.eval +} diff --git a/tests/disabled/macro/run/t5418a.check b/tests/disabled/macro/run/t5418a.check new file mode 100644 index 000000000..527022936 --- /dev/null +++ b/tests/disabled/macro/run/t5418a.check @@ -0,0 +1 @@ +Expr[Class[_ <: java.lang.Object]](new Object().getClass()) diff --git a/tests/disabled/macro/run/t5418a.scala b/tests/disabled/macro/run/t5418a.scala new file mode 100644 index 000000000..722348685 --- /dev/null +++ b/tests/disabled/macro/run/t5418a.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + println(scala.reflect.runtime.universe.reify(new Object().getClass)) +} diff --git a/tests/disabled/macro/run/t5418b.check b/tests/disabled/macro/run/t5418b.check new file mode 100644 index 000000000..f036a4be8 --- /dev/null +++ b/tests/disabled/macro/run/t5418b.check @@ -0,0 +1,2 @@ +new Object().getClass() +TypeRef(ThisType(java.lang), java.lang.Class, List(TypeRef(NoPrefix, TypeName("?0"), List()))) diff --git a/tests/disabled/macro/run/t5418b.scala b/tests/disabled/macro/run/t5418b.scala new file mode 100644 index 000000000..650700ae2 --- /dev/null +++ b/tests/disabled/macro/run/t5418b.scala @@ -0,0 +1,11 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val tb = cm.mkToolBox() + val untyped = reify(new Object().getClass).tree + val typed = tb.typecheck(untyped) + println(typed) + println(showRaw(typed.tpe)) +} diff --git a/tests/disabled/macro/run/t5419.check b/tests/disabled/macro/run/t5419.check new file mode 100644 index 000000000..a9c0f262e --- /dev/null +++ b/tests/disabled/macro/run/t5419.check @@ -0,0 +1 @@ +5: @Foo.asInstanceOf[Int] diff --git a/tests/disabled/macro/run/t5419.scala b/tests/disabled/macro/run/t5419.scala new file mode 100644 index 000000000..e0ee02a5c --- /dev/null +++ b/tests/disabled/macro/run/t5419.scala @@ -0,0 +1,8 @@ +import scala.reflect.runtime.universe._ + +class Foo extends annotation.StaticAnnotation + +object Test extends dotty.runtime.LegacyApp { + val tree = reify{(5: @Foo).asInstanceOf[Int]}.tree + println(tree.toString) +} diff --git a/tests/disabled/macro/run/t5704.check b/tests/disabled/macro/run/t5704.check new file mode 100644 index 000000000..102e3209c --- /dev/null +++ b/tests/disabled/macro/run/t5704.check @@ -0,0 +1 @@ +String diff --git a/tests/disabled/macro/run/t5704.flags b/tests/disabled/macro/run/t5704.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/t5704.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/t5704.scala b/tests/disabled/macro/run/t5704.scala new file mode 100644 index 000000000..b9765ebb6 --- /dev/null +++ b/tests/disabled/macro/run/t5704.scala @@ -0,0 +1,19 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + class MyQuerycollection{ + def findUserByName( name:String ) = { + val tree = reify{ "test" == name }.tree + val toolbox = cm.mkToolBox() + toolbox.typecheck(tree) match{ + case Apply(Select(lhs,op),rhs::Nil) => + println(rhs.tpe) + } + } + } + val qc = new MyQuerycollection + qc.findUserByName("some value") +} diff --git a/tests/disabled/macro/run/t5710-1.check b/tests/disabled/macro/run/t5710-1.check new file mode 100644 index 000000000..eac2025ae --- /dev/null +++ b/tests/disabled/macro/run/t5710-1.check @@ -0,0 +1 @@ +evaluated = (abc,abc) diff --git a/tests/disabled/macro/run/t5710-1.scala b/tests/disabled/macro/run/t5710-1.scala new file mode 100644 index 000000000..5548ca4ca --- /dev/null +++ b/tests/disabled/macro/run/t5710-1.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + val (x, y) = ("abc": Any) match { case x => (x, x) } + (x, y) + }; + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/disabled/macro/run/t5710-2.check b/tests/disabled/macro/run/t5710-2.check new file mode 100644 index 000000000..eac2025ae --- /dev/null +++ b/tests/disabled/macro/run/t5710-2.check @@ -0,0 +1 @@ +evaluated = (abc,abc) diff --git a/tests/disabled/macro/run/t5710-2.scala b/tests/disabled/macro/run/t5710-2.scala new file mode 100644 index 000000000..c5129ce34 --- /dev/null +++ b/tests/disabled/macro/run/t5710-2.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + val (x, y) = "abc" match { case x => (x, x) } + (x, y) + }; + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/disabled/macro/run/t5713.check b/tests/disabled/macro/run/t5713.check new file mode 100644 index 000000000..1419eb9d7 --- /dev/null +++ b/tests/disabled/macro/run/t5713.check @@ -0,0 +1 @@ +err diff --git a/tests/disabled/macro/run/t5713.flags b/tests/disabled/macro/run/t5713.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/t5713.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/t5713/Impls_Macros_1.scala b/tests/disabled/macro/run/t5713/Impls_Macros_1.scala new file mode 100644 index 000000000..7b04197cf --- /dev/null +++ b/tests/disabled/macro/run/t5713/Impls_Macros_1.scala @@ -0,0 +1,28 @@ +package m + +import language.experimental.macros +import scala.reflect.macros.blackbox.Context + +object Level extends Enumeration { + val Error = Value(5) +} + +object Logger { + def error(message: String): Unit = macro LoggerMacros.error +} + +private object LoggerMacros { + + type LoggerContext = Context { type PrefixType = Logger.type } + + def error(c: LoggerContext)(message: c.Expr[String]): c.Expr[Unit] = + log(c)(c.universe.reify(Level.Error), message) + + private def log(c: LoggerContext)(level: c.Expr[Level.Value], message: c.Expr[String]): c.Expr[Unit] = +// was: if (level.splice.id < 4) // TODO Remove hack! + if (c.eval(level).id < 4) // TODO Remove hack! + c.universe.reify(()) + else { + c.universe.reify(println(message.splice)) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t5713/Test_2.scala b/tests/disabled/macro/run/t5713/Test_2.scala new file mode 100644 index 000000000..7e4d02a80 --- /dev/null +++ b/tests/disabled/macro/run/t5713/Test_2.scala @@ -0,0 +1,5 @@ +import m._ + +object Test extends dotty.runtime.LegacyApp { + Logger.error("err") +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t5753_1.check b/tests/disabled/macro/run/t5753_1.check new file mode 100644 index 000000000..f70d7bba4 --- /dev/null +++ b/tests/disabled/macro/run/t5753_1.check @@ -0,0 +1 @@ +42 \ No newline at end of file diff --git a/tests/disabled/macro/run/t5753_1.flags b/tests/disabled/macro/run/t5753_1.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/t5753_1.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/t5753_1/Impls_Macros_1.scala b/tests/disabled/macro/run/t5753_1/Impls_Macros_1.scala new file mode 100644 index 000000000..ce0713885 --- /dev/null +++ b/tests/disabled/macro/run/t5753_1/Impls_Macros_1.scala @@ -0,0 +1,10 @@ +import scala.reflect.macros.blackbox.Context +import language.experimental.macros + +trait Impls { + def impl(c: Context)(x: c.Expr[Any]) = x +} + +object Macros extends Impls { + def foo(x: Any) = macro impl +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t5753_1/Test_2.scala b/tests/disabled/macro/run/t5753_1/Test_2.scala new file mode 100644 index 000000000..413eefff3 --- /dev/null +++ b/tests/disabled/macro/run/t5753_1/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + import Macros._ + println(foo(42)) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t5753_2.check b/tests/disabled/macro/run/t5753_2.check new file mode 100644 index 000000000..f70d7bba4 --- /dev/null +++ b/tests/disabled/macro/run/t5753_2.check @@ -0,0 +1 @@ +42 \ No newline at end of file diff --git a/tests/disabled/macro/run/t5753_2.flags b/tests/disabled/macro/run/t5753_2.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/t5753_2.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/t5753_2/Impls_Macros_1.scala b/tests/disabled/macro/run/t5753_2/Impls_Macros_1.scala new file mode 100644 index 000000000..d446d37bd --- /dev/null +++ b/tests/disabled/macro/run/t5753_2/Impls_Macros_1.scala @@ -0,0 +1,10 @@ +import scala.reflect.macros.blackbox.Context + +trait Macro_T { + def foo[T](c: Context)(s: c.Expr[T]) = s +} + +object Macros { + def foo[T](s: T) = macro Impls.foo[T] + object Impls extends Macro_T +} diff --git a/tests/disabled/macro/run/t5753_2/Test_2.scala b/tests/disabled/macro/run/t5753_2/Test_2.scala new file mode 100644 index 000000000..413eefff3 --- /dev/null +++ b/tests/disabled/macro/run/t5753_2/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + import Macros._ + println(foo(42)) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t5770.check b/tests/disabled/macro/run/t5770.check new file mode 100644 index 000000000..f00c965d8 --- /dev/null +++ b/tests/disabled/macro/run/t5770.check @@ -0,0 +1,10 @@ +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 diff --git a/tests/disabled/macro/run/t5770.scala b/tests/disabled/macro/run/t5770.scala new file mode 100644 index 000000000..409efb2d1 --- /dev/null +++ b/tests/disabled/macro/run/t5770.scala @@ -0,0 +1,25 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect._ + +object Test extends dotty.runtime.LegacyApp { + var i = 0 + val action = reify { i += 1; println(i) }.tree + + val tb1 = cm.mkToolBox() + tb1.eval(action) + tb1.eval(action) + tb1.eval(action) + tb1.frontEnd.reset() + tb1.eval(action) + tb1.eval(action) + + val tb2 = cm.mkToolBox() + tb2.eval(action) + tb2.frontEnd.reset() + tb2.eval(action) + tb2.eval(action) + tb2.frontEnd.reset() + tb2.eval(action) + tb2.eval(action) +} diff --git a/tests/disabled/macro/run/t5816.check b/tests/disabled/macro/run/t5816.check new file mode 100644 index 000000000..8e58ace9b --- /dev/null +++ b/tests/disabled/macro/run/t5816.check @@ -0,0 +1 @@ +5.+(Test.this.y) diff --git a/tests/disabled/macro/run/t5816.scala b/tests/disabled/macro/run/t5816.scala new file mode 100644 index 000000000..4c2a5bcb7 --- /dev/null +++ b/tests/disabled/macro/run/t5816.scala @@ -0,0 +1,17 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val toolbox = cm.mkToolBox() + + def printSource[T](expr: Expr[T]): Unit = { + val ttree = toolbox typecheck expr.tree + println(ttree.toString) + } + + var y = 3 + printSource(reify { + 5 + y + }) +} diff --git a/tests/disabled/macro/run/t5824.check b/tests/disabled/macro/run/t5824.check new file mode 100644 index 000000000..3774da60e --- /dev/null +++ b/tests/disabled/macro/run/t5824.check @@ -0,0 +1 @@ +a b c diff --git a/tests/disabled/macro/run/t5824.scala b/tests/disabled/macro/run/t5824.scala new file mode 100644 index 000000000..c5cfc280f --- /dev/null +++ b/tests/disabled/macro/run/t5824.scala @@ -0,0 +1,8 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + println("%s %s %s".format(List("a", "b", "c"): _*)) + }.eval +} diff --git a/tests/disabled/macro/run/t5840.scala b/tests/disabled/macro/run/t5840.scala new file mode 100644 index 000000000..ba2376f0f --- /dev/null +++ b/tests/disabled/macro/run/t5840.scala @@ -0,0 +1,7 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + reify { + class C[T <: String with Singleton] + } +} diff --git a/tests/disabled/macro/run/t5894.scala b/tests/disabled/macro/run/t5894.scala new file mode 100644 index 000000000..c67a46def --- /dev/null +++ b/tests/disabled/macro/run/t5894.scala @@ -0,0 +1,18 @@ +import scala.reflect.macros.blackbox.Context +import scala.language.experimental.macros + +class Test + +object Test { + def foo: Unit = macro fooImpl + def fooImpl(c: Context) = { import c.universe._; c.Expr[Unit](q"()") } + + def main(args: Array[String]): Unit = { + try { + val method = classOf[Test].getMethod("foo") + sys.error("Static forwarder generated for macro: " + method) + } catch { + case _: NoSuchMethodException => // okay + } + } +} diff --git a/tests/disabled/macro/run/t5903a.check b/tests/disabled/macro/run/t5903a.check new file mode 100644 index 000000000..ce6efd812 --- /dev/null +++ b/tests/disabled/macro/run/t5903a.check @@ -0,0 +1 @@ +(SomeTree,SomeTree) diff --git a/tests/disabled/macro/run/t5903a.flags b/tests/disabled/macro/run/t5903a.flags new file mode 100644 index 000000000..02ecab49e --- /dev/null +++ b/tests/disabled/macro/run/t5903a.flags @@ -0,0 +1 @@ +-Xlog-reflective-calls \ No newline at end of file diff --git a/tests/disabled/macro/run/t5903a/Macros_1.scala b/tests/disabled/macro/run/t5903a/Macros_1.scala new file mode 100644 index 000000000..5d084ceed --- /dev/null +++ b/tests/disabled/macro/run/t5903a/Macros_1.scala @@ -0,0 +1,28 @@ +import scala.reflect.macros.whitebox.Context +import language.experimental.macros + +trait Tree +case object SomeTree extends Tree + +object NewQuasiquotes { + implicit class QuasiquoteInterpolation(c: StringContext) { + object nq { + def unapply(t: Tree): Any = macro QuasiquoteMacros.unapplyImpl + } + } +} + +object QuasiquoteMacros { + def unapplyImpl(c: Context)(t: c.Tree) = { + import c.universe._ + q""" + new { + def isEmpty = false + def get = this + def _1 = SomeTree + def _2 = SomeTree + def unapply(t: Tree) = this + }.unapply($t) + """ + } +} diff --git a/tests/disabled/macro/run/t5903a/Test_2.scala b/tests/disabled/macro/run/t5903a/Test_2.scala new file mode 100644 index 000000000..55a8320b3 --- /dev/null +++ b/tests/disabled/macro/run/t5903a/Test_2.scala @@ -0,0 +1,6 @@ +object Test extends dotty.runtime.LegacyApp { + import NewQuasiquotes._ + SomeTree match { + case nq"$x + $y" => println((x, y)) + } +} diff --git a/tests/disabled/macro/run/t5903b.check b/tests/disabled/macro/run/t5903b.check new file mode 100644 index 000000000..75891bc67 --- /dev/null +++ b/tests/disabled/macro/run/t5903b.check @@ -0,0 +1 @@ +oops diff --git a/tests/disabled/macro/run/t5903b.flags b/tests/disabled/macro/run/t5903b.flags new file mode 100644 index 000000000..02ecab49e --- /dev/null +++ b/tests/disabled/macro/run/t5903b.flags @@ -0,0 +1 @@ +-Xlog-reflective-calls \ No newline at end of file diff --git a/tests/disabled/macro/run/t5903b/Macros_1.scala b/tests/disabled/macro/run/t5903b/Macros_1.scala new file mode 100644 index 000000000..29a05f7fe --- /dev/null +++ b/tests/disabled/macro/run/t5903b/Macros_1.scala @@ -0,0 +1,25 @@ +import scala.reflect.macros.whitebox.Context +import language.experimental.macros + +object Interpolation { + implicit class TestInterpolation(c: StringContext) { + object t { + def unapply[T](x: T): Any = macro Macros.unapplyImpl[T] + } + } +} + +object Macros { + def unapplyImpl[T: c.WeakTypeTag](c: Context)(x: c.Tree) = { + import c.universe._ + q""" + new { + def isEmpty = false + def get = this + def _1 = 2 + def unapply(x: Int) = this + override def toString = "oops" + }.unapply($x) + """ + } +} diff --git a/tests/disabled/macro/run/t5903b/Test_2.scala b/tests/disabled/macro/run/t5903b/Test_2.scala new file mode 100644 index 000000000..23a92225d --- /dev/null +++ b/tests/disabled/macro/run/t5903b/Test_2.scala @@ -0,0 +1,6 @@ +object Test extends dotty.runtime.LegacyApp { + import Interpolation._ + 2 match { + case t"$x" => println(x) + } +} diff --git a/tests/disabled/macro/run/t5903c.check b/tests/disabled/macro/run/t5903c.check new file mode 100644 index 000000000..0cfbf0888 --- /dev/null +++ b/tests/disabled/macro/run/t5903c.check @@ -0,0 +1 @@ +2 diff --git a/tests/disabled/macro/run/t5903c.flags b/tests/disabled/macro/run/t5903c.flags new file mode 100644 index 000000000..02ecab49e --- /dev/null +++ b/tests/disabled/macro/run/t5903c.flags @@ -0,0 +1 @@ +-Xlog-reflective-calls \ No newline at end of file diff --git a/tests/disabled/macro/run/t5903c/Macros_1.scala b/tests/disabled/macro/run/t5903c/Macros_1.scala new file mode 100644 index 000000000..34fe1d880 --- /dev/null +++ b/tests/disabled/macro/run/t5903c/Macros_1.scala @@ -0,0 +1,23 @@ +import scala.reflect.macros.whitebox.Context +import language.experimental.macros + +object Interpolation { + implicit class TestInterpolation(c: StringContext) { + object t { + def unapply[T](x: T): Any = macro Macros.unapplyImpl[T] + } + } +} + +object Macros { + def unapplyImpl[T: c.WeakTypeTag](c: Context)(x: c.Tree) = { + import c.universe._ + q""" + new { + def isEmpty = false + def get = 2 + def unapply(x: Int) = this + }.unapply($x) + """ + } +} diff --git a/tests/disabled/macro/run/t5903c/Test_2.scala b/tests/disabled/macro/run/t5903c/Test_2.scala new file mode 100644 index 000000000..23a92225d --- /dev/null +++ b/tests/disabled/macro/run/t5903c/Test_2.scala @@ -0,0 +1,6 @@ +object Test extends dotty.runtime.LegacyApp { + import Interpolation._ + 2 match { + case t"$x" => println(x) + } +} diff --git a/tests/disabled/macro/run/t5903d.check b/tests/disabled/macro/run/t5903d.check new file mode 100644 index 000000000..d81cc0710 --- /dev/null +++ b/tests/disabled/macro/run/t5903d.check @@ -0,0 +1 @@ +42 diff --git a/tests/disabled/macro/run/t5903d.flags b/tests/disabled/macro/run/t5903d.flags new file mode 100644 index 000000000..02ecab49e --- /dev/null +++ b/tests/disabled/macro/run/t5903d.flags @@ -0,0 +1 @@ +-Xlog-reflective-calls \ No newline at end of file diff --git a/tests/disabled/macro/run/t5903d/Macros_1.scala b/tests/disabled/macro/run/t5903d/Macros_1.scala new file mode 100644 index 000000000..f1f8dc1fd --- /dev/null +++ b/tests/disabled/macro/run/t5903d/Macros_1.scala @@ -0,0 +1,25 @@ +import scala.reflect.macros.whitebox.Context +import language.experimental.macros + +object Interpolation { + implicit class TestInterpolation(c: StringContext) { + object t { + def unapply(x: Int): Any = macro Macros.unapplyImpl + } + } +} + +object Macros { + def unapplyImpl(c: Context)(x: c.Tree) = { + import c.universe._ + q""" + new { + class Match(x: Int) { + def isEmpty = false + def get = x + } + def unapply(x: Int) = new Match(x) + }.unapply($x) + """ + } +} diff --git a/tests/disabled/macro/run/t5903d/Test_2.scala b/tests/disabled/macro/run/t5903d/Test_2.scala new file mode 100644 index 000000000..5df60f024 --- /dev/null +++ b/tests/disabled/macro/run/t5903d/Test_2.scala @@ -0,0 +1,6 @@ +object Test extends dotty.runtime.LegacyApp { + import Interpolation._ + 42 match { + case t"$x" => println(x) + } +} diff --git a/tests/disabled/macro/run/t5923a.check b/tests/disabled/macro/run/t5923a.check new file mode 100644 index 000000000..7165b734a --- /dev/null +++ b/tests/disabled/macro/run/t5923a.check @@ -0,0 +1,3 @@ +C(Int) +C(String) +C(Nothing) diff --git a/tests/disabled/macro/run/t5923a/Macros_1.scala b/tests/disabled/macro/run/t5923a/Macros_1.scala new file mode 100644 index 000000000..9050fd4b1 --- /dev/null +++ b/tests/disabled/macro/run/t5923a/Macros_1.scala @@ -0,0 +1,53 @@ +import scala.reflect.macros.whitebox.Context +import language.experimental.macros + +case class C[T](t: String) +object C { + implicit def foo[T]: C[T] = macro Macros.impl[T] +} + +object Macros { + def impl[T](c: Context)(ttag: c.WeakTypeTag[T]) = { + import c.universe._ + import internal._ + val ttag0 = ttag; + { + // When we're expanding implicitly[C[Nothing]], the type inferencer will see + // that foo[T] returns C[T] and that we request an implicit of type C[Nothing]. + // + // Then the type inferencer will try to match C[T] against C[Nothing] and infer everything it can infer + // from that match, but not more (e.g. if we were returning Iso[T, U] and the type we were looking at was Iso[Foo, L], + // we wouldn't want U to be auto-inferred to Nothing, as it usually happens with normal methods, + // but would rather want it to remain unknown, so that our macro could take a stab at inferring it: + // see the comments in this commit for more information). + // + // Equipped with common sense, in our case of C[T] and C[Nothing] we would expect T to be inferred as Nothing, and then we + // would expect T in the corresponding macro invocation to be Nothing. Unfortunately it is not that simple. + // + // Internally the type inferencer uses Nothing as a dummy value, which stands for "don't know how to + // infer this type parameter". In the Iso example, matching Iso[T, U] against Iso[Foo, L] would result in + // T being inferred as Foo and U being inferred as Nothing (!!). Then the type inferencer will think: + // "Aha! U ended up being Nothing. This means that I failed to infer it, + // therefore the result of my work is: T -> Foo, U -> still unknown". + // + // That's all very good and works very well until Nothing is a genuine result of type inference, + // as in our original example of inferring T in C[T] from C[Nothing]. In that case, the inferencer becomes confused + // and here in the macro implementation we get weakTypeOf[T] equal to some dummy type carrying a type parameter + // instead of Nothing. + // + // This eccentric behavior of the type inferencer is a long-standing problem in scalac, + // so the best one can do for now until it's fixed is to work around, manually converting + // suspicious T's into Nothings. Of course, this means that we would have to approximate, + // because there's no way to know whether having T here stands for a failed attempt to infer Nothing + // or for a failed attempt to infer anything, but at least we're in full control of making the best + // of this sad situation. + implicit def ttag: WeakTypeTag[T] = { + val tpe = ttag0.tpe + val sym = tpe.typeSymbol.asType + if (sym.isParameter && !isSkolem(sym)) TypeTag.Nothing.asInstanceOf[TypeTag[T]] + else ttag0 + } + reify(C[T](c.Expr[String](Literal(Constant(weakTypeOf[T].toString))).splice)) + } + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t5923a/Test_2.scala b/tests/disabled/macro/run/t5923a/Test_2.scala new file mode 100644 index 000000000..1f0413bdf --- /dev/null +++ b/tests/disabled/macro/run/t5923a/Test_2.scala @@ -0,0 +1,5 @@ +object Test extends dotty.runtime.LegacyApp { + println(implicitly[C[Int]]) + println(implicitly[C[String]]) + println(implicitly[C[Nothing]]) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t5923d/Macros_1.scala b/tests/disabled/macro/run/t5923d/Macros_1.scala new file mode 100644 index 000000000..1400674d4 --- /dev/null +++ b/tests/disabled/macro/run/t5923d/Macros_1.scala @@ -0,0 +1,9 @@ +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.Context + +trait MappedRow +trait RowMapper[T <: MappedRow] +object RowMapper { + implicit def mapper[T <: MappedRow]: RowMapper[T] = macro impl[T] + def impl[T <: MappedRow : c.WeakTypeTag](c: Context) = c.universe.reify(new RowMapper[T]{}) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t5923d/Test_2.scala b/tests/disabled/macro/run/t5923d/Test_2.scala new file mode 100644 index 000000000..e9c446209 --- /dev/null +++ b/tests/disabled/macro/run/t5923d/Test_2.scala @@ -0,0 +1,7 @@ +class RowA extends MappedRow +class RowB extends MappedRow + +object Test extends dotty.runtime.LegacyApp { + implicitly[RowMapper[RowA]] + implicitly[RowMapper[RowB]] +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t5940.scala b/tests/disabled/macro/run/t5940.scala new file mode 100644 index 000000000..856070821 --- /dev/null +++ b/tests/disabled/macro/run/t5940.scala @@ -0,0 +1,41 @@ +import scala.tools.partest._ + +object Test extends DirectTest { + def code = ??? + + def macros_1 = """ + import scala.reflect.macros.blackbox.Context + + object Impls { + def impl(c: Context) = { import c.universe._; c.Expr[Unit](q"()") } + } + + object Macros { + //import Impls._ + def impl(c: Context) = { import c.universe._; c.Expr[Unit](q"()") } + def foo: Unit = macro impl + } + """ + def compileMacros() = { + val classpath = List(sys.props("partest.lib"), sys.props("partest.reflect")) mkString sys.props("path.separator") + compileString(newCompiler("-language:experimental.macros", "-cp", classpath, "-d", testOutput.path))(macros_1) + } + + def test_2 = """ + object Test extends dotty.runtime.LegacyApp { + println(Macros.foo) + } + """ + def compileTest() = { + val classpath = List(sys.props("partest.lib"), testOutput.path) mkString sys.props("path.separator") + compileString(newCompiler("-cp", classpath, "-d", testOutput.path))(test_2) + } + + def show(): Unit = { + log("Compiling Macros_1...") + if (compileMacros()) { + log("Compiling Test_2...") + if (compileTest()) log("Success!") else log("Failed...") + } + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t6023.check b/tests/disabled/macro/run/t6023.check new file mode 100644 index 000000000..ee9356523 --- /dev/null +++ b/tests/disabled/macro/run/t6023.check @@ -0,0 +1,12 @@ +{ + abstract trait Foo extends AnyRef { + def a: Int + }; + () +} +{ + abstract trait Foo extends AnyRef { + def a: Int + }; + () +} diff --git a/tests/disabled/macro/run/t6023.scala b/tests/disabled/macro/run/t6023.scala new file mode 100644 index 000000000..9ec8724a4 --- /dev/null +++ b/tests/disabled/macro/run/t6023.scala @@ -0,0 +1,17 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + // test 1: reify + val tree = reify{ trait Foo { val a: Int } }.tree + println(tree.toString) + + // test 2: import and typecheck + val toolbox = cm.mkToolBox() + val ttree = toolbox.typecheck(tree) + println(ttree.toString) + + // test 3: import and compile + toolbox.eval(tree) +} diff --git a/tests/disabled/macro/run/t6187.check b/tests/disabled/macro/run/t6187.check new file mode 100644 index 000000000..9a9e266ec --- /dev/null +++ b/tests/disabled/macro/run/t6187.check @@ -0,0 +1,32 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> import scala.language.experimental.macros, scala.reflect.macros.blackbox.Context +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.Context + +scala> def macroImpl[T: c.WeakTypeTag](c: Context)(t: c.Expr[T]): c.Expr[List[T]] = { + val r = c.universe.reify { List(t.splice) } + c.Expr[List[T]]( c.untypecheck(r.tree) ) +} +macroImpl: [T](c: scala.reflect.macros.blackbox.Context)(t: c.Expr[T])(implicit evidence$1: c.WeakTypeTag[T])c.Expr[List[T]] + +scala> def demo[T](t: T): List[T] = macro macroImpl[T] +defined term macro demo: [T](t: T)List[T] + +scala> def m[T](t: T): List[List[T]] = + demo( List((t,true)) collect { case (x,true) => x } ) +m: [T](t: T)List[List[T]] + +scala> m(List(1)) +res0: List[List[List[Int]]] = List(List(List(1))) + +scala> // Showing we haven't added unreachable warnings + +scala> List(1) collect { case x => x } +res1: List[Int] = List(1) + +scala> List("") collect { case x => x } +res2: List[String] = List("") + +scala> :quit diff --git a/tests/disabled/macro/run/t6187.scala b/tests/disabled/macro/run/t6187.scala new file mode 100644 index 000000000..7a39cfd9e --- /dev/null +++ b/tests/disabled/macro/run/t6187.scala @@ -0,0 +1,18 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + override def code = """ +import scala.language.experimental.macros, scala.reflect.macros.blackbox.Context +def macroImpl[T: c.WeakTypeTag](c: Context)(t: c.Expr[T]): c.Expr[List[T]] = { + val r = c.universe.reify { List(t.splice) } + c.Expr[List[T]]( c.untypecheck(r.tree) ) +} +def demo[T](t: T): List[T] = macro macroImpl[T] +def m[T](t: T): List[List[T]] = + demo( List((t,true)) collect { case (x,true) => x } ) +m(List(1)) +// Showing we haven't added unreachable warnings +List(1) collect { case x => x } +List("") collect { case x => x } + """.trim +} diff --git a/tests/disabled/macro/run/t6187b.scala b/tests/disabled/macro/run/t6187b.scala new file mode 100644 index 000000000..412880f38 --- /dev/null +++ b/tests/disabled/macro/run/t6187b.scala @@ -0,0 +1,5 @@ +object Test extends dotty.runtime.LegacyApp { + val x: PartialFunction[Int, Int] = { case 1 => 1 } + val o: Any = "" + assert(x.applyOrElse(0, (_: Int) => o) == "") +} diff --git a/tests/disabled/macro/run/t6221.check b/tests/disabled/macro/run/t6221.check new file mode 100644 index 000000000..aa1bdd0e6 --- /dev/null +++ b/tests/disabled/macro/run/t6221.check @@ -0,0 +1 @@ +((x) => x.$percent(2).$eq$eq(0)) diff --git a/tests/disabled/macro/run/t6221/Macros_1.scala b/tests/disabled/macro/run/t6221/Macros_1.scala new file mode 100644 index 000000000..0aeaa00c8 --- /dev/null +++ b/tests/disabled/macro/run/t6221/Macros_1.scala @@ -0,0 +1,23 @@ +import language.experimental.macros +import language.implicitConversions +import scala.reflect.macros.blackbox.Context +import scala.reflect.runtime.universe.Tree + +class ReflectiveClosure[A, B](val tree: Tree, fn: A => B) extends (A => B) { + def apply(x: A) = fn(x) +} + +object ReflectiveClosure { + implicit def reflectClosure[A, B](f: A => B): ReflectiveClosure[A, B] = macro Macros.reflectiveClosureImpl[A, B] +} + +object Macros { + def reflectiveClosureImpl[A, B](c: Context)(f: c.Expr[A => B]): c.Expr[ReflectiveClosure[A, B]] = { + import c.universe._ + import internal._ + val u = gen.mkRuntimeUniverseRef + val m = EmptyTree + val tree = c.Expr[scala.reflect.runtime.universe.Tree](Select(c.reifyTree(u, m, f.tree), newTermName("tree"))) + c.universe.reify(new ReflectiveClosure(tree.splice, f.splice)) + } +} diff --git a/tests/disabled/macro/run/t6221/Test_2.scala b/tests/disabled/macro/run/t6221/Test_2.scala new file mode 100644 index 000000000..bc295d437 --- /dev/null +++ b/tests/disabled/macro/run/t6221/Test_2.scala @@ -0,0 +1,10 @@ +object Test extends dotty.runtime.LegacyApp { + implicit class PimpedList[T](val list: List[T]) { + def query(predicate: ReflectiveClosure[T, Boolean]): List[T] = { + println(predicate.tree) + list filter predicate + } + } + + List(1, 2, 3).query(x => x % 2 == 0) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t6379.check b/tests/disabled/macro/run/t6379.check new file mode 100644 index 000000000..3e5dfec62 --- /dev/null +++ b/tests/disabled/macro/run/t6379.check @@ -0,0 +1,14 @@ +compile-time +uninitialized close: List(class IOException) +initialized close: List(class IOException) +uninitialized productElement: List(class IndexOutOfBoundsException) +initialized productElement: List(class IndexOutOfBoundsException) +uninitialized read: List(class IOException) +initialized read: List(class IOException) +runtime +uninitialized close: List(class IOException) +initialized close: List(class IOException) +uninitialized productElement: List(class IndexOutOfBoundsException) +initialized productElement: List(class IndexOutOfBoundsException) +uninitialized read: List(class IOException) +initialized read: List(class IOException) diff --git a/tests/disabled/macro/run/t6379/Macros_1.scala b/tests/disabled/macro/run/t6379/Macros_1.scala new file mode 100644 index 000000000..4f3daf497 --- /dev/null +++ b/tests/disabled/macro/run/t6379/Macros_1.scala @@ -0,0 +1,26 @@ +import scala.reflect.macros.whitebox._ +import scala.language.experimental.macros +import java.io._ + +object Macros { + def impl(c: Context) = { + var messages = List[String]() + def println(msg: String) = messages :+= msg + + import c.universe._ + def test(sym: MethodSymbol): Unit = { + println(s"uninitialized ${sym.name}: ${sym.exceptions}") + sym.info + println(s"initialized ${sym.name}: ${sym.exceptions}") + } + + println("compile-time") + test(typeOf[Closeable].declaration(TermName("close")).asMethod) + test(typeOf[Product1[_]].declaration(TermName("productElement")).asMethod) + test(c.mirror.staticClass("Reader").info.decl(TermName("read")).asMethod) + + q"..${messages.map(msg => q"println($msg)")}" + } + + def foo: Any = macro impl +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t6379/Test_2.scala b/tests/disabled/macro/run/t6379/Test_2.scala new file mode 100644 index 000000000..05bdd5575 --- /dev/null +++ b/tests/disabled/macro/run/t6379/Test_2.scala @@ -0,0 +1,22 @@ +import java.io._ +import scala.reflect.runtime.universe._ + +class Reader(fname: String) { + private val in = new BufferedReader(new FileReader(fname)) + @throws[IOException]("if the file doesn't exist") + def read() = in.read() +} + +object Test extends dotty.runtime.LegacyApp { + def test(sym: MethodSymbol): Unit = { + println(s"uninitialized ${sym.name}: ${sym.exceptions}") + sym.info + println(s"initialized ${sym.name}: ${sym.exceptions}") + } + + Macros.foo + println("runtime") + test(typeOf[Closeable].decl(TermName("close")).asMethod) + test(typeOf[Product1[_]].decl(TermName("productElement")).asMethod) + test(typeOf[Reader].decl(TermName("read")).asMethod) +} diff --git a/tests/disabled/macro/run/t6381.check b/tests/disabled/macro/run/t6381.check new file mode 100644 index 000000000..49c6a784a --- /dev/null +++ b/tests/disabled/macro/run/t6381.check @@ -0,0 +1,19 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> import scala.language.experimental.macros +import scala.language.experimental.macros + +scala> def pos_impl(c: scala.reflect.macros.blackbox.Context): c.Expr[String] = { + import c.universe._ + c.Expr[String](Literal(Constant(c.enclosingPosition.getClass.toString))) +} +pos_impl: (c: scala.reflect.macros.blackbox.Context)c.Expr[String] + +scala> def pos: String = macro pos_impl +defined term macro pos: String + +scala> pos +res0: String = class scala.reflect.internal.util.RangePosition + +scala> :quit diff --git a/tests/disabled/macro/run/t6381.scala b/tests/disabled/macro/run/t6381.scala new file mode 100644 index 000000000..5a687c10c --- /dev/null +++ b/tests/disabled/macro/run/t6381.scala @@ -0,0 +1,15 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ + |import scala.language.experimental.macros + |def pos_impl(c: scala.reflect.macros.blackbox.Context): c.Expr[String] = { + | import c.universe._ + | c.Expr[String](Literal(Constant(c.enclosingPosition.getClass.toString))) + |} + |def pos: String = macro pos_impl + |pos + |""".stripMargin.trim + + override def extraSettings: String = "-Yrangepos" +} diff --git a/tests/disabled/macro/run/t6394a.check b/tests/disabled/macro/run/t6394a.check new file mode 100644 index 000000000..2a02d41ce --- /dev/null +++ b/tests/disabled/macro/run/t6394a.check @@ -0,0 +1 @@ +TEST diff --git a/tests/disabled/macro/run/t6394a.flags b/tests/disabled/macro/run/t6394a.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/t6394a.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/t6394a/Macros_1.scala b/tests/disabled/macro/run/t6394a/Macros_1.scala new file mode 100644 index 000000000..376d85ba6 --- /dev/null +++ b/tests/disabled/macro/run/t6394a/Macros_1.scala @@ -0,0 +1,12 @@ +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl(c:Context): c.Expr[Any] = { + import c.universe._ + + val selfTree = This(c.enclosingImpl.symbol.asModule.moduleClass) + c.Expr[AnyRef](selfTree) + } + + def foo: Any = macro impl +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t6394a/Test_2.scala b/tests/disabled/macro/run/t6394a/Test_2.scala new file mode 100644 index 000000000..989ab3031 --- /dev/null +++ b/tests/disabled/macro/run/t6394a/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + println(Macros.foo) + override def toString = "TEST" +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t6394b.check b/tests/disabled/macro/run/t6394b.check new file mode 100644 index 000000000..2a02d41ce --- /dev/null +++ b/tests/disabled/macro/run/t6394b.check @@ -0,0 +1 @@ +TEST diff --git a/tests/disabled/macro/run/t6394b.flags b/tests/disabled/macro/run/t6394b.flags new file mode 100644 index 000000000..cd66464f2 --- /dev/null +++ b/tests/disabled/macro/run/t6394b.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/disabled/macro/run/t6394b/Macros_1.scala b/tests/disabled/macro/run/t6394b/Macros_1.scala new file mode 100644 index 000000000..1a747816e --- /dev/null +++ b/tests/disabled/macro/run/t6394b/Macros_1.scala @@ -0,0 +1,12 @@ +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl(c:Context): c.Expr[Any] = { + import c.universe._ + + val selfTree = This(typeNames.EMPTY) + c.Expr[AnyRef](selfTree) + } + + def foo: Any = macro impl +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t6394b/Test_2.scala b/tests/disabled/macro/run/t6394b/Test_2.scala new file mode 100644 index 000000000..989ab3031 --- /dev/null +++ b/tests/disabled/macro/run/t6394b/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + println(Macros.foo) + override def toString = "TEST" +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t6591_1.check b/tests/disabled/macro/run/t6591_1.check new file mode 100644 index 000000000..d1d448f28 --- /dev/null +++ b/tests/disabled/macro/run/t6591_1.check @@ -0,0 +1 @@ +Block(List(ValDef(Modifiers(), TermName("v"), Select(Ident(A), TypeName("I")), Select(Ident(A), TermName("impl")))), Ident(TermName("v"))) diff --git a/tests/disabled/macro/run/t6591_1.scala b/tests/disabled/macro/run/t6591_1.scala new file mode 100644 index 000000000..8c152f68a --- /dev/null +++ b/tests/disabled/macro/run/t6591_1.scala @@ -0,0 +1,19 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +trait O { trait I } + +object A extends O { + val impl = new I {} +} + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + val v: A.I = A.impl + v + } + println(showRaw(code.tree)) + + val v: A.I = code.eval +} diff --git a/tests/disabled/macro/run/t6591_2.check b/tests/disabled/macro/run/t6591_2.check new file mode 100644 index 000000000..a2930b174 --- /dev/null +++ b/tests/disabled/macro/run/t6591_2.check @@ -0,0 +1 @@ +Block(List(ValDef(Modifiers(), TermName("v"), SelectFromTypeTree(Ident(A), TypeName("I")), Select(Apply(Select(New(Ident(A)), termNames.CONSTRUCTOR), List()), TermName("impl")))), Ident(TermName("v"))) diff --git a/tests/disabled/macro/run/t6591_2.scala b/tests/disabled/macro/run/t6591_2.scala new file mode 100644 index 000000000..9e6c917e8 --- /dev/null +++ b/tests/disabled/macro/run/t6591_2.scala @@ -0,0 +1,19 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +trait O { trait I } + +class A extends O { + val impl = new I {} +} + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + val v: A#I = (new A).impl + v + } + println(showRaw(code.tree)) + + val v: A#I = code.eval +} diff --git a/tests/disabled/macro/run/t6591_3.check b/tests/disabled/macro/run/t6591_3.check new file mode 100644 index 000000000..362aafd11 --- /dev/null +++ b/tests/disabled/macro/run/t6591_3.check @@ -0,0 +1 @@ +Block(List(ValDef(Modifiers(), TermName("v"), Select(This(TypeName("A")), TypeName("I")), Apply(Select(New(Select(This(TypeName("A")), TypeName("I"))), termNames.CONSTRUCTOR), List()))), Ident(TermName("v"))) diff --git a/tests/disabled/macro/run/t6591_3.scala b/tests/disabled/macro/run/t6591_3.scala new file mode 100644 index 000000000..5069b800e --- /dev/null +++ b/tests/disabled/macro/run/t6591_3.scala @@ -0,0 +1,17 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +class O { class I } + +object A extends O { + val code = reify { + val v: I = new I + v + } + println(showRaw(code.tree)) +} + +object Test extends dotty.runtime.LegacyApp { + val v: A.I = A.code.eval +} diff --git a/tests/disabled/macro/run/t6591_5.check b/tests/disabled/macro/run/t6591_5.check new file mode 100644 index 000000000..4ebc2236a --- /dev/null +++ b/tests/disabled/macro/run/t6591_5.check @@ -0,0 +1 @@ +Expr(Block(List(ValDef(Modifiers(), TermName("v"), Select(Select(This(TypeName("A")), TermName("x")), TypeName("I")), Select(Ident(scala.Predef), TermName("$qmark$qmark$qmark")))), Ident(TermName("v")))) diff --git a/tests/disabled/macro/run/t6591_5.scala b/tests/disabled/macro/run/t6591_5.scala new file mode 100644 index 000000000..dfb4cd5ad --- /dev/null +++ b/tests/disabled/macro/run/t6591_5.scala @@ -0,0 +1,23 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval +import java.lang.reflect.InvocationTargetException + +class O { class I } + +object A extends O { + val x = new O + val code = reify { + val v: x.I = ??? + v + } + println(showRaw(code)) +} + +object Test extends dotty.runtime.LegacyApp { + try { + val v: A.x.I = A.code.eval + } catch { + case ex: InvocationTargetException if ex.getCause.isInstanceOf[NotImplementedError] => + } +} diff --git a/tests/disabled/macro/run/t6591_6.check b/tests/disabled/macro/run/t6591_6.check new file mode 100644 index 000000000..940e2026f --- /dev/null +++ b/tests/disabled/macro/run/t6591_6.check @@ -0,0 +1 @@ +Expr(Block(List(ValDef(Modifiers(), TermName("v"), Select(Select(Ident(TermName("A")), TermName("x")), TypeName("I")), Select(Ident(scala.Predef), TermName("$qmark$qmark$qmark")))), Ident(TermName("v")))) diff --git a/tests/disabled/macro/run/t6591_6.scala b/tests/disabled/macro/run/t6591_6.scala new file mode 100644 index 000000000..afb2da229 --- /dev/null +++ b/tests/disabled/macro/run/t6591_6.scala @@ -0,0 +1,24 @@ +import scala.language.existentials +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval +import java.lang.reflect.InvocationTargetException + +class O { class I } + +class A extends O { + val x = new O + val code = reify { + val v: x.I = ??? + v + } + println(showRaw(code)) +} + +object Test extends dotty.runtime.LegacyApp { + try { + val v = (new A).code.eval + } catch { + case ex: InvocationTargetException if ex.getCause.isInstanceOf[NotImplementedError] => + } +} diff --git a/tests/disabled/macro/run/t6591_7.check b/tests/disabled/macro/run/t6591_7.check new file mode 100644 index 000000000..e21a3669b --- /dev/null +++ b/tests/disabled/macro/run/t6591_7.check @@ -0,0 +1,4 @@ +name = x, stable = true +name = y, stable = true +name = z, stable = false +name = C, stable = true diff --git a/tests/disabled/macro/run/t6591_7.scala b/tests/disabled/macro/run/t6591_7.scala new file mode 100644 index 000000000..cec0d2cda --- /dev/null +++ b/tests/disabled/macro/run/t6591_7.scala @@ -0,0 +1,27 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval +import internal._ + +object Test extends dotty.runtime.LegacyApp { + locally { + val x = 2 + def y = 3 + var z = 4 + class C { + var w = 5 + locally { + val expr = reify(x + y + z + w) + // blocked by SI-7103, though it's not the focus of this test + // therefore I'm just commenting out the evaluation + // println(expr.eval) + freeTerms(expr.tree) foreach (ft => { + // blocked by SI-7104, though it's not the focus of this test + // therefore I'm just commenting out the call to info + // println(s"name = ${ft.name}, sig = ${ft.info}, stable = ${ft.isStable}") + println(s"name = ${ft.name}, stable = ${ft.isStable}") + }) + } + } + new C() + } +} diff --git a/tests/disabled/macro/run/t6662.check b/tests/disabled/macro/run/t6662.check new file mode 100644 index 000000000..6a452c185 --- /dev/null +++ b/tests/disabled/macro/run/t6662.check @@ -0,0 +1 @@ +() diff --git a/tests/disabled/macro/run/t6662/Macro_1.scala b/tests/disabled/macro/run/t6662/Macro_1.scala new file mode 100644 index 000000000..419859772 --- /dev/null +++ b/tests/disabled/macro/run/t6662/Macro_1.scala @@ -0,0 +1,8 @@ +import language.experimental.macros +import scala.reflect.macros.blackbox.Context + +object Demo { + def id[T](a: T): T = macro idImpl[T] + + def idImpl[T: c.WeakTypeTag](c: Context)(a: c.Expr[T]): c.Expr[T] = a +} diff --git a/tests/disabled/macro/run/t6662/Test_2.scala b/tests/disabled/macro/run/t6662/Test_2.scala new file mode 100644 index 000000000..82ac54cb4 --- /dev/null +++ b/tests/disabled/macro/run/t6662/Test_2.scala @@ -0,0 +1,8 @@ +// Macro usage: + +object Test { + def main(args: Array[String]) { + val s = Demo id (()) + println(s) + } +} diff --git a/tests/disabled/macro/run/t6814.check b/tests/disabled/macro/run/t6814.check new file mode 100644 index 000000000..97ada7720 --- /dev/null +++ b/tests/disabled/macro/run/t6814.check @@ -0,0 +1,7 @@ +List[Int] +scala.collection.immutable.List.type +object java.lang.RuntimeException is not a value +List[Int] +List +scala.collection.immutable.List.type +scala.collection.immutable.List.type does not take parameters diff --git a/tests/disabled/macro/run/t6814/Macros_1.scala b/tests/disabled/macro/run/t6814/Macros_1.scala new file mode 100644 index 000000000..0257f451d --- /dev/null +++ b/tests/disabled/macro/run/t6814/Macros_1.scala @@ -0,0 +1,24 @@ +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl(c: Context) = { + import c.universe._ + + def test(tree: Tree, mode: c.TypecheckMode): String = { + try c.typecheck(tree, mode, silent = false).tpe.toString + catch { case c.TypecheckException(_, msg) => msg } + } + + q""" + println(${test(q"List(1, 2)", c.TERMmode)}) + println(${test(q"List", c.TERMmode)}) + println(${test(q"RuntimeException", c.TERMmode)}) + println(${test(tq"List[Int]", c.TYPEmode)}) + println(${test(tq"List", c.TYPEmode)}) + println(${test(q"List", c.TYPEmode)}) + println(${test(q"List(1, 2)", c.TYPEmode)}) + """ + } + def foo: Unit = macro impl +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t6814/Test_2.scala b/tests/disabled/macro/run/t6814/Test_2.scala new file mode 100644 index 000000000..0fc472aa6 --- /dev/null +++ b/tests/disabled/macro/run/t6814/Test_2.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + Macros.foo +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t6992.check b/tests/disabled/macro/run/t6992.check new file mode 100644 index 000000000..021f32ec9 --- /dev/null +++ b/tests/disabled/macro/run/t6992.check @@ -0,0 +1,4 @@ +Test.foo.T +Int +42 +42 diff --git a/tests/disabled/macro/run/t6992/Macros_1.scala b/tests/disabled/macro/run/t6992/Macros_1.scala new file mode 100644 index 000000000..f578f2b3c --- /dev/null +++ b/tests/disabled/macro/run/t6992/Macros_1.scala @@ -0,0 +1,75 @@ +import scala.language.experimental.macros +import scala.reflect.macros.whitebox.Context + +object Macros { + def foo(name: String): Any = macro foo_impl + def foo_impl(c: Context)(name: c.Expr[String]) = { + import c.universe._ + + val Literal(Constant(lit: String)) = name.tree + val anon = newTypeName(c.fresh) + + c.Expr(Block( + ClassDef( + Modifiers(Flag.FINAL), anon, Nil, Template( + Nil, noSelfType, List( + DefDef(Modifiers(), termNames.CONSTRUCTOR, List(), List(List()), TypeTree(), Block(List(pendingSuperCall), Literal(Constant(())))), + TypeDef(Modifiers(), TypeName(lit), Nil, TypeTree(typeOf[Int])) + ) + ) + ), + Apply(Select(New(Ident(anon)), termNames.CONSTRUCTOR), Nil) + )) + } + + def bar(name: String): Any = macro bar_impl + def bar_impl(c: Context)(name: c.Expr[String]) = { + import c.universe._ + + val Literal(Constant(lit: String)) = name.tree + val anon = newTypeName(c.fresh) + + c.Expr(Block( + ClassDef( + Modifiers(Flag.FINAL), anon, Nil, Template( + Nil, noSelfType, List( + DefDef(Modifiers(), termNames.CONSTRUCTOR, List(), List(List()), TypeTree(), Block(List(pendingSuperCall), Literal(Constant(())))), + DefDef( + Modifiers(), TermName(lit), Nil, Nil, TypeTree(), + c.literal(42).tree + ) + ) + ) + ), + Apply(Select(New(Ident(anon)), termNames.CONSTRUCTOR), Nil) + )) + } + + def baz(name: String): Any = macro baz_impl + def baz_impl(c: Context)(name: c.Expr[String]) = { + import c.universe._ + + val Literal(Constant(lit: String)) = name.tree + val anon = newTypeName(c.fresh) + val wrapper = newTypeName(c.fresh) + + c.Expr(Block( + ClassDef( + Modifiers(), anon, Nil, Template( + Nil, emptyValDef, List( + DefDef(Modifiers(), termNames.CONSTRUCTOR, List(), List(List()), TypeTree(), Block(List(pendingSuperCall), Literal(Constant(())))), + DefDef( + Modifiers(), TermName(lit), Nil, Nil, TypeTree(), + c.literal(42).tree + ) + ) + ) + ), + ClassDef( + Modifiers(Flag.FINAL), wrapper, Nil, + Template(Ident(anon) :: Nil, noSelfType, DefDef(Modifiers(), termNames.CONSTRUCTOR, List(), List(List()), TypeTree(), Block(List(pendingSuperCall), Literal(Constant(())))) :: Nil) + ), + Apply(Select(New(Ident(wrapper)), termNames.CONSTRUCTOR), Nil) + )) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t6992/Test_2.scala b/tests/disabled/macro/run/t6992/Test_2.scala new file mode 100644 index 000000000..5d1a64eac --- /dev/null +++ b/tests/disabled/macro/run/t6992/Test_2.scala @@ -0,0 +1,14 @@ +import scala.language.reflectiveCalls + +object Test extends dotty.runtime.LegacyApp { + val foo = Macros.foo("T") + val ttpe = scala.reflect.runtime.universe.weakTypeOf[foo.T] + println(ttpe) + println(ttpe.typeSymbol.info) + + val bar = Macros.bar("test") + println(bar.test) + + val baz = Macros.baz("test") + println(baz.test) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t7008-scala-defined.check b/tests/disabled/macro/run/t7008-scala-defined.check new file mode 100644 index 000000000..84ed62619 --- /dev/null +++ b/tests/disabled/macro/run/t7008-scala-defined.check @@ -0,0 +1,7 @@ +: List(throws[NullPointerException]("")) +bar: List(throws[E1]("")) +baz: List(throws[IllegalStateException]("")) +============= +: List(throws[NullPointerException]("")) +bar: List(throws[E1]("")) +baz: List(throws[IllegalStateException]("")) diff --git a/tests/disabled/macro/run/t7008-scala-defined.flags b/tests/disabled/macro/run/t7008-scala-defined.flags new file mode 100644 index 000000000..49f2d2c4c --- /dev/null +++ b/tests/disabled/macro/run/t7008-scala-defined.flags @@ -0,0 +1 @@ +-Ybackend:GenASM diff --git a/tests/disabled/macro/run/t7008-scala-defined/Impls_Macros_2.scala b/tests/disabled/macro/run/t7008-scala-defined/Impls_Macros_2.scala new file mode 100644 index 000000000..330db8da7 --- /dev/null +++ b/tests/disabled/macro/run/t7008-scala-defined/Impls_Macros_2.scala @@ -0,0 +1,13 @@ +import language.experimental.macros +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl(c: Context) = { + import c.universe._ + val decls = c.typeOf[ScalaClassWithCheckedExceptions_1[_]].decls.toList + val s = decls.sortBy(_.name.toString).map(decl => (s"${decl.name}: ${decl.annotations}")).mkString(scala.compat.Platform.EOL) + reify(println(c.Expr[String](Literal(Constant(s))).splice)) + } + + def foo = macro impl +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t7008-scala-defined/ScalaClassWithCheckedExceptions_1.scala b/tests/disabled/macro/run/t7008-scala-defined/ScalaClassWithCheckedExceptions_1.scala new file mode 100644 index 000000000..7783c873e --- /dev/null +++ b/tests/disabled/macro/run/t7008-scala-defined/ScalaClassWithCheckedExceptions_1.scala @@ -0,0 +1,6 @@ +class ScalaClassWithCheckedExceptions_1[E1 <: Exception] @throws[NullPointerException]("") () { + @throws[E1]("") def bar() {} + @throws[IllegalStateException]("") def baz(x: Int) {} + // FIXME: SI-7066 + // @throws[E2]("") def foo[E2 <: Exception] {} +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t7008-scala-defined/Test_3.scala b/tests/disabled/macro/run/t7008-scala-defined/Test_3.scala new file mode 100644 index 000000000..23adb88b2 --- /dev/null +++ b/tests/disabled/macro/run/t7008-scala-defined/Test_3.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + Macros.foo + println("=============") + + val decls = typeOf[ScalaClassWithCheckedExceptions_1[_]].decls.toList + decls sortBy (_.name.toString) foreach (decl => println(s"${decl.name}: ${decl.annotations}")) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t7008.check b/tests/disabled/macro/run/t7008.check new file mode 100644 index 000000000..ee077f90f --- /dev/null +++ b/tests/disabled/macro/run/t7008.check @@ -0,0 +1,9 @@ +: List(throws[NullPointerException](classOf[java.lang.NullPointerException])) +bar: List(throws[Exception](classOf[java.lang.Exception])) +baz: List(throws[IllegalStateException](classOf[java.lang.IllegalStateException])) +foo: List(throws[Exception](classOf[java.lang.Exception])) +============= +: List(throws[java.lang.NullPointerException](classOf[java.lang.NullPointerException])) +bar: List(throws[java.lang.Exception](classOf[java.lang.Exception])) +baz: List(throws[java.lang.IllegalStateException](classOf[java.lang.IllegalStateException])) +foo: List(throws[java.lang.Exception](classOf[java.lang.Exception])) diff --git a/tests/disabled/macro/run/t7008/Impls_Macros_2.scala b/tests/disabled/macro/run/t7008/Impls_Macros_2.scala new file mode 100644 index 000000000..3c6fe116c --- /dev/null +++ b/tests/disabled/macro/run/t7008/Impls_Macros_2.scala @@ -0,0 +1,13 @@ +import language.experimental.macros +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl(c: Context) = { + import c.universe._ + val decls = c.typeOf[JavaClassWithCheckedExceptions_1[_]].decls.toList + val s = decls.sortBy(_.name.toString).map(decl => (s"${decl.name}: ${decl.annotations}")).mkString(scala.compat.Platform.EOL) + reify(println(c.Expr[String](Literal(Constant(s))).splice)) + } + + def foo = macro impl +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t7008/JavaClassWithCheckedExceptions_1.java b/tests/disabled/macro/run/t7008/JavaClassWithCheckedExceptions_1.java new file mode 100644 index 000000000..dda212830 --- /dev/null +++ b/tests/disabled/macro/run/t7008/JavaClassWithCheckedExceptions_1.java @@ -0,0 +1,7 @@ +class JavaClassWithCheckedExceptions_1 { + public JavaClassWithCheckedExceptions_1() throws NullPointerException {} + + public void bar() throws E1 {} + public void baz(int x) throws IllegalStateException {} + public void foo() throws E2 {} +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t7008/Test_3.scala b/tests/disabled/macro/run/t7008/Test_3.scala new file mode 100644 index 000000000..00e0eb684 --- /dev/null +++ b/tests/disabled/macro/run/t7008/Test_3.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + Macros.foo + println("=============") + + val decls = typeOf[JavaClassWithCheckedExceptions_1[_]].decls.toList + decls sortBy (_.name.toString) foreach (decl => println(s"${decl.name}: ${decl.annotations}")) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t7044.check b/tests/disabled/macro/run/t7044.check new file mode 100644 index 000000000..ab523873b --- /dev/null +++ b/tests/disabled/macro/run/t7044.check @@ -0,0 +1,14 @@ +compile-time +uninitialized File: +initialized File: +uninitialized BitSet: +initialized BitSet: +uninitialized C: Test_2.scala +initialized C: Test_2.scala +runtime +autoinitialized File: true +autoinitialized File: true +autoinitialized BitSet: true +autoinitialized BitSet: true +autoinitialized C: true +autoinitialized C: true diff --git a/tests/disabled/macro/run/t7044/Macros_1.scala b/tests/disabled/macro/run/t7044/Macros_1.scala new file mode 100644 index 000000000..3b3f8c338 --- /dev/null +++ b/tests/disabled/macro/run/t7044/Macros_1.scala @@ -0,0 +1,26 @@ +import scala.reflect.macros.whitebox._ +import scala.language.experimental.macros + +object Macros { + def impl(c: Context) = { + var messages = List[String]() + def println(msg: String) = messages :+= msg + + import c.universe._ + def test(tpe: Type): Unit = { + val sym = tpe.typeSymbol + println(s"uninitialized ${sym.name}: ${sym.pos.source.file.name}") + internal.initialize(sym) + println(s"initialized ${sym.name}: ${sym.pos.source.file.name}") + } + + println("compile-time") + test(typeOf[java.io.File]) + test(typeOf[scala.collection.BitSet]) + test(c.mirror.staticClass("C").toType) + + q"..${messages.map(msg => q"println($msg)")}" + } + + def foo: Any = macro impl +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t7044/Test_2.scala b/tests/disabled/macro/run/t7044/Test_2.scala new file mode 100644 index 000000000..e7a34d04c --- /dev/null +++ b/tests/disabled/macro/run/t7044/Test_2.scala @@ -0,0 +1,19 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} + +class C + +object Test extends dotty.runtime.LegacyApp { + def test(tpe: Type): Unit = { + val sym = tpe.typeSymbol + println(s"autoinitialized ${sym.name}: ${sym.pos.source.file.name} ${sym.pos.source.file.sizeOption.nonEmpty}") + internal.initialize(sym) + println(s"autoinitialized ${sym.name}: ${sym.pos.source.file.name} ${sym.pos.source.file.sizeOption.nonEmpty}") + } + + Macros.foo + println("runtime") + test(typeOf[java.io.File]) + test(typeOf[scala.collection.BitSet]) + test(typeOf[C]) +} diff --git a/tests/disabled/macro/run/t7047.check b/tests/disabled/macro/run/t7047.check new file mode 100644 index 000000000..32bd58109 --- /dev/null +++ b/tests/disabled/macro/run/t7047.check @@ -0,0 +1,3 @@ +Test_2.scala:2: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + Macros.foo + ^ diff --git a/tests/disabled/macro/run/t7047/Impls_Macros_1.scala b/tests/disabled/macro/run/t7047/Impls_Macros_1.scala new file mode 100644 index 000000000..787ea6cfe --- /dev/null +++ b/tests/disabled/macro/run/t7047/Impls_Macros_1.scala @@ -0,0 +1,19 @@ +import scala.reflect.macros.blackbox.Context +import language.experimental.macros + +class Foo + +object Macros { + def impl(c: Context) = { + import c.universe._ + try { + c.inferImplicitValue(typeOf[Foo], silent = false) + c.abort(c.enclosingPosition, "silent=false is not working") + } catch { + case _: Exception => + } + c.Expr[Null](Literal(Constant(null))) + } + + def foo = macro impl +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t7047/Test_2.scala b/tests/disabled/macro/run/t7047/Test_2.scala new file mode 100644 index 000000000..0fc472aa6 --- /dev/null +++ b/tests/disabled/macro/run/t7047/Test_2.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + Macros.foo +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t7157.check b/tests/disabled/macro/run/t7157.check new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/tests/disabled/macro/run/t7157.check @@ -0,0 +1 @@ +1 diff --git a/tests/disabled/macro/run/t7157/Impls_Macros_1.scala b/tests/disabled/macro/run/t7157/Impls_Macros_1.scala new file mode 100644 index 000000000..cc258b016 --- /dev/null +++ b/tests/disabled/macro/run/t7157/Impls_Macros_1.scala @@ -0,0 +1,15 @@ +import scala.reflect.macros.blackbox.Context +import language.experimental.macros + +object Macros { + object AImpl { + def a(ctx: Context)(args: ctx.Expr[Any]*): ctx.Expr[Unit] = { + import ctx.universe._ + ctx.Expr[Unit](Apply(Ident(TermName("println")), List(Literal(Constant(1))))) + } + } + + implicit class A(context: StringContext) { + def a(args: Any*): Unit = macro AImpl.a + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t7157/Test_2.scala b/tests/disabled/macro/run/t7157/Test_2.scala new file mode 100644 index 000000000..be0d54d75 --- /dev/null +++ b/tests/disabled/macro/run/t7157/Test_2.scala @@ -0,0 +1,5 @@ +import Macros._ + +object Test extends dotty.runtime.LegacyApp { + a"" +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t7185.check b/tests/disabled/macro/run/t7185.check new file mode 100644 index 000000000..e4f80a8ff --- /dev/null +++ b/tests/disabled/macro/run/t7185.check @@ -0,0 +1,32 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> import scala.tools.reflect.ToolBox +import scala.tools.reflect.ToolBox + +scala> import scala.reflect.runtime.universe._ +import scala.reflect.runtime.universe._ + +scala> object O { def apply() = 0 } +defined object O + +scala> val ORef = reify { O }.tree +ORef: reflect.runtime.universe.Tree = $read.O + +scala> val tree = Apply(Block(Nil, Block(Nil, ORef)), Nil) +tree: reflect.runtime.universe.Apply = +{ + { + $read.O + } +}() + +scala> {val tb = reflect.runtime.currentMirror.mkToolBox(); tb.typecheck(tree): Any} +res0: Any = +{ + { + $read.O.apply() + } +} + +scala> :quit diff --git a/tests/disabled/macro/run/t7185.scala b/tests/disabled/macro/run/t7185.scala new file mode 100644 index 000000000..62d64246b --- /dev/null +++ b/tests/disabled/macro/run/t7185.scala @@ -0,0 +1,12 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + override def code = """ +import scala.tools.reflect.ToolBox +import scala.reflect.runtime.universe._ +object O { def apply() = 0 } +val ORef = reify { O }.tree +val tree = Apply(Block(Nil, Block(Nil, ORef)), Nil) +{val tb = reflect.runtime.currentMirror.mkToolBox(); tb.typecheck(tree): Any} +""" +} diff --git a/tests/disabled/macro/run/t7235.check b/tests/disabled/macro/run/t7235.check new file mode 100644 index 000000000..9cb9c55a0 --- /dev/null +++ b/tests/disabled/macro/run/t7235.check @@ -0,0 +1,4 @@ +C +List(C) +private val _ = _ +List() diff --git a/tests/disabled/macro/run/t7235.scala b/tests/disabled/macro/run/t7235.scala new file mode 100644 index 000000000..2e6af545d --- /dev/null +++ b/tests/disabled/macro/run/t7235.scala @@ -0,0 +1,14 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +class C + +object Test extends dotty.runtime.LegacyApp { + val Block(List(ValDef(_, _, tpt: CompoundTypeTree, _)), _) = reify{ val x: C{} = ??? }.tree + println(tpt) + println(tpt.templ.parents) + println(tpt.templ.self) + println(tpt.templ.body) +} diff --git a/tests/disabled/macro/run/t7240/Macros_1.scala b/tests/disabled/macro/run/t7240/Macros_1.scala new file mode 100644 index 000000000..b24b607d1 --- /dev/null +++ b/tests/disabled/macro/run/t7240/Macros_1.scala @@ -0,0 +1,48 @@ +package bakery + +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.Context + +trait FailureCake { + implicit def liftAnyFails[T: Manifest]: Any = ??? + + // This works + // implicit def liftAny[T]: Any = ??? +} + +object Bakery { + + def failure: Any = macro failureImpl + def failureImpl(c: Context): c.Expr[Any] = { + import c.universe._ + + def dslTrait(dslName: String) = { + val names = dslName.split("\\.").toList.reverse + assert(names.length >= 1, "DSL trait name must be in the valid format. DSL trait name is " + dslName) + + val tpeName = newTypeName(names.head) + names.tail.reverse match { + case head :: tail ⇒ + Select(tail.foldLeft[Tree](Ident(newTermName(head)))((tree, name) ⇒ Select(tree, newTermName(name))), tpeName) + case Nil ⇒ + Ident(tpeName) + } + } + + def composeDSL(transformedBody: Tree) = + ClassDef(Modifiers(), newTypeName("eval"), List(), Template( + List(dslTrait("bakery.FailureCake")), + emptyValDef, + List( + DefDef(Modifiers(), termNames.CONSTRUCTOR, List(), List(List()), TypeTree(), + Block(List(Apply(Select(Super(This(typeNames.EMPTY), typeNames.EMPTY), termNames.CONSTRUCTOR), List())), Literal(Constant(())))), + DefDef(Modifiers(), newTermName("main"), List(), List(List()), Ident(newTypeName("Any")), transformedBody)))) + + def constructor = Apply(Select(New(Ident(newTypeName("eval"))), termNames.CONSTRUCTOR), List()) + + c.eval(c.Expr[Any]( + c.untypecheck(Block(composeDSL(Literal(Constant(1))), constructor)))) + + c.Expr[Any](Literal(Constant(1))) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t7240/Test_2.scala b/tests/disabled/macro/run/t7240/Test_2.scala new file mode 100644 index 000000000..27d2893d3 --- /dev/null +++ b/tests/disabled/macro/run/t7240/Test_2.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + val v = bakery.Bakery.failure +} diff --git a/tests/disabled/macro/run/t7375b.check b/tests/disabled/macro/run/t7375b.check new file mode 100644 index 000000000..d7578e28b --- /dev/null +++ b/tests/disabled/macro/run/t7375b.check @@ -0,0 +1,4 @@ +Predef.this.classOf[C1] +Predef.this.classOf[C2] +Predef.this.classOf[C1] +Predef.this.classOf[C2] diff --git a/tests/disabled/macro/run/t7375b/Macros_1.scala b/tests/disabled/macro/run/t7375b/Macros_1.scala new file mode 100644 index 000000000..b6090e730 --- /dev/null +++ b/tests/disabled/macro/run/t7375b/Macros_1.scala @@ -0,0 +1,18 @@ +import language.experimental.macros +import scala.reflect.macros.blackbox.Context + +class C1(val n: Int) extends AnyVal +class C2(val n: Int) extends AnyRef + +object Macros { + type F1 = C1 + type F2 = C2 + + def foo = macro impl + def impl(c: Context) = { + import c.universe._ + def test[T: c.TypeTag] = reify(println(c.Expr[String](Literal(Constant(c.reifyRuntimeClass(c.typeOf[T]).toString))).splice)).tree + def tests = Block(List(test[C1], test[C2], test[F1], test[F2]), Literal(Constant(()))) + c.Expr[Unit](tests) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t7375b/Test_2.scala b/tests/disabled/macro/run/t7375b/Test_2.scala new file mode 100644 index 000000000..0fc472aa6 --- /dev/null +++ b/tests/disabled/macro/run/t7375b/Test_2.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + Macros.foo +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t7558.scala b/tests/disabled/macro/run/t7558.scala new file mode 100644 index 000000000..26163555f --- /dev/null +++ b/tests/disabled/macro/run/t7558.scala @@ -0,0 +1,9 @@ +object Test extends dotty.runtime.LegacyApp { + val cm = reflect.runtime.currentMirror + val u = cm.universe + import scala.tools.reflect.ToolBox + val tb = cm.mkToolBox() + val t = { var x = "ab".toList; u.reify { x = x.reverse; x }.tree } + val evaluated = tb.eval(t) + assert(evaluated == "ba".toList, evaluated) +} diff --git a/tests/disabled/macro/run/t7617a.check b/tests/disabled/macro/run/t7617a.check new file mode 100644 index 000000000..94954abda --- /dev/null +++ b/tests/disabled/macro/run/t7617a.check @@ -0,0 +1,2 @@ +hello +world diff --git a/tests/disabled/macro/run/t7617a/Macros_1.scala b/tests/disabled/macro/run/t7617a/Macros_1.scala new file mode 100644 index 000000000..77b18c20e --- /dev/null +++ b/tests/disabled/macro/run/t7617a/Macros_1.scala @@ -0,0 +1,22 @@ +import scala.reflect.macros.blackbox.Context +import language.experimental.macros + +object Macros { + def getValueImpl[T](c: Context): c.Expr[T] = { + import c.universe._ + c.Expr[T](Apply(Select(c.prefix.tree, newTermName("getVal")), Nil)) + } + def setValueImpl[T](c: Context)(value: c.Expr[T]): c.Expr[Unit] = { + import c.universe._ + c.Expr[Unit](Apply(Select(c.prefix.tree, newTermName("setVal")), List(value.tree))) + } +} + +object Module { + private var _val: String = "hello" + def setVal(value: String): Unit = this._val = value + def getVal(): String = this._val + + def value: String = macro Macros.getValueImpl[String] + def value_=(value: String): Unit = macro Macros.setValueImpl[String] +} diff --git a/tests/disabled/macro/run/t7617a/Test_2.scala b/tests/disabled/macro/run/t7617a/Test_2.scala new file mode 100644 index 000000000..aaf268a8c --- /dev/null +++ b/tests/disabled/macro/run/t7617a/Test_2.scala @@ -0,0 +1,5 @@ +object Test extends dotty.runtime.LegacyApp { + println(Module.value) + Module.value = "world" + println(Module.value) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t7617b.check b/tests/disabled/macro/run/t7617b.check new file mode 100644 index 000000000..81ec7e8b7 --- /dev/null +++ b/tests/disabled/macro/run/t7617b.check @@ -0,0 +1 @@ +foo = 2 diff --git a/tests/disabled/macro/run/t7617b/Macros_1.scala b/tests/disabled/macro/run/t7617b/Macros_1.scala new file mode 100644 index 000000000..90fcfda47 --- /dev/null +++ b/tests/disabled/macro/run/t7617b/Macros_1.scala @@ -0,0 +1,8 @@ +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl(c: Context)(name: c.Expr[String])(value: c.Expr[Any]) = { + import c.universe._ + reify(println(s"${name.splice} = ${value.splice}")) + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t7617b/Test_2.scala b/tests/disabled/macro/run/t7617b/Test_2.scala new file mode 100644 index 000000000..0ce77a1c7 --- /dev/null +++ b/tests/disabled/macro/run/t7617b/Test_2.scala @@ -0,0 +1,11 @@ +import scala.language.dynamics +import language.experimental.macros + +class C extends Dynamic { + def updateDynamic(name: String)(value: Any): Unit = macro Macros.impl +} + +object Test extends dotty.runtime.LegacyApp { + val c = new C + c.foo = 2 +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t7657.check b/tests/disabled/macro/run/t7657.check new file mode 100644 index 000000000..c25d8d1c1 --- /dev/null +++ b/tests/disabled/macro/run/t7657.check @@ -0,0 +1,3 @@ +() +() +() diff --git a/tests/disabled/macro/run/t7657/Macros_1.scala b/tests/disabled/macro/run/t7657/Macros_1.scala new file mode 100644 index 000000000..a883f76bc --- /dev/null +++ b/tests/disabled/macro/run/t7657/Macros_1.scala @@ -0,0 +1,8 @@ +import scala.reflect.macros.blackbox.Context +import language.experimental.macros + +trait T { def t(): Unit } +abstract class A extends T { override def t(): Unit = () } + +object Macro { def t(c: Context)(): c.Expr[Unit] = c.universe.reify(()) } +class C extends A { override def t(): Unit = macro Macro.t } diff --git a/tests/disabled/macro/run/t7657/Test_2.scala b/tests/disabled/macro/run/t7657/Test_2.scala new file mode 100644 index 000000000..68dfb5c8b --- /dev/null +++ b/tests/disabled/macro/run/t7657/Test_2.scala @@ -0,0 +1,6 @@ +object Test extends dotty.runtime.LegacyApp { + val c = new C() + println(c.t()) + println((c: T).t()) + println((c: A).t()) +} diff --git a/tests/disabled/macro/run/t7777.check b/tests/disabled/macro/run/t7777.check new file mode 100644 index 000000000..162ff2d2a --- /dev/null +++ b/tests/disabled/macro/run/t7777.check @@ -0,0 +1,7 @@ +foo(1, 2) +bar(4, 5) +foo(3) +bar(7) +apply(6) +apply(9) +foo(8) diff --git a/tests/disabled/macro/run/t7777/Macros_1.scala b/tests/disabled/macro/run/t7777/Macros_1.scala new file mode 100644 index 000000000..1dc6d6740 --- /dev/null +++ b/tests/disabled/macro/run/t7777/Macros_1.scala @@ -0,0 +1,17 @@ +import scala.language.experimental.macros +import scala.language.dynamics +import scala.reflect.macros.whitebox.Context + +class DynMacro extends Dynamic { + def applyDynamic(s: String)(xs: Any*): DynMacro = + macro DynMacro.applyDynamicMacro +} + +object DynMacro extends DynMacro { + def applyDynamicMacro(c: Context)(s: c.Expr[String])(xs: c.Expr[Any]*): c.Expr[DynMacro] = { + import c.universe._ + val Literal(Constant(n: String)) = s.tree + val args = xs.map(_.tree.toString).mkString("(", ", ", ")") + c.Expr(q"println(${ n + args }); ${c.prefix.tree}") + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t7777/Test_2.scala b/tests/disabled/macro/run/t7777/Test_2.scala new file mode 100644 index 000000000..7f84f64e4 --- /dev/null +++ b/tests/disabled/macro/run/t7777/Test_2.scala @@ -0,0 +1,6 @@ +object Test extends dotty.runtime.LegacyApp { + DynMacro.foo(1, 2) // prints "foo(1, 2)" + DynMacro.foo(3).bar(4, 5) // prints "bar(4, 5)", then "foo(3)" + DynMacro(6).bar(7) // prints "bar(7)", then "apply(6)" + DynMacro.foo(8)(9) // Fails! +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t7868b.check b/tests/disabled/macro/run/t7868b.check new file mode 100644 index 000000000..6577c4bc4 --- /dev/null +++ b/tests/disabled/macro/run/t7868b.check @@ -0,0 +1,6 @@ +Expr[Int]({ + val x = (0: Short): @unchecked match { + case A((x @ _)) => x + }; + x +}) diff --git a/tests/disabled/macro/run/t7868b.scala b/tests/disabled/macro/run/t7868b.scala new file mode 100644 index 000000000..33d33f10a --- /dev/null +++ b/tests/disabled/macro/run/t7868b.scala @@ -0,0 +1,11 @@ +object A { + def unapply(n: Int): Option[Int] = Some(1) +} + +object Test extends dotty.runtime.LegacyApp { + import reflect.runtime.universe._ + println(reify { + val A(x) = (0: Short) + x + }) +} diff --git a/tests/disabled/macro/run/t7871.check b/tests/disabled/macro/run/t7871.check new file mode 100644 index 000000000..ce6efd812 --- /dev/null +++ b/tests/disabled/macro/run/t7871.check @@ -0,0 +1 @@ +(SomeTree,SomeTree) diff --git a/tests/disabled/macro/run/t7871/Macros_1.scala b/tests/disabled/macro/run/t7871/Macros_1.scala new file mode 100644 index 000000000..dca250812 --- /dev/null +++ b/tests/disabled/macro/run/t7871/Macros_1.scala @@ -0,0 +1,27 @@ +import scala.reflect.macros.whitebox.Context +import language.experimental.macros + +trait Tree +case object SomeTree extends Tree + +object NewQuasiquotes { + implicit class QuasiquoteInterpolation(c: StringContext) { + object nq { + def unapply(t: Tree): Any = macro QuasiquoteMacros.unapplyImpl + } + } +} + +object QuasiquoteMacros { + def unapplyImpl(c: Context)(t: c.Tree) = { + import c.universe._ + q""" + new { + def unapply(t: Tree) = t match { + case SomeTree => Some((SomeTree, SomeTree)) + case _ => None + } + }.unapply($t) + """ + } +} diff --git a/tests/disabled/macro/run/t7871/Test_2.scala b/tests/disabled/macro/run/t7871/Test_2.scala new file mode 100644 index 000000000..55a8320b3 --- /dev/null +++ b/tests/disabled/macro/run/t7871/Test_2.scala @@ -0,0 +1,6 @@ +object Test extends dotty.runtime.LegacyApp { + import NewQuasiquotes._ + SomeTree match { + case nq"$x + $y" => println((x, y)) + } +} diff --git a/tests/disabled/macro/run/t8048a.check b/tests/disabled/macro/run/t8048a.check new file mode 100644 index 000000000..8fb9e26e8 --- /dev/null +++ b/tests/disabled/macro/run/t8048a.check @@ -0,0 +1 @@ +Some(2) diff --git a/tests/disabled/macro/run/t8048a/Macros_1.scala b/tests/disabled/macro/run/t8048a/Macros_1.scala new file mode 100644 index 000000000..d13e851d9 --- /dev/null +++ b/tests/disabled/macro/run/t8048a/Macros_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.whitebox.Context +import scala.language.experimental.macros + +object Macros { + def impl(c: Context) = { + import c.universe._ + q"if (true) Some(2) else None" + } + + def foo: Any = macro impl +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t8048a/Test_2.scala b/tests/disabled/macro/run/t8048a/Test_2.scala new file mode 100644 index 000000000..623a22a3a --- /dev/null +++ b/tests/disabled/macro/run/t8048a/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + val x: Option[Int] = Macros.foo + println(x) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t8048b.check b/tests/disabled/macro/run/t8048b.check new file mode 100644 index 000000000..083edaac2 --- /dev/null +++ b/tests/disabled/macro/run/t8048b.check @@ -0,0 +1,3 @@ +2 +2 +2 diff --git a/tests/disabled/macro/run/t8048b/Macros_1.scala b/tests/disabled/macro/run/t8048b/Macros_1.scala new file mode 100644 index 000000000..520a6fac0 --- /dev/null +++ b/tests/disabled/macro/run/t8048b/Macros_1.scala @@ -0,0 +1,37 @@ +// see the following discussions to understand what's being tested here: +// * https://issues.scala-lang.org/browse/SI-6992 +// * https://issues.scala-lang.org/browse/SI-8048 +// * http://stackoverflow.com/questions/14370842/getting-a-structural-type-with-an-anonymous-classs-methods-from-a-macro +// * http://stackoverflow.com/questions/18480707/method-cannot-be-accessed-in-macro-generated-class/18485004#18485004 +// * https://groups.google.com/forum/#!topic/scala-internals/eXQt-BPm4i8 + +import scala.language.experimental.macros +import scala.reflect.macros.whitebox.Context + +object Macros { + def impl1(c: Context) = { + import c.universe._ + q""" + trait Foo { def x = 2 } + new Foo {} + """ + } + def foo1: Any = macro impl1 + + def impl2(c: Context) = { + import c.universe._ + q""" + class Foo { def x = 2 } + new Foo + """ + } + def foo2: Any = macro impl2 + + def impl3(c: Context) = { + import c.universe._ + q""" + new { def x = 2 } + """ + } + def foo3: Any = macro impl3 +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t8048b/Test_2.scala b/tests/disabled/macro/run/t8048b/Test_2.scala new file mode 100644 index 000000000..8474a34ec --- /dev/null +++ b/tests/disabled/macro/run/t8048b/Test_2.scala @@ -0,0 +1,5 @@ +object Test extends dotty.runtime.LegacyApp { + println(Macros.foo1.x) + println(Macros.foo2.x) + println(Macros.foo3.x) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t8104.check b/tests/disabled/macro/run/t8104.check new file mode 100644 index 000000000..40523a286 --- /dev/null +++ b/tests/disabled/macro/run/t8104.check @@ -0,0 +1,2 @@ +WeakTypeTag[.this.Repr] +(Int, Int) diff --git a/tests/disabled/macro/run/t8104/Macros_1.scala b/tests/disabled/macro/run/t8104/Macros_1.scala new file mode 100644 index 000000000..e135bd807 --- /dev/null +++ b/tests/disabled/macro/run/t8104/Macros_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.whitebox.Context + +object Macros { + def impl[T](c: Context)(implicit T: c.WeakTypeTag[T]) = { + import c.universe._ + import definitions._ + val fields = T.tpe.decls.toList.collect{ case x: TermSymbol if x.isVal && x.isCaseAccessor => x } + val Repr = appliedType(TupleClass(fields.length).asType.toType, fields.map(_.info)) + q"new Generic[$T]{ type Repr = $Repr }" + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t8104/Test_2.scala b/tests/disabled/macro/run/t8104/Test_2.scala new file mode 100644 index 000000000..4e97cdf9d --- /dev/null +++ b/tests/disabled/macro/run/t8104/Test_2.scala @@ -0,0 +1,19 @@ +trait Generic[T] { type Repr } +object Generic { + type Aux[T, Repr0] = Generic[T] { type Repr = Repr0 } + import scala.language.experimental.macros + implicit def materializeGeneric[T, Repr]: Generic.Aux[T, Repr] = macro Macros.impl[T] +} + +object Test extends dotty.runtime.LegacyApp { + case class C(x: Int, y: Int) + + import scala.reflect.runtime.universe._ + def reprify[T, Repr](x: T)(implicit generic: Generic.Aux[T, Repr], tag: WeakTypeTag[Repr]) = { + println(tag) + println(tag.tpe.typeSymbol.info) + } + reprify(C(40, 2)) + + implicitly[Generic.Aux[C, (Int, Int)]] +} diff --git a/tests/disabled/macro/run/t8192.check b/tests/disabled/macro/run/t8192.check new file mode 100644 index 000000000..2423a7acb --- /dev/null +++ b/tests/disabled/macro/run/t8192.check @@ -0,0 +1,32 @@ +compile-time +package scala +primary constructor: NoSymbol +object List +primary constructor: def (): scala.collection.immutable.List.type => true +def (): scala.collection.immutable.List.type => true +trait Product1 +primary constructor: def $init$(): Unit => true +class UninitializedFieldError +primary constructor: def (msg: String): UninitializedFieldError => true +def (msg: String): UninitializedFieldError => true +def (obj: Any): UninitializedFieldError => false +class C +primary constructor: def (x: Int): C => true +def (x: Int): C => true +def (x: String): C => false +runtime +package scala +primary constructor: NoSymbol +object List +primary constructor: def (): scala.collection.immutable.List.type => true +def (): scala.collection.immutable.List.type => true +trait Product1 +primary constructor: def $init$(): Unit => true +class UninitializedFieldError +primary constructor: def (msg: String): UninitializedFieldError => true +def (msg: String): UninitializedFieldError => true +def (obj: Any): UninitializedFieldError => false +class C +primary constructor: def (x: Int): C => true +def (x: Int): C => true +def (x: String): C => false diff --git a/tests/disabled/macro/run/t8192/Macros_1.scala b/tests/disabled/macro/run/t8192/Macros_1.scala new file mode 100644 index 000000000..72fb2cf31 --- /dev/null +++ b/tests/disabled/macro/run/t8192/Macros_1.scala @@ -0,0 +1,45 @@ +import scala.reflect.macros.whitebox._ +import scala.language.experimental.macros +import java.io._ + +object Macros { + def impl(c: Context) = { + var messages = List[String]() + def println(msg: String) = messages :+= msg + + import c.universe._ + def test(sym: ClassSymbol): Unit = { + def fullyInitializeSymbol(sym: Symbol): Unit = { + val internal = c.universe.asInstanceOf[scala.reflect.internal.SymbolTable] + internal.definitions.fullyInitializeSymbol(sym.asInstanceOf[internal.Symbol]) + } + def defString(sym: Symbol): String = { + val internal = c.universe.asInstanceOf[scala.reflect.internal.SymbolTable] + sym.asInstanceOf[internal.Symbol].defString + } + def showCtor(sym: Symbol): String = { + fullyInitializeSymbol(sym) + if (sym == NoSymbol) "NoSymbol" + else s"${defString(sym)} => ${sym.asMethod.isPrimaryConstructor}" + } + sym.info + println(sym.toString) + println(s"primary constructor: ${showCtor(sym.primaryConstructor)}") + val ctors = sym.info.members.filter(_.name == termNames.CONSTRUCTOR).map(sym => showCtor(sym)) + ctors.toList.sorted.foreach(println) + } + + println("compile-time") + // SI-8367 primaryConstructor for Java-defined classes is unstable, so I'm commenting this out + // test(typeOf[File].typeSymbol.asClass) + test(definitions.ScalaPackageClass) + test(definitions.ListModule.moduleClass.asClass) + test(typeOf[Product1[_]].typeSymbol.asClass) + test(typeOf[UninitializedFieldError].typeSymbol.asClass) + test(c.mirror.staticClass("C").asClass) + + q"..${messages.map(msg => q"println($msg)")}" + } + + def foo: Any = macro impl +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t8192/Test_2.scala b/tests/disabled/macro/run/t8192/Test_2.scala new file mode 100644 index 000000000..dec90ab66 --- /dev/null +++ b/tests/disabled/macro/run/t8192/Test_2.scala @@ -0,0 +1,40 @@ +import java.io._ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} + +class C(x: Int) { + def this(x: String) = this(x.toInt) +} + +object Test extends dotty.runtime.LegacyApp { + def test(sym: ClassSymbol): Unit = { + def fullyInitializeSymbol(sym: Symbol): Unit = { + val internal = ru.asInstanceOf[scala.reflect.internal.SymbolTable] + internal.definitions.fullyInitializeSymbol(sym.asInstanceOf[internal.Symbol]) + } + def defString(sym: Symbol): String = { + val internal = ru.asInstanceOf[scala.reflect.internal.SymbolTable] + sym.asInstanceOf[internal.Symbol].defString + } + def showCtor(sym: Symbol): String = { + fullyInitializeSymbol(sym) + if (sym == NoSymbol) "NoSymbol" + else s"${defString(sym)} => ${sym.asMethod.isPrimaryConstructor}" + } + sym.info + println(sym.toString) + println(s"primary constructor: ${showCtor(sym.primaryConstructor)}") + val ctors = sym.info.members.filter(_.name == termNames.CONSTRUCTOR).map(sym => showCtor(sym)) + ctors.toList.sorted.foreach(println) + } + + Macros.foo + println("runtime") + // SI-8367 primaryConstructor for Java-defined classes is unstable, so I'm commenting this out + // test(typeOf[File].typeSymbol.asClass) + test(definitions.ScalaPackageClass) + test(definitions.ListModule.moduleClass.asClass) + test(typeOf[Product1[_]].typeSymbol.asClass) + test(typeOf[UninitializedFieldError].typeSymbol.asClass) + test(typeOf[C].typeSymbol.asClass) +} diff --git a/tests/disabled/macro/run/t8321.check b/tests/disabled/macro/run/t8321.check new file mode 100644 index 000000000..0cfbf0888 --- /dev/null +++ b/tests/disabled/macro/run/t8321.check @@ -0,0 +1 @@ +2 diff --git a/tests/disabled/macro/run/t8321/Macros_1.scala b/tests/disabled/macro/run/t8321/Macros_1.scala new file mode 100644 index 000000000..70e44fc76 --- /dev/null +++ b/tests/disabled/macro/run/t8321/Macros_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.whitebox._ +import scala.language.experimental.macros + +class Bundle(val c: Context) { + import c.universe._ + def impl = q"new { val x = 2 }" +} + +object Macros { + def foo: Any = macro Bundle.impl +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t8321/Test_2.scala b/tests/disabled/macro/run/t8321/Test_2.scala new file mode 100644 index 000000000..d49442117 --- /dev/null +++ b/tests/disabled/macro/run/t8321/Test_2.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + println(Macros.foo.x) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t8425.check b/tests/disabled/macro/run/t8425.check new file mode 100644 index 000000000..8379fa0a7 --- /dev/null +++ b/tests/disabled/macro/run/t8425.check @@ -0,0 +1 @@ +List(fresh$macro$1, $macro$2) diff --git a/tests/disabled/macro/run/t8425/Macros_1.scala b/tests/disabled/macro/run/t8425/Macros_1.scala new file mode 100644 index 000000000..71a96518e --- /dev/null +++ b/tests/disabled/macro/run/t8425/Macros_1.scala @@ -0,0 +1,12 @@ +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.Context + +object Macros { + def foo: Unit = macro impl + def impl(c: Context) = { + import c.universe._ + val test1 = c.freshName() + val test2 = c.freshName("$") + q"println(List($test1, $test2))" + } +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t8425/Test_2.scala b/tests/disabled/macro/run/t8425/Test_2.scala new file mode 100644 index 000000000..0fc472aa6 --- /dev/null +++ b/tests/disabled/macro/run/t8425/Test_2.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + Macros.foo +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t8437.check b/tests/disabled/macro/run/t8437.check new file mode 100644 index 000000000..fd3c81a4d --- /dev/null +++ b/tests/disabled/macro/run/t8437.check @@ -0,0 +1,2 @@ +5 +5 diff --git a/tests/disabled/macro/run/t8437/Macros_1.scala b/tests/disabled/macro/run/t8437/Macros_1.scala new file mode 100644 index 000000000..6286ea2a8 --- /dev/null +++ b/tests/disabled/macro/run/t8437/Macros_1.scala @@ -0,0 +1,18 @@ +import scala.language.experimental.macros +import scala.reflect.macros._ + +abstract class AbstractBundle(val c: blackbox.Context) { + import c.Expr + import c.universe._ + def foo: Expr[Int] = Expr[Int](q"5") +} + +class ConcreteBundle(override val c: blackbox.Context) extends AbstractBundle(c) { + import c.Expr + val bar: Expr[Int] = foo +} + +object InvokeBundle { + def foo: Int = macro ConcreteBundle.foo // nope + def bar: Int = macro ConcreteBundle.bar // yep +} \ No newline at end of file diff --git a/tests/disabled/macro/run/t8437/Test_2.scala b/tests/disabled/macro/run/t8437/Test_2.scala new file mode 100644 index 000000000..fef54005f --- /dev/null +++ b/tests/disabled/macro/run/t8437/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + println(InvokeBundle.foo) + println(InvokeBundle.bar) +} \ No newline at end of file diff --git a/tests/disabled/macro/run/toolbox_console_reporter.check b/tests/disabled/macro/run/toolbox_console_reporter.check new file mode 100644 index 000000000..1395c6874 --- /dev/null +++ b/tests/disabled/macro/run/toolbox_console_reporter.check @@ -0,0 +1,8 @@ +hello +============compiler console============= +warning: method foo in object Utils is deprecated: test + +========================================= +============compiler messages============ +Info(NoPosition,method foo in object Utils is deprecated: test,WARNING) +========================================= diff --git a/tests/disabled/macro/run/toolbox_console_reporter.scala b/tests/disabled/macro/run/toolbox_console_reporter.scala new file mode 100644 index 000000000..53cbcb0fb --- /dev/null +++ b/tests/disabled/macro/run/toolbox_console_reporter.scala @@ -0,0 +1,28 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.{ToolBox, mkConsoleFrontEnd} + +object Test extends dotty.runtime.LegacyApp { + //val oldErr = Console.err; + val baos = new java.io.ByteArrayOutputStream() + val errs = new java.io.PrintStream(baos) + (Console withErr errs) { + val toolbox = cm.mkToolBox(frontEnd = mkConsoleFrontEnd(), options = "-deprecation") + toolbox.eval(reify{ + object Utils { + @deprecated("test", "2.10.0") + def foo: Unit = { println("hello") } + } + + Utils.foo + }.tree) + println("============compiler console=============") + errs.flush() + println(baos.toString); + println("=========================================") + println("============compiler messages============") + toolbox.frontEnd.infos.foreach(println(_)) + println("=========================================") + } +} diff --git a/tests/disabled/macro/run/toolbox_current_run_compiles.check b/tests/disabled/macro/run/toolbox_current_run_compiles.check new file mode 100644 index 000000000..da29283aa --- /dev/null +++ b/tests/disabled/macro/run/toolbox_current_run_compiles.check @@ -0,0 +1,2 @@ +true +false diff --git a/tests/disabled/macro/run/toolbox_current_run_compiles.scala b/tests/disabled/macro/run/toolbox_current_run_compiles.scala new file mode 100644 index 000000000..702741c2e --- /dev/null +++ b/tests/disabled/macro/run/toolbox_current_run_compiles.scala @@ -0,0 +1,28 @@ +package pkg { + import scala.reflect.macros.blackbox.Context + import scala.language.experimental.macros + + object Macros { + def impl[T: c.WeakTypeTag](c: Context) = { + import c.universe._ + val sym = c.weakTypeOf[T].typeSymbol + val g = c.universe.asInstanceOf[scala.tools.nsc.Global] + c.Expr[Boolean](Literal(Constant(g.currentRun.compiles(sym.asInstanceOf[g.Symbol])))) + } + def compiles[T]: Boolean = macro impl[T] + } +} + +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val cm = ru.runtimeMirror(getClass.getClassLoader) + val toolbox = cm.mkToolBox() + toolbox.eval(toolbox.parse("""{ + class C + println(pkg.Macros.compiles[C]) + println(pkg.Macros.compiles[Object]) + }""")) +} diff --git a/tests/disabled/macro/run/toolbox_default_reporter_is_silent.check b/tests/disabled/macro/run/toolbox_default_reporter_is_silent.check new file mode 100644 index 000000000..ce0136250 --- /dev/null +++ b/tests/disabled/macro/run/toolbox_default_reporter_is_silent.check @@ -0,0 +1 @@ +hello diff --git a/tests/disabled/macro/run/toolbox_default_reporter_is_silent.scala b/tests/disabled/macro/run/toolbox_default_reporter_is_silent.scala new file mode 100644 index 000000000..694720721 --- /dev/null +++ b/tests/disabled/macro/run/toolbox_default_reporter_is_silent.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val toolbox = cm.mkToolBox() + toolbox.eval(reify{ + object Utils { + @deprecated("test", "2.10.0") + def foo: Unit = { println("hello") } + } + + Utils.foo + }.tree) +} diff --git a/tests/disabled/macro/run/toolbox_silent_reporter.check b/tests/disabled/macro/run/toolbox_silent_reporter.check new file mode 100644 index 000000000..2d05b1e3f --- /dev/null +++ b/tests/disabled/macro/run/toolbox_silent_reporter.check @@ -0,0 +1,4 @@ +hello +============compiler messages============ +Info(NoPosition,method foo in object Utils is deprecated: test,WARNING) +========================================= diff --git a/tests/disabled/macro/run/toolbox_silent_reporter.scala b/tests/disabled/macro/run/toolbox_silent_reporter.scala new file mode 100644 index 000000000..72109b822 --- /dev/null +++ b/tests/disabled/macro/run/toolbox_silent_reporter.scala @@ -0,0 +1,19 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.{ToolBox, mkSilentFrontEnd} + +object Test extends dotty.runtime.LegacyApp { + val toolbox = cm.mkToolBox(options = "-deprecation", frontEnd = mkSilentFrontEnd()) + toolbox.eval(reify{ + object Utils { + @deprecated("test", "2.10.0") + def foo: Unit = { println("hello") } + } + + Utils.foo + }.tree) + println("============compiler messages============") + toolbox.frontEnd.infos.foreach(println(_)) + println("=========================================") +} diff --git a/tests/disabled/macro/run/toolbox_typecheck_macrosdisabled.check b/tests/disabled/macro/run/toolbox_typecheck_macrosdisabled.check new file mode 100644 index 000000000..62de37582 --- /dev/null +++ b/tests/disabled/macro/run/toolbox_typecheck_macrosdisabled.check @@ -0,0 +1,41 @@ +({ + val $u: ru.type = ru; + val $m: $u.Mirror = ru.runtimeMirror({ + final class $anon extends scala.AnyRef { + def (): <$anon: AnyRef> = { + $anon.super.(); + () + }; + () + }; + new $anon() +}.getClass().getClassLoader()); + $u.Expr.apply[Int(2)]($m, { + final class $treecreator1 extends TreeCreator { + def (): $treecreator1 = { + $treecreator1.super.(); + () + }; + def apply[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Tree = { + val $u: U = $m$untyped.universe; + val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror]; + $u.Literal.apply($u.Constant.apply(2)) + } + }; + new $treecreator1() + })($u.TypeTag.apply[Int(2)]($m, { + final class $typecreator2 extends TypeCreator { + def (): $typecreator2 = { + $typecreator2.super.(); + () + }; + def apply[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Type = { + val $u: U = $m$untyped.universe; + val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror]; + $u.internal.reificationSupport.ConstantType($u.Constant.apply(2)) + } + }; + new $typecreator2() + })) +}: ru.Expr[Int]) +ru.reify[Int](2) diff --git a/tests/disabled/macro/run/toolbox_typecheck_macrosdisabled.scala b/tests/disabled/macro/run/toolbox_typecheck_macrosdisabled.scala new file mode 100644 index 000000000..2aa0202e7 --- /dev/null +++ b/tests/disabled/macro/run/toolbox_typecheck_macrosdisabled.scala @@ -0,0 +1,26 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox +import internal._ + +// Note: If you're looking at this test and you don't know why, you may +// have accidentally changed the way type tags reify. If so, validate +// that your changes are accurate and update the check file. + +object Test extends dotty.runtime.LegacyApp { + val toolbox = cm.mkToolBox() + val rupkg = cm.staticModule("scala.reflect.runtime.package") + val rusym = reificationSupport.selectTerm(rupkg, "universe") + val NullaryMethodType(rutpe) = rusym.info + val ru = reificationSupport.newFreeTerm("ru", scala.reflect.runtime.universe) + reificationSupport.setInfo(ru, rutpe) + + val tree1 = Apply(Select(Ident(ru), TermName("reify")), List(Literal(Constant(2)))) + val ttree1 = toolbox.typecheck(tree1, withMacrosDisabled = false) + println(ttree1) + + val tree2 = Apply(Select(Ident(ru), TermName("reify")), List(Literal(Constant(2)))) + val ttree2 = toolbox.typecheck(tree2, withMacrosDisabled = true) + println(ttree2) +} diff --git a/tests/disabled/macro/run/toolbox_typecheck_macrosdisabled2.check b/tests/disabled/macro/run/toolbox_typecheck_macrosdisabled2.check new file mode 100644 index 000000000..86f89504d --- /dev/null +++ b/tests/disabled/macro/run/toolbox_typecheck_macrosdisabled2.check @@ -0,0 +1,41 @@ +({ + val $u: ru.type = ru; + val $m: $u.Mirror = ru.runtimeMirror({ + final class $anon extends scala.AnyRef { + def (): <$anon: AnyRef> = { + $anon.super.(); + () + }; + () + }; + new $anon() +}.getClass().getClassLoader()); + $u.Expr.apply[Array[Int]]($m, { + final class $treecreator1 extends TreeCreator { + def (): $treecreator1 = { + $treecreator1.super.(); + () + }; + def apply[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Tree = { + val $u: U = $m$untyped.universe; + val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror]; + $u.Apply.apply($u.Select.apply($u.internal.reificationSupport.mkIdent($m.staticModule("scala.Array")), $u.TermName.apply("apply")), scala.collection.immutable.List.apply[$u.Literal]($u.Literal.apply($u.Constant.apply(2)))) + } + }; + new $treecreator1() + })($u.TypeTag.apply[Array[Int]]($m, { + final class $typecreator2 extends TypeCreator { + def (): $typecreator2 = { + $typecreator2.super.(); + () + }; + def apply[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Type = { + val $u: U = $m$untyped.universe; + val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror]; + $u.internal.reificationSupport.TypeRef($u.internal.reificationSupport.ThisType($m.staticPackage("scala").asModule.moduleClass), $m.staticClass("scala.Array"), scala.collection.immutable.List.apply[$u.Type]($m.staticClass("scala.Int").asType.toTypeConstructor)) + } + }; + new $typecreator2() + })) +}: ru.Expr[Array[Int]]) +ru.reify[Array[Int]](scala.Array.apply(2)) diff --git a/tests/disabled/macro/run/toolbox_typecheck_macrosdisabled2.scala b/tests/disabled/macro/run/toolbox_typecheck_macrosdisabled2.scala new file mode 100644 index 000000000..c554110ed --- /dev/null +++ b/tests/disabled/macro/run/toolbox_typecheck_macrosdisabled2.scala @@ -0,0 +1,26 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox +import internal._ + +// Note: If you're looking at this test and you don't know why, you may +// have accidentally changed the way type tags reify. If so, validate +// that your changes are accurate and update the check file. + +object Test extends dotty.runtime.LegacyApp { + val toolbox = cm.mkToolBox() + val rupkg = cm.staticModule("scala.reflect.runtime.package") + val rusym = reificationSupport.selectTerm(rupkg, "universe") + val NullaryMethodType(rutpe) = rusym.info + val ru = reificationSupport.newFreeTerm("ru", scala.reflect.runtime.universe) + reificationSupport.setInfo(ru, rutpe) + + val tree1 = Apply(Select(Ident(ru), TermName("reify")), List(Apply(Select(Ident(TermName("scala")), TermName("Array")), List(Literal(Constant(2)))))) + val ttree1 = toolbox.typecheck(tree1, withMacrosDisabled = false) + println(ttree1) + + val tree2 = Apply(Select(Ident(ru), TermName("reify")), List(Apply(Select(Ident(TermName("scala")), TermName("Array")), List(Literal(Constant(2)))))) + val ttree2 = toolbox.typecheck(tree2, withMacrosDisabled = true) + println(ttree2) +} diff --git a/tests/disabled/macro/run/typecheck.check b/tests/disabled/macro/run/typecheck.check new file mode 100644 index 000000000..e69de29bb diff --git a/tests/disabled/macro/run/typecheck/Macros_1.scala b/tests/disabled/macro/run/typecheck/Macros_1.scala new file mode 100644 index 000000000..ee1c8da76 --- /dev/null +++ b/tests/disabled/macro/run/typecheck/Macros_1.scala @@ -0,0 +1,12 @@ +import scala.reflect.macros.whitebox._ +import scala.language.experimental.macros + +object Macros { + def impl(c: Context) = { + import c.universe._ + c.typecheck(q"class C") + q"()" + } + + def foo: Any = macro impl +} \ No newline at end of file diff --git a/tests/disabled/macro/run/typecheck/Test_2.scala b/tests/disabled/macro/run/typecheck/Test_2.scala new file mode 100644 index 000000000..b79cc3b31 --- /dev/null +++ b/tests/disabled/macro/run/typecheck/Test_2.scala @@ -0,0 +1,10 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + Macros.foo + + val tb = cm.mkToolBox() + tb.typecheck(q"class C") +} \ No newline at end of file diff --git a/tests/disabled/macro/run/typed-annotated.check b/tests/disabled/macro/run/typed-annotated.check new file mode 100644 index 000000000..d81cc0710 --- /dev/null +++ b/tests/disabled/macro/run/typed-annotated.check @@ -0,0 +1 @@ +42 diff --git a/tests/disabled/macro/run/typed-annotated/Macros_1.scala b/tests/disabled/macro/run/typed-annotated/Macros_1.scala new file mode 100644 index 000000000..4f0660dc4 --- /dev/null +++ b/tests/disabled/macro/run/typed-annotated/Macros_1.scala @@ -0,0 +1,17 @@ +import scala.reflect.macros.blackbox.Context +import language.experimental.macros + +class ann extends scala.annotation.StaticAnnotation + +object Macros { + def impl(c: Context) = { + import c.universe._ + // val tpt = Annotated(Apply(Select(New(Ident(newTypeName("ann"))), termNames.CONSTRUCTOR), List()), Ident(newTypeName("Int"))) + val tpt = Annotated(Apply(Select(New(Ident(newTypeName("ann"))), termNames.CONSTRUCTOR), List()), TypeTree(weakTypeOf[Int])) + c.Expr[Unit](Block( + List(ValDef(Modifiers(), newTermName("x"), tpt, Literal(Constant(42)))), + Apply(Ident(newTermName("println")), List(Ident(newTermName("x")))))) + } + + def foo = macro impl +} \ No newline at end of file diff --git a/tests/disabled/macro/run/typed-annotated/Test_2.scala b/tests/disabled/macro/run/typed-annotated/Test_2.scala new file mode 100644 index 000000000..0fc472aa6 --- /dev/null +++ b/tests/disabled/macro/run/typed-annotated/Test_2.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + Macros.foo +} \ No newline at end of file diff --git a/tests/pending/pos/attachments-typed-another-ident/Impls_1.scala b/tests/pending/pos/attachments-typed-another-ident/Impls_1.scala deleted file mode 100644 index 98062a9c7..000000000 --- a/tests/pending/pos/attachments-typed-another-ident/Impls_1.scala +++ /dev/null @@ -1,18 +0,0 @@ -import scala.reflect.macros.blackbox.Context -import language.experimental.macros - -object MyAttachment - -object Macros { - def impl(c: Context) = { - import c.universe._ - import internal._ - val ident = updateAttachment(Ident(TermName("bar")), MyAttachment) - assert(attachments(ident).get[MyAttachment.type].isDefined, attachments(ident)) - val typed = c.typecheck(ident) - assert(attachments(typed).get[MyAttachment.type].isDefined, attachments(typed)) - c.Expr[Int](typed) - } - - def foo = macro impl -} diff --git a/tests/pending/pos/attachments-typed-another-ident/Macros_Test_2.scala b/tests/pending/pos/attachments-typed-another-ident/Macros_Test_2.scala deleted file mode 100644 index 022639bfe..000000000 --- a/tests/pending/pos/attachments-typed-another-ident/Macros_Test_2.scala +++ /dev/null @@ -1,5 +0,0 @@ -object Test extends App { - def bar = 2 - Macros.foo -} - diff --git a/tests/pending/pos/attachments-typed-ident/Impls_1.scala b/tests/pending/pos/attachments-typed-ident/Impls_1.scala deleted file mode 100644 index 98062a9c7..000000000 --- a/tests/pending/pos/attachments-typed-ident/Impls_1.scala +++ /dev/null @@ -1,18 +0,0 @@ -import scala.reflect.macros.blackbox.Context -import language.experimental.macros - -object MyAttachment - -object Macros { - def impl(c: Context) = { - import c.universe._ - import internal._ - val ident = updateAttachment(Ident(TermName("bar")), MyAttachment) - assert(attachments(ident).get[MyAttachment.type].isDefined, attachments(ident)) - val typed = c.typecheck(ident) - assert(attachments(typed).get[MyAttachment.type].isDefined, attachments(typed)) - c.Expr[Int](typed) - } - - def foo = macro impl -} diff --git a/tests/pending/pos/attachments-typed-ident/Macros_Test_2.scala b/tests/pending/pos/attachments-typed-ident/Macros_Test_2.scala deleted file mode 100644 index 45a0609de..000000000 --- a/tests/pending/pos/attachments-typed-ident/Macros_Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends App { - def bar = 2 - Macros.foo -} diff --git a/tests/pending/pos/liftcode_polymorphic.scala b/tests/pending/pos/liftcode_polymorphic.scala deleted file mode 100644 index 249f5a056..000000000 --- a/tests/pending/pos/liftcode_polymorphic.scala +++ /dev/null @@ -1,12 +0,0 @@ -import scala.reflect.runtime.universe._ - -object Append extends App { - - def append[A](l1: List[A], l2: List[A]):List[A] = - l1 match { - case Nil => l2 - case x::xs => x :: append(xs, l2) - } - - println(reify(append _).tree) -} diff --git a/tests/pending/pos/macro-bundle-disambiguate-bundle.check b/tests/pending/pos/macro-bundle-disambiguate-bundle.check deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/pending/pos/macro-bundle-disambiguate-bundle.scala b/tests/pending/pos/macro-bundle-disambiguate-bundle.scala deleted file mode 100644 index 40d965b0e..000000000 --- a/tests/pending/pos/macro-bundle-disambiguate-bundle.scala +++ /dev/null @@ -1,14 +0,0 @@ -import scala.reflect.macros.whitebox._ -import scala.language.experimental.macros - -class Macros(val c: Context) { - def impl = ??? -} - -object Macros { - def impl(c: Context)(x: c.Tree) = ??? -} - -object Test extends App { - def foo: Unit = macro Macros.impl -} diff --git a/tests/pending/pos/macro-bundle-disambiguate-nonbundle.check b/tests/pending/pos/macro-bundle-disambiguate-nonbundle.check deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/pending/pos/macro-bundle-disambiguate-nonbundle.scala b/tests/pending/pos/macro-bundle-disambiguate-nonbundle.scala deleted file mode 100644 index 185177607..000000000 --- a/tests/pending/pos/macro-bundle-disambiguate-nonbundle.scala +++ /dev/null @@ -1,14 +0,0 @@ -import scala.reflect.macros.whitebox._ -import scala.language.experimental.macros - -class Macros(val c: Context) { - def impl(x: c.Tree) = ??? -} - -object Macros { - def impl(c: Context) = ??? -} - -object Test extends App { - def foo: Unit = macro Macros.impl -} diff --git a/tests/pending/pos/macro-implicit-invalidate-on-error.check b/tests/pending/pos/macro-implicit-invalidate-on-error.check deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/pending/pos/macro-implicit-invalidate-on-error.scala b/tests/pending/pos/macro-implicit-invalidate-on-error.scala deleted file mode 100644 index bb83e3cc3..000000000 --- a/tests/pending/pos/macro-implicit-invalidate-on-error.scala +++ /dev/null @@ -1,25 +0,0 @@ -import scala.language.experimental.macros -import scala.reflect.macros.blackbox.Context - -trait LegacyLiftable[T] { - def apply(universe: scala.reflect.api.Universe, value: T): universe.Tree -} - -object LegacyLiftable { - implicit def liftCaseClass[T <: Product]: LegacyLiftable[T] = macro liftCaseClassImpl[T] - - def liftCaseClassImpl[T: c.WeakTypeTag](c: Context): c.Expr[LegacyLiftable[T]] = { - import c.universe._ - val tpe = weakTypeOf[T] - if (!tpe.typeSymbol.asClass.isCaseClass) c.abort(c.enclosingPosition, "denied") - val p = List(q"Literal(Constant(1))") - c.Expr[LegacyLiftable[T]] { q""" - new LegacyLiftable[$tpe] { - def apply(universe: scala.reflect.api.Universe, value: $tpe): universe.Tree = { - import universe._ - Apply(Select(Ident(TermName("C")), TermName("apply")), List(..$p)) - } - } - """ } - } -} diff --git a/tests/pending/pos/macro-qmarkqmarkqmark.scala b/tests/pending/pos/macro-qmarkqmarkqmark.scala deleted file mode 100644 index de94d69d5..000000000 --- a/tests/pending/pos/macro-qmarkqmarkqmark.scala +++ /dev/null @@ -1,7 +0,0 @@ -import language.experimental.macros - -object Macros { - def foo1 = macro ??? - def foo2(x: Int) = macro ??? - def foo3[T] = macro ??? -} diff --git a/tests/pending/pos/t5223.scala b/tests/pending/pos/t5223.scala deleted file mode 100644 index bfd1e153c..000000000 --- a/tests/pending/pos/t5223.scala +++ /dev/null @@ -1,6 +0,0 @@ -import scala.reflect.runtime.universe._ - -object Foo extends App { - reify{def printf(format: String, args: Any*): String = null } - reify{def printf(format: String, args: Any*): String = ("abc": @deprecated)} -} diff --git a/tests/pending/pos/t5692a/Macros_1.scala b/tests/pending/pos/t5692a/Macros_1.scala deleted file mode 100644 index 6e5069aff..000000000 --- a/tests/pending/pos/t5692a/Macros_1.scala +++ /dev/null @@ -1,6 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Macros { - def impl[T](c: Context) = { import c.universe._; c.Expr[Unit](q"()") } - def foo[T] = macro impl[T] -} diff --git a/tests/pending/pos/t5692a/Test_2.scala b/tests/pending/pos/t5692a/Test_2.scala deleted file mode 100644 index 72ecd9576..000000000 --- a/tests/pending/pos/t5692a/Test_2.scala +++ /dev/null @@ -1,3 +0,0 @@ -class Test { - def x = Macros.foo -} diff --git a/tests/pending/pos/t5692b/Macros_1.scala b/tests/pending/pos/t5692b/Macros_1.scala deleted file mode 100644 index 82109075f..000000000 --- a/tests/pending/pos/t5692b/Macros_1.scala +++ /dev/null @@ -1,6 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Macros { - def impl[T, U](c: Context) = { import c.universe._; c.Expr[Unit](q"()") } - def foo[T, U] = macro impl[T, U] -} diff --git a/tests/pending/pos/t5692b/Test_2.scala b/tests/pending/pos/t5692b/Test_2.scala deleted file mode 100644 index 72ecd9576..000000000 --- a/tests/pending/pos/t5692b/Test_2.scala +++ /dev/null @@ -1,3 +0,0 @@ -class Test { - def x = Macros.foo -} diff --git a/tests/pending/pos/t5706.flags b/tests/pending/pos/t5706.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/pos/t5706.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/pos/t5706.scala b/tests/pending/pos/t5706.scala deleted file mode 100644 index 6f0207366..000000000 --- a/tests/pending/pos/t5706.scala +++ /dev/null @@ -1,15 +0,0 @@ -import scala.reflect.macros.blackbox.{Context => BlackboxContext} -import scala.reflect.macros.whitebox.{Context => WhiteboxContext} - -class Logger { - def error1(message: String) = macro Impls.error1 - def error2(message: String) = macro Impls.error2 -} - -object Impls { - type LoggerContext1 = BlackboxContext { type PrefixType = Logger } - def error1(c: LoggerContext1)(message: c.Expr[String]): c.Expr[Unit] = ??? - - type LoggerContext2 = WhiteboxContext { type PrefixType = Logger } - def error2(c: LoggerContext2)(message: c.Expr[String]): c.Expr[Unit] = ??? -} diff --git a/tests/pending/pos/t5744/Macros_1.scala b/tests/pending/pos/t5744/Macros_1.scala deleted file mode 100644 index 11da37f17..000000000 --- a/tests/pending/pos/t5744/Macros_1.scala +++ /dev/null @@ -1,22 +0,0 @@ -import scala.language.experimental.macros -import scala.reflect.macros.blackbox.Context - -object Macros { - def foo[U: Numeric](x: U) = macro foo_impl[U] - def bar[U: Numeric : Equiv, Y <% String](x: U)(implicit s: String) = macro bar_impl[U, Y] - - def foo_impl[U](c: Context)(x: c.Expr[U])(numeric: c.Expr[Numeric[U]]) = { - import c.universe._ - val plusOne = Apply(Select(numeric.tree, newTermName("plus")), List(x.tree, Literal(Constant(1)))) - val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(plusOne)) - c.Expr[Unit](body) - } - - def bar_impl[U, Y](c: Context)(x: c.Expr[U])(numeric: c.Expr[Numeric[U]], equiv: c.Expr[Equiv[U]], viewAsString: c.Expr[Y => String], s: c.Expr[String]) = { - import c.universe._ - val plusOne = Apply(Select(numeric.tree, newTermName("plus")), List(x.tree, Literal(Constant(1)))) - val plusLen = Apply(Select(numeric.tree, newTermName("plus")), List(plusOne, Select(s.tree, newTermName("length")))) - val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(plusLen)) - c.Expr[Unit](body) - } -} diff --git a/tests/pending/pos/t5744/Test_2.scala b/tests/pending/pos/t5744/Test_2.scala deleted file mode 100644 index dc3de03e4..000000000 --- a/tests/pending/pos/t5744/Test_2.scala +++ /dev/null @@ -1,6 +0,0 @@ -object Test extends App { - import Macros._ - foo(42) - implicit val s = "" - bar(43) -} diff --git a/tests/pending/pos/t6047.flags b/tests/pending/pos/t6047.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/pos/t6047.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/pos/t6047.scala b/tests/pending/pos/t6047.scala deleted file mode 100644 index e7d0c38c6..000000000 --- a/tests/pending/pos/t6047.scala +++ /dev/null @@ -1,20 +0,0 @@ -import scala.reflect.macros.blackbox.Context -import java.io.InputStream - -object Macros { - def unpack[A](input: InputStream): A = macro unpack_impl[A] - - def unpack_impl[A: c.WeakTypeTag](c: Context)(input: c.Expr[InputStream]): c.Expr[A] = { - import c.universe._ - - def unpackcode(tpe: c.Type): c.Expr[_] = { - if (tpe <:< implicitly[c.WeakTypeTag[Traversable[_]]].tpe) { - - } - ??? - } - - unpackcode(implicitly[c.WeakTypeTag[A]].tpe) - ??? - } - } diff --git a/tests/pending/pos/t6386.scala b/tests/pending/pos/t6386.scala deleted file mode 100644 index 4031ae267..000000000 --- a/tests/pending/pos/t6386.scala +++ /dev/null @@ -1,5 +0,0 @@ -import scala.reflect.runtime.universe._ - -object Test extends App { - reify(manifest[Some[_]]) -} diff --git a/tests/pending/pos/t6447.scala b/tests/pending/pos/t6447.scala deleted file mode 100644 index 6ef69d485..000000000 --- a/tests/pending/pos/t6447.scala +++ /dev/null @@ -1,18 +0,0 @@ -import scala.language.experimental.macros -import scala.reflect.macros.blackbox.Context - -class X { type T } - -object X { - // this works - def foo(x: X): x.T = macro fooImpl - def fooImpl(c: Context)(x: c.Expr[X]): c.Expr[x.value.T] = ??? - - // this doesn't - def bar(x: X, y: X): (x.T, y.T) = macro barImpl - def barImpl(c: Context)(x: c.Expr[X], y: c.Expr[X]): c.Expr[(x.value.T, y.value.T)] = ??? - - // neither does this - def baz(x: X)(xs: List[x.T]): Unit = macro bazImpl - def bazImpl(c: Context)(x: c.Expr[X])(xs: c.Expr[List[x.value.T]]): c.Expr[Unit] = ??? -} diff --git a/tests/pending/pos/t6485a/Macros_1.scala b/tests/pending/pos/t6485a/Macros_1.scala deleted file mode 100644 index cc7dc3d3e..000000000 --- a/tests/pending/pos/t6485a/Macros_1.scala +++ /dev/null @@ -1,5 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Macros { - def crash(c: Context): c.Expr[Unit] = c.universe.reify(()) -} diff --git a/tests/pending/pos/t6485a/Test_2.scala b/tests/pending/pos/t6485a/Test_2.scala deleted file mode 100644 index 54e260ac7..000000000 --- a/tests/pending/pos/t6485a/Test_2.scala +++ /dev/null @@ -1,5 +0,0 @@ -import scala.language.experimental.macros - -final class Ops[T](val x: T) extends AnyVal { - def f = macro Macros.crash -} diff --git a/tests/pending/pos/t6485b/Test.scala b/tests/pending/pos/t6485b/Test.scala deleted file mode 100644 index 46d707073..000000000 --- a/tests/pending/pos/t6485b/Test.scala +++ /dev/null @@ -1,10 +0,0 @@ -import scala.language.experimental.macros -import scala.reflect.macros.blackbox.Context - -final class Ops[T](val x: T) extends AnyVal { - def f = macro Macros.crash -} - -object Macros { - def crash(c: Context): c.Expr[Unit] = c.universe.reify(()) -} diff --git a/tests/pending/pos/t6516.scala b/tests/pending/pos/t6516.scala deleted file mode 100644 index 2980d83eb..000000000 --- a/tests/pending/pos/t6516.scala +++ /dev/null @@ -1,19 +0,0 @@ -import scala.language.experimental.macros -import scala.reflect.macros.blackbox.Context -import scala.collection.TraversableLike - -// This one compiles -object Test { - type Alias[T, CC[_]] = Context { type PrefixType = TraversableLike[T, CC[T]] } - def f() = macro f_impl - def f_impl(c: Alias[Int, List])() = ??? -} - -// This one doesn't -object Test2 { - type Ctx = scala.reflect.macros.blackbox.Context - type Alias[T, CC[_]] = Ctx { type PrefixType = TraversableLike[T, CC[T]] } - - def f() = macro f_impl - def f_impl(c: Alias[Int, List])() = ??? -} diff --git a/tests/pending/pos/t7190.scala b/tests/pending/pos/t7190.scala deleted file mode 100644 index 449e5c83f..000000000 --- a/tests/pending/pos/t7190.scala +++ /dev/null @@ -1,26 +0,0 @@ -import scala.language.experimental.macros -import scala.reflect.macros._ - -trait A[T] { - def min[U >: T](implicit ord: Numeric[U]): T = macro A.min[T, U] -} - -object A { - def min[T: c.WeakTypeTag, U >: T: c.WeakTypeTag](c: Context)(ord: c.Expr[Numeric[U]]): c.Expr[T] = { - c.universe.reify { - ord.splice.zero.asInstanceOf[T] - } - } -} - -class B extends A[Int] { - override def min[U >: Int](implicit ord: Numeric[U]): Int = macro B.min[U] -} - -object B { - def min[U >: Int: c.WeakTypeTag](c: Context)(ord: c.Expr[Numeric[U]]): c.Expr[Int] = { - c.universe.reify { - ord.splice.zero.asInstanceOf[Int] - } - } -} diff --git a/tests/pending/pos/t7377/Client_2.scala b/tests/pending/pos/t7377/Client_2.scala deleted file mode 100644 index 5728956cc..000000000 --- a/tests/pending/pos/t7377/Client_2.scala +++ /dev/null @@ -1,11 +0,0 @@ -object Test { - M.noop(List(1) match { case Nil => 0; case (x::xs) => x }) - - case class Foo(a: Int) - val FooAlias: Foo.type = Foo - M.noop(Foo(0) match { case FooAlias(_) => 0 }) - - case class Bar() - val BarAlias: Bar.type = Bar - M.noop(Bar() match { case BarAlias() => 0 }) -} diff --git a/tests/pending/pos/t7377/Macro_1.scala b/tests/pending/pos/t7377/Macro_1.scala deleted file mode 100644 index b38687c8b..000000000 --- a/tests/pending/pos/t7377/Macro_1.scala +++ /dev/null @@ -1,7 +0,0 @@ -import language.experimental._ -import scala.reflect.macros.blackbox.Context - -object M { - def noopImpl[A](c: Context)(expr: c.Expr[A]): c.Expr[A] = c.Expr(c.typecheck(c.untypecheck(expr.tree))) - def noop[A](expr: A): A = macro noopImpl[A] -} diff --git a/tests/pending/pos/t7461/Macros_1.scala b/tests/pending/pos/t7461/Macros_1.scala deleted file mode 100644 index 74ebf5af9..000000000 --- a/tests/pending/pos/t7461/Macros_1.scala +++ /dev/null @@ -1,13 +0,0 @@ -import scala.reflect.macros.blackbox.Context -import language.experimental.macros - -object Macros { - def impl(c: Context) = { - import c.universe._ - val wut = c.typecheck(Select(Literal(Constant(10)), newTermName("$minus")), silent = true) - // println(showRaw(wut, printIds = true, printTypes = true)) - c.Expr[Unit](q"()") - } - - def foo = macro impl -} diff --git a/tests/pending/pos/t7461/Test_2.scala b/tests/pending/pos/t7461/Test_2.scala deleted file mode 100644 index 866e3dc6f..000000000 --- a/tests/pending/pos/t7461/Test_2.scala +++ /dev/null @@ -1,3 +0,0 @@ -class C { - def foo = Macros.foo -} diff --git a/tests/pending/pos/t7516/A_1.scala b/tests/pending/pos/t7516/A_1.scala deleted file mode 100644 index 3bd477dcd..000000000 --- a/tests/pending/pos/t7516/A_1.scala +++ /dev/null @@ -1,9 +0,0 @@ -import scala.reflect._,macros._, scala.language.experimental.macros - -object A { - def impl[T: c.WeakTypeTag](c: Context)(t: c.Expr[T]): c.Expr[List[T]] = { - val r = c.universe.reify { List(t.splice) } - c.Expr[List[T]]( c.untypecheck(r.tree) ) - } - def demo[T](t: T): List[T] = macro impl[T] -} diff --git a/tests/pending/pos/t7516/B_2.scala b/tests/pending/pos/t7516/B_2.scala deleted file mode 100644 index 1b8531bc8..000000000 --- a/tests/pending/pos/t7516/B_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object B { - final case class CV(p: Int = 3, g: Int = 2) - A.demo { val d = 4; CV(g = d); "a" } -} diff --git a/tests/pending/pos/t7649.flags b/tests/pending/pos/t7649.flags deleted file mode 100644 index fcf951d90..000000000 --- a/tests/pending/pos/t7649.flags +++ /dev/null @@ -1 +0,0 @@ --Yrangepos \ No newline at end of file diff --git a/tests/pending/pos/t7649.scala b/tests/pending/pos/t7649.scala deleted file mode 100644 index d70dc05ea..000000000 --- a/tests/pending/pos/t7649.scala +++ /dev/null @@ -1,20 +0,0 @@ -object Test { - val c: scala.reflect.macros.blackbox.Context = ??? - import c.universe._ - reify { - // The lookup of the implicit WeakTypeTag[Any] - // was triggering an unpositioned tree. - c.Expr[Any](q"0").splice - } - - import scala.reflect.ClassTag - def ct[A: ClassTag]: Expr[A] = ??? - def tt[A: TypeTag]: Expr[A] = ??? - def wtt[A: WeakTypeTag]: Expr[A] = ??? - - reify { - ct[String].splice - tt[String].splice - wtt[String].splice - } -} diff --git a/tests/pending/pos/t7776.check b/tests/pending/pos/t7776.check deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/pending/pos/t7776.scala b/tests/pending/pos/t7776.scala deleted file mode 100644 index 627d20dd6..000000000 --- a/tests/pending/pos/t7776.scala +++ /dev/null @@ -1,20 +0,0 @@ -import scala.language.experimental.macros -import scala.reflect.macros.blackbox.Context - -class MacroErasure { - def app(f: Any => Any, x: Any): Any = macro MacroErasure.appMacro - def app[A](f: A => Any, x: Any): Any = macro MacroErasure.appMacroA[A] -} - -object MacroErasure { - def appMacro(c: Context)( - f: c.Expr[Any => Any], x: c.Expr[Any]): c.Expr[Any] = { - import c.universe._ - c.Expr(q"$f($x)") - } - def appMacroA[A](c: Context)(f: c.Expr[A => Any], x: c.Expr[Any])( - implicit tt: c.WeakTypeTag[A]): c.Expr[Any] = { - import c.universe._ - c.Expr(q"$f[${tt.tpe}]($x)") - } -} diff --git a/tests/pending/pos/t7987/Macro_1.scala b/tests/pending/pos/t7987/Macro_1.scala deleted file mode 100644 index 81f717b9c..000000000 --- a/tests/pending/pos/t7987/Macro_1.scala +++ /dev/null @@ -1,6 +0,0 @@ -import scala.language.experimental._ - -object Macro { - def apply[A](a: A): A = macro impl[A] - def impl[A](c: reflect.macros.Context)(a: c.Expr[A]): c.Expr[A] = a -} diff --git a/tests/pending/pos/t7987/Test_2.scala b/tests/pending/pos/t7987/Test_2.scala deleted file mode 100644 index aaa21ec4c..000000000 --- a/tests/pending/pos/t7987/Test_2.scala +++ /dev/null @@ -1,12 +0,0 @@ -class C[T] { - def foo = 0 -} - -object Test { - implicit def AnyToC[T](a: Any): C[T] = new C[T] - // was: "macro not expanded" - Macro { - "".foo - () - } -} diff --git a/tests/pending/pos/t8001/Macros_1.scala b/tests/pending/pos/t8001/Macros_1.scala deleted file mode 100644 index 077082a9c..000000000 --- a/tests/pending/pos/t8001/Macros_1.scala +++ /dev/null @@ -1,10 +0,0 @@ -import scala.language.experimental.macros -import scala.reflect.macros.blackbox.Context - -object Macros { - def foo: Unit = macro impl - def impl(c: Context) = { - import c.universe._ - q"()" - } -} diff --git a/tests/pending/pos/t8001/Test_2.scala b/tests/pending/pos/t8001/Test_2.scala deleted file mode 100644 index 55024506e..000000000 --- a/tests/pending/pos/t8001/Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends App { - Macros.foo - (): Unit -} diff --git a/tests/pending/pos/t8013/inpervolated_2.scala b/tests/pending/pos/t8013/inpervolated_2.scala deleted file mode 100644 index 90e571b42..000000000 --- a/tests/pending/pos/t8013/inpervolated_2.scala +++ /dev/null @@ -1,11 +0,0 @@ -/* - * scalac: -Xfatal-warnings -Xlint - */ -package t8013 - -// unsuspecting user of perverse macro -trait User { - import Perverse.Impervolator - val foo = "bar" - Console println p"Hello, $foo" -} diff --git a/tests/pending/pos/t8013/inpervolator_1.scala b/tests/pending/pos/t8013/inpervolator_1.scala deleted file mode 100644 index 612e1d727..000000000 --- a/tests/pending/pos/t8013/inpervolator_1.scala +++ /dev/null @@ -1,33 +0,0 @@ - -package t8013 - -// perverse macro to confuse Xlint - -import scala.language.experimental.macros -import scala.reflect.macros.blackbox.Context - -object Perverse { - - implicit class Impervolator(sc: StringContext) { - def p(args: Any*): String = macro pImpl - } - - // turn a nice interpolation into something that looks - // nothing like an interpolation or anything we might - // recognize, but which includes a "$id" in an apply. - def pImpl(c: Context)(args: c.Expr[Any]*): c.Expr[String] = { - import c.universe._ - val macroPos = c.macroApplication.pos - val text = macroPos.source.lineToString(macroPos.line - 1) substring macroPos.column - val tt = Literal(Constant(text)) - val tree = q"t8013.Perverse.pervert($tt)" - c.Expr[String](tree) - } - - // identity doesn't seem very perverse in this context - //def pervert(text: String): String = text - def pervert(text: String): String = { - Console println s"Perverting [$text]" - text - } -} diff --git a/tests/pending/pos/t8064/Client_2.scala b/tests/pending/pos/t8064/Client_2.scala deleted file mode 100644 index 42c9b21ce..000000000 --- a/tests/pending/pos/t8064/Client_2.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Test { - Macro { - def s = "" - Macro(s): @unchecked - ??? - } -} -// Was: a range position validation error (unpositioned tree) diff --git a/tests/pending/pos/t8064/Macro_1.scala b/tests/pending/pos/t8064/Macro_1.scala deleted file mode 100644 index 9f1e6955b..000000000 --- a/tests/pending/pos/t8064/Macro_1.scala +++ /dev/null @@ -1,10 +0,0 @@ -import language.experimental.macros -import scala.reflect.macros.blackbox.Context - -object Macro { - def apply(a: Any): Any = macro impl - - def impl(c: Context)(a: c.Tree): c.Tree = { - c.untypecheck(a) - } -} diff --git a/tests/pending/pos/t8064b/Client_2.scala b/tests/pending/pos/t8064b/Client_2.scala deleted file mode 100644 index 055b7a606..000000000 --- a/tests/pending/pos/t8064b/Client_2.scala +++ /dev/null @@ -1,6 +0,0 @@ -object Test { - Macro { - "".reverse - } -} -// Was: a range position validation error (tree with offset position enclosing tree with range position) diff --git a/tests/pending/pos/t8064b/Macro_1.scala b/tests/pending/pos/t8064b/Macro_1.scala deleted file mode 100644 index 60996bfec..000000000 --- a/tests/pending/pos/t8064b/Macro_1.scala +++ /dev/null @@ -1,11 +0,0 @@ -import language.experimental.macros -import scala.reflect.macros.blackbox.Context - -object Macro { - def apply(a: Any): Any = macro impl - def impl(c: Context)(a: c.Tree): c.Tree = { - import c.universe._ - - q"{$a; true}" - } -} diff --git a/tests/pending/pos/t8209a/Macros_1.scala b/tests/pending/pos/t8209a/Macros_1.scala deleted file mode 100644 index 5d7852cb7..000000000 --- a/tests/pending/pos/t8209a/Macros_1.scala +++ /dev/null @@ -1,17 +0,0 @@ -import scala.language.experimental.macros -import scala.language.implicitConversions -import scala.reflect.macros.blackbox.Context - -class A -object A { implicit def a2b(a: A): B = ??? } -class B -class C extends A - -object Macros { - def impl(c: Context) = { - import c.universe._ - q"new C" - } - - def foo: A = macro impl -} diff --git a/tests/pending/pos/t8209a/Test_2.scala b/tests/pending/pos/t8209a/Test_2.scala deleted file mode 100644 index bedef776f..000000000 --- a/tests/pending/pos/t8209a/Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends App { - val a: A = Macros.foo - val b: B = Macros.foo -} diff --git a/tests/pending/pos/t8209b/Macros_1.scala b/tests/pending/pos/t8209b/Macros_1.scala deleted file mode 100644 index fa521d38d..000000000 --- a/tests/pending/pos/t8209b/Macros_1.scala +++ /dev/null @@ -1,17 +0,0 @@ -import scala.language.experimental.macros -import scala.language.implicitConversions -import scala.reflect.macros.whitebox.Context - -class A -object A { implicit def a2b(a: A): B = ??? } -class B -class C extends A - -object Macros { - def impl(c: Context) = { - import c.universe._ - q"new C" - } - - def foo: A = macro impl -} diff --git a/tests/pending/pos/t8209b/Test_2.scala b/tests/pending/pos/t8209b/Test_2.scala deleted file mode 100644 index bedef776f..000000000 --- a/tests/pending/pos/t8209b/Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends App { - val a: A = Macros.foo - val b: B = Macros.foo -} diff --git a/tests/pending/pos/t8352/Macros_1.scala b/tests/pending/pos/t8352/Macros_1.scala deleted file mode 100644 index c1c63e57b..000000000 --- a/tests/pending/pos/t8352/Macros_1.scala +++ /dev/null @@ -1,7 +0,0 @@ -import scala.reflect.macros.whitebox._ -import scala.language.experimental.macros - -object Macros { - def impl(c: Context)(x: c.Expr[Boolean]): c.Expr[Boolean] = x - def foo(x: Boolean): Boolean = macro impl -} diff --git a/tests/pending/pos/t8352/Test_2.scala b/tests/pending/pos/t8352/Test_2.scala deleted file mode 100644 index 1f84c3ca1..000000000 --- a/tests/pending/pos/t8352/Test_2.scala +++ /dev/null @@ -1,5 +0,0 @@ -object Test extends App { - def expectUnit(): Unit = { - Macros.foo(true) - } -} diff --git a/tests/pending/run/exprs_serialize.check b/tests/pending/run/exprs_serialize.check deleted file mode 100644 index 551823ccd..000000000 --- a/tests/pending/run/exprs_serialize.check +++ /dev/null @@ -1,19 +0,0 @@ -Expr[Int(2)](2) -Expr[java.lang.String]({ - def foo = "hello"; - foo.$plus("world!") -}) -Expr[Boolean]({ - def foo(x: Int) = { - class Local extends AnyRef { - def () = { - super.(); - () - }; - val f = 2 - }; - val obj = new Local(); - x.$percent(obj.f).$eq$eq(0) - }; - foo(5) -}) diff --git a/tests/pending/run/exprs_serialize.scala b/tests/pending/run/exprs_serialize.scala deleted file mode 100644 index 85cf55e1c..000000000 --- a/tests/pending/run/exprs_serialize.scala +++ /dev/null @@ -1,39 +0,0 @@ -import java.io._ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} - -object Test extends dotty.runtime.LegacyApp { - def test(expr: Expr[_]) = - try { - val fout = new ByteArrayOutputStream() - val out = new ObjectOutputStream(fout) - out.writeObject(expr) - out.close() - fout.close() - - val fin = new ByteArrayInputStream(fout.toByteArray) - val in = new ObjectInputStream(fin) - val reexpr = in.readObject().asInstanceOf[ru.Expr[_]].in(cm) - in.close() - fin.close() - - println(reexpr) - } catch { - case ex: Exception => - println(ex) - } - - test(reify(2)) - test(reify{def foo = "hello"; foo + "world!"}) - test(reify { - def foo(x: Int) = { - class Local { - val f = 2 - } - val obj = new Local - x % obj.f == 0 - } - foo(5) - }) -} diff --git a/tests/pending/run/freetypes_false_alarm1.check b/tests/pending/run/freetypes_false_alarm1.check deleted file mode 100644 index 085b3ee50..000000000 --- a/tests/pending/run/freetypes_false_alarm1.check +++ /dev/null @@ -1 +0,0 @@ -scala.List[Int] diff --git a/tests/pending/run/freetypes_false_alarm1.scala b/tests/pending/run/freetypes_false_alarm1.scala deleted file mode 100644 index b06e10efe..000000000 --- a/tests/pending/run/freetypes_false_alarm1.scala +++ /dev/null @@ -1,10 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - val ru = scala.reflect.runtime.universe - val tpe: ru.Type = ru.typeOf[List[Int]] - println(tpe) - }.eval -} diff --git a/tests/pending/run/idempotency-case-classes.check b/tests/pending/run/idempotency-case-classes.check deleted file mode 100644 index 5a8d0ad9d..000000000 --- a/tests/pending/run/idempotency-case-classes.check +++ /dev/null @@ -1,55 +0,0 @@ -C(2,3) -() -{ - case class C extends AnyRef with Product with Serializable { - private[this] val x: Int = _; - def x: Int = C.this.x; - private[this] val y: Int = _; - def y: Int = C.this.y; - def (x: Int, y: Int): C = { - C.super.(); - () - }; - def copy(x: Int = x, y: Int = y): C = new C(x, y); - def copy$default$1: Int = C.this.x; - def copy$default$2: Int = C.this.y; - override def productPrefix: String = "C"; - def productArity: Int = 2; - def productElement(x$1: Int): Any = x$1 match { - case 0 => C.this.x - case 1 => C.this.y - case _ => throw new IndexOutOfBoundsException(x$1.toString()) - }; - override def productIterator: Iterator[Any] = runtime.this.ScalaRunTime.typedProductIterator[Any](C.this); - def canEqual(x$1: Any): Boolean = x$1.$isInstanceOf[C](); - override def hashCode(): Int = { - var acc: Int = -889275714; - acc = Statics.this.mix(acc, x); - acc = Statics.this.mix(acc, y); - Statics.this.finalizeHash(acc, 2) - }; - override def toString(): String = ScalaRunTime.this._toString(C.this); - override def equals(x$1: Any): Boolean = C.this.eq(x$1.asInstanceOf[Object]).||(x$1 match { - case (_: C) => true - case _ => false -}.&&({ - val C$1: C = x$1.asInstanceOf[C]; - C.this.x.==(C$1.x).&&(C.this.y.==(C$1.y)).&&(C$1.canEqual(C.this)) - })) - }; - object C extends scala.runtime.AbstractFunction2[Int,Int,C] with Serializable { - def (): C.type = { - C.super.(); - () - }; - final override def toString(): String = "C"; - case def apply(x: Int, y: Int): C = new C(x, y); - case def unapply(x$0: C): Option[(Int, Int)] = if (x$0.==(null)) - scala.this.None - else - Some.apply[(Int, Int)](scala.Tuple2.apply[Int, Int](x$0.x, x$0.y)); - private def readResolve(): Object = C - }; - Predef.println(C.apply(2, 3)) -} -error! diff --git a/tests/pending/run/idempotency-case-classes.scala b/tests/pending/run/idempotency-case-classes.scala deleted file mode 100644 index 8c2aa70dc..000000000 --- a/tests/pending/run/idempotency-case-classes.scala +++ /dev/null @@ -1,22 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.{ToolBox, ToolBoxError} -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - val casee = reify { - case class C(x: Int, y: Int) - println(C(2, 3)) - } - println(casee.eval) - val tb = cm.mkToolBox() - val tcasee = tb.typecheck(casee.tree) - println(tcasee) - val rtcasee = tb.untypecheck(tcasee) - try { - println(tb.eval(rtcasee)) - } catch { - // this is the current behaviour, rather than the desired behavior; see SI-5467 - case _: ToolBoxError => println("error!") - } -} diff --git a/tests/pending/run/idempotency-extractors.check b/tests/pending/run/idempotency-extractors.check deleted file mode 100644 index fcd50faa7..000000000 --- a/tests/pending/run/idempotency-extractors.check +++ /dev/null @@ -1,5 +0,0 @@ -2 -2 match { - case Test.this.Extractor.unapply() ((x @ _)) => x -} -error! diff --git a/tests/pending/run/idempotency-extractors.scala b/tests/pending/run/idempotency-extractors.scala deleted file mode 100644 index f5d6cd193..000000000 --- a/tests/pending/run/idempotency-extractors.scala +++ /dev/null @@ -1,22 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.{ToolBox, ToolBoxError} -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - object Extractor { def unapply(x: Int): Option[Int] = Some(x) } - val extractor = reify { - 2 match { case Extractor(x) => x } - } - println(extractor.eval) - val tb = cm.mkToolBox() - val textractor = tb.typecheck(extractor.tree) - println(textractor) - val rtextractor = tb.untypecheck(textractor) - try { - println(tb.eval(rtextractor)) - } catch { - // this is the current behaviour, rather than the desired behavior; see SI-5465 - case _: ToolBoxError => println("error!") - } -} diff --git a/tests/pending/run/idempotency-labels.check b/tests/pending/run/idempotency-labels.check deleted file mode 100644 index 8709efeb4..000000000 --- a/tests/pending/run/idempotency-labels.check +++ /dev/null @@ -1,15 +0,0 @@ -2 -{ - var x: Int = 0; - while$1(){ - if (x.<(2)) - { - x = x.+(1); - while$1() - } - else - () - }; - x -} -2 diff --git a/tests/pending/run/idempotency-labels.scala b/tests/pending/run/idempotency-labels.scala deleted file mode 100644 index 126063384..000000000 --- a/tests/pending/run/idempotency-labels.scala +++ /dev/null @@ -1,22 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.{ToolBox, ToolBoxError} -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - val label = reify { - var x = 0 - while (x < 2) { x += 1 } - x - } - println(label.eval) - val tb = cm.mkToolBox() - val tlabel = tb.typecheck(label.tree) - println(tlabel) - val rtlabel = tb.untypecheck(tlabel) - try { - println(tb.eval(rtlabel)) - } catch { - case _: ToolBoxError => println("error!") - } -} diff --git a/tests/pending/run/idempotency-lazy-vals.check b/tests/pending/run/idempotency-lazy-vals.check deleted file mode 100644 index 15afa5303..000000000 --- a/tests/pending/run/idempotency-lazy-vals.check +++ /dev/null @@ -1,23 +0,0 @@ -6 -{ - class C extends AnyRef { - def (): C = { - C.super.(); - () - }; - lazy private[this] val x: Int = _; - lazy def x: Int = { - C.this.x = 2; - C.this.x - }; - lazy private[this] val y: Int = _; - implicit lazy def y: Int = { - C.this.y = 3; - C.this.y - } - }; - val c: C = new C(); - import c._; - c.x.*(Predef.implicitly[Int](c.y)) -} -error! diff --git a/tests/pending/run/idempotency-lazy-vals.scala b/tests/pending/run/idempotency-lazy-vals.scala deleted file mode 100644 index cb757f1ab..000000000 --- a/tests/pending/run/idempotency-lazy-vals.scala +++ /dev/null @@ -1,27 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.{ToolBox, ToolBoxError} -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - val lazee = reify { - class C { - lazy val x = 2 - implicit lazy val y = 3 - } - val c = new C() - import c._ - x * implicitly[Int] - } - println(lazee.eval) - val tb = cm.mkToolBox() - val tlazee = tb.typecheck(lazee.tree) - println(tlazee) - val rtlazee = tb.untypecheck(tlazee) - try { - println(tb.eval(rtlazee)) - } catch { - // this is the current behaviour, rather than the desired behavior; see SI-5466 - case _: ToolBoxError => println("error!") - } -} diff --git a/tests/pending/run/idempotency-this.check b/tests/pending/run/idempotency-this.check deleted file mode 100644 index 88b8288ad..000000000 --- a/tests/pending/run/idempotency-this.check +++ /dev/null @@ -1,4 +0,0 @@ -List() -List.apply[String]("") -Apply(TypeApply(Select(Ident(scala.collection.immutable.List), TermName("apply")), List(TypeTree().setOriginal(Select(Ident(scala.Predef), TypeName("String"))))), List(Literal(Constant("")))) -List() diff --git a/tests/pending/run/idempotency-this.scala b/tests/pending/run/idempotency-this.scala deleted file mode 100644 index 2e2f7cf66..000000000 --- a/tests/pending/run/idempotency-this.scala +++ /dev/null @@ -1,22 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.{ToolBox, ToolBoxError} -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - val thiss = reify { - List[String]("") - } - println(thiss.eval) - val tb = cm.mkToolBox() - val tthiss = tb.typecheck(thiss.tree) - println(tthiss) - println(showRaw(tthiss)) - val rtthiss = tb.untypecheck(tthiss) - try { - println(tb.eval(rtthiss)) - } catch { - // this is the current behaviour, rather than the desired behavior; see SI-5705 - case _: ToolBoxError => println("error!") - } -} diff --git a/tests/pending/run/macro-abort-fresh.check b/tests/pending/run/macro-abort-fresh.check deleted file mode 100644 index 5064b96ee..000000000 --- a/tests/pending/run/macro-abort-fresh.check +++ /dev/null @@ -1,6 +0,0 @@ -fresh$macro$1 -qwe$macro$2 -qwe$macro$3 -reflective compilation has failed: - -blargh diff --git a/tests/pending/run/macro-abort-fresh.flags b/tests/pending/run/macro-abort-fresh.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-abort-fresh.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-abort-fresh/Macros_1.scala b/tests/pending/run/macro-abort-fresh/Macros_1.scala deleted file mode 100644 index 2b03512ef..000000000 --- a/tests/pending/run/macro-abort-fresh/Macros_1.scala +++ /dev/null @@ -1,15 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def impl(c: Context) = { - import c.universe._ - println(c.fresh()) - println(c.fresh("qwe")) - println(c.fresh(TypeName("qwe"))) - c.abort(NoPosition, "blargh") - } -} - -object Macros { - def foo = macro Impls.impl -} \ No newline at end of file diff --git a/tests/pending/run/macro-abort-fresh/Test_2.scala b/tests/pending/run/macro-abort-fresh/Test_2.scala deleted file mode 100644 index dea6e6d62..000000000 --- a/tests/pending/run/macro-abort-fresh/Test_2.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - import scala.reflect.runtime.universe._ - import scala.reflect.runtime.{currentMirror => cm} - import scala.tools.reflect.ToolBox - val tree = Select(Ident(TermName("Macros")), TermName("foo")) - try cm.mkToolBox().eval(tree) - catch { case ex: Throwable => println(ex.getMessage) } -} \ No newline at end of file diff --git a/tests/pending/run/macro-auto-duplicate.check b/tests/pending/run/macro-auto-duplicate.check deleted file mode 100644 index d81cc0710..000000000 --- a/tests/pending/run/macro-auto-duplicate.check +++ /dev/null @@ -1 +0,0 @@ -42 diff --git a/tests/pending/run/macro-auto-duplicate/Macros_1.scala b/tests/pending/run/macro-auto-duplicate/Macros_1.scala deleted file mode 100644 index 2c910e6af..000000000 --- a/tests/pending/run/macro-auto-duplicate/Macros_1.scala +++ /dev/null @@ -1,17 +0,0 @@ -import scala.reflect.macros.blackbox.Context -import language.experimental.macros - -object Macros { - def impl(c: Context) = { - import c.universe._ - val x = Ident(newTermName("x")) - def defAndUseX(rhs: Tree) = { - Block(List(ValDef(NoMods, newTermName("x"), TypeTree(), rhs)), x) - } - val xi4 = defAndUseX(Literal(Constant(4))) - val xs2 = defAndUseX(Literal(Constant("2"))) - c.Expr[String](Apply(Select(xi4, newTermName("$plus")), List(xs2))) - } - - def foo = macro impl -} \ No newline at end of file diff --git a/tests/pending/run/macro-auto-duplicate/Test_2.scala b/tests/pending/run/macro-auto-duplicate/Test_2.scala deleted file mode 100644 index eed62a0fe..000000000 --- a/tests/pending/run/macro-auto-duplicate/Test_2.scala +++ /dev/null @@ -1,3 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - println(Macros.foo) -} \ No newline at end of file diff --git a/tests/pending/run/macro-basic-ma-md-mi.check b/tests/pending/run/macro-basic-ma-md-mi.check deleted file mode 100644 index b74e882ae..000000000 --- a/tests/pending/run/macro-basic-ma-md-mi.check +++ /dev/null @@ -1 +0,0 @@ -31 \ No newline at end of file diff --git a/tests/pending/run/macro-basic-ma-md-mi.flags b/tests/pending/run/macro-basic-ma-md-mi.flags deleted file mode 100644 index 5e5dd6ce7..000000000 --- a/tests/pending/run/macro-basic-ma-md-mi.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros diff --git a/tests/pending/run/macro-basic-ma-md-mi/Impls_1.scala b/tests/pending/run/macro-basic-ma-md-mi/Impls_1.scala deleted file mode 100644 index fc75b99ef..000000000 --- a/tests/pending/run/macro-basic-ma-md-mi/Impls_1.scala +++ /dev/null @@ -1,21 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo(c: Context)(x: c.Expr[Int]): c.Expr[Int] = { - import c.universe._ - val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(1)))) - c.Expr[Int](body) - } - - def bar(c: Context)(x: c.Expr[Int]): c.Expr[Int] = { - import c.universe._ - val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(2)))) - c.Expr[Int](body) - } - - def quux(c: Context)(x: c.Expr[Int]): c.Expr[Int] = { - import c.universe._ - val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(3)))) - c.Expr[Int](body) - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-basic-ma-md-mi/Macros_2.scala b/tests/pending/run/macro-basic-ma-md-mi/Macros_2.scala deleted file mode 100644 index 527904374..000000000 --- a/tests/pending/run/macro-basic-ma-md-mi/Macros_2.scala +++ /dev/null @@ -1,10 +0,0 @@ -object Macros { - object Shmacros { - def foo(x: Int): Int = macro Impls.foo - } - def bar(x: Int): Int = macro Impls.bar -} - -class Macros { - def quux(x: Int): Int = macro Impls.quux -} \ No newline at end of file diff --git a/tests/pending/run/macro-basic-ma-md-mi/Test_3.scala b/tests/pending/run/macro-basic-ma-md-mi/Test_3.scala deleted file mode 100644 index 9c45f59d7..000000000 --- a/tests/pending/run/macro-basic-ma-md-mi/Test_3.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - import Macros.Shmacros._ - println(foo(2) + Macros.bar(2) * new Macros().quux(4)) -} \ No newline at end of file diff --git a/tests/pending/run/macro-basic-ma-mdmi.check b/tests/pending/run/macro-basic-ma-mdmi.check deleted file mode 100644 index b74e882ae..000000000 --- a/tests/pending/run/macro-basic-ma-mdmi.check +++ /dev/null @@ -1 +0,0 @@ -31 \ No newline at end of file diff --git a/tests/pending/run/macro-basic-ma-mdmi.flags b/tests/pending/run/macro-basic-ma-mdmi.flags deleted file mode 100644 index 5e5dd6ce7..000000000 --- a/tests/pending/run/macro-basic-ma-mdmi.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros diff --git a/tests/pending/run/macro-basic-ma-mdmi/Impls_Macros_1.scala b/tests/pending/run/macro-basic-ma-mdmi/Impls_Macros_1.scala deleted file mode 100644 index 73a5a971a..000000000 --- a/tests/pending/run/macro-basic-ma-mdmi/Impls_Macros_1.scala +++ /dev/null @@ -1,32 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo(c: Context)(x: c.Expr[Int]): c.Expr[Int] = { - import c.universe._ - val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(1)))) - c.Expr[Int](body) - } - - def bar(c: Context)(x: c.Expr[Int]): c.Expr[Int] = { - import c.universe._ - val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(2)))) - c.Expr[Int](body) - } - - def quux(c: Context)(x: c.Expr[Int]): c.Expr[Int] = { - import c.universe._ - val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(3)))) - c.Expr[Int](body) - } -} - -object Macros { - object Shmacros { - def foo(x: Int): Int = macro Impls.foo - } - def bar(x: Int): Int = macro Impls.bar -} - -class Macros { - def quux(x: Int): Int = macro Impls.quux -} \ No newline at end of file diff --git a/tests/pending/run/macro-basic-ma-mdmi/Test_2.scala b/tests/pending/run/macro-basic-ma-mdmi/Test_2.scala deleted file mode 100644 index 9c45f59d7..000000000 --- a/tests/pending/run/macro-basic-ma-mdmi/Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - import Macros.Shmacros._ - println(foo(2) + Macros.bar(2) * new Macros().quux(4)) -} \ No newline at end of file diff --git a/tests/pending/run/macro-basic-mamd-mi.check b/tests/pending/run/macro-basic-mamd-mi.check deleted file mode 100644 index b74e882ae..000000000 --- a/tests/pending/run/macro-basic-mamd-mi.check +++ /dev/null @@ -1 +0,0 @@ -31 \ No newline at end of file diff --git a/tests/pending/run/macro-basic-mamd-mi.flags b/tests/pending/run/macro-basic-mamd-mi.flags deleted file mode 100644 index 5e5dd6ce7..000000000 --- a/tests/pending/run/macro-basic-mamd-mi.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros diff --git a/tests/pending/run/macro-basic-mamd-mi/Impls_1.scala b/tests/pending/run/macro-basic-mamd-mi/Impls_1.scala deleted file mode 100644 index 0be915c11..000000000 --- a/tests/pending/run/macro-basic-mamd-mi/Impls_1.scala +++ /dev/null @@ -1,19 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo(c: Context)(x: c.Expr[Int]): c.Expr[Int] = { - import c.universe._ - c.Expr(Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(1))))) - } - - def bar(c: Context)(x: c.Expr[Int]): c.Expr[Int] = { - import c.universe._ - c.Expr(Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(2))))) - } - - def quux(c: Context)(x: c.Expr[Int]): c.Expr[Int] = { - import c.universe._ - val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(3)))) - c.Expr[Int](body) - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-basic-mamd-mi/Macros_Test_2.scala b/tests/pending/run/macro-basic-mamd-mi/Macros_Test_2.scala deleted file mode 100644 index 9bfcbc4a7..000000000 --- a/tests/pending/run/macro-basic-mamd-mi/Macros_Test_2.scala +++ /dev/null @@ -1,15 +0,0 @@ -object Macros { - object Shmacros { - def foo(x: Int): Int = macro Impls.foo - } - def bar(x: Int): Int = macro Impls.bar -} - -class Macros { - def quux(x: Int): Int = macro Impls.quux -} - -object Test extends dotty.runtime.LegacyApp { - import Macros.Shmacros._ - println(foo(2) + Macros.bar(2) * new Macros().quux(4)) -} \ No newline at end of file diff --git a/tests/pending/run/macro-blackbox-materialization.check b/tests/pending/run/macro-blackbox-materialization.check deleted file mode 100644 index 7165b734a..000000000 --- a/tests/pending/run/macro-blackbox-materialization.check +++ /dev/null @@ -1,3 +0,0 @@ -C(Int) -C(String) -C(Nothing) diff --git a/tests/pending/run/macro-blackbox-materialization/Macros_1.scala b/tests/pending/run/macro-blackbox-materialization/Macros_1.scala deleted file mode 100644 index ea8d1bed1..000000000 --- a/tests/pending/run/macro-blackbox-materialization/Macros_1.scala +++ /dev/null @@ -1,16 +0,0 @@ -// For the full version of the test, take a look at run/t5923a - -import scala.reflect.macros.blackbox.Context -import language.experimental.macros - -case class C[T](t: String) -object C { - implicit def foo[T]: C[T] = macro Macros.impl[T] -} - -object Macros { - def impl[T: c.WeakTypeTag](c: Context) = { - import c.universe._ - reify(C[T](c.literal(weakTypeOf[T].toString).splice)) - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-blackbox-materialization/Test_2.scala b/tests/pending/run/macro-blackbox-materialization/Test_2.scala deleted file mode 100644 index 1f0413bdf..000000000 --- a/tests/pending/run/macro-blackbox-materialization/Test_2.scala +++ /dev/null @@ -1,5 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - println(implicitly[C[Int]]) - println(implicitly[C[String]]) - println(implicitly[C[Nothing]]) -} \ No newline at end of file diff --git a/tests/pending/run/macro-bodyexpandstoimpl.check b/tests/pending/run/macro-bodyexpandstoimpl.check deleted file mode 100644 index f70d7bba4..000000000 --- a/tests/pending/run/macro-bodyexpandstoimpl.check +++ /dev/null @@ -1 +0,0 @@ -42 \ No newline at end of file diff --git a/tests/pending/run/macro-bodyexpandstoimpl.flags b/tests/pending/run/macro-bodyexpandstoimpl.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-bodyexpandstoimpl.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-bodyexpandstoimpl/Impls_1.scala b/tests/pending/run/macro-bodyexpandstoimpl/Impls_1.scala deleted file mode 100644 index d46af4952..000000000 --- a/tests/pending/run/macro-bodyexpandstoimpl/Impls_1.scala +++ /dev/null @@ -1,16 +0,0 @@ -import scala.language.experimental.macros -import scala.reflect.macros.blackbox.{Context => BlackboxContext} -import scala.reflect.macros.whitebox.{Context => WhiteboxContext} - -object Impls { - def foo(c: BlackboxContext)(x: c.Expr[Int]) = x - - def refToFoo(dummy: Int): Int = macro refToFoo_impl - def refToFoo_impl(c: WhiteboxContext)(dummy: c.Expr[Int]) = { - import c.universe._ - val body = Select(Ident(TermName("Impls")), TermName("foo")) - val global = c.universe.asInstanceOf[scala.tools.nsc.Global] - global.analyzer.markMacroImplRef(body.asInstanceOf[global.Tree]) - c.Expr[Int](body) - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-bodyexpandstoimpl/Macros_Test_2.scala b/tests/pending/run/macro-bodyexpandstoimpl/Macros_Test_2.scala deleted file mode 100644 index f0fe4a8e3..000000000 --- a/tests/pending/run/macro-bodyexpandstoimpl/Macros_Test_2.scala +++ /dev/null @@ -1,10 +0,0 @@ -import scala.language.experimental.macros - -object Macros { - def foo(x: Int): Int = macro Impls.refToFoo(42) -} - -object Test extends dotty.runtime.LegacyApp { - import Macros._ - println(foo(42)) -} \ No newline at end of file diff --git a/tests/pending/run/macro-bundle-context-alias.check b/tests/pending/run/macro-bundle-context-alias.check deleted file mode 100644 index 55e4dfcf9..000000000 --- a/tests/pending/run/macro-bundle-context-alias.check +++ /dev/null @@ -1,4 +0,0 @@ -C -C -C -C diff --git a/tests/pending/run/macro-bundle-context-alias/Macros_1.scala b/tests/pending/run/macro-bundle-context-alias/Macros_1.scala deleted file mode 100644 index 354c5e0d9..000000000 --- a/tests/pending/run/macro-bundle-context-alias/Macros_1.scala +++ /dev/null @@ -1,38 +0,0 @@ -import scala.language.experimental.macros -import scala.reflect.macros.blackbox.{Context => BlackboxContext} -import scala.reflect.macros.whitebox.{Context => WhiteboxContext} - -object Module { - type BBC = BlackboxContext - type RBBC = BBC { type PrefixType = C } - type WBC = WhiteboxContext - type RWBC = WBC { type PrefixType = C } - - class BlackboxBundle(val c: BBC) { - import c.universe._ - def impl = q"${c.prefix}" - } - - class RefinedBlackboxBundle(val c: RBBC) { - import c.universe._ - def impl = reify(c.prefix.splice) - } - - class WhiteboxBundle(val c: WBC) { - import c.universe._ - def impl = q"${c.prefix}" - } - - class RefinedWhiteboxBundle(val c: RWBC) { - import c.universe._ - def impl = reify(c.prefix.splice) - } -} - -class C { - def blackbox: C = macro Module.BlackboxBundle.impl - def refinedBlackbox: C = macro Module.RefinedBlackboxBundle.impl - def whitebox: C = macro Module.WhiteboxBundle.impl - def refinedWhitebox: C = macro Module.RefinedWhiteboxBundle.impl - override def toString = "C" -} \ No newline at end of file diff --git a/tests/pending/run/macro-bundle-context-alias/Test_2.scala b/tests/pending/run/macro-bundle-context-alias/Test_2.scala deleted file mode 100644 index 6c70277de..000000000 --- a/tests/pending/run/macro-bundle-context-alias/Test_2.scala +++ /dev/null @@ -1,6 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - println(new C().blackbox) - println(new C().refinedBlackbox) - println(new C().whitebox) - println(new C().refinedWhitebox) -} \ No newline at end of file diff --git a/tests/pending/run/macro-bundle-context-refinement.check b/tests/pending/run/macro-bundle-context-refinement.check deleted file mode 100644 index 10f9ebb61..000000000 --- a/tests/pending/run/macro-bundle-context-refinement.check +++ /dev/null @@ -1,2 +0,0 @@ -C -C diff --git a/tests/pending/run/macro-bundle-context-refinement/Macros_1.scala b/tests/pending/run/macro-bundle-context-refinement/Macros_1.scala deleted file mode 100644 index d3a5d179c..000000000 --- a/tests/pending/run/macro-bundle-context-refinement/Macros_1.scala +++ /dev/null @@ -1,19 +0,0 @@ -import scala.language.experimental.macros -import scala.reflect.macros.blackbox.{Context => BlackboxContext} -import scala.reflect.macros.whitebox.{Context => WhiteboxContext} - -class BlackboxBundle(val c: BlackboxContext { type PrefixType = C }) { - import c.universe._ - def impl = reify(c.prefix.splice) -} - -class WhiteboxBundle(val c: WhiteboxContext { type PrefixType = C }) { - import c.universe._ - def impl = reify(c.prefix.splice) -} - -class C { - def blackbox: C = macro BlackboxBundle.impl - def whitebox: C = macro WhiteboxBundle.impl - override def toString = "C" -} \ No newline at end of file diff --git a/tests/pending/run/macro-bundle-context-refinement/Test_2.scala b/tests/pending/run/macro-bundle-context-refinement/Test_2.scala deleted file mode 100644 index d631b8f7e..000000000 --- a/tests/pending/run/macro-bundle-context-refinement/Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - println(new C().blackbox) - println(new C().whitebox) -} \ No newline at end of file diff --git a/tests/pending/run/macro-bundle-repl.check b/tests/pending/run/macro-bundle-repl.check deleted file mode 100644 index 75c5c2add..000000000 --- a/tests/pending/run/macro-bundle-repl.check +++ /dev/null @@ -1,24 +0,0 @@ -Type in expressions to have them evaluated. -Type :help for more information. - -scala> import scala.language.experimental.macros -import scala.language.experimental.macros - -scala> import scala.reflect.macros.blackbox.Context -import scala.reflect.macros.blackbox.Context - -scala> class Bar(val c: Context) { def impl = { import c.universe._; c.Expr[Unit](q"()") } };def bar: Unit = macro Bar.impl -defined class Bar -defined term macro bar: Unit - -scala> bar - -scala> class Foo(val c: Context) { def impl = { import c.universe._; c.Expr[Unit](q"()") } } -defined class Foo - -scala> def foo: Unit = macro Foo.impl -defined term macro foo: Unit - -scala> foo - -scala> :quit diff --git a/tests/pending/run/macro-bundle-repl.scala b/tests/pending/run/macro-bundle-repl.scala deleted file mode 100644 index 808441845..000000000 --- a/tests/pending/run/macro-bundle-repl.scala +++ /dev/null @@ -1,13 +0,0 @@ -import scala.tools.partest.ReplTest - -object Test extends ReplTest { - def code = """ -import scala.language.experimental.macros -import scala.reflect.macros.blackbox.Context -class Bar(val c: Context) { def impl = { import c.universe._; c.Expr[Unit](q"()") } };def bar: Unit = macro Bar.impl -bar -class Foo(val c: Context) { def impl = { import c.universe._; c.Expr[Unit](q"()") } } -def foo: Unit = macro Foo.impl -foo - """ -} diff --git a/tests/pending/run/macro-bundle-static.check b/tests/pending/run/macro-bundle-static.check deleted file mode 100644 index 37c8eaf27..000000000 --- a/tests/pending/run/macro-bundle-static.check +++ /dev/null @@ -1,6 +0,0 @@ -() -Int -() -true -IntInt -true diff --git a/tests/pending/run/macro-bundle-static/Impls_Macros_1.scala b/tests/pending/run/macro-bundle-static/Impls_Macros_1.scala deleted file mode 100644 index 0142e5d94..000000000 --- a/tests/pending/run/macro-bundle-static/Impls_Macros_1.scala +++ /dev/null @@ -1,30 +0,0 @@ -import scala.reflect.macros.blackbox.Context -import scala.language.experimental.macros - -object Enclosing { - class Impl(val c: Context) { - def mono = { import c.universe._; c.Expr[Unit](q"()") } - def poly[T: c.WeakTypeTag] = { import c.universe._; c.Expr[String](q"${c.weakTypeOf[T].toString}") } - def weird = macro mono - } -} - -object Macros { - def mono = macro Enclosing.Impl.mono - def poly[T] = macro Enclosing.Impl.poly[T] -} - -package pkg { - object Enclosing { - class Impl(val c: Context) { - def mono = { import c.universe._; c.Expr[Boolean](q"true") } - def poly[T: c.WeakTypeTag] = { import c.universe._; c.Expr[String](q"${c.weakTypeOf[T].toString + c.weakTypeOf[T].toString}") } - def weird = macro mono - } - } - - object Macros { - def mono = macro Enclosing.Impl.mono - def poly[T] = macro Enclosing.Impl.poly[T] - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-bundle-static/Test_2.scala b/tests/pending/run/macro-bundle-static/Test_2.scala deleted file mode 100644 index cfc1e1563..000000000 --- a/tests/pending/run/macro-bundle-static/Test_2.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - println(Macros.mono) - println(Macros.poly[Int]) - println(new Enclosing.Impl(???).weird) - println(pkg.Macros.mono) - println(pkg.Macros.poly[Int]) - println(new pkg.Enclosing.Impl(???).weird) -} \ No newline at end of file diff --git a/tests/pending/run/macro-bundle-toplevel.check b/tests/pending/run/macro-bundle-toplevel.check deleted file mode 100644 index 37c8eaf27..000000000 --- a/tests/pending/run/macro-bundle-toplevel.check +++ /dev/null @@ -1,6 +0,0 @@ -() -Int -() -true -IntInt -true diff --git a/tests/pending/run/macro-bundle-toplevel.flags b/tests/pending/run/macro-bundle-toplevel.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-bundle-toplevel.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-bundle-toplevel/Impls_Macros_1.scala b/tests/pending/run/macro-bundle-toplevel/Impls_Macros_1.scala deleted file mode 100644 index 6fd7be3b2..000000000 --- a/tests/pending/run/macro-bundle-toplevel/Impls_Macros_1.scala +++ /dev/null @@ -1,25 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -class Impl(val c: Context) { - def mono = { import c.universe._; c.Expr[Unit](q"()") } - def poly[T: c.WeakTypeTag] = { import c.universe._; c.Expr[String](q"${c.weakTypeOf[T].toString}") } - def weird = macro mono -} - -object Macros { - def mono = macro Impl.mono - def poly[T] = macro Impl.poly[T] -} - -package pkg { - class Impl(val c: Context) { - def mono = { import c.universe._; c.Expr[Boolean](q"true") } - def poly[T: c.WeakTypeTag] = { import c.universe._; c.Expr[String](q"${c.weakTypeOf[T].toString + c.weakTypeOf[T].toString}") } - def weird = macro mono - } - - object Macros { - def mono = macro Impl.mono - def poly[T] = macro Impl.poly[T] - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-bundle-toplevel/Test_2.scala b/tests/pending/run/macro-bundle-toplevel/Test_2.scala deleted file mode 100644 index 013baa348..000000000 --- a/tests/pending/run/macro-bundle-toplevel/Test_2.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - println(Macros.mono) - println(Macros.poly[Int]) - println(new Impl(???).weird) - println(pkg.Macros.mono) - println(pkg.Macros.poly[Int]) - println(new pkg.Impl(???).weird) -} \ No newline at end of file diff --git a/tests/pending/run/macro-bundle-whitebox-decl.check b/tests/pending/run/macro-bundle-whitebox-decl.check deleted file mode 100644 index 37c8eaf27..000000000 --- a/tests/pending/run/macro-bundle-whitebox-decl.check +++ /dev/null @@ -1,6 +0,0 @@ -() -Int -() -true -IntInt -true diff --git a/tests/pending/run/macro-bundle-whitebox-decl/Impls_Macros_1.scala b/tests/pending/run/macro-bundle-whitebox-decl/Impls_Macros_1.scala deleted file mode 100644 index 5e1b11895..000000000 --- a/tests/pending/run/macro-bundle-whitebox-decl/Impls_Macros_1.scala +++ /dev/null @@ -1,26 +0,0 @@ -import scala.language.experimental.macros -import scala.reflect.macros.whitebox.Context - -class Impl(val c: Context) { - def mono = { import c.universe._; c.Expr[Unit](q"()") } - def poly[T: c.WeakTypeTag] = { import c.universe._; c.Expr[String](q"${c.weakTypeOf[T].toString}") } - def weird = macro mono -} - -object Macros { - def mono = macro Impl.mono - def poly[T] = macro Impl.poly[T] -} - -package pkg { - class Impl(val c: Context) { - def mono = { import c.universe._; c.Expr[Boolean](q"true") } - def poly[T: c.WeakTypeTag] = { import c.universe._; c.Expr[String](q"${c.weakTypeOf[T].toString + c.weakTypeOf[T].toString}") } - def weird = macro mono - } - - object Macros { - def mono = macro Impl.mono - def poly[T] = macro Impl.poly[T] - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-bundle-whitebox-decl/Test_2.scala b/tests/pending/run/macro-bundle-whitebox-decl/Test_2.scala deleted file mode 100644 index 013baa348..000000000 --- a/tests/pending/run/macro-bundle-whitebox-decl/Test_2.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - println(Macros.mono) - println(Macros.poly[Int]) - println(new Impl(???).weird) - println(pkg.Macros.mono) - println(pkg.Macros.poly[Int]) - println(new pkg.Impl(???).weird) -} \ No newline at end of file diff --git a/tests/pending/run/macro-bundle-whitebox-use-raw.check b/tests/pending/run/macro-bundle-whitebox-use-raw.check deleted file mode 100644 index 5679c5fab..000000000 --- a/tests/pending/run/macro-bundle-whitebox-use-raw.check +++ /dev/null @@ -1,5 +0,0 @@ -2 -(23,foo,true) -null -C2 -42 diff --git a/tests/pending/run/macro-bundle-whitebox-use-raw/Macros_1.scala b/tests/pending/run/macro-bundle-whitebox-use-raw/Macros_1.scala deleted file mode 100644 index de1863418..000000000 --- a/tests/pending/run/macro-bundle-whitebox-use-raw/Macros_1.scala +++ /dev/null @@ -1,108 +0,0 @@ -import scala.reflect.macros.whitebox.Context -import scala.language.experimental.macros - -// whitebox use case #1: return type refinement - -class ReturnTypeRefinementBundle(val c: Context) { - import c.universe._ - def impl = { - q""" - trait Foo { - def x = 2 - } - new Foo {} - """ - } -} - -object ReturnTypeRefinement { - def foo: Any = macro ReturnTypeRefinementBundle.impl -} - -// whitebox use case #2: fundep materialization - -trait FundepMaterialization[T, U] { - def to(t : T) : U - // def from(u : U) : T -} - -class FundepMaterializationBundle(val c: Context) { - import c.universe._ - import definitions._ - import Flag._ - - def impl[T: c.WeakTypeTag, U: c.WeakTypeTag]: c.Expr[FundepMaterialization[T, U]] = { - val sym = c.weakTypeOf[T].typeSymbol - if (!sym.isClass || !sym.asClass.isCaseClass) c.abort(c.enclosingPosition, s"$sym is not a case class") - val fields = sym.info.decls.toList.collect{ case x: TermSymbol if x.isVal && x.isCaseAccessor => x } - - def mkTpt() = { - val core = Ident(TupleClass(fields.length) orElse UnitClass) - if (fields.length == 0) core - else AppliedTypeTree(core, fields map (f => TypeTree(f.info))) - } - - def mkFrom() = { - if (fields.length == 0) Literal(Constant(Unit)) - else Apply(Ident(newTermName("Tuple" + fields.length)), fields map (f => Select(Ident(newTermName("f")), newTermName(f.name.toString.trim)))) - } - - val evidenceClass = ClassDef(Modifiers(FINAL), newTypeName("$anon"), List(), Template( - List(AppliedTypeTree(Ident(newTypeName("FundepMaterialization")), List(Ident(sym), mkTpt()))), - emptyValDef, - List( - DefDef(Modifiers(), termNames.CONSTRUCTOR, List(), List(List()), TypeTree(), Block(List(Apply(Select(Super(This(typeNames.EMPTY), typeNames.EMPTY), termNames.CONSTRUCTOR), List())), Literal(Constant(())))), - DefDef(Modifiers(), newTermName("to"), List(), List(List(ValDef(Modifiers(PARAM), newTermName("f"), Ident(sym), EmptyTree))), TypeTree(), mkFrom())))) - c.Expr[FundepMaterialization[T, U]](Block(List(evidenceClass), Apply(Select(New(Ident(newTypeName("$anon"))), termNames.CONSTRUCTOR), List()))) - } -} - -object FundepMaterialization { - implicit def materializeIso[T, U]: FundepMaterialization[T, U] = macro FundepMaterializationBundle.impl[T, U] -} - -// whitebox use case #3: dynamic materialization - -trait DynamicMaterialization[T] - -class C1(val x: Int) -class C2(val x: String) - -trait LowPriority { - implicit def lessSpecific[T]: DynamicMaterialization[T] = null -} - -object DynamicMaterialization extends LowPriority { - implicit def moreSpecific[T]: DynamicMaterialization[T] = macro DynamicMaterializationBundle.impl[T] -} - -class DynamicMaterializationBundle(val c: Context) { - import c.universe._ - def impl[T: c.WeakTypeTag] = { - val tpe = weakTypeOf[T] - if (tpe.members.exists(_.info =:= typeOf[Int])) - c.abort(c.enclosingPosition, "I don't like classes that contain integers") - q"new DynamicMaterialization[$tpe]{ override def toString = ${tpe.toString} }" - } -} - -// whitebox use case #4: extractor macros - -object ExtractorMacro { - def unapply(x: Int): Any = macro ExtractorBundle.unapplyImpl -} - -class ExtractorBundle(val c: Context) { - import c.universe._ - def unapplyImpl(x: Tree) = { - q""" - new { - class Match(x: Int) { - def isEmpty = false - def get = x - } - def unapply(x: Int) = new Match(x) - }.unapply($x) - """ - } -} diff --git a/tests/pending/run/macro-bundle-whitebox-use-raw/Test_2.scala b/tests/pending/run/macro-bundle-whitebox-use-raw/Test_2.scala deleted file mode 100644 index b28ebfd71..000000000 --- a/tests/pending/run/macro-bundle-whitebox-use-raw/Test_2.scala +++ /dev/null @@ -1,19 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - println(ReturnTypeRefinement.foo.x) - - case class Foo(i: Int, s: String, b: Boolean) - def foo[C, L](c: C)(implicit iso: FundepMaterialization[C, L]): L = iso.to(c) - locally { - val equiv = foo(Foo(23, "foo", true)) - def typed[T](t: => T) {} - typed[(Int, String, Boolean)](equiv) - println(equiv) - } - - println(implicitly[DynamicMaterialization[C1]]) - println(implicitly[DynamicMaterialization[C2]]) - - 42 match { - case ExtractorMacro(x) => println(x) - } -} diff --git a/tests/pending/run/macro-bundle-whitebox-use-refined.check b/tests/pending/run/macro-bundle-whitebox-use-refined.check deleted file mode 100644 index 5679c5fab..000000000 --- a/tests/pending/run/macro-bundle-whitebox-use-refined.check +++ /dev/null @@ -1,5 +0,0 @@ -2 -(23,foo,true) -null -C2 -42 diff --git a/tests/pending/run/macro-bundle-whitebox-use-refined/Macros_1.scala b/tests/pending/run/macro-bundle-whitebox-use-refined/Macros_1.scala deleted file mode 100644 index de1863418..000000000 --- a/tests/pending/run/macro-bundle-whitebox-use-refined/Macros_1.scala +++ /dev/null @@ -1,108 +0,0 @@ -import scala.reflect.macros.whitebox.Context -import scala.language.experimental.macros - -// whitebox use case #1: return type refinement - -class ReturnTypeRefinementBundle(val c: Context) { - import c.universe._ - def impl = { - q""" - trait Foo { - def x = 2 - } - new Foo {} - """ - } -} - -object ReturnTypeRefinement { - def foo: Any = macro ReturnTypeRefinementBundle.impl -} - -// whitebox use case #2: fundep materialization - -trait FundepMaterialization[T, U] { - def to(t : T) : U - // def from(u : U) : T -} - -class FundepMaterializationBundle(val c: Context) { - import c.universe._ - import definitions._ - import Flag._ - - def impl[T: c.WeakTypeTag, U: c.WeakTypeTag]: c.Expr[FundepMaterialization[T, U]] = { - val sym = c.weakTypeOf[T].typeSymbol - if (!sym.isClass || !sym.asClass.isCaseClass) c.abort(c.enclosingPosition, s"$sym is not a case class") - val fields = sym.info.decls.toList.collect{ case x: TermSymbol if x.isVal && x.isCaseAccessor => x } - - def mkTpt() = { - val core = Ident(TupleClass(fields.length) orElse UnitClass) - if (fields.length == 0) core - else AppliedTypeTree(core, fields map (f => TypeTree(f.info))) - } - - def mkFrom() = { - if (fields.length == 0) Literal(Constant(Unit)) - else Apply(Ident(newTermName("Tuple" + fields.length)), fields map (f => Select(Ident(newTermName("f")), newTermName(f.name.toString.trim)))) - } - - val evidenceClass = ClassDef(Modifiers(FINAL), newTypeName("$anon"), List(), Template( - List(AppliedTypeTree(Ident(newTypeName("FundepMaterialization")), List(Ident(sym), mkTpt()))), - emptyValDef, - List( - DefDef(Modifiers(), termNames.CONSTRUCTOR, List(), List(List()), TypeTree(), Block(List(Apply(Select(Super(This(typeNames.EMPTY), typeNames.EMPTY), termNames.CONSTRUCTOR), List())), Literal(Constant(())))), - DefDef(Modifiers(), newTermName("to"), List(), List(List(ValDef(Modifiers(PARAM), newTermName("f"), Ident(sym), EmptyTree))), TypeTree(), mkFrom())))) - c.Expr[FundepMaterialization[T, U]](Block(List(evidenceClass), Apply(Select(New(Ident(newTypeName("$anon"))), termNames.CONSTRUCTOR), List()))) - } -} - -object FundepMaterialization { - implicit def materializeIso[T, U]: FundepMaterialization[T, U] = macro FundepMaterializationBundle.impl[T, U] -} - -// whitebox use case #3: dynamic materialization - -trait DynamicMaterialization[T] - -class C1(val x: Int) -class C2(val x: String) - -trait LowPriority { - implicit def lessSpecific[T]: DynamicMaterialization[T] = null -} - -object DynamicMaterialization extends LowPriority { - implicit def moreSpecific[T]: DynamicMaterialization[T] = macro DynamicMaterializationBundle.impl[T] -} - -class DynamicMaterializationBundle(val c: Context) { - import c.universe._ - def impl[T: c.WeakTypeTag] = { - val tpe = weakTypeOf[T] - if (tpe.members.exists(_.info =:= typeOf[Int])) - c.abort(c.enclosingPosition, "I don't like classes that contain integers") - q"new DynamicMaterialization[$tpe]{ override def toString = ${tpe.toString} }" - } -} - -// whitebox use case #4: extractor macros - -object ExtractorMacro { - def unapply(x: Int): Any = macro ExtractorBundle.unapplyImpl -} - -class ExtractorBundle(val c: Context) { - import c.universe._ - def unapplyImpl(x: Tree) = { - q""" - new { - class Match(x: Int) { - def isEmpty = false - def get = x - } - def unapply(x: Int) = new Match(x) - }.unapply($x) - """ - } -} diff --git a/tests/pending/run/macro-bundle-whitebox-use-refined/Test_2.scala b/tests/pending/run/macro-bundle-whitebox-use-refined/Test_2.scala deleted file mode 100644 index b28ebfd71..000000000 --- a/tests/pending/run/macro-bundle-whitebox-use-refined/Test_2.scala +++ /dev/null @@ -1,19 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - println(ReturnTypeRefinement.foo.x) - - case class Foo(i: Int, s: String, b: Boolean) - def foo[C, L](c: C)(implicit iso: FundepMaterialization[C, L]): L = iso.to(c) - locally { - val equiv = foo(Foo(23, "foo", true)) - def typed[T](t: => T) {} - typed[(Int, String, Boolean)](equiv) - println(equiv) - } - - println(implicitly[DynamicMaterialization[C1]]) - println(implicitly[DynamicMaterialization[C2]]) - - 42 match { - case ExtractorMacro(x) => println(x) - } -} diff --git a/tests/pending/run/macro-def-path-dependent.check b/tests/pending/run/macro-def-path-dependent.check deleted file mode 100644 index 7658ad2c2..000000000 --- a/tests/pending/run/macro-def-path-dependent.check +++ /dev/null @@ -1 +0,0 @@ -it works diff --git a/tests/pending/run/macro-def-path-dependent.flags b/tests/pending/run/macro-def-path-dependent.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-def-path-dependent.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-def-path-dependent/Dummy.scala b/tests/pending/run/macro-def-path-dependent/Dummy.scala deleted file mode 100644 index 2ccaa3940..000000000 --- a/tests/pending/run/macro-def-path-dependent/Dummy.scala +++ /dev/null @@ -1,3 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - println("it works") -} \ No newline at end of file diff --git a/tests/pending/run/macro-def-path-dependent/Test_1.scala b/tests/pending/run/macro-def-path-dependent/Test_1.scala deleted file mode 100644 index 4161a6430..000000000 --- a/tests/pending/run/macro-def-path-dependent/Test_1.scala +++ /dev/null @@ -1,25 +0,0 @@ -// NOTE: blocked by SI-8049 - -// package test1 -// -// import scala.reflect.macros.blackbox.Context -// -// trait Exprs { -// self: Universe => -// -// class Expr[T] -// } -// -// trait Reifiers { -// self: Universe => -// -// type Expr[T] -// -// def reify[T](expr: T): Expr[T] = macro Impls.reify[T] -// } -// -// trait Universe extends Exprs with Reifiers -// -// object Impls { -// def reify[T](cc: Context{ type PrefixType = Reifiers })(expr: cc.Expr[T]): cc.Expr[cc.prefix.value.Expr[T]] = ??? -// } diff --git a/tests/pending/run/macro-def-path-dependent/Test_2.scala b/tests/pending/run/macro-def-path-dependent/Test_2.scala deleted file mode 100644 index 75a03b54e..000000000 --- a/tests/pending/run/macro-def-path-dependent/Test_2.scala +++ /dev/null @@ -1,22 +0,0 @@ -package test2 - -import scala.reflect.macros.blackbox.Context - -trait Exprs { - self: Universe => - - class Expr[T] -} - -trait Reifiers { - self: Universe => - -} - -trait Universe extends Exprs with Reifiers { - def reify[T](expr: T): Expr[T] = macro Impls.reify[T] -} - -object Impls { - def reify[T](cc: Context{ type PrefixType = Universe })(expr: cc.Expr[T]): cc.Expr[cc.prefix.value.Expr[T]] = ??? -} diff --git a/tests/pending/run/macro-def-path-dependent/Test_3.scala b/tests/pending/run/macro-def-path-dependent/Test_3.scala deleted file mode 100644 index 1a5da8200..000000000 --- a/tests/pending/run/macro-def-path-dependent/Test_3.scala +++ /dev/null @@ -1,22 +0,0 @@ -package test3 - -import scala.reflect.macros.blackbox.Context - -trait Exprs { - self: Universe => - - class Expr[T] -} - -trait Reifiers { - self: Universe => - -} - -trait Universe extends Exprs with Reifiers { - def reify[T](expr: T): Expr[T] = macro Impls.reify[T] -} - -object Impls { - def reify[T](cc: Context{ type PrefixType = Universe })(expr: cc.Expr[T]): cc.Expr[cc.prefix.value.Expr[T]] = ??? -} diff --git a/tests/pending/run/macro-def-path-dependent/Test_4.scala b/tests/pending/run/macro-def-path-dependent/Test_4.scala deleted file mode 100644 index 67cb88ee6..000000000 --- a/tests/pending/run/macro-def-path-dependent/Test_4.scala +++ /dev/null @@ -1,11 +0,0 @@ -package test4 - -import scala.reflect.runtime.universe._ -import scala.reflect.macros.blackbox.Context -import scala.reflect.api.Universe - -object Test { - def materializeTypeTag[T](u: Universe)(e: T): u.TypeTag[T] = macro materializeTypeTag_impl[T] - - def materializeTypeTag_impl[T: c.WeakTypeTag](c: Context)(u: c.Expr[Universe])(e: c.Expr[T]): c.Expr[u.value.TypeTag[T]] = ??? -} \ No newline at end of file diff --git a/tests/pending/run/macro-def-path-dependent/Test_5.scala b/tests/pending/run/macro-def-path-dependent/Test_5.scala deleted file mode 100644 index b518ce864..000000000 --- a/tests/pending/run/macro-def-path-dependent/Test_5.scala +++ /dev/null @@ -1,9 +0,0 @@ -package test56 - -import scala.reflect.runtime.universe._ -import scala.reflect.macros.blackbox.Context -import scala.reflect.api.Universe - -object Impls { - def materializeTypeTag_impl[T: c.WeakTypeTag](c: Context)(u: c.Expr[Universe])(e: c.Expr[T]): c.Expr[u.value.TypeTag[T]] = ??? -} \ No newline at end of file diff --git a/tests/pending/run/macro-def-path-dependent/Test_6.scala b/tests/pending/run/macro-def-path-dependent/Test_6.scala deleted file mode 100644 index a8b50ce7d..000000000 --- a/tests/pending/run/macro-def-path-dependent/Test_6.scala +++ /dev/null @@ -1,9 +0,0 @@ -package test56 - -import scala.reflect.runtime.universe._ -import scala.reflect.macros.blackbox.Context -import scala.reflect.api.Universe - -object Macros { - def materializeTypeTag[T](u: Universe)(e: T): u.TypeTag[T] = macro Impls.materializeTypeTag_impl[T] -} \ No newline at end of file diff --git a/tests/pending/run/macro-default-params.check b/tests/pending/run/macro-default-params.check deleted file mode 100644 index 573541ac9..000000000 --- a/tests/pending/run/macro-default-params.check +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/tests/pending/run/macro-default-params/Macros_1.scala b/tests/pending/run/macro-default-params/Macros_1.scala deleted file mode 100644 index 74588a1cf..000000000 --- a/tests/pending/run/macro-default-params/Macros_1.scala +++ /dev/null @@ -1,27 +0,0 @@ -import scala.language.experimental.macros -import scala.reflect.macros.whitebox.Context - -object Macros { - def id[A]: A = null.asInstanceOf[A] - - def foo: Any = macro impl - def impl(c: Context): c.Tree = { - import c.universe._ - import Flag._ - - lazy val tpe = TypeTree(typeOf[Int]) - - /* If we used this line instead, it would work! */ - // lazy val tpe = tq"Int" - - lazy val param: ValDef = { - val p1 = q"val a: ${tpe.duplicate} = Macros.id[${tpe.duplicate}]" - ValDef(Modifiers(DEFAULTPARAM), p1.name, p1.tpt, p1.rhs) - } - - q""" - class C { def f($param) = a } - println(new C().f()) - """ - } -} diff --git a/tests/pending/run/macro-default-params/Test_2.scala b/tests/pending/run/macro-default-params/Test_2.scala deleted file mode 100644 index d75fbd0db..000000000 --- a/tests/pending/run/macro-default-params/Test_2.scala +++ /dev/null @@ -1,3 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - Macros.foo -} diff --git a/tests/pending/run/macro-divergence-spurious.check b/tests/pending/run/macro-divergence-spurious.check deleted file mode 100644 index 19765bd50..000000000 --- a/tests/pending/run/macro-divergence-spurious.check +++ /dev/null @@ -1 +0,0 @@ -null diff --git a/tests/pending/run/macro-divergence-spurious/Impls_Macros_1.scala b/tests/pending/run/macro-divergence-spurious/Impls_Macros_1.scala deleted file mode 100644 index 7ac8fccc3..000000000 --- a/tests/pending/run/macro-divergence-spurious/Impls_Macros_1.scala +++ /dev/null @@ -1,23 +0,0 @@ -import scala.reflect.macros.blackbox.Context -import language.experimental.macros - -trait Complex[T] - -class Foo(val bar: Bar) -class Bar(val s: String) - -object Complex { - def impl[T: c.WeakTypeTag](c: Context): c.Expr[Complex[T]] = { - import c.universe._ - val tpe = weakTypeOf[T] - for (f <- tpe.decls.collect{case f: TermSymbol if f.isParamAccessor && !f.isMethod => f}) { - val trecur = appliedType(typeOf[Complex[_]], List(f.info)) - val recur = c.inferImplicitValue(trecur, silent = true) - if (recur == EmptyTree) c.abort(c.enclosingPosition, s"couldn't synthesize $trecur") - } - c.Expr[Null](Literal(Constant(null))) - } - - implicit object ComplexString extends Complex[String] - implicit def genComplex[T]: Complex[T] = macro impl[T] -} diff --git a/tests/pending/run/macro-divergence-spurious/Test_2.scala b/tests/pending/run/macro-divergence-spurious/Test_2.scala deleted file mode 100644 index 0a9820701..000000000 --- a/tests/pending/run/macro-divergence-spurious/Test_2.scala +++ /dev/null @@ -1,3 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - println(implicitly[Complex[Foo]]) -} \ No newline at end of file diff --git a/tests/pending/run/macro-duplicate.check b/tests/pending/run/macro-duplicate.check deleted file mode 100644 index 58781b719..000000000 --- a/tests/pending/run/macro-duplicate.check +++ /dev/null @@ -1,3 +0,0 @@ -Test_2.scala:5: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses - Macros.foo - ^ diff --git a/tests/pending/run/macro-duplicate.flags b/tests/pending/run/macro-duplicate.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-duplicate.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-duplicate/Impls_Macros_1.scala b/tests/pending/run/macro-duplicate/Impls_Macros_1.scala deleted file mode 100644 index 84fb2c5b6..000000000 --- a/tests/pending/run/macro-duplicate/Impls_Macros_1.scala +++ /dev/null @@ -1,29 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Macros { - def impl(c: Context) = { - import c.universe._ - val Expr(Block((cdef: ClassDef) :: Nil, _)) = reify { class C { def x = 2 } } - val cdef1 = - new Transformer { - override def transform(tree: Tree): Tree = tree match { - case Template(_, _, ctor :: defs) => - val defs1 = defs collect { - case ddef @ DefDef(mods, name, tparams, vparamss, tpt, body) => - val future = Select(Select(Ident(TermName("scala")), TermName("concurrent")), TermName("Future")) - val Future = Select(Select(Ident(TermName("scala")), TermName("concurrent")), TypeName("Future")) - val tpt1 = if (tpt.isEmpty) tpt else AppliedTypeTree(Future, List(tpt)) - val body1 = Apply(future, List(body)) - val name1 = TermName("async" + name.toString.capitalize) - DefDef(mods, name1, tparams, vparamss, tpt1, body1) - } - Template(Nil, emptyValDef, ctor +: defs ::: defs1) - case _ => - super.transform(tree) - } - } transform cdef - c.Expr[Unit](Block(cdef1 :: Nil, Literal(Constant(())))) - } - - def foo = macro impl -} diff --git a/tests/pending/run/macro-duplicate/Test_2.scala b/tests/pending/run/macro-duplicate/Test_2.scala deleted file mode 100644 index 8706883b4..000000000 --- a/tests/pending/run/macro-duplicate/Test_2.scala +++ /dev/null @@ -1,6 +0,0 @@ -import scala.concurrent._ -import ExecutionContext.Implicits.global - -object Test extends dotty.runtime.LegacyApp { - Macros.foo -} \ No newline at end of file diff --git a/tests/pending/run/macro-enclosingowner-detectvar.check b/tests/pending/run/macro-enclosingowner-detectvar.check deleted file mode 100644 index c8f86ec73..000000000 --- a/tests/pending/run/macro-enclosingowner-detectvar.check +++ /dev/null @@ -1,16 +0,0 @@ -(true,false,false,false) -(true,false,false,false) -(true,false,false,false) -(true,false,false,false) -(false,true,false,false) -(false,true,false,false) -(false,true,false,false) -(false,true,false,false) -(false,false,true,false) -(false,false,true,false) -(false,false,true,false) -(false,false,true,false) -(false,false,false,true) -(false,false,false,true) -(false,false,false,true) -(false,false,false,true) diff --git a/tests/pending/run/macro-enclosingowner-detectvar/Macros_1.scala b/tests/pending/run/macro-enclosingowner-detectvar/Macros_1.scala deleted file mode 100644 index 26ed64d8c..000000000 --- a/tests/pending/run/macro-enclosingowner-detectvar/Macros_1.scala +++ /dev/null @@ -1,14 +0,0 @@ -import scala.reflect.macros.whitebox._ -import scala.language.experimental.macros - -object Macros { - def impl(c: Context) = { - import c.universe._ - def detectFlags(sym: TermSymbol): String = { - (sym.isVal, sym.isVar, !sym.isVal && !sym.isVar && !sym.isLazy, sym.isLazy).toString - } - q"println(${detectFlags(c.internal.enclosingOwner.asTerm)}); 42" - } - - def foo: Int = macro impl -} \ No newline at end of file diff --git a/tests/pending/run/macro-enclosingowner-detectvar/Test_2.scala b/tests/pending/run/macro-enclosingowner-detectvar/Test_2.scala deleted file mode 100644 index edc0eb654..000000000 --- a/tests/pending/run/macro-enclosingowner-detectvar/Test_2.scala +++ /dev/null @@ -1,23 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - val a1 = Macros.foo - val a2 = Predef.identity(Predef.identity(Macros.foo)) - val a3: Int = Macros.foo - val a4: Int = Predef.identity(Predef.identity(Macros.foo)) - - var b1 = Macros.foo - var b2 = Predef.identity(Predef.identity(Macros.foo)) - var b3: Int = Macros.foo - var b4: Int = Predef.identity(Predef.identity(Macros.foo)) - - def c1 = Macros.foo - def c2 = Predef.identity(Predef.identity(Macros.foo)) - def c3: Int = Macros.foo - def c4: Int = Predef.identity(Predef.identity(Macros.foo)) - c1; c2; c3; c4; - - lazy val d1 = Macros.foo - lazy val d2 = Predef.identity(Predef.identity(Macros.foo)) - lazy val d3: Int = Macros.foo - lazy val d4: Int = Predef.identity(Predef.identity(Macros.foo)) - d1; d2; d3; d4 -} \ No newline at end of file diff --git a/tests/pending/run/macro-enclosingowner-sbt.check b/tests/pending/run/macro-enclosingowner-sbt.check deleted file mode 100644 index 3c95698e9..000000000 --- a/tests/pending/run/macro-enclosingowner-sbt.check +++ /dev/null @@ -1,16 +0,0 @@ -a1 -a2 -a3 -a4 -b1 -b2 -b3 -b4 -c1 -c2 -c3 -c4 -d1 -d2 -d3 -d4 diff --git a/tests/pending/run/macro-enclosingowner-sbt/Macros_1.scala b/tests/pending/run/macro-enclosingowner-sbt/Macros_1.scala deleted file mode 100644 index a98a98486..000000000 --- a/tests/pending/run/macro-enclosingowner-sbt/Macros_1.scala +++ /dev/null @@ -1,14 +0,0 @@ -import scala.reflect.macros.whitebox._ -import scala.language.experimental.macros - -object Macros { - def impl(c: Context) = { - import c.universe._ - def enclosingName(sym: Symbol): String = { - sym.name.toString.stripSuffix(termNames.LOCAL_SUFFIX_STRING) - } - q"println(${enclosingName(c.internal.enclosingOwner).toString}); 42" - } - - def foo: Int = macro impl -} \ No newline at end of file diff --git a/tests/pending/run/macro-enclosingowner-sbt/Test_2.scala b/tests/pending/run/macro-enclosingowner-sbt/Test_2.scala deleted file mode 100644 index edc0eb654..000000000 --- a/tests/pending/run/macro-enclosingowner-sbt/Test_2.scala +++ /dev/null @@ -1,23 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - val a1 = Macros.foo - val a2 = Predef.identity(Predef.identity(Macros.foo)) - val a3: Int = Macros.foo - val a4: Int = Predef.identity(Predef.identity(Macros.foo)) - - var b1 = Macros.foo - var b2 = Predef.identity(Predef.identity(Macros.foo)) - var b3: Int = Macros.foo - var b4: Int = Predef.identity(Predef.identity(Macros.foo)) - - def c1 = Macros.foo - def c2 = Predef.identity(Predef.identity(Macros.foo)) - def c3: Int = Macros.foo - def c4: Int = Predef.identity(Predef.identity(Macros.foo)) - c1; c2; c3; c4; - - lazy val d1 = Macros.foo - lazy val d2 = Predef.identity(Predef.identity(Macros.foo)) - lazy val d3: Int = Macros.foo - lazy val d4: Int = Predef.identity(Predef.identity(Macros.foo)) - d1; d2; d3; d4 -} \ No newline at end of file diff --git a/tests/pending/run/macro-enclosures.check b/tests/pending/run/macro-enclosures.check deleted file mode 100644 index b6fe7a4a9..000000000 --- a/tests/pending/run/macro-enclosures.check +++ /dev/null @@ -1,34 +0,0 @@ -enclosingPackage = package test { - object Test extends scala.AnyRef { - def () = { - super.(); - () - }; - def test = Macros.foo - } -} -enclosingClass = object Test extends scala.AnyRef { - def () = { - super.(); - () - }; - def test = Macros.foo -} -enclosingImpl = object Test extends scala.AnyRef { - def () = { - super.(); - () - }; - def test = Macros.foo -} -enclosingTemplate = scala.AnyRef { - def () = { - super.(); - () - }; - def test = Macros.foo -} -enclosingMethod = def test = Macros.foo -enclosingDef = def test = Macros.foo -enclosingOwner = method test -enclosingOwnerChain = List(method test, object Test, package test, package ) diff --git a/tests/pending/run/macro-enclosures.flags b/tests/pending/run/macro-enclosures.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-enclosures.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-enclosures/Impls_Macros_1.scala b/tests/pending/run/macro-enclosures/Impls_Macros_1.scala deleted file mode 100644 index 564cdfa68..000000000 --- a/tests/pending/run/macro-enclosures/Impls_Macros_1.scala +++ /dev/null @@ -1,23 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Macros { - def impl(c: Context) = { - import c.universe._ - def chain(sym: Symbol): List[Symbol] = sym.owner match { - case NoSymbol => sym :: Nil - case owner => sym :: chain(owner) - } - q""" - println("enclosingPackage = " + ${c.enclosingPackage.toString}) - println("enclosingClass = " + ${c.enclosingClass.toString}) - println("enclosingImpl = " + ${c.enclosingImpl.toString}) - println("enclosingTemplate = " + ${c.enclosingTemplate.toString}) - println("enclosingMethod = " + ${c.enclosingMethod.toString}) - println("enclosingDef = " + ${c.enclosingDef.toString}) - println("enclosingOwner = " + ${c.internal.enclosingOwner.toString}) - println("enclosingOwnerChain = " + ${chain(c.internal.enclosingOwner).toString}) - """ - } - - def foo: Any = macro impl -} \ No newline at end of file diff --git a/tests/pending/run/macro-enclosures/Test_2.scala b/tests/pending/run/macro-enclosures/Test_2.scala deleted file mode 100644 index 8b8dc10cd..000000000 --- a/tests/pending/run/macro-enclosures/Test_2.scala +++ /dev/null @@ -1,11 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - test.Test.test -} - -package test { - object Test { - def test = { - Macros.foo - } - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-implicit-argument.check b/tests/pending/run/macro-expand-implicit-argument.check deleted file mode 100644 index 15a62794a..000000000 --- a/tests/pending/run/macro-expand-implicit-argument.check +++ /dev/null @@ -1 +0,0 @@ -List(1, 2, 3) diff --git a/tests/pending/run/macro-expand-implicit-argument.flags b/tests/pending/run/macro-expand-implicit-argument.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-expand-implicit-argument.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-implicit-argument/Macros_1.scala b/tests/pending/run/macro-expand-implicit-argument/Macros_1.scala deleted file mode 100644 index 465f313ef..000000000 --- a/tests/pending/run/macro-expand-implicit-argument/Macros_1.scala +++ /dev/null @@ -1,59 +0,0 @@ -import annotation.tailrec -import scala.math.{min, max} -import scala.{specialized => spec} - -import language.experimental.macros - -import scala.reflect.ClassTag -import scala.reflect.macros.blackbox.Context - -object Macros { - def alloc[@spec A:ClassTag](src:Array[A], s1:Int, len:Int) = { - val as = Array.ofDim[A](len) - System.arraycopy(src, s1, as, 0, len) - as - } - - /** - * Efficient alternative to Array.apply. - * - * "As seen on scala-internals!" - */ - def array[A](as:A*)(implicit ct: ClassTag[A]) = macro arrayMacro[A] - - /** - * Takes in something like: - * ArrayUtil.alloc[Int](11, 22, 33, 44)(ct) - * - * and builds a tree like: - * { - * val arr:Array[Int] = ct.newArray(4) - * arr.update(0, 11) - * arr.update(1, 22) - * arr.update(2, 33) - * arr.update(3, 44) - * arr - * } - */ - def arrayMacro[A:c.WeakTypeTag](c:Context)(as:c.Expr[A]*)(ct: c.Expr[ClassTag[A]]): c.Expr[Array[A]] = { - import c.mirror._ - import c.universe._ - def const(x:Int) = Literal(Constant(x)) - - val n = as.length - val arr = TermName("arr") - - val create = Apply(Select(ct.tree, TermName("newArray")), List(const(n))) - val arrtpe = TypeTree(implicitly[c.WeakTypeTag[Array[A]]].tpe) - val valdef = ValDef(Modifiers(), arr, arrtpe, create) - - val updates = (0 until n).map { - i => Apply(Select(Ident(arr), TermName("update")), List(const(i), as(i).tree)) - } - - val exprs = (Seq(valdef) ++ updates ++ Seq(Ident(arr))).toList - val block = Block(exprs.init, exprs.last) - - c.Expr[Array[A]](block) - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-implicit-argument/Test_2.scala b/tests/pending/run/macro-expand-implicit-argument/Test_2.scala deleted file mode 100644 index edb1de413..000000000 --- a/tests/pending/run/macro-expand-implicit-argument/Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - import Macros._ - println(array(1, 2, 3).toList) -} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-implicit-macro-has-implicit.check b/tests/pending/run/macro-expand-implicit-macro-has-implicit.check deleted file mode 100644 index d81cc0710..000000000 --- a/tests/pending/run/macro-expand-implicit-macro-has-implicit.check +++ /dev/null @@ -1 +0,0 @@ -42 diff --git a/tests/pending/run/macro-expand-implicit-macro-has-implicit.flags b/tests/pending/run/macro-expand-implicit-macro-has-implicit.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-expand-implicit-macro-has-implicit.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-implicit-macro-has-implicit/Impls_1.scala b/tests/pending/run/macro-expand-implicit-macro-has-implicit/Impls_1.scala deleted file mode 100644 index 18c97956e..000000000 --- a/tests/pending/run/macro-expand-implicit-macro-has-implicit/Impls_1.scala +++ /dev/null @@ -1,9 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo(c: Context)(x: c.Expr[Int]) = { - import c.universe._ - val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(x.tree)) - c.Expr[Unit](body) - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-implicit-macro-has-implicit/Macros_Test_2.scala b/tests/pending/run/macro-expand-implicit-macro-has-implicit/Macros_Test_2.scala deleted file mode 100644 index 2f5648758..000000000 --- a/tests/pending/run/macro-expand-implicit-macro-has-implicit/Macros_Test_2.scala +++ /dev/null @@ -1,5 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - implicit val x = 42 - def foo(implicit x: Int): Unit = macro Impls.foo - foo -} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-implicit-macro-is-implicit.check b/tests/pending/run/macro-expand-implicit-macro-is-implicit.check deleted file mode 100644 index c205945d0..000000000 --- a/tests/pending/run/macro-expand-implicit-macro-is-implicit.check +++ /dev/null @@ -1,2 +0,0 @@ -Some(2) -2 diff --git a/tests/pending/run/macro-expand-implicit-macro-is-implicit.flags b/tests/pending/run/macro-expand-implicit-macro-is-implicit.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-expand-implicit-macro-is-implicit.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-implicit-macro-is-implicit/Impls_1.scala b/tests/pending/run/macro-expand-implicit-macro-is-implicit/Impls_1.scala deleted file mode 100644 index aeceee5a5..000000000 --- a/tests/pending/run/macro-expand-implicit-macro-is-implicit/Impls_1.scala +++ /dev/null @@ -1,9 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo(c: Context)(x: c.Expr[String]): c.Expr[Option[Int]] = { - import c.universe._ - val body = Apply(Ident(definitions.SomeModule), List(Select(x.tree, TermName("toInt")))) - c.Expr[Option[Int]](body) - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-implicit-macro-is-implicit/Macros_Test_2.scala b/tests/pending/run/macro-expand-implicit-macro-is-implicit/Macros_Test_2.scala deleted file mode 100644 index 8f0fbe60e..000000000 --- a/tests/pending/run/macro-expand-implicit-macro-is-implicit/Macros_Test_2.scala +++ /dev/null @@ -1,11 +0,0 @@ -object Macros { - import scala.language.implicitConversions - implicit def foo(x: String): Option[Int] = macro Impls.foo -} - -object Test extends dotty.runtime.LegacyApp { - import Macros._ - println("2": Option[Int]) - val s: Int = "2" getOrElse 0 - println(s) -} diff --git a/tests/pending/run/macro-expand-implicit-macro-is-val.check b/tests/pending/run/macro-expand-implicit-macro-is-val.check deleted file mode 100644 index 0cfbf0888..000000000 --- a/tests/pending/run/macro-expand-implicit-macro-is-val.check +++ /dev/null @@ -1 +0,0 @@ -2 diff --git a/tests/pending/run/macro-expand-implicit-macro-is-val.flags b/tests/pending/run/macro-expand-implicit-macro-is-val.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-expand-implicit-macro-is-val.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-implicit-macro-is-val/Impls_1.scala b/tests/pending/run/macro-expand-implicit-macro-is-val/Impls_1.scala deleted file mode 100644 index fd267d32c..000000000 --- a/tests/pending/run/macro-expand-implicit-macro-is-val/Impls_1.scala +++ /dev/null @@ -1,9 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo(c: Context) = { - import c.universe._ - val body = Literal(Constant(2)) - c.Expr[Int](body) - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-implicit-macro-is-val/Macros_Test_2.scala b/tests/pending/run/macro-expand-implicit-macro-is-val/Macros_Test_2.scala deleted file mode 100644 index 3b851de05..000000000 --- a/tests/pending/run/macro-expand-implicit-macro-is-val/Macros_Test_2.scala +++ /dev/null @@ -1,5 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - implicit def foo: Int = macro Impls.foo - def bar(implicit x: Int) = println(x) - bar -} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-implicit-macro-is-view.check b/tests/pending/run/macro-expand-implicit-macro-is-view.check deleted file mode 100644 index 0cfbf0888..000000000 --- a/tests/pending/run/macro-expand-implicit-macro-is-view.check +++ /dev/null @@ -1 +0,0 @@ -2 diff --git a/tests/pending/run/macro-expand-implicit-macro-is-view/Impls_1.scala b/tests/pending/run/macro-expand-implicit-macro-is-view/Impls_1.scala deleted file mode 100644 index d72db872e..000000000 --- a/tests/pending/run/macro-expand-implicit-macro-is-view/Impls_1.scala +++ /dev/null @@ -1,9 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo(c: Context)(x: c.Expr[String]): c.Expr[Option[Int]] = { - import c.universe._ - val body = Apply(Ident(definitions.SomeModule), List(Select(x.tree, TermName("toInt")))) - c.Expr[Option[Int]](body) - } -} diff --git a/tests/pending/run/macro-expand-implicit-macro-is-view/Macros_Test_2.scala b/tests/pending/run/macro-expand-implicit-macro-is-view/Macros_Test_2.scala deleted file mode 100644 index c7b09435a..000000000 --- a/tests/pending/run/macro-expand-implicit-macro-is-view/Macros_Test_2.scala +++ /dev/null @@ -1,12 +0,0 @@ - -object Macros { - import scala.language.experimental.macros - import scala.language.implicitConversions - implicit def foo(x: String): Option[Int] = macro Impls.foo -} - -object Test extends dotty.runtime.LegacyApp { - import Macros._ - def bar[T <% Option[Int]](x: T) = println(x) - println("2") -} diff --git a/tests/pending/run/macro-expand-multiple-arglists.check b/tests/pending/run/macro-expand-multiple-arglists.check deleted file mode 100644 index c24b6ae77..000000000 --- a/tests/pending/run/macro-expand-multiple-arglists.check +++ /dev/null @@ -1 +0,0 @@ -38 \ No newline at end of file diff --git a/tests/pending/run/macro-expand-multiple-arglists.flags b/tests/pending/run/macro-expand-multiple-arglists.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-expand-multiple-arglists.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-multiple-arglists/Impls_1.scala b/tests/pending/run/macro-expand-multiple-arglists/Impls_1.scala deleted file mode 100644 index 9278633c1..000000000 --- a/tests/pending/run/macro-expand-multiple-arglists/Impls_1.scala +++ /dev/null @@ -1,10 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo(c: Context)(x: c.Expr[Int])(y: c.Expr[Int]) = { - import c.universe._ - val sum = Apply(Select(x.tree, TermName("$minus")), List(y.tree)) - val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(sum)) - c.Expr[Unit](body) - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-multiple-arglists/Macros_Test_2.scala b/tests/pending/run/macro-expand-multiple-arglists/Macros_Test_2.scala deleted file mode 100644 index 09de5e02f..000000000 --- a/tests/pending/run/macro-expand-multiple-arglists/Macros_Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - def foo(x: Int)(y: Int): Unit = macro Impls.foo - foo(40)(2) -} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-nullary-generic.check b/tests/pending/run/macro-expand-nullary-generic.check deleted file mode 100644 index 0470d239d..000000000 --- a/tests/pending/run/macro-expand-nullary-generic.check +++ /dev/null @@ -1,6 +0,0 @@ -fooNullary[Int] -fooEmpty[Int] -fooEmpty[Int] -barNullary[Int] -barEmpty[Int] -kkthxbai diff --git a/tests/pending/run/macro-expand-nullary-generic.flags b/tests/pending/run/macro-expand-nullary-generic.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-expand-nullary-generic.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-nullary-generic/Impls_1.scala b/tests/pending/run/macro-expand-nullary-generic/Impls_1.scala deleted file mode 100644 index 9362d6c17..000000000 --- a/tests/pending/run/macro-expand-nullary-generic/Impls_1.scala +++ /dev/null @@ -1,15 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.macros.blackbox.Context - -object Impls { - def impl[T: c.WeakTypeTag](c: Context)(meth: String) = { - import c.universe._ - val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(s"$meth[${c.weakTypeOf[T]}]")))) - c.Expr[Unit](body) - } - - def fooNullary[T: c.WeakTypeTag](c: Context) = impl[T](c)("fooNullary") - def fooEmpty[T: c.WeakTypeTag](c: Context)() = impl[T](c)("fooEmpty") - def barNullary[T: c.WeakTypeTag](c: Context)(x: c.Expr[Int]) = impl[T](c)("barNullary") - def barEmpty[T: c.WeakTypeTag](c: Context)(x: c.Expr[Int])() = impl[T](c)("barEmpty") -} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-nullary-generic/Macros_Test_2.scala b/tests/pending/run/macro-expand-nullary-generic/Macros_Test_2.scala deleted file mode 100644 index da418c63c..000000000 --- a/tests/pending/run/macro-expand-nullary-generic/Macros_Test_2.scala +++ /dev/null @@ -1,15 +0,0 @@ -object Macros { - def foo1[T]: Unit = macro Impls.fooNullary[T] - def foo2[T](): Unit = macro Impls.fooEmpty[T] - def bar1[T](x: Int): Unit = macro Impls.barNullary[T] - def bar2[T](x: Int)(): Unit = macro Impls.barEmpty[T] -} - -object Test extends dotty.runtime.LegacyApp { - Macros.foo1[Int] - Macros.foo2[Int] - Macros.foo2[Int]() - Macros.bar1[Int](42) - Macros.bar2[Int](42)() - println("kkthxbai") -} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-nullary-nongeneric.check b/tests/pending/run/macro-expand-nullary-nongeneric.check deleted file mode 100644 index cb7e76639..000000000 --- a/tests/pending/run/macro-expand-nullary-nongeneric.check +++ /dev/null @@ -1,6 +0,0 @@ -fooNullary -fooEmpty -fooEmpty -barNullary -barEmpty -kkthxbai diff --git a/tests/pending/run/macro-expand-nullary-nongeneric.flags b/tests/pending/run/macro-expand-nullary-nongeneric.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-expand-nullary-nongeneric.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-nullary-nongeneric/Impls_1.scala b/tests/pending/run/macro-expand-nullary-nongeneric/Impls_1.scala deleted file mode 100644 index c8c3d255c..000000000 --- a/tests/pending/run/macro-expand-nullary-nongeneric/Impls_1.scala +++ /dev/null @@ -1,15 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.macros.blackbox.Context - -object Impls { - def impl(c: Context)(meth: String) = { - import c.universe._ - val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(meth)))) - c.Expr[Unit](body) - } - - def fooNullary(c: Context) = impl(c)("fooNullary") - def fooEmpty(c: Context)() = impl(c)("fooEmpty") - def barNullary(c: Context)(x: c.Expr[Int]) = impl(c)("barNullary") - def barEmpty(c: Context)(x: c.Expr[Int])() = impl(c)("barEmpty") -} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-nullary-nongeneric/Macros_Test_2.scala b/tests/pending/run/macro-expand-nullary-nongeneric/Macros_Test_2.scala deleted file mode 100644 index a14d981ce..000000000 --- a/tests/pending/run/macro-expand-nullary-nongeneric/Macros_Test_2.scala +++ /dev/null @@ -1,15 +0,0 @@ -object Macros { - def foo1: Unit = macro Impls.fooNullary - def foo2(): Unit = macro Impls.fooEmpty - def bar1(x: Int): Unit = macro Impls.barNullary - def bar2(x: Int)(): Unit = macro Impls.barEmpty -} - -object Test extends dotty.runtime.LegacyApp { - Macros.foo1 - Macros.foo2 - Macros.foo2() - Macros.bar1(42) - Macros.bar2(42)() - println("kkthxbai") -} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-overload.check b/tests/pending/run/macro-expand-overload.check deleted file mode 100644 index a2b7b0e78..000000000 --- a/tests/pending/run/macro-expand-overload.check +++ /dev/null @@ -1,6 +0,0 @@ -(fooObjectString,Expr[Nothing](Macros),42) -(fooObjectInt,Expr[Nothing](Macros),42) -fooObjectBoolean -(fooClassString,Expr[Nothing](new Macros()),42) -(fooClassInt,Expr[Nothing](new Macros()),42) -fooClassBoolean diff --git a/tests/pending/run/macro-expand-overload.flags b/tests/pending/run/macro-expand-overload.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-expand-overload.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-overload/Impls_1.scala b/tests/pending/run/macro-expand-overload/Impls_1.scala deleted file mode 100644 index ef9d01d4e..000000000 --- a/tests/pending/run/macro-expand-overload/Impls_1.scala +++ /dev/null @@ -1,15 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def impl(c: Context)(tag: String, x: c.Expr[_]) = { - import c.{prefix => prefix} - import c.universe._ - val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(tag)), Literal(Constant(prefix.toString)), x.tree)) - c.Expr[Unit](body) - } - - def fooObjectString(c: Context)(x: c.Expr[_]) = impl(c)("fooObjectString", x) - def fooObjectInt(c: Context)(x: c.Expr[_]) = impl(c)("fooObjectInt", x) - def fooClassString(c: Context)(x: c.Expr[_]) = impl(c)("fooClassString", x) - def fooClassInt(c: Context)(x: c.Expr[_]) = impl(c)("fooClassInt", x) -} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-overload/Macros_Test_2.scala b/tests/pending/run/macro-expand-overload/Macros_Test_2.scala deleted file mode 100644 index b367f35b7..000000000 --- a/tests/pending/run/macro-expand-overload/Macros_Test_2.scala +++ /dev/null @@ -1,20 +0,0 @@ -object Macros { - def foo(x: String): Unit = macro Impls.fooObjectString - def foo(x: Int): Unit = macro Impls.fooObjectInt - def foo(x: Boolean): Unit = println("fooObjectBoolean") -} - -class Macros { - def foo(x: String): Unit = macro Impls.fooClassString - def foo(x: Int): Unit = macro Impls.fooClassInt - def foo(x: Boolean): Unit = println("fooClassBoolean") -} - -object Test extends dotty.runtime.LegacyApp { - Macros.foo("42") - Macros.foo(42) - Macros.foo(true) - new Macros().foo("42") - new Macros().foo(42) - new Macros().foo(true) -} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-override.check b/tests/pending/run/macro-expand-override.check deleted file mode 100644 index b41dc156c..000000000 --- a/tests/pending/run/macro-expand-override.check +++ /dev/null @@ -1,15 +0,0 @@ -(fooBString,Expr[Nothing](Test.this.dd),42) -(fooDInt,Expr[Nothing](Test.this.dd),42) -fooBBoolean -(fooBString,Expr[Nothing](Test.this.db),42) -(fooBInt,Expr[Nothing](Test.this.db),42) -fooBBoolean -(fooZString,Expr[Nothing](Test.this.zz),42) -(fooDInt,Expr[Nothing](Test.this.zz),42) -fooZBoolean -(fooBString,Expr[Nothing](Test.this.zd),42) -(fooDInt,Expr[Nothing](Test.this.zd),42) -fooZBoolean -(fooBString,Expr[Nothing](Test.this.zb),42) -(fooBInt,Expr[Nothing](Test.this.zb),42) -fooZBoolean diff --git a/tests/pending/run/macro-expand-override.flags b/tests/pending/run/macro-expand-override.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-expand-override.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-override/Impls_1.scala b/tests/pending/run/macro-expand-override/Impls_1.scala deleted file mode 100644 index e6ce18f17..000000000 --- a/tests/pending/run/macro-expand-override/Impls_1.scala +++ /dev/null @@ -1,15 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def impl(c: Context)(tag: String, x: c.Expr[_]) = { - import c.{prefix => prefix} - import c.universe._ - val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(tag)), Literal(Constant(prefix.toString)), x.tree)) - c.Expr[Unit](body) - } - - def fooBString(c: Context)(x: c.Expr[_]) = impl(c)("fooBString", x) - def fooBInt(c: Context)(x: c.Expr[_]) = impl(c)("fooBInt", x) - def fooDInt(c: Context)(x: c.Expr[_]) = impl(c)("fooDInt", x) - def fooZString(c: Context)(x: c.Expr[_]) = impl(c)("fooZString", x) -} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-override/Macros_Test_2.scala b/tests/pending/run/macro-expand-override/Macros_Test_2.scala deleted file mode 100644 index 46c1f49cc..000000000 --- a/tests/pending/run/macro-expand-override/Macros_Test_2.scala +++ /dev/null @@ -1,43 +0,0 @@ -class B { - def foo(x: String): Unit = macro Impls.fooBString - def foo(x: Int): Unit = macro Impls.fooBInt - def foo(x: Boolean): Unit = println("fooBBoolean") -} - -class D extends B { - //override def foo(x: String): Unit = println("fooDString") => method cannot override a macro - override def foo(x: Int): Unit = macro Impls.fooDInt -} - -class Z extends D { - override def foo(x: String): Unit = macro Impls.fooZString - override def foo(x: Boolean): Unit = println("fooZBoolean") -} - -object Test extends dotty.runtime.LegacyApp { - - val dd: D = new D() - dd.foo("42") - dd.foo(42) - dd.foo(true) - - val db: B = new D() - db.foo("42") - db.foo(42) - db.foo(true) - - val zz: Z = new Z() - zz.foo("42") - zz.foo(42) - zz.foo(true) - - val zd: D = new Z() - zd.foo("42") - zd.foo(42) - zd.foo(true) - - val zb: B = new Z() - zb.foo("42") - zb.foo(42) - zb.foo(true) -} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-recursive.check b/tests/pending/run/macro-expand-recursive.check deleted file mode 100644 index 7658ad2c2..000000000 --- a/tests/pending/run/macro-expand-recursive.check +++ /dev/null @@ -1 +0,0 @@ -it works diff --git a/tests/pending/run/macro-expand-recursive.flags b/tests/pending/run/macro-expand-recursive.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-expand-recursive.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-recursive/Impls_1.scala b/tests/pending/run/macro-expand-recursive/Impls_1.scala deleted file mode 100644 index 3def2d2fb..000000000 --- a/tests/pending/run/macro-expand-recursive/Impls_1.scala +++ /dev/null @@ -1,15 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo(c: Context) = { - import c.universe._ - val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works")))) - c.Expr[Unit](body) - } - - def fooFoo(c: Context) = { - import c.universe._ - val body = Select(Ident(TermName("Macros")), TermName("foo")) - c.Expr[Unit](body) - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-recursive/Macros_Test_2.scala b/tests/pending/run/macro-expand-recursive/Macros_Test_2.scala deleted file mode 100644 index e8a88afc9..000000000 --- a/tests/pending/run/macro-expand-recursive/Macros_Test_2.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Macros { - def foo: Unit = macro Impls.foo - def fooFoo: Unit = macro Impls.fooFoo -} - -object Test extends dotty.runtime.LegacyApp { - Macros.fooFoo -} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-tparams-bounds.check b/tests/pending/run/macro-expand-tparams-bounds.check deleted file mode 100644 index 317e9677c..000000000 --- a/tests/pending/run/macro-expand-tparams-bounds.check +++ /dev/null @@ -1,2 +0,0 @@ -hello -hello diff --git a/tests/pending/run/macro-expand-tparams-bounds.flags b/tests/pending/run/macro-expand-tparams-bounds.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-expand-tparams-bounds.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-tparams-bounds/Impls_1.scala b/tests/pending/run/macro-expand-tparams-bounds/Impls_1.scala deleted file mode 100644 index 95aaa1c3d..000000000 --- a/tests/pending/run/macro-expand-tparams-bounds/Impls_1.scala +++ /dev/null @@ -1,12 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls1 { - def foo[U <: String](c: Context): c.Expr[Unit] = { import c.universe._; c.Expr[Unit](q"""println("hello")""") } -} - -class C -class D extends C - -object Impls2 { - def foo[U <: C](c: Context): c.Expr[Unit] = { import c.universe._; c.Expr[Unit](q"""println("hello")""") } -} diff --git a/tests/pending/run/macro-expand-tparams-bounds/Macros_Test_2.scala b/tests/pending/run/macro-expand-tparams-bounds/Macros_Test_2.scala deleted file mode 100644 index f1cab82ec..000000000 --- a/tests/pending/run/macro-expand-tparams-bounds/Macros_Test_2.scala +++ /dev/null @@ -1,12 +0,0 @@ -object Macros1 { - def foo[U <: String]: Unit = macro Impls1.foo[U] -} - -object Macros2 { - def foo[T <: D]: Unit = macro Impls2.foo[T] -} - -object Test extends dotty.runtime.LegacyApp { - Macros1.foo[String] - Macros2.foo[D] -} diff --git a/tests/pending/run/macro-expand-tparams-explicit.check b/tests/pending/run/macro-expand-tparams-explicit.check deleted file mode 100644 index b6b4f6fa3..000000000 --- a/tests/pending/run/macro-expand-tparams-explicit.check +++ /dev/null @@ -1 +0,0 @@ -WeakTypeTag[Int] diff --git a/tests/pending/run/macro-expand-tparams-explicit.flags b/tests/pending/run/macro-expand-tparams-explicit.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-expand-tparams-explicit.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-tparams-explicit/Impls_1.scala b/tests/pending/run/macro-expand-tparams-explicit/Impls_1.scala deleted file mode 100644 index c33ac6d1b..000000000 --- a/tests/pending/run/macro-expand-tparams-explicit/Impls_1.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo[U: c.WeakTypeTag](c: Context) = { - import c.universe._ - val U = implicitly[c.WeakTypeTag[U]] - val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(U.toString)))) - c.Expr[Unit](body) - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-tparams-explicit/Macros_Test_2.scala b/tests/pending/run/macro-expand-tparams-explicit/Macros_Test_2.scala deleted file mode 100644 index 14154ee03..000000000 --- a/tests/pending/run/macro-expand-tparams-explicit/Macros_Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - def foo[U]: Unit = macro Impls.foo[U] - foo[Int] -} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-tparams-implicit.check b/tests/pending/run/macro-expand-tparams-implicit.check deleted file mode 100644 index a9bf55423..000000000 --- a/tests/pending/run/macro-expand-tparams-implicit.check +++ /dev/null @@ -1,2 +0,0 @@ -WeakTypeTag[Int] -WeakTypeTag[String] diff --git a/tests/pending/run/macro-expand-tparams-implicit.flags b/tests/pending/run/macro-expand-tparams-implicit.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-expand-tparams-implicit.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-tparams-implicit/Impls_1.scala b/tests/pending/run/macro-expand-tparams-implicit/Impls_1.scala deleted file mode 100644 index 32cee0d5f..000000000 --- a/tests/pending/run/macro-expand-tparams-implicit/Impls_1.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo[U: c.WeakTypeTag](c: Context)(x: c.Expr[U]) = { - import c.universe._ - val U = implicitly[c.WeakTypeTag[U]] - val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(U.toString)))) - c.Expr[Unit](body) - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-tparams-implicit/Macros_Test_2.scala b/tests/pending/run/macro-expand-tparams-implicit/Macros_Test_2.scala deleted file mode 100644 index 386817469..000000000 --- a/tests/pending/run/macro-expand-tparams-implicit/Macros_Test_2.scala +++ /dev/null @@ -1,5 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - def foo[U](x: U): Unit = macro Impls.foo[U] - foo(42) - foo("42") -} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-tparams-prefix.check b/tests/pending/run/macro-expand-tparams-prefix.check deleted file mode 100644 index 739795806..000000000 --- a/tests/pending/run/macro-expand-tparams-prefix.check +++ /dev/null @@ -1,20 +0,0 @@ -===Macros1=== -WeakTypeTag[Int] -WeakTypeTag[Int] -WeakTypeTag[String] -WeakTypeTag[Boolean] -===Macros2=== -WeakTypeTag[Boolean] WeakTypeTag[Int] -WeakTypeTag[Boolean] WeakTypeTag[String] -===Macros3=== -WeakTypeTag[Int] -WeakTypeTag[String] -WeakTypeTag[Boolean] -===Macros4=== -WeakTypeTag[Int] -WeakTypeTag[String] -WeakTypeTag[Boolean] -===Macros5=== -WeakTypeTag[T] -WeakTypeTag[U] -WeakTypeTag[Boolean] diff --git a/tests/pending/run/macro-expand-tparams-prefix.flags b/tests/pending/run/macro-expand-tparams-prefix.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-expand-tparams-prefix.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-tparams-prefix/Impls_1.scala b/tests/pending/run/macro-expand-tparams-prefix/Impls_1.scala deleted file mode 100644 index 289f07162..000000000 --- a/tests/pending/run/macro-expand-tparams-prefix/Impls_1.scala +++ /dev/null @@ -1,39 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.macros.blackbox.Context - -object Impls1 { - def foo[U: c.WeakTypeTag](c: Context)(x: c.Expr[U]) = { - import c.universe._ - val U = implicitly[c.WeakTypeTag[U]] - c.Expr[Unit](q"println(${U.toString})") - } -} - -object Impls2 { - def foo[T: c.WeakTypeTag, U: c.WeakTypeTag](c: Context)(x: c.Expr[U]) = { - import c.universe._ - val T = implicitly[c.WeakTypeTag[T]] - val U = implicitly[c.WeakTypeTag[U]] - val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(T.toString + " " + U.toString)))) - c.Expr[Unit](q"""println(${T.toString} + " " + ${U.toString})""") - } -} - -object Impls345 { - def foo[T, U: c.WeakTypeTag, V](c: Context)(implicit T: c.WeakTypeTag[T], V: c.WeakTypeTag[V]): c.Expr[Unit] = { - import c.universe._ - c.Expr(q""" - println(${T.toString}) - println(${implicitly[c.WeakTypeTag[U]].toString}) - println(${V.toString}) - """) - } -} - -object Macros4 { - class D[T] { - class C[U] { - def foo[V] = macro Impls345.foo[T, U, V] - } - } -} diff --git a/tests/pending/run/macro-expand-tparams-prefix/Macros_Test_2.scala b/tests/pending/run/macro-expand-tparams-prefix/Macros_Test_2.scala deleted file mode 100644 index 8916f03e4..000000000 --- a/tests/pending/run/macro-expand-tparams-prefix/Macros_Test_2.scala +++ /dev/null @@ -1,57 +0,0 @@ -object Macros1 { - class C[T] { - def foo[U](x: U): Unit = macro Impls1.foo[U] - } -} - -object Macros2 { - class C[T] { - def foo[U](x: U): Unit = macro Impls2.foo[T, U] - } -} - -object Macros3 { - class D[T] { - class C[U] { - def foo[V]: Unit = macro Impls345.foo[T, U, V] - } - } -} - -// object Macros4 is declared in Impls_1.scala - -object Macros5 { - class D[T] { - class C[U] { - def foo[V]: Unit = macro Impls345.foo[T, U, V] - foo[Boolean] - } - } -} - -object Test extends dotty.runtime.LegacyApp { - println("===Macros1===") - new Macros1.C[Int]().foo(42) - new Macros1.C[Boolean]().foo(42) - new Macros1.C[Int]().foo("42") - new Macros1.C[String]().foo(true) - - println("===Macros2===") - object D2 extends Macros2.C[Boolean] - D2.foo(42) - D2.foo("42") - - println("===Macros3===") - val outer31 = new Macros3.D[Int] - val outer32 = new outer31.C[String] - outer32.foo[Boolean] - - println("===Macros4===") - val outer41 = new Macros4.D[Int] - val outer42 = new outer41.C[String] - outer42.foo[Boolean] - - println("===Macros5===") - val outer1 = new Macros5.D[Int] - new outer1.C[String] -} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-unapply-a.check b/tests/pending/run/macro-expand-unapply-a.check deleted file mode 100644 index 7c2976e51..000000000 --- a/tests/pending/run/macro-expand-unapply-a.check +++ /dev/null @@ -1,2 +0,0 @@ -(1,2) -(1,2,3) diff --git a/tests/pending/run/macro-expand-unapply-a.flags b/tests/pending/run/macro-expand-unapply-a.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-expand-unapply-a.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-unapply-a/Impls_Macros_1.scala b/tests/pending/run/macro-expand-unapply-a/Impls_Macros_1.scala deleted file mode 100644 index 64f16c6a8..000000000 --- a/tests/pending/run/macro-expand-unapply-a/Impls_Macros_1.scala +++ /dev/null @@ -1,15 +0,0 @@ -import scala.reflect.macros.whitebox.Context - -object Helper { - def unapplySeq[T](x: List[T]): Option[Seq[T]] = List.unapplySeq[T](x) -} - -object Macros { - def impl[T: c.WeakTypeTag](c: Context)(x: c.Expr[List[T]]) = { - c.universe.reify(Helper.unapplySeq(x.splice)) - } - - object UnapplyMacro { - def unapplySeq[T](x: List[T]): Option[Seq[T]] = macro impl[T] - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-unapply-a/Test_2.scala b/tests/pending/run/macro-expand-unapply-a/Test_2.scala deleted file mode 100644 index ce52df802..000000000 --- a/tests/pending/run/macro-expand-unapply-a/Test_2.scala +++ /dev/null @@ -1,6 +0,0 @@ -import Macros._ - -object Test extends dotty.runtime.LegacyApp { - List(1, 2) match { case UnapplyMacro(x, y) => println((x, y)) } - List(1, 2, 3) match { case UnapplyMacro(x, y, z) => println((x, y, z)) } -} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-bad.check b/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-bad.check deleted file mode 100644 index 2709b5703..000000000 --- a/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-bad.check +++ /dev/null @@ -1,4 +0,0 @@ -reflective compilation has failed: - -no `: _*' annotation allowed here -(such annotations are only allowed in arguments to *-parameters) diff --git a/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-bad.flags b/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-bad.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-bad.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Impls_1.scala b/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Impls_1.scala deleted file mode 100644 index 18af84583..000000000 --- a/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Impls_1.scala +++ /dev/null @@ -1,9 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo(c: Context)(xs: c.Expr[Int]*) = { - import c.universe._ - val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), xs.map(_.tree).toList) - c.Expr[Unit](body) - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Macros_Test_2.scala b/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Macros_Test_2.scala deleted file mode 100644 index 868fb8d91..000000000 --- a/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Macros_Test_2.scala +++ /dev/null @@ -1,12 +0,0 @@ -object Macros { - def foo(xs: Int*): Unit = macro Impls.foo -} - -object Test extends dotty.runtime.LegacyApp { - import scala.reflect.runtime.universe._ - import scala.reflect.runtime.{currentMirror => cm} - import scala.tools.reflect.ToolBox - val tree = Apply(Select(Ident(TermName("Macros")), TermName("foo")), List(Typed(Apply(Ident(definitions.ListModule), List(Literal(Constant(1)), Literal(Constant(2)))), Ident(typeNames.WILDCARD_STAR)))) - try cm.mkToolBox().eval(tree) - catch { case ex: Throwable => println(ex.getMessage) } -} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-good.check b/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-good.check deleted file mode 100644 index fe90caed3..000000000 --- a/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-good.check +++ /dev/null @@ -1 +0,0 @@ -List(1, 2, 3, 4, 5) diff --git a/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-good.flags b/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-good.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-good.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-good/Impls_1.scala b/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-good/Impls_1.scala deleted file mode 100644 index eb067c25a..000000000 --- a/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-good/Impls_1.scala +++ /dev/null @@ -1,13 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo(c: Context)(xs: c.Expr[Int]*) = { - import c.universe._ - val stripped_xs = xs map (_.tree) toList match { - case List(Typed(stripped, Ident(wildstar))) if wildstar == typeNames.WILDCARD_STAR => List(stripped) - case _ => ??? - } - val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), stripped_xs) - c.Expr[Unit](body) - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-good/Macros_Test_2.scala b/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-good/Macros_Test_2.scala deleted file mode 100644 index 7eba411cd..000000000 --- a/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-good/Macros_Test_2.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Macros { - def foo(xs: Int*): Unit = macro Impls.foo -} - -object Test extends dotty.runtime.LegacyApp { - val numbers = List(1, 2, 3, 4, 5) - Macros.foo(numbers: _*) -} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-varargs-explicit-over-varargs.check b/tests/pending/run/macro-expand-varargs-explicit-over-varargs.check deleted file mode 100644 index fe90caed3..000000000 --- a/tests/pending/run/macro-expand-varargs-explicit-over-varargs.check +++ /dev/null @@ -1 +0,0 @@ -List(1, 2, 3, 4, 5) diff --git a/tests/pending/run/macro-expand-varargs-explicit-over-varargs.flags b/tests/pending/run/macro-expand-varargs-explicit-over-varargs.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-expand-varargs-explicit-over-varargs.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-varargs-explicit-over-varargs/Impls_1.scala b/tests/pending/run/macro-expand-varargs-explicit-over-varargs/Impls_1.scala deleted file mode 100644 index 64ab7de02..000000000 --- a/tests/pending/run/macro-expand-varargs-explicit-over-varargs/Impls_1.scala +++ /dev/null @@ -1,13 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def myprintln(xs: Int*) = { - println(xs) - } - - def foo(c: Context)(xs: c.Expr[Int]*) = { - import c.universe._ - val body = Apply(Select(Ident(TermName("Impls")), TermName("myprintln")), xs.map(_.tree).toList) - c.Expr[Unit](body) - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-varargs-explicit-over-varargs/Macros_Test_2.scala b/tests/pending/run/macro-expand-varargs-explicit-over-varargs/Macros_Test_2.scala deleted file mode 100644 index 7eba411cd..000000000 --- a/tests/pending/run/macro-expand-varargs-explicit-over-varargs/Macros_Test_2.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Macros { - def foo(xs: Int*): Unit = macro Impls.foo -} - -object Test extends dotty.runtime.LegacyApp { - val numbers = List(1, 2, 3, 4, 5) - Macros.foo(numbers: _*) -} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-varargs-implicit-over-nonvarargs.check b/tests/pending/run/macro-expand-varargs-implicit-over-nonvarargs.check deleted file mode 100644 index bcfab1984..000000000 --- a/tests/pending/run/macro-expand-varargs-implicit-over-nonvarargs.check +++ /dev/null @@ -1 +0,0 @@ -(1,2,3,4,5) diff --git a/tests/pending/run/macro-expand-varargs-implicit-over-nonvarargs.flags b/tests/pending/run/macro-expand-varargs-implicit-over-nonvarargs.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-expand-varargs-implicit-over-nonvarargs.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-varargs-implicit-over-nonvarargs/Impls_1.scala b/tests/pending/run/macro-expand-varargs-implicit-over-nonvarargs/Impls_1.scala deleted file mode 100644 index 18af84583..000000000 --- a/tests/pending/run/macro-expand-varargs-implicit-over-nonvarargs/Impls_1.scala +++ /dev/null @@ -1,9 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo(c: Context)(xs: c.Expr[Int]*) = { - import c.universe._ - val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), xs.map(_.tree).toList) - c.Expr[Unit](body) - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-varargs-implicit-over-nonvarargs/Macros_Test_2.scala b/tests/pending/run/macro-expand-varargs-implicit-over-nonvarargs/Macros_Test_2.scala deleted file mode 100644 index f50a5d742..000000000 --- a/tests/pending/run/macro-expand-varargs-implicit-over-nonvarargs/Macros_Test_2.scala +++ /dev/null @@ -1,7 +0,0 @@ -object Macros { - def foo(xs: Int*): Unit = macro Impls.foo -} - -object Test extends dotty.runtime.LegacyApp { - Macros.foo(1, 2, 3, 4, 5) -} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-varargs-implicit-over-varargs.check b/tests/pending/run/macro-expand-varargs-implicit-over-varargs.check deleted file mode 100644 index 2c174a8a9..000000000 --- a/tests/pending/run/macro-expand-varargs-implicit-over-varargs.check +++ /dev/null @@ -1 +0,0 @@ -WrappedArray(1, 2, 3, 4, 5) diff --git a/tests/pending/run/macro-expand-varargs-implicit-over-varargs.flags b/tests/pending/run/macro-expand-varargs-implicit-over-varargs.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-expand-varargs-implicit-over-varargs.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-varargs-implicit-over-varargs/Impls_1.scala b/tests/pending/run/macro-expand-varargs-implicit-over-varargs/Impls_1.scala deleted file mode 100644 index 64ab7de02..000000000 --- a/tests/pending/run/macro-expand-varargs-implicit-over-varargs/Impls_1.scala +++ /dev/null @@ -1,13 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def myprintln(xs: Int*) = { - println(xs) - } - - def foo(c: Context)(xs: c.Expr[Int]*) = { - import c.universe._ - val body = Apply(Select(Ident(TermName("Impls")), TermName("myprintln")), xs.map(_.tree).toList) - c.Expr[Unit](body) - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-varargs-implicit-over-varargs/Macros_Test_2.scala b/tests/pending/run/macro-expand-varargs-implicit-over-varargs/Macros_Test_2.scala deleted file mode 100644 index f50a5d742..000000000 --- a/tests/pending/run/macro-expand-varargs-implicit-over-varargs/Macros_Test_2.scala +++ /dev/null @@ -1,7 +0,0 @@ -object Macros { - def foo(xs: Int*): Unit = macro Impls.foo -} - -object Test extends dotty.runtime.LegacyApp { - Macros.foo(1, 2, 3, 4, 5) -} \ No newline at end of file diff --git a/tests/pending/run/macro-impl-default-params.check b/tests/pending/run/macro-impl-default-params.check deleted file mode 100644 index b32e34570..000000000 --- a/tests/pending/run/macro-impl-default-params.check +++ /dev/null @@ -1,5 +0,0 @@ -foo_targs: -invoking foo_targs... -type of prefix is: Nothing -type of prefix tree is: Macros[Int] -U is: String diff --git a/tests/pending/run/macro-impl-default-params.flags b/tests/pending/run/macro-impl-default-params.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-impl-default-params.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-impl-default-params/Impls_Macros_1.scala b/tests/pending/run/macro-impl-default-params/Impls_Macros_1.scala deleted file mode 100644 index 9b1d0eed3..000000000 --- a/tests/pending/run/macro-impl-default-params/Impls_Macros_1.scala +++ /dev/null @@ -1,20 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo_targs[T, U: c.WeakTypeTag](c: Context = null)(x: c.Expr[Int] = null) = { - import c.{prefix => prefix} - import c.universe._ - val U = implicitly[c.WeakTypeTag[U]] - c.Expr[Unit](q""" - println("invoking foo_targs...") - println("type of prefix is: " + ${prefix.staticType.toString}) - println("type of prefix tree is: " + ${prefix.tree.tpe.toString}) - println("U is: " + ${U.tpe.toString}) - """) - } -} - -class Macros[T] { - def foo_targs[U](x: Int) = macro Impls.foo_targs[T, U] -} \ No newline at end of file diff --git a/tests/pending/run/macro-impl-default-params/Test_2.scala b/tests/pending/run/macro-impl-default-params/Test_2.scala deleted file mode 100644 index 476c881f8..000000000 --- a/tests/pending/run/macro-impl-default-params/Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - println("foo_targs:") - new Macros[Int]().foo_targs[String](42) -} \ No newline at end of file diff --git a/tests/pending/run/macro-impl-relaxed.check b/tests/pending/run/macro-impl-relaxed.check deleted file mode 100644 index 487b11653..000000000 --- a/tests/pending/run/macro-impl-relaxed.check +++ /dev/null @@ -1,4 +0,0 @@ -2 -2 -2 -2 diff --git a/tests/pending/run/macro-impl-relaxed/Macros_1.scala b/tests/pending/run/macro-impl-relaxed/Macros_1.scala deleted file mode 100644 index 420eb2a39..000000000 --- a/tests/pending/run/macro-impl-relaxed/Macros_1.scala +++ /dev/null @@ -1,14 +0,0 @@ -import language.experimental.macros -import scala.reflect.macros.blackbox.Context - -object Macros { - def implUU(c: Context)(x: c.Tree): c.Tree = x - def implTU(c: Context)(x: c.Expr[Int]): c.Tree = x.tree - def implUT(c: Context)(x: c.Tree): c.Expr[Int] = c.Expr[Int](x) - def implTT(c: Context)(x: c.Expr[Int]): c.Expr[Int] = x - - def fooUU(x: Int): Int = macro implUU - def fooTU(x: Int): Int = macro implTU - def fooUT(x: Int): Int = macro implUT - def fooTT(x: Int): Int = macro implTT -} \ No newline at end of file diff --git a/tests/pending/run/macro-impl-relaxed/Test_2.scala b/tests/pending/run/macro-impl-relaxed/Test_2.scala deleted file mode 100644 index 460626272..000000000 --- a/tests/pending/run/macro-impl-relaxed/Test_2.scala +++ /dev/null @@ -1,6 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - println(Macros.fooUU(2)) - println(Macros.fooTU(2)) - println(Macros.fooUT(2)) - println(Macros.fooTT(2)) -} \ No newline at end of file diff --git a/tests/pending/run/macro-impl-rename-context.check b/tests/pending/run/macro-impl-rename-context.check deleted file mode 100644 index 6a34e5fd8..000000000 --- a/tests/pending/run/macro-impl-rename-context.check +++ /dev/null @@ -1,2 +0,0 @@ -foo -invoking foo... diff --git a/tests/pending/run/macro-impl-rename-context.flags b/tests/pending/run/macro-impl-rename-context.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-impl-rename-context.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-impl-rename-context/Impls_Macros_1.scala b/tests/pending/run/macro-impl-rename-context/Impls_Macros_1.scala deleted file mode 100644 index acc47fcde..000000000 --- a/tests/pending/run/macro-impl-rename-context/Impls_Macros_1.scala +++ /dev/null @@ -1,12 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo(unconventionalName: Context)(x: unconventionalName.Expr[Int]) = { - import unconventionalName.universe._ - unconventionalName.Expr[Unit](q"""println("invoking foo...")""") - } -} - -object Macros { - def foo(x: Int) = macro Impls.foo -} diff --git a/tests/pending/run/macro-impl-rename-context/Test_2.scala b/tests/pending/run/macro-impl-rename-context/Test_2.scala deleted file mode 100644 index 6b1cdecd0..000000000 --- a/tests/pending/run/macro-impl-rename-context/Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - println("foo") - Macros.foo(42) -} \ No newline at end of file diff --git a/tests/pending/run/macro-impl-tparam-only-in-impl.check b/tests/pending/run/macro-impl-tparam-only-in-impl.check deleted file mode 100644 index 3b18e512d..000000000 --- a/tests/pending/run/macro-impl-tparam-only-in-impl.check +++ /dev/null @@ -1 +0,0 @@ -hello world diff --git a/tests/pending/run/macro-impl-tparam-only-in-impl.flags b/tests/pending/run/macro-impl-tparam-only-in-impl.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-impl-tparam-only-in-impl.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-impl-tparam-only-in-impl/Impls_1.scala b/tests/pending/run/macro-impl-tparam-only-in-impl/Impls_1.scala deleted file mode 100644 index 705defb18..000000000 --- a/tests/pending/run/macro-impl-tparam-only-in-impl/Impls_1.scala +++ /dev/null @@ -1,5 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo[U <: String](c: Context): c.Expr[Unit] = { import c.universe._; c.Expr[Unit](q"""println("hello world")""") } -} diff --git a/tests/pending/run/macro-impl-tparam-only-in-impl/Macros_Test_2.scala b/tests/pending/run/macro-impl-tparam-only-in-impl/Macros_Test_2.scala deleted file mode 100644 index b626ce35e..000000000 --- a/tests/pending/run/macro-impl-tparam-only-in-impl/Macros_Test_2.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Macros { - def foo: Unit = macro Impls.foo[String] -} - -object Test extends dotty.runtime.LegacyApp { - import Macros._ - foo -} \ No newline at end of file diff --git a/tests/pending/run/macro-impl-tparam-typetag-is-optional.check b/tests/pending/run/macro-impl-tparam-typetag-is-optional.check deleted file mode 100644 index b4a0f394c..000000000 --- a/tests/pending/run/macro-impl-tparam-typetag-is-optional.check +++ /dev/null @@ -1 +0,0 @@ -don't know U diff --git a/tests/pending/run/macro-impl-tparam-typetag-is-optional.flags b/tests/pending/run/macro-impl-tparam-typetag-is-optional.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-impl-tparam-typetag-is-optional.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-impl-tparam-typetag-is-optional/Impls_1.scala b/tests/pending/run/macro-impl-tparam-typetag-is-optional/Impls_1.scala deleted file mode 100644 index fc72e7a97..000000000 --- a/tests/pending/run/macro-impl-tparam-typetag-is-optional/Impls_1.scala +++ /dev/null @@ -1,9 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo[U](c: Context) = { - import c.universe._ - val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("don't know U")))) - c.Expr[Unit](body) - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-impl-tparam-typetag-is-optional/Macros_Test_2.scala b/tests/pending/run/macro-impl-tparam-typetag-is-optional/Macros_Test_2.scala deleted file mode 100644 index 14154ee03..000000000 --- a/tests/pending/run/macro-impl-tparam-typetag-is-optional/Macros_Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - def foo[U]: Unit = macro Impls.foo[U] - foo[Int] -} \ No newline at end of file diff --git a/tests/pending/run/macro-invalidret-doesnt-conform-to-def-rettype.check b/tests/pending/run/macro-invalidret-doesnt-conform-to-def-rettype.check deleted file mode 100644 index 1d531f6d8..000000000 --- a/tests/pending/run/macro-invalidret-doesnt-conform-to-def-rettype.check +++ /dev/null @@ -1,5 +0,0 @@ -reflective compilation has failed: - -type mismatch; - found : String("42") - required: Int diff --git a/tests/pending/run/macro-invalidret-doesnt-conform-to-def-rettype.flags b/tests/pending/run/macro-invalidret-doesnt-conform-to-def-rettype.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-invalidret-doesnt-conform-to-def-rettype.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-invalidret-doesnt-conform-to-def-rettype/Impls_Macros_1.scala b/tests/pending/run/macro-invalidret-doesnt-conform-to-def-rettype/Impls_Macros_1.scala deleted file mode 100644 index 603500b59..000000000 --- a/tests/pending/run/macro-invalidret-doesnt-conform-to-def-rettype/Impls_Macros_1.scala +++ /dev/null @@ -1,12 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo(c: Context): c.Expr[Int] = { - import c.universe._ - c.Expr(Literal(Constant("42"))) - } -} - -object Macros { - def foo: Int = macro Impls.foo -} \ No newline at end of file diff --git a/tests/pending/run/macro-invalidret-doesnt-conform-to-def-rettype/Test_2.scala b/tests/pending/run/macro-invalidret-doesnt-conform-to-def-rettype/Test_2.scala deleted file mode 100644 index dea6e6d62..000000000 --- a/tests/pending/run/macro-invalidret-doesnt-conform-to-def-rettype/Test_2.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - import scala.reflect.runtime.universe._ - import scala.reflect.runtime.{currentMirror => cm} - import scala.tools.reflect.ToolBox - val tree = Select(Ident(TermName("Macros")), TermName("foo")) - try cm.mkToolBox().eval(tree) - catch { case ex: Throwable => println(ex.getMessage) } -} \ No newline at end of file diff --git a/tests/pending/run/macro-invalidret-nontypeable.check b/tests/pending/run/macro-invalidret-nontypeable.check deleted file mode 100644 index 25cef2c78..000000000 --- a/tests/pending/run/macro-invalidret-nontypeable.check +++ /dev/null @@ -1,3 +0,0 @@ -reflective compilation has failed: - -not found: value IDoNotExist diff --git a/tests/pending/run/macro-invalidret-nontypeable.flags b/tests/pending/run/macro-invalidret-nontypeable.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-invalidret-nontypeable.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-invalidret-nontypeable/Impls_Macros_1.scala b/tests/pending/run/macro-invalidret-nontypeable/Impls_Macros_1.scala deleted file mode 100644 index b6b961174..000000000 --- a/tests/pending/run/macro-invalidret-nontypeable/Impls_Macros_1.scala +++ /dev/null @@ -1,13 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo(c: Context) = { - import c.universe._ - val body = Ident(TermName("IDoNotExist")) - c.Expr[Int](body) - } -} - -object Macros { - def foo = macro Impls.foo -} \ No newline at end of file diff --git a/tests/pending/run/macro-invalidret-nontypeable/Test_2.scala b/tests/pending/run/macro-invalidret-nontypeable/Test_2.scala deleted file mode 100644 index 26de1d9de..000000000 --- a/tests/pending/run/macro-invalidret-nontypeable/Test_2.scala +++ /dev/null @@ -1,8 +0,0 @@ - object Test extends dotty.runtime.LegacyApp { - import scala.reflect.runtime.universe._ - import scala.reflect.runtime.{currentMirror => cm} - import scala.tools.reflect.ToolBox - val tree = Select(Ident(TermName("Macros")), TermName("foo")) - try cm.mkToolBox().eval(tree) - catch { case ex: Throwable => println(ex.getMessage) } -} \ No newline at end of file diff --git a/tests/pending/run/macro-invalidusage-badret.check b/tests/pending/run/macro-invalidusage-badret.check deleted file mode 100644 index e79550043..000000000 --- a/tests/pending/run/macro-invalidusage-badret.check +++ /dev/null @@ -1,5 +0,0 @@ -reflective compilation has failed: - -type mismatch; - found : Int - required: String diff --git a/tests/pending/run/macro-invalidusage-badret.flags b/tests/pending/run/macro-invalidusage-badret.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-invalidusage-badret.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-invalidusage-badret/Impls_Macros_1.scala b/tests/pending/run/macro-invalidusage-badret/Impls_Macros_1.scala deleted file mode 100644 index 0d4c5755f..000000000 --- a/tests/pending/run/macro-invalidusage-badret/Impls_Macros_1.scala +++ /dev/null @@ -1,9 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo(c: Context)(x: c.Expr[Int]) = x -} - -object Macros { - def foo(x: Int) = macro Impls.foo -} diff --git a/tests/pending/run/macro-invalidusage-badret/Test_2.scala b/tests/pending/run/macro-invalidusage-badret/Test_2.scala deleted file mode 100644 index 1d208aeb1..000000000 --- a/tests/pending/run/macro-invalidusage-badret/Test_2.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - import scala.reflect.runtime.universe._ - import scala.reflect.runtime.{currentMirror => cm} - import scala.tools.reflect.ToolBox - val tree = Typed(Apply(Select(Ident(TermName("Macros")), TermName("foo")), List(Literal(Constant(42)))), Ident(TypeName("String"))) - try cm.mkToolBox().eval(tree) - catch { case ex: Throwable => println(ex.getMessage) } -} diff --git a/tests/pending/run/macro-invalidusage-partialapplication-with-tparams.check b/tests/pending/run/macro-invalidusage-partialapplication-with-tparams.check deleted file mode 100644 index 6cbcb9e5a..000000000 --- a/tests/pending/run/macro-invalidusage-partialapplication-with-tparams.check +++ /dev/null @@ -1,3 +0,0 @@ -reflective compilation has failed: - -too few argument lists for macro invocation diff --git a/tests/pending/run/macro-invalidusage-partialapplication-with-tparams.flags b/tests/pending/run/macro-invalidusage-partialapplication-with-tparams.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-invalidusage-partialapplication-with-tparams.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-invalidusage-partialapplication-with-tparams/Impls_Macros_1.scala b/tests/pending/run/macro-invalidusage-partialapplication-with-tparams/Impls_Macros_1.scala deleted file mode 100644 index 8b5c59bde..000000000 --- a/tests/pending/run/macro-invalidusage-partialapplication-with-tparams/Impls_Macros_1.scala +++ /dev/null @@ -1,13 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo[T: c.WeakTypeTag](c: Context)(x: c.Expr[T]) = { - import c.universe._ - val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(x.tree.toString)))) - c.Expr[Unit](body) - } -} - -object Macros { - def foo[T](x: T) = macro Impls.foo[T] -} \ No newline at end of file diff --git a/tests/pending/run/macro-invalidusage-partialapplication-with-tparams/Test_2.scala b/tests/pending/run/macro-invalidusage-partialapplication-with-tparams/Test_2.scala deleted file mode 100644 index ba763eda5..000000000 --- a/tests/pending/run/macro-invalidusage-partialapplication-with-tparams/Test_2.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - import scala.reflect.runtime.universe._ - import scala.reflect.runtime.{currentMirror => cm} - import scala.tools.reflect.ToolBox - val tree = Select(Ident(TermName("Macros")), TermName("foo")) - try cm.mkToolBox().eval(tree) - catch { case ex: Throwable => println(ex.getMessage) } -} diff --git a/tests/pending/run/macro-invalidusage-partialapplication.check b/tests/pending/run/macro-invalidusage-partialapplication.check deleted file mode 100644 index 6cbcb9e5a..000000000 --- a/tests/pending/run/macro-invalidusage-partialapplication.check +++ /dev/null @@ -1,3 +0,0 @@ -reflective compilation has failed: - -too few argument lists for macro invocation diff --git a/tests/pending/run/macro-invalidusage-partialapplication.flags b/tests/pending/run/macro-invalidusage-partialapplication.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-invalidusage-partialapplication.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-invalidusage-partialapplication/Impls_Macros_1.scala b/tests/pending/run/macro-invalidusage-partialapplication/Impls_Macros_1.scala deleted file mode 100644 index 6970b4dd7..000000000 --- a/tests/pending/run/macro-invalidusage-partialapplication/Impls_Macros_1.scala +++ /dev/null @@ -1,14 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo(c: Context)(x: c.Expr[Int])(y: c.Expr[Int]) = { - import c.universe._ - val sum = Apply(Select(x.tree, TermName("$plus")), List(y.tree)) - val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(sum)) - c.Expr[Unit](body) - } -} - -object Macros { - def foo(x: Int)(y: Int) = macro Impls.foo -} \ No newline at end of file diff --git a/tests/pending/run/macro-invalidusage-partialapplication/Test_2.scala b/tests/pending/run/macro-invalidusage-partialapplication/Test_2.scala deleted file mode 100644 index a0b90ee6b..000000000 --- a/tests/pending/run/macro-invalidusage-partialapplication/Test_2.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - import scala.reflect.runtime.universe._ - import scala.reflect.runtime.{currentMirror => cm} - import scala.tools.reflect.ToolBox - val tree = Apply(Select(Ident(TermName("Macros")), TermName("foo")), List(Literal(Constant(40)))) - try cm.mkToolBox().eval(tree) - catch { case ex: Throwable => println(ex.getMessage) } -} diff --git a/tests/pending/run/macro-openmacros.check b/tests/pending/run/macro-openmacros.check deleted file mode 100644 index ba0ae3ff4..000000000 --- a/tests/pending/run/macro-openmacros.check +++ /dev/null @@ -1,3 +0,0 @@ -List(MacroContext(foo@source-Test_2.scala,line-2,offset=35 +0)) -List(MacroContext(foo@source-Test_2.scala,line-2,offset=35 +1), MacroContext(foo@source-Test_2.scala,line-2,offset=35 +0)) -List(MacroContext(foo@source-Test_2.scala,line-2,offset=35 +2), MacroContext(foo@source-Test_2.scala,line-2,offset=35 +1), MacroContext(foo@source-Test_2.scala,line-2,offset=35 +0)) diff --git a/tests/pending/run/macro-openmacros.flags b/tests/pending/run/macro-openmacros.flags deleted file mode 100644 index 2433c055a..000000000 --- a/tests/pending/run/macro-openmacros.flags +++ /dev/null @@ -1,2 +0,0 @@ --Yrangepos:false --language:experimental.macros diff --git a/tests/pending/run/macro-openmacros/Impls_Macros_1.scala b/tests/pending/run/macro-openmacros/Impls_Macros_1.scala deleted file mode 100644 index b60ca90d9..000000000 --- a/tests/pending/run/macro-openmacros/Impls_Macros_1.scala +++ /dev/null @@ -1,25 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Macros { - def impl(c: Context): c.Expr[Unit] = { - // we're macros, so we can reflect against our source path - // so we don't need any partests to clean up after us! - val dir = c.enclosingUnit.source.file.file.getCanonicalFile.getParentFile - def normalizePaths(s: String) = { - val base = (dir.getCanonicalPath + java.io.File.separator).replace('\\', '/') - var regex = """\Q%s\E""" format base - val isWin = System.getProperty("os.name", "") startsWith "Windows" - if (isWin) regex = "(?i)" + regex - s.replace('\\', '/').replaceAll(regex, "") - } - - import c.universe._ - val next = if (c.enclosingMacros.length < 3) c.Expr[Unit](Select(Ident(c.mirror.staticModule("Macros")), TermName("foo"))) else c.Expr[Unit](Literal(Constant(()))) - c.universe.reify { - println(c.Expr[String](Literal(Constant(normalizePaths(c.enclosingMacros.toString)))).splice) - next.splice - } - } - - def foo = macro impl -} \ No newline at end of file diff --git a/tests/pending/run/macro-openmacros/Test_2.scala b/tests/pending/run/macro-openmacros/Test_2.scala deleted file mode 100644 index d75fbd0db..000000000 --- a/tests/pending/run/macro-openmacros/Test_2.scala +++ /dev/null @@ -1,3 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - Macros.foo -} diff --git a/tests/pending/run/macro-parse-position-malformed.check b/tests/pending/run/macro-parse-position-malformed.check deleted file mode 100644 index 00f0bc5b6..000000000 --- a/tests/pending/run/macro-parse-position-malformed.check +++ /dev/null @@ -1 +0,0 @@ -failed with 'source-,line-1,offset=7' position and '')' expected but eof found.' message diff --git a/tests/pending/run/macro-parse-position-malformed/Impls_Macros_1.scala b/tests/pending/run/macro-parse-position-malformed/Impls_Macros_1.scala deleted file mode 100644 index b623d8820..000000000 --- a/tests/pending/run/macro-parse-position-malformed/Impls_Macros_1.scala +++ /dev/null @@ -1,18 +0,0 @@ -import scala.language.experimental.macros -import scala.reflect.macros.blackbox.Context -import scala.reflect.macros.ParseException - -object Macros { - def impl(c: Context)() = { - import c.universe._ - val out = try { - c.parse("foo(bar") - "didn't fail" - } catch { - case e: ParseException => - s"failed with '${e.pos}' position and '${e.msg}' message" - } - c.Expr[String](Literal(Constant(out))) - } - def foo(): String = macro impl -} \ No newline at end of file diff --git a/tests/pending/run/macro-parse-position-malformed/Test_2.scala b/tests/pending/run/macro-parse-position-malformed/Test_2.scala deleted file mode 100644 index 1b04d2af2..000000000 --- a/tests/pending/run/macro-parse-position-malformed/Test_2.scala +++ /dev/null @@ -1,3 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - println(Macros.foo) -} diff --git a/tests/pending/run/macro-parse-position.check b/tests/pending/run/macro-parse-position.check deleted file mode 100644 index 3da032069..000000000 --- a/tests/pending/run/macro-parse-position.check +++ /dev/null @@ -1,5 +0,0 @@ -false -source-,line-1,offset=4 -8 -foo bar - diff --git a/tests/pending/run/macro-parse-position.flags b/tests/pending/run/macro-parse-position.flags deleted file mode 100644 index ea7fc37e1..000000000 --- a/tests/pending/run/macro-parse-position.flags +++ /dev/null @@ -1 +0,0 @@ --Yrangepos:false diff --git a/tests/pending/run/macro-parse-position/Impls_Macros_1.scala b/tests/pending/run/macro-parse-position/Impls_Macros_1.scala deleted file mode 100644 index dd20fd291..000000000 --- a/tests/pending/run/macro-parse-position/Impls_Macros_1.scala +++ /dev/null @@ -1,12 +0,0 @@ -import scala.language.experimental.macros -import scala.reflect.macros.blackbox.Context - -object Macros { - def impl(c: Context)() = { - import c.universe._ - val t = c.parse("foo bar") - val out = s"${t.pos == NoPosition}\n${t.pos}\n${t.pos.source.content.length}\n${new String(t.pos.source.content)}" - c.Expr[String](Literal(Constant(out))) - } - def foo(): String = macro impl -} \ No newline at end of file diff --git a/tests/pending/run/macro-parse-position/Test_2.scala b/tests/pending/run/macro-parse-position/Test_2.scala deleted file mode 100644 index 1b04d2af2..000000000 --- a/tests/pending/run/macro-parse-position/Test_2.scala +++ /dev/null @@ -1,3 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - println(Macros.foo) -} diff --git a/tests/pending/run/macro-quasiinvalidbody-c.check b/tests/pending/run/macro-quasiinvalidbody-c.check deleted file mode 100644 index f70d7bba4..000000000 --- a/tests/pending/run/macro-quasiinvalidbody-c.check +++ /dev/null @@ -1 +0,0 @@ -42 \ No newline at end of file diff --git a/tests/pending/run/macro-quasiinvalidbody-c.flags b/tests/pending/run/macro-quasiinvalidbody-c.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-quasiinvalidbody-c.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-quasiinvalidbody-c/Impls_Macros_1.scala b/tests/pending/run/macro-quasiinvalidbody-c/Impls_Macros_1.scala deleted file mode 100644 index df189b70d..000000000 --- a/tests/pending/run/macro-quasiinvalidbody-c/Impls_Macros_1.scala +++ /dev/null @@ -1,9 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Macros { - object Impls { - def foo(c: Context)(x: c.Expr[Any]) = x - } - - def foo(x: Any) = macro Impls.foo -} \ No newline at end of file diff --git a/tests/pending/run/macro-quasiinvalidbody-c/Test_2.scala b/tests/pending/run/macro-quasiinvalidbody-c/Test_2.scala deleted file mode 100644 index 91053843d..000000000 --- a/tests/pending/run/macro-quasiinvalidbody-c/Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - import Macros._ - println(foo(42)) -} \ No newline at end of file diff --git a/tests/pending/run/macro-quasiquotes.check b/tests/pending/run/macro-quasiquotes.check deleted file mode 100644 index 94ebaf900..000000000 --- a/tests/pending/run/macro-quasiquotes.check +++ /dev/null @@ -1,4 +0,0 @@ -1 -2 -3 -4 diff --git a/tests/pending/run/macro-quasiquotes/Macros_1.scala b/tests/pending/run/macro-quasiquotes/Macros_1.scala deleted file mode 100644 index 764542a87..000000000 --- a/tests/pending/run/macro-quasiquotes/Macros_1.scala +++ /dev/null @@ -1,15 +0,0 @@ -import language.experimental.macros -import scala.reflect.macros.blackbox.Context - -class Impls(val c: Context) { - import c.universe._ - def impl1 = q"println(1)" - def impl2 = q"{ println(2); println(3) }" - def impl3 = q"4" -} - -object Macros { - def m1: Unit = macro Impls.impl1 - def m2: Unit = macro Impls.impl2 - def m3: Int = macro Impls.impl3 -} \ No newline at end of file diff --git a/tests/pending/run/macro-quasiquotes/Test_2.scala b/tests/pending/run/macro-quasiquotes/Test_2.scala deleted file mode 100644 index b7d203197..000000000 --- a/tests/pending/run/macro-quasiquotes/Test_2.scala +++ /dev/null @@ -1,5 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - Macros.m1 - Macros.m2 - println(Macros.m3) -} diff --git a/tests/pending/run/macro-range.check b/tests/pending/run/macro-range.check deleted file mode 100644 index 071939893..000000000 --- a/tests/pending/run/macro-range.check +++ /dev/null @@ -1,9 +0,0 @@ -1 -2 -3 -4 -5 -6 -7 -8 -9 diff --git a/tests/pending/run/macro-range.flags b/tests/pending/run/macro-range.flags deleted file mode 100644 index 5e5dd6ce7..000000000 --- a/tests/pending/run/macro-range.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros diff --git a/tests/pending/run/macro-range/Common_1.scala b/tests/pending/run/macro-range/Common_1.scala deleted file mode 100644 index 35d2efd76..000000000 --- a/tests/pending/run/macro-range/Common_1.scala +++ /dev/null @@ -1,48 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -abstract class RangeDefault { - val from, to: Int - def foreach(f: Int => Unit) = { - var i = from - while (i < to) { f(i); i += 1 } - } -} - -/** This class should go into reflect.macro once it is a bit more stable. */ -abstract class Utils { - val context: Context - import context.universe._ - import internal._ - - class TreeSubstituter(from: List[Symbol], to: List[Tree]) extends Transformer { - override def transform(tree: Tree): Tree = tree match { - case Ident(_) => - def subst(from: List[Symbol], to: List[Tree]): Tree = - if (from.isEmpty) tree - else if (tree.symbol == from.head) to.head.duplicate // TODO: does it ever make sense *not* to perform a shallowDuplicate on `to.head`? - else subst(from.tail, to.tail); - subst(from, to) - case _ => - val tree1 = super.transform(tree) - if (tree1 ne tree) setType(tree1, null) - tree1 - } - } - def makeApply(fn: Tree, args: List[Tree]): Tree = fn match { - case Function(vparams, body) => - new TreeSubstituter(vparams map (_.symbol), args) transform body - case Block(stats, expr) => - Block(stats, makeApply(expr, args)) - case _ => - // todo. read the compiler config and print if -Ydebug is set - //println("no beta on "+fn+" "+fn.getClass) - Apply(fn, args) - } - def makeWhile(lname: TermName, cond: Tree, body: Tree): Tree = { - val continu = Apply(Ident(lname), Nil) - val rhs = If(cond, Block(List(body), continu), Literal(Constant())) - LabelDef(lname, Nil, rhs) - } - def makeBinop(left: Tree, op: String, right: Tree): Tree = - Apply(Select(left, TermName(op)), List(right)) -} diff --git a/tests/pending/run/macro-range/Expansion_Impossible_2.scala b/tests/pending/run/macro-range/Expansion_Impossible_2.scala deleted file mode 100644 index b3c2fa348..000000000 --- a/tests/pending/run/macro-range/Expansion_Impossible_2.scala +++ /dev/null @@ -1,53 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foreach(c: Context)(f: c.Expr[Int => Unit]): c.Expr[Unit] = { - // todo. read the compiler config and print if -Ydebug is set - //println("macro-expand, _this = "+ _this) - object utils extends Utils { val context: c.type = c } - import utils._ - import c.universe._ - import Flag._ - - val initName = termNames.CONSTRUCTOR - // Either: - // scala"{ var i = $low; val h = $hi; while (i < h) { $f(i); i = i + 1 } } - // or: - // scala"($_this: RangeDefault).foreach($f)" - c.Expr(c.prefix.tree match { - case Apply(Select(New(tpt), initName), List(lo, hi)) if tpt.symbol.fullName == "Range" => - val iname = TermName("$i") - val hname = TermName("$h") - def iref = Ident(iname) - def href = Ident(hname) - val labelname = TermName("$while") - val cond = makeBinop(iref, "$less", href) - val body = Block( - List(makeApply(f.tree, List(iref))), - Assign(iref, makeBinop(iref, "$plus", Literal(Constant(1))))) - val generated = - Block( - List( - 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 - //tools.nsc.util.trace("generated: ")(generated) - generated - case _ => - Apply( - Select( - Typed(c.prefix.tree, Ident(TypeName("RangeDefault"))), - TermName("foreach")), - List(f.tree)) - }) - } -} - -class Range(val from: Int, val to: Int) extends RangeDefault { - override def foreach(f: Int => Unit): Unit = macro Impls.foreach -} - -object Test extends dotty.runtime.LegacyApp { - new Range(1, 10) foreach println -} \ No newline at end of file diff --git a/tests/pending/run/macro-range/Expansion_Possible_3.scala b/tests/pending/run/macro-range/Expansion_Possible_3.scala deleted file mode 100644 index b1fbba765..000000000 --- a/tests/pending/run/macro-range/Expansion_Possible_3.scala +++ /dev/null @@ -1,7 +0,0 @@ -class Range(val from: Int, val to: Int) extends RangeDefault { - override def foreach(f: Int => Unit): Unit = macro Impls.foreach -} - -object Test extends dotty.runtime.LegacyApp { - new Range(1, 10) foreach println -} \ No newline at end of file diff --git a/tests/pending/run/macro-rangepos-args.check b/tests/pending/run/macro-rangepos-args.check deleted file mode 100644 index d779505c6..000000000 --- a/tests/pending/run/macro-rangepos-args.check +++ /dev/null @@ -1 +0,0 @@ -Line: 3. Width: 5. diff --git a/tests/pending/run/macro-rangepos-args.flags b/tests/pending/run/macro-rangepos-args.flags deleted file mode 100644 index fcf951d90..000000000 --- a/tests/pending/run/macro-rangepos-args.flags +++ /dev/null @@ -1 +0,0 @@ --Yrangepos \ No newline at end of file diff --git a/tests/pending/run/macro-rangepos-args/Macros_1.scala b/tests/pending/run/macro-rangepos-args/Macros_1.scala deleted file mode 100644 index 97b938613..000000000 --- a/tests/pending/run/macro-rangepos-args/Macros_1.scala +++ /dev/null @@ -1,10 +0,0 @@ -import scala.language.experimental.macros -import scala.reflect.macros.blackbox.Context - -object Macros { - def impl(c: Context)(x: c.Tree): c.Tree = { - import c.universe._ - Literal(Constant(s"Line: ${x.pos.line}. Width: ${x.pos.end - x.pos.start}.")) - } - def pos(x: Any): String = macro impl -} diff --git a/tests/pending/run/macro-rangepos-args/Test_2.scala b/tests/pending/run/macro-rangepos-args/Test_2.scala deleted file mode 100644 index 936b945c7..000000000 --- a/tests/pending/run/macro-rangepos-args/Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - val x = 2 - println(Macros.pos(x + 2)) -} \ No newline at end of file diff --git a/tests/pending/run/macro-rangepos-subpatterns.check b/tests/pending/run/macro-rangepos-subpatterns.check deleted file mode 100644 index 760e15d01..000000000 --- a/tests/pending/run/macro-rangepos-subpatterns.check +++ /dev/null @@ -1 +0,0 @@ -The width of the subpattern is: 2 diff --git a/tests/pending/run/macro-rangepos-subpatterns.flags b/tests/pending/run/macro-rangepos-subpatterns.flags deleted file mode 100644 index fcf951d90..000000000 --- a/tests/pending/run/macro-rangepos-subpatterns.flags +++ /dev/null @@ -1 +0,0 @@ --Yrangepos \ No newline at end of file diff --git a/tests/pending/run/macro-rangepos-subpatterns/Macros_1.scala b/tests/pending/run/macro-rangepos-subpatterns/Macros_1.scala deleted file mode 100644 index 0f3086234..000000000 --- a/tests/pending/run/macro-rangepos-subpatterns/Macros_1.scala +++ /dev/null @@ -1,18 +0,0 @@ -import scala.reflect.macros.whitebox.Context -import language.experimental.macros - -object Extractor { - def unapply(x: Any): Any = macro unapplyImpl - def unapplyImpl(c: Context)(x: c.Tree) = { - import c.universe._ - import internal._ - val pos = subpatterns(x).get.head.pos - q""" - new { - def isEmpty = false - def get = ${"The width of the subpattern is: " + (pos.end - pos.start + 1)} - def unapply(x: Any) = this - }.unapply($x) - """ - } -} diff --git a/tests/pending/run/macro-rangepos-subpatterns/Test_2.scala b/tests/pending/run/macro-rangepos-subpatterns/Test_2.scala deleted file mode 100644 index b9b308cea..000000000 --- a/tests/pending/run/macro-rangepos-subpatterns/Test_2.scala +++ /dev/null @@ -1,5 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - 42 match { - case Extractor(a) => println(a) - } -} diff --git a/tests/pending/run/macro-reflective-ma-normal-mdmi.check b/tests/pending/run/macro-reflective-ma-normal-mdmi.check deleted file mode 100644 index ac4213d6e..000000000 --- a/tests/pending/run/macro-reflective-ma-normal-mdmi.check +++ /dev/null @@ -1 +0,0 @@ -43 \ No newline at end of file diff --git a/tests/pending/run/macro-reflective-ma-normal-mdmi.flags b/tests/pending/run/macro-reflective-ma-normal-mdmi.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-reflective-ma-normal-mdmi.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-reflective-ma-normal-mdmi/Impls_Macros_1.scala b/tests/pending/run/macro-reflective-ma-normal-mdmi/Impls_Macros_1.scala deleted file mode 100644 index e964da210..000000000 --- a/tests/pending/run/macro-reflective-ma-normal-mdmi/Impls_Macros_1.scala +++ /dev/null @@ -1,13 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo(c: Context)(x: c.Expr[Int]) = { - import c.universe._ - val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(1)))) - c.Expr[Int](body) - } -} - -object Macros { - def foo(x: Int) = macro Impls.foo -} \ No newline at end of file diff --git a/tests/pending/run/macro-reflective-ma-normal-mdmi/Test_2.scala b/tests/pending/run/macro-reflective-ma-normal-mdmi/Test_2.scala deleted file mode 100644 index b8d969b83..000000000 --- a/tests/pending/run/macro-reflective-ma-normal-mdmi/Test_2.scala +++ /dev/null @@ -1,7 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - import scala.reflect.runtime.universe._ - import scala.reflect.runtime.{currentMirror => cm} - import scala.tools.reflect.ToolBox - val tree = Apply(Select(Ident(TermName("Macros")), TermName("foo")), List(Literal(Constant(42)))) - println(cm.mkToolBox().eval(tree)) -} diff --git a/tests/pending/run/macro-reflective-mamd-normal-mi.check b/tests/pending/run/macro-reflective-mamd-normal-mi.check deleted file mode 100644 index 920a13966..000000000 --- a/tests/pending/run/macro-reflective-mamd-normal-mi.check +++ /dev/null @@ -1 +0,0 @@ -43 diff --git a/tests/pending/run/macro-reflective-mamd-normal-mi/Impls_1.scala b/tests/pending/run/macro-reflective-mamd-normal-mi/Impls_1.scala deleted file mode 100644 index e62db783b..000000000 --- a/tests/pending/run/macro-reflective-mamd-normal-mi/Impls_1.scala +++ /dev/null @@ -1,9 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo(c: Context)(x: c.Expr[Int]) = { - import c.universe._ - val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(1)))) - c.Expr[Int](body) - } -} diff --git a/tests/pending/run/macro-reflective-mamd-normal-mi/Macros_Test_2.scala b/tests/pending/run/macro-reflective-mamd-normal-mi/Macros_Test_2.scala deleted file mode 100644 index 0b867e787..000000000 --- a/tests/pending/run/macro-reflective-mamd-normal-mi/Macros_Test_2.scala +++ /dev/null @@ -1,20 +0,0 @@ -//object Macros { -// def foo(x: Int) = macro Impls.foo -//} - -object Test extends dotty.runtime.LegacyApp { - import scala.reflect.runtime.universe._ - import scala.reflect.runtime.universe.Flag._ - import scala.reflect.runtime.{currentMirror => cm} - import scala.tools.reflect.ToolBox - - val macrobody = Select(Ident(TermName("Impls")), TermName("foo")) - val macroparam = ValDef(NoMods, TermName("x"), TypeTree(definitions.IntClass.toType), EmptyTree) - val macrodef = DefDef(Modifiers(MACRO), TermName("foo"), Nil, List(List(macroparam)), Ident(TypeName("Int")), macrobody) - val modulector = DefDef(NoMods, termNames.CONSTRUCTOR, Nil, List(List()), TypeTree(), Block(List(Apply(Select(Super(This(typeNames.EMPTY), typeNames.EMPTY), termNames.CONSTRUCTOR), List())), Literal(Constant(())))) - val module = ModuleDef(NoMods, TermName("Macros"), Template(Nil, noSelfType, List(modulector, macrodef))) - val macroapp = Apply(Select(Ident(TermName("Macros")), TermName("foo")), List(Literal(Constant(42)))) - val tree = Block(List(macrodef, module), macroapp) - val toolbox = cm.mkToolBox(options = "-language:experimental.macros") - println(toolbox.eval(tree)) -} diff --git a/tests/pending/run/macro-reify-basic.check b/tests/pending/run/macro-reify-basic.check deleted file mode 100644 index 3b18e512d..000000000 --- a/tests/pending/run/macro-reify-basic.check +++ /dev/null @@ -1 +0,0 @@ -hello world diff --git a/tests/pending/run/macro-reify-basic.flags b/tests/pending/run/macro-reify-basic.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-reify-basic.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-reify-basic/Macros_1.scala b/tests/pending/run/macro-reify-basic/Macros_1.scala deleted file mode 100644 index 1cf2a8a40..000000000 --- a/tests/pending/run/macro-reify-basic/Macros_1.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Macros { - def foo(s: String) = macro Impls.foo - - object Impls { - def foo(c: Context)(s: c.Expr[String]) = c.universe.reify { - println("hello " + s.splice) - } - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-basic/Test_2.scala b/tests/pending/run/macro-reify-basic/Test_2.scala deleted file mode 100644 index 26b2c7d9f..000000000 --- a/tests/pending/run/macro-reify-basic/Test_2.scala +++ /dev/null @@ -1,3 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - Macros.foo("world") -} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-chained1/Impls_Macros_1.scala b/tests/pending/run/macro-reify-chained1/Impls_Macros_1.scala deleted file mode 100644 index 7f877b272..000000000 --- a/tests/pending/run/macro-reify-chained1/Impls_Macros_1.scala +++ /dev/null @@ -1,47 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.macros.blackbox.Context -import scala.language.experimental.macros - -case class Utils[C <: Context]( c:C ) { - import c.universe._ - import c.{Tree=>_} - object removeDoubleReify extends c.universe.Transformer { - def apply( tree:Tree ) = transform(tree) - override def transform(tree: Tree): Tree = { - super.transform { - tree match { - case Apply(TypeApply(Select(_this, termname), _), reification::Nil ) - if termname.toString == "factory" => c.unreifyTree(reification) - case Apply(Select(_this, termname), reification::Nil ) - if termname.toString == "factory" => c.unreifyTree(reification) - case _ => tree - } - } - } - } -} -object QueryableMacros{ - def _helper[C <: Context,S:c.WeakTypeTag]( c:C )( name:String, projection:c.Expr[_] ) = { - import c.universe._ - import internal._ - val element_type = implicitly[c.WeakTypeTag[S]].tpe - val foo = c.Expr[ru.Expr[Queryable[S]]]( - c.reifyTree( gen.mkRuntimeUniverseRef, EmptyTree, c.typecheck( - Utils[c.type](c).removeDoubleReify( - Apply(Select(c.prefix.tree, TermName( name )), List( projection.tree )) - ).asInstanceOf[Tree] - ))) - c.universe.reify{ Queryable.factory[S]( foo.splice )} - } - def map[T:c.WeakTypeTag, S:c.WeakTypeTag] - (c: Context) - (projection: c.Expr[T => S]): c.Expr[Queryable[S]] = _helper[c.type,S]( c )( "_map", projection ) -} -class Queryable[T]{ - def _map[S]( projection: T => S ) : Queryable[S] = ??? - def map[S]( projection: T => S ) : Queryable[S] = macro QueryableMacros.map[T,S] -} -object Queryable{ - def factory[S]( projection:ru.Expr[Queryable[S]] ) : Queryable[S] = null -} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-chained1/Test_2.scala b/tests/pending/run/macro-reify-chained1/Test_2.scala deleted file mode 100644 index 01a021893..000000000 --- a/tests/pending/run/macro-reify-chained1/Test_2.scala +++ /dev/null @@ -1,9 +0,0 @@ -object Test extends dotty.runtime.LegacyApp{ - val q : Queryable[Any] = new Queryable[Any] - q.map(x => x).map(x => x) - - locally { - val q : Queryable[Any] = new Queryable[Any] - q.map(x => x).map(x => x) - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-chained2/Impls_Macros_1.scala b/tests/pending/run/macro-reify-chained2/Impls_Macros_1.scala deleted file mode 100644 index 965b19104..000000000 --- a/tests/pending/run/macro-reify-chained2/Impls_Macros_1.scala +++ /dev/null @@ -1,47 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.macros.whitebox.Context -import scala.language.experimental.macros - -case class Utils[C <: Context]( c:C ) { - import c.universe._ - import c.{Tree=>_} - object removeDoubleReify extends c.universe.Transformer { - def apply( tree:Tree ) = transform(tree) - override def transform(tree: Tree): Tree = { - super.transform { - tree match { - case Apply(TypeApply(Select(_this, termname), _), reification::Nil ) - if termname.toString == "factory" => c.unreifyTree(reification) - case Apply(Select(_this, termname), reification::Nil ) - if termname.toString == "factory" => c.unreifyTree(reification) - case _ => tree - } - } - } - } -} -object QueryableMacros{ - def _helper[C <: Context,S:c.WeakTypeTag]( c:C )( name:String, projection:c.Expr[_] ) = { - import c.universe._ - import internal._ - val element_type = implicitly[c.WeakTypeTag[S]].tpe - val foo = c.Expr[ru.Expr[Queryable[S]]]( - c.reifyTree( gen.mkRuntimeUniverseRef, EmptyTree, c.typecheck( - Utils[c.type](c).removeDoubleReify( - Apply(Select(c.prefix.tree, TermName( name )), List( projection.tree )) - ).asInstanceOf[Tree] - ))) - c.universe.reify{ Queryable.factory[S]( foo.splice )} - } - def map[T:c.WeakTypeTag, S:c.WeakTypeTag] - (c: Context) - (projection: c.Expr[T => S]): c.Expr[Queryable[S]] = _helper[c.type,S]( c )( "_map", projection ) -} -class Queryable[T]{ - def _map[S]( projection: T => S ) : Queryable[S] = ??? - def map[S]( projection: T => S ) : Queryable[S] = macro QueryableMacros.map[T,S] -} -object Queryable{ - def factory[S]( projection:ru.Expr[Queryable[S]] ) : Queryable[S] = null -} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-chained2/Test_2.scala b/tests/pending/run/macro-reify-chained2/Test_2.scala deleted file mode 100644 index 01a021893..000000000 --- a/tests/pending/run/macro-reify-chained2/Test_2.scala +++ /dev/null @@ -1,9 +0,0 @@ -object Test extends dotty.runtime.LegacyApp{ - val q : Queryable[Any] = new Queryable[Any] - q.map(x => x).map(x => x) - - locally { - val q : Queryable[Any] = new Queryable[Any] - q.map(x => x).map(x => x) - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-freevars.check b/tests/pending/run/macro-reify-freevars.check deleted file mode 100644 index f618e307b..000000000 --- a/tests/pending/run/macro-reify-freevars.check +++ /dev/null @@ -1,3 +0,0 @@ -reflective compilation has failed: - -Macro expansion contains free term variable code defined by map in Macros_1.scala:9:9. Have you forgotten to use splice when splicing this variable into a reifee? If you have troubles tracking free term variables, consider using -Xlog-free-terms diff --git a/tests/pending/run/macro-reify-freevars.flags b/tests/pending/run/macro-reify-freevars.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-reify-freevars.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-reify-freevars/Macros_1.scala b/tests/pending/run/macro-reify-freevars/Macros_1.scala deleted file mode 100644 index 912f602c6..000000000 --- a/tests/pending/run/macro-reify-freevars/Macros_1.scala +++ /dev/null @@ -1,20 +0,0 @@ -package scala.collection.slick - -object QueryableMacros{ - def map[T:c.WeakTypeTag, S:c.WeakTypeTag] - (c: scala.reflect.macros.blackbox.Context) - (projection: c.Expr[T => S]) - : c.Expr[scala.collection.slick.Queryable[S]] = { - import c.universe._ - val code = EmptyTree - c.universe.reify{ - Queryable.factory[S]( code.asInstanceOf[reflect.runtime.universe.Tree] ) - } - } -} -class Queryable[T]{ - def map[S]( projection: T => S ) : Queryable[S] = macro QueryableMacros.map[T,S] -} -object Queryable{ - def factory[S]( projection:reflect.runtime.universe.Tree ) : Queryable[S] = null -} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-freevars/Test_2.scala b/tests/pending/run/macro-reify-freevars/Test_2.scala deleted file mode 100644 index 11c8128cd..000000000 --- a/tests/pending/run/macro-reify-freevars/Test_2.scala +++ /dev/null @@ -1,11 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - import scala.reflect.runtime.universe._ - import scala.reflect.runtime.{currentMirror => cm} - import scala.tools.reflect.ToolBox - val q = New(AppliedTypeTree(Select(Select(Select(Ident(TermName("scala")), TermName("collection")), TermName("slick")), TypeName("Queryable")), List(Ident(TermName("Int"))))) - val x = ValDef(NoMods, TermName("x"), Ident(TermName("Int")), EmptyTree) - val fn = Function(List(x), Apply(Select(Ident(TermName("x")), TermName("$plus")), List(Literal(Constant("5"))))) - val tree = Apply(Select(q, TermName("map")), List(fn)) - try cm.mkToolBox().eval(tree) - catch { case ex: Throwable => println(ex.getMessage) } -} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-nested-a1/Impls_Macros_1.scala b/tests/pending/run/macro-reify-nested-a1/Impls_Macros_1.scala deleted file mode 100644 index 7f877b272..000000000 --- a/tests/pending/run/macro-reify-nested-a1/Impls_Macros_1.scala +++ /dev/null @@ -1,47 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.macros.blackbox.Context -import scala.language.experimental.macros - -case class Utils[C <: Context]( c:C ) { - import c.universe._ - import c.{Tree=>_} - object removeDoubleReify extends c.universe.Transformer { - def apply( tree:Tree ) = transform(tree) - override def transform(tree: Tree): Tree = { - super.transform { - tree match { - case Apply(TypeApply(Select(_this, termname), _), reification::Nil ) - if termname.toString == "factory" => c.unreifyTree(reification) - case Apply(Select(_this, termname), reification::Nil ) - if termname.toString == "factory" => c.unreifyTree(reification) - case _ => tree - } - } - } - } -} -object QueryableMacros{ - def _helper[C <: Context,S:c.WeakTypeTag]( c:C )( name:String, projection:c.Expr[_] ) = { - import c.universe._ - import internal._ - val element_type = implicitly[c.WeakTypeTag[S]].tpe - val foo = c.Expr[ru.Expr[Queryable[S]]]( - c.reifyTree( gen.mkRuntimeUniverseRef, EmptyTree, c.typecheck( - Utils[c.type](c).removeDoubleReify( - Apply(Select(c.prefix.tree, TermName( name )), List( projection.tree )) - ).asInstanceOf[Tree] - ))) - c.universe.reify{ Queryable.factory[S]( foo.splice )} - } - def map[T:c.WeakTypeTag, S:c.WeakTypeTag] - (c: Context) - (projection: c.Expr[T => S]): c.Expr[Queryable[S]] = _helper[c.type,S]( c )( "_map", projection ) -} -class Queryable[T]{ - def _map[S]( projection: T => S ) : Queryable[S] = ??? - def map[S]( projection: T => S ) : Queryable[S] = macro QueryableMacros.map[T,S] -} -object Queryable{ - def factory[S]( projection:ru.Expr[Queryable[S]] ) : Queryable[S] = null -} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-nested-a1/Test_2.scala b/tests/pending/run/macro-reify-nested-a1/Test_2.scala deleted file mode 100644 index 37282cad7..000000000 --- a/tests/pending/run/macro-reify-nested-a1/Test_2.scala +++ /dev/null @@ -1,9 +0,0 @@ -object Test extends dotty.runtime.LegacyApp{ - val q : Queryable[Any] = new Queryable[Any] - q.map(e1 => q.map(e2=>e1)) - - locally { - val q : Queryable[Any] = new Queryable[Any] - q.map(e1 => q.map(e2=>e1)) - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-nested-a2/Impls_Macros_1.scala b/tests/pending/run/macro-reify-nested-a2/Impls_Macros_1.scala deleted file mode 100644 index 965b19104..000000000 --- a/tests/pending/run/macro-reify-nested-a2/Impls_Macros_1.scala +++ /dev/null @@ -1,47 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.macros.whitebox.Context -import scala.language.experimental.macros - -case class Utils[C <: Context]( c:C ) { - import c.universe._ - import c.{Tree=>_} - object removeDoubleReify extends c.universe.Transformer { - def apply( tree:Tree ) = transform(tree) - override def transform(tree: Tree): Tree = { - super.transform { - tree match { - case Apply(TypeApply(Select(_this, termname), _), reification::Nil ) - if termname.toString == "factory" => c.unreifyTree(reification) - case Apply(Select(_this, termname), reification::Nil ) - if termname.toString == "factory" => c.unreifyTree(reification) - case _ => tree - } - } - } - } -} -object QueryableMacros{ - def _helper[C <: Context,S:c.WeakTypeTag]( c:C )( name:String, projection:c.Expr[_] ) = { - import c.universe._ - import internal._ - val element_type = implicitly[c.WeakTypeTag[S]].tpe - val foo = c.Expr[ru.Expr[Queryable[S]]]( - c.reifyTree( gen.mkRuntimeUniverseRef, EmptyTree, c.typecheck( - Utils[c.type](c).removeDoubleReify( - Apply(Select(c.prefix.tree, TermName( name )), List( projection.tree )) - ).asInstanceOf[Tree] - ))) - c.universe.reify{ Queryable.factory[S]( foo.splice )} - } - def map[T:c.WeakTypeTag, S:c.WeakTypeTag] - (c: Context) - (projection: c.Expr[T => S]): c.Expr[Queryable[S]] = _helper[c.type,S]( c )( "_map", projection ) -} -class Queryable[T]{ - def _map[S]( projection: T => S ) : Queryable[S] = ??? - def map[S]( projection: T => S ) : Queryable[S] = macro QueryableMacros.map[T,S] -} -object Queryable{ - def factory[S]( projection:ru.Expr[Queryable[S]] ) : Queryable[S] = null -} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-nested-a2/Test_2.scala b/tests/pending/run/macro-reify-nested-a2/Test_2.scala deleted file mode 100644 index 37282cad7..000000000 --- a/tests/pending/run/macro-reify-nested-a2/Test_2.scala +++ /dev/null @@ -1,9 +0,0 @@ -object Test extends dotty.runtime.LegacyApp{ - val q : Queryable[Any] = new Queryable[Any] - q.map(e1 => q.map(e2=>e1)) - - locally { - val q : Queryable[Any] = new Queryable[Any] - q.map(e1 => q.map(e2=>e1)) - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-nested-b1/Impls_Macros_1.scala b/tests/pending/run/macro-reify-nested-b1/Impls_Macros_1.scala deleted file mode 100644 index 7f877b272..000000000 --- a/tests/pending/run/macro-reify-nested-b1/Impls_Macros_1.scala +++ /dev/null @@ -1,47 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.macros.blackbox.Context -import scala.language.experimental.macros - -case class Utils[C <: Context]( c:C ) { - import c.universe._ - import c.{Tree=>_} - object removeDoubleReify extends c.universe.Transformer { - def apply( tree:Tree ) = transform(tree) - override def transform(tree: Tree): Tree = { - super.transform { - tree match { - case Apply(TypeApply(Select(_this, termname), _), reification::Nil ) - if termname.toString == "factory" => c.unreifyTree(reification) - case Apply(Select(_this, termname), reification::Nil ) - if termname.toString == "factory" => c.unreifyTree(reification) - case _ => tree - } - } - } - } -} -object QueryableMacros{ - def _helper[C <: Context,S:c.WeakTypeTag]( c:C )( name:String, projection:c.Expr[_] ) = { - import c.universe._ - import internal._ - val element_type = implicitly[c.WeakTypeTag[S]].tpe - val foo = c.Expr[ru.Expr[Queryable[S]]]( - c.reifyTree( gen.mkRuntimeUniverseRef, EmptyTree, c.typecheck( - Utils[c.type](c).removeDoubleReify( - Apply(Select(c.prefix.tree, TermName( name )), List( projection.tree )) - ).asInstanceOf[Tree] - ))) - c.universe.reify{ Queryable.factory[S]( foo.splice )} - } - def map[T:c.WeakTypeTag, S:c.WeakTypeTag] - (c: Context) - (projection: c.Expr[T => S]): c.Expr[Queryable[S]] = _helper[c.type,S]( c )( "_map", projection ) -} -class Queryable[T]{ - def _map[S]( projection: T => S ) : Queryable[S] = ??? - def map[S]( projection: T => S ) : Queryable[S] = macro QueryableMacros.map[T,S] -} -object Queryable{ - def factory[S]( projection:ru.Expr[Queryable[S]] ) : Queryable[S] = null -} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-nested-b1/Test_2.scala b/tests/pending/run/macro-reify-nested-b1/Test_2.scala deleted file mode 100644 index b9d6846dc..000000000 --- a/tests/pending/run/macro-reify-nested-b1/Test_2.scala +++ /dev/null @@ -1,9 +0,0 @@ -object Test extends dotty.runtime.LegacyApp{ - val q : Queryable[Any] = new Queryable[Any] - q.map(e1 => q.map(e2=>e1).map(e2=>e1)) - - locally { - val q : Queryable[Any] = new Queryable[Any] - q.map(e1 => q.map(e2=>e1).map(e2=>e1)) - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-nested-b2/Impls_Macros_1.scala b/tests/pending/run/macro-reify-nested-b2/Impls_Macros_1.scala deleted file mode 100644 index 965b19104..000000000 --- a/tests/pending/run/macro-reify-nested-b2/Impls_Macros_1.scala +++ /dev/null @@ -1,47 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.macros.whitebox.Context -import scala.language.experimental.macros - -case class Utils[C <: Context]( c:C ) { - import c.universe._ - import c.{Tree=>_} - object removeDoubleReify extends c.universe.Transformer { - def apply( tree:Tree ) = transform(tree) - override def transform(tree: Tree): Tree = { - super.transform { - tree match { - case Apply(TypeApply(Select(_this, termname), _), reification::Nil ) - if termname.toString == "factory" => c.unreifyTree(reification) - case Apply(Select(_this, termname), reification::Nil ) - if termname.toString == "factory" => c.unreifyTree(reification) - case _ => tree - } - } - } - } -} -object QueryableMacros{ - def _helper[C <: Context,S:c.WeakTypeTag]( c:C )( name:String, projection:c.Expr[_] ) = { - import c.universe._ - import internal._ - val element_type = implicitly[c.WeakTypeTag[S]].tpe - val foo = c.Expr[ru.Expr[Queryable[S]]]( - c.reifyTree( gen.mkRuntimeUniverseRef, EmptyTree, c.typecheck( - Utils[c.type](c).removeDoubleReify( - Apply(Select(c.prefix.tree, TermName( name )), List( projection.tree )) - ).asInstanceOf[Tree] - ))) - c.universe.reify{ Queryable.factory[S]( foo.splice )} - } - def map[T:c.WeakTypeTag, S:c.WeakTypeTag] - (c: Context) - (projection: c.Expr[T => S]): c.Expr[Queryable[S]] = _helper[c.type,S]( c )( "_map", projection ) -} -class Queryable[T]{ - def _map[S]( projection: T => S ) : Queryable[S] = ??? - def map[S]( projection: T => S ) : Queryable[S] = macro QueryableMacros.map[T,S] -} -object Queryable{ - def factory[S]( projection:ru.Expr[Queryable[S]] ) : Queryable[S] = null -} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-nested-b2/Test_2.scala b/tests/pending/run/macro-reify-nested-b2/Test_2.scala deleted file mode 100644 index b9d6846dc..000000000 --- a/tests/pending/run/macro-reify-nested-b2/Test_2.scala +++ /dev/null @@ -1,9 +0,0 @@ -object Test extends dotty.runtime.LegacyApp{ - val q : Queryable[Any] = new Queryable[Any] - q.map(e1 => q.map(e2=>e1).map(e2=>e1)) - - locally { - val q : Queryable[Any] = new Queryable[Any] - q.map(e1 => q.map(e2=>e1).map(e2=>e1)) - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-ref-to-packageless.check b/tests/pending/run/macro-reify-ref-to-packageless.check deleted file mode 100644 index d81cc0710..000000000 --- a/tests/pending/run/macro-reify-ref-to-packageless.check +++ /dev/null @@ -1 +0,0 @@ -42 diff --git a/tests/pending/run/macro-reify-ref-to-packageless.flags b/tests/pending/run/macro-reify-ref-to-packageless.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-reify-ref-to-packageless.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-reify-ref-to-packageless/Impls_1.scala b/tests/pending/run/macro-reify-ref-to-packageless/Impls_1.scala deleted file mode 100644 index 38ec6f022..000000000 --- a/tests/pending/run/macro-reify-ref-to-packageless/Impls_1.scala +++ /dev/null @@ -1,6 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - val `Answer to the Ultimate Question of Life, the Universe, and Everything` = 42 - def foo(c: Context) = c.universe.reify { `Answer to the Ultimate Question of Life, the Universe, and Everything` } -} diff --git a/tests/pending/run/macro-reify-ref-to-packageless/Test_2.scala b/tests/pending/run/macro-reify-ref-to-packageless/Test_2.scala deleted file mode 100644 index ff5b60a6a..000000000 --- a/tests/pending/run/macro-reify-ref-to-packageless/Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - def foo: Int = macro Impls.foo - println(foo) -} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-splice-outside-reify.check b/tests/pending/run/macro-reify-splice-outside-reify.check deleted file mode 100644 index d81cc0710..000000000 --- a/tests/pending/run/macro-reify-splice-outside-reify.check +++ /dev/null @@ -1 +0,0 @@ -42 diff --git a/tests/pending/run/macro-reify-splice-outside-reify.flags b/tests/pending/run/macro-reify-splice-outside-reify.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-reify-splice-outside-reify.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-reify-splice-outside-reify/Impls_Macros_1.scala b/tests/pending/run/macro-reify-splice-outside-reify/Impls_Macros_1.scala deleted file mode 100644 index f038d8714..000000000 --- a/tests/pending/run/macro-reify-splice-outside-reify/Impls_Macros_1.scala +++ /dev/null @@ -1,13 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo(c: Context)(x: c.Expr[Int]) = { - import c.universe._ - val x1 = c.Expr[Int](c.untypecheck(x.tree)) - c.Expr[Int](Literal(Constant(c.eval(x1)))) - } -} - -object Macros { - def foo(x: Int) = macro Impls.foo -} diff --git a/tests/pending/run/macro-reify-splice-outside-reify/Test_2.scala b/tests/pending/run/macro-reify-splice-outside-reify/Test_2.scala deleted file mode 100644 index f99d40dad..000000000 --- a/tests/pending/run/macro-reify-splice-outside-reify/Test_2.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - import scala.reflect.runtime.universe._ - import scala.reflect.runtime.{currentMirror => cm} - import scala.tools.reflect.ToolBox - val tree = Apply(Select(Ident(TermName("Macros")), TermName("foo")), List(Literal(Constant(42)))) - try println(cm.mkToolBox().eval(tree)) - catch { case ex: Throwable => println(ex.getMessage) } -} diff --git a/tests/pending/run/macro-reify-staticXXX.check b/tests/pending/run/macro-reify-staticXXX.check deleted file mode 100644 index 2894fa584..000000000 --- a/tests/pending/run/macro-reify-staticXXX.check +++ /dev/null @@ -1,12 +0,0 @@ -object -class -object > object -object > class -package > object -package > class -object -class -object > object -object > class -package > object -package > class \ No newline at end of file diff --git a/tests/pending/run/macro-reify-staticXXX.flags b/tests/pending/run/macro-reify-staticXXX.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-reify-staticXXX.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-reify-staticXXX/Macros_1.scala b/tests/pending/run/macro-reify-staticXXX/Macros_1.scala deleted file mode 100644 index 2993218bb..000000000 --- a/tests/pending/run/macro-reify-staticXXX/Macros_1.scala +++ /dev/null @@ -1,48 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object B { override def toString = "object" } -class C { override def toString = "class" } - -package foo { - object B { override def toString = "package > object" } - class C { override def toString = "package > class" } -} - -object foo { - object B { override def toString = "object > object" } - class C { override def toString = "object > class" } -} - -object packageless { - def impl(c: Context) = { - import c.universe._ - reify { - println(B) - println(new C) - println(foo.B) - println(new foo.C) - println(_root_.foo.B) - println(new _root_.foo.C) - } - } - - def test = macro impl -} - -package packageful { - object Test { - def impl(c: Context) = { - import c.universe._ - reify { - println(B) - println(new C) - println(foo.B) - println(new foo.C) - println(_root_.foo.B) - println(new _root_.foo.C) - } - } - - def test = macro impl - } -} diff --git a/tests/pending/run/macro-reify-staticXXX/Test_2.scala b/tests/pending/run/macro-reify-staticXXX/Test_2.scala deleted file mode 100644 index 4c02e26f6..000000000 --- a/tests/pending/run/macro-reify-staticXXX/Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - packageless.test - packageful.Test.test -} diff --git a/tests/pending/run/macro-reify-tagful-a.check b/tests/pending/run/macro-reify-tagful-a.check deleted file mode 100644 index 3f4c71999..000000000 --- a/tests/pending/run/macro-reify-tagful-a.check +++ /dev/null @@ -1 +0,0 @@ -List(hello world) diff --git a/tests/pending/run/macro-reify-tagful-a.flags b/tests/pending/run/macro-reify-tagful-a.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-reify-tagful-a.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-reify-tagful-a/Macros_1.scala b/tests/pending/run/macro-reify-tagful-a/Macros_1.scala deleted file mode 100644 index 6f061fd26..000000000 --- a/tests/pending/run/macro-reify-tagful-a/Macros_1.scala +++ /dev/null @@ -1,12 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.macros.blackbox.Context - -object Macros { - def foo[T](s: T) = macro Impls.foo[T] - - object Impls { - def foo[T: c.WeakTypeTag](c: Context)(s: c.Expr[T]) = c.universe.reify { - List(s.splice) - } - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-tagful-a/Test_2.scala b/tests/pending/run/macro-reify-tagful-a/Test_2.scala deleted file mode 100644 index 5095ddcaa..000000000 --- a/tests/pending/run/macro-reify-tagful-a/Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - val list: List[String] = Macros.foo("hello world") - println(list) -} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-tagless-a.check b/tests/pending/run/macro-reify-tagless-a.check deleted file mode 100644 index d160e8043..000000000 --- a/tests/pending/run/macro-reify-tagless-a.check +++ /dev/null @@ -1,3 +0,0 @@ -reflective compilation has failed: - -Macro expansion contains free type variable T defined by foo in Impls_Macros_1.scala:7:13. Have you forgotten to use c.WeakTypeTag annotation for this type parameter? If you have troubles tracking free type variables, consider using -Xlog-free-types diff --git a/tests/pending/run/macro-reify-tagless-a.flags b/tests/pending/run/macro-reify-tagless-a.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-reify-tagless-a.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-reify-tagless-a/Impls_Macros_1.scala b/tests/pending/run/macro-reify-tagless-a/Impls_Macros_1.scala deleted file mode 100644 index faac3e3a3..000000000 --- a/tests/pending/run/macro-reify-tagless-a/Impls_Macros_1.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Macros { - def foo[T](s: T) = macro Impls.foo[T] - - object Impls { - def foo[T](c: Context)(s: c.Expr[T]) = c.universe.reify { - List[T](s.splice) - } - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-tagless-a/Test_2.scala b/tests/pending/run/macro-reify-tagless-a/Test_2.scala deleted file mode 100644 index af882664d..000000000 --- a/tests/pending/run/macro-reify-tagless-a/Test_2.scala +++ /dev/null @@ -1,14 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - //val list: List[String] = Macros.foo("hello world") - //println(list) - - import scala.reflect.runtime.universe._ - import scala.reflect.runtime.{currentMirror => cm} - import scala.tools.reflect.ToolBox - val tpt = AppliedTypeTree(Ident(definitions.ListClass), List(Ident(definitions.StringClass))) - val rhs = Apply(Select(Ident(TermName("Macros")), TermName("foo")), List(Literal(Constant("hello world")))) - val list = ValDef(NoMods, TermName("list"), tpt, rhs) - val tree = Block(List(list), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Ident(list.name)))) - try cm.mkToolBox().eval(tree) - catch { case ex: Throwable => println(ex.getMessage) } -} diff --git a/tests/pending/run/macro-reify-type.check b/tests/pending/run/macro-reify-type.check deleted file mode 100644 index ea5e70e10..000000000 --- a/tests/pending/run/macro-reify-type.check +++ /dev/null @@ -1 +0,0 @@ -[B, That](f: Int => B)(implicit bf: scala.collection.generic.CanBuildFrom[List[Int],B,That])That \ No newline at end of file diff --git a/tests/pending/run/macro-reify-type.flags b/tests/pending/run/macro-reify-type.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-reify-type.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-reify-type/Macros_1.scala b/tests/pending/run/macro-reify-type/Macros_1.scala deleted file mode 100644 index c38cf8aa5..000000000 --- a/tests/pending/run/macro-reify-type/Macros_1.scala +++ /dev/null @@ -1,28 +0,0 @@ -import scala.reflect.macros.blackbox.Context -import scala.reflect.runtime.{universe => ru} - -object StaticReflect { - def method[A](name: String): ru.Type = macro methodImpl[A] - - def methodImpl[A: c.WeakTypeTag](c: Context)(name: c.Expr[String]): c.Expr[ru.Type] = { - import c.universe._ - import internal._ - - val nameName: TermName = name.tree match { - case Literal(Constant(str: String)) => TermName(str) - case _ => c.error(c.enclosingPosition, s"Method name not constant.") ; return reify(ru.NoType) - } - val clazz = weakTypeOf[A] - - clazz member nameName match { - case NoSymbol => c.error(c.enclosingPosition, s"No member called $nameName in $clazz.") ; reify(ru.NoType) - case member => - val mtpe = member infoIn clazz - val mtag = c.reifyType(gen.mkRuntimeUniverseRef, Select(gen.mkRuntimeUniverseRef, TermName("rootMirror")), mtpe) - val mtree = Select(mtag, TermName("tpe")) - - c.Expr[ru.Type](mtree) - } - } - -} diff --git a/tests/pending/run/macro-reify-type/Test_2.scala b/tests/pending/run/macro-reify-type/Test_2.scala deleted file mode 100644 index c9e56d718..000000000 --- a/tests/pending/run/macro-reify-type/Test_2.scala +++ /dev/null @@ -1,21 +0,0 @@ -import StaticReflect._ - -object Test extends dotty.runtime.LegacyApp { - //println(method[List[Int]]("distinct")) - println(method[List[Int]]("map")) - //val $u: scala.reflect.runtime.universe.type = scala.reflect.runtime.universe; - //val $m: $u.Mirror = scala.reflect.runtime.universe.rootMirror; - //import $u._, $m._, Flag._, internal._ - //val tpe = { - // val symdef$B2 = reificationSupport.newNestedSymbol(reificationSupport.selectTerm(staticClass("scala.collection.TraversableLike"), "map"), TypeName("B"), NoPosition, DEFERRED | PARAM, false); - // val symdef$That2 = reificationSupport.newNestedSymbol(reificationSupport.selectTerm(staticClass("scala.collection.TraversableLike"), "map"), TypeName("That"), NoPosition, DEFERRED | PARAM, false); - // val symdef$f2 = reificationSupport.newNestedSymbol(reificationSupport.selectTerm(staticClass("scala.collection.TraversableLike"), "map"), TermName("f"), NoPosition, PARAM, false); - // val symdef$bf2 = reificationSupport.newNestedSymbol(reificationSupport.selectTerm(staticClass("scala.collection.TraversableLike"), "map"), TermName("bf"), NoPosition, IMPLICIT | PARAM, false); - // reificationSupport.setInfo(symdef$B2, TypeBounds(staticClass("scala.Nothing").asType.toTypeConstructor, staticClass("scala.Any").asType.toTypeConstructor)); - // reificationSupport.setInfo(symdef$That2, TypeBounds(staticClass("scala.Nothing").asType.toTypeConstructor, staticClass("scala.Any").asType.toTypeConstructor)); - // reificationSupport.setInfo(symdef$f2, TypeRef(ThisType(staticPackage("scala").asModule.moduleClass), staticClass("scala.Function1"), List(staticClass("scala.Int").asType.toTypeConstructor, TypeRef(NoPrefix, symdef$B2, List())))); - // reificationSupport.setInfo(symdef$bf2, TypeRef(ThisType(staticPackage("scala.collection.generic").asModule.moduleClass), staticClass("scala.collection.generic.CanBuildFrom"), List(TypeRef(ThisType(staticPackage("scala.collection.immutable").asModule.moduleClass), staticClass("scala.collection.immutable.List"), List(staticClass("scala.Int").asType.toTypeConstructor)), TypeRef(NoPrefix, symdef$B2, List()), TypeRef(NoPrefix, symdef$That2, List())))); - // PolyType(List(symdef$B2, symdef$That2), MethodType(List(symdef$f2), MethodType(List(symdef$bf2), TypeRef(NoPrefix, symdef$That2, List())))) - //} - //println(tpe) -} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-typetag-notypeparams.check b/tests/pending/run/macro-reify-typetag-notypeparams.check deleted file mode 100644 index 7732c10d7..000000000 --- a/tests/pending/run/macro-reify-typetag-notypeparams.check +++ /dev/null @@ -1,2 +0,0 @@ -TypeTag[Int] -TypeTag[List[Int]] diff --git a/tests/pending/run/macro-reify-typetag-notypeparams/Test.scala b/tests/pending/run/macro-reify-typetag-notypeparams/Test.scala deleted file mode 100644 index 1eff6e93f..000000000 --- a/tests/pending/run/macro-reify-typetag-notypeparams/Test.scala +++ /dev/null @@ -1,6 +0,0 @@ -import scala.reflect.runtime.universe._ - -object Test extends dotty.runtime.LegacyApp { - println(implicitly[TypeTag[Int]]) - println(implicitly[TypeTag[List[Int]]]) -} diff --git a/tests/pending/run/macro-reify-typetag-typeparams-tags.check b/tests/pending/run/macro-reify-typetag-typeparams-tags.check deleted file mode 100644 index 7732c10d7..000000000 --- a/tests/pending/run/macro-reify-typetag-typeparams-tags.check +++ /dev/null @@ -1,2 +0,0 @@ -TypeTag[Int] -TypeTag[List[Int]] diff --git a/tests/pending/run/macro-reify-typetag-typeparams-tags/Test.scala b/tests/pending/run/macro-reify-typetag-typeparams-tags/Test.scala deleted file mode 100644 index 4540bb6b3..000000000 --- a/tests/pending/run/macro-reify-typetag-typeparams-tags/Test.scala +++ /dev/null @@ -1,9 +0,0 @@ -import scala.reflect.runtime.universe._ - -object Test extends dotty.runtime.LegacyApp { - def fooTypeTag[T: TypeTag] = { - println(implicitly[TypeTag[T]]) - println(implicitly[TypeTag[List[T]]]) - } - fooTypeTag[Int] -} diff --git a/tests/pending/run/macro-reify-unreify.check b/tests/pending/run/macro-reify-unreify.check deleted file mode 100644 index 7a6d53c47..000000000 --- a/tests/pending/run/macro-reify-unreify.check +++ /dev/null @@ -1 +0,0 @@ -hello world = Expr[java.lang.String("hello world")]("hello world") diff --git a/tests/pending/run/macro-reify-unreify.flags b/tests/pending/run/macro-reify-unreify.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-reify-unreify.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-reify-unreify/Macros_1.scala b/tests/pending/run/macro-reify-unreify/Macros_1.scala deleted file mode 100644 index d92dfa3e2..000000000 --- a/tests/pending/run/macro-reify-unreify/Macros_1.scala +++ /dev/null @@ -1,20 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Macros { - def foo(s: String) = macro Impls.foo - - object Impls { - def foo(c: Context)(s: c.Expr[String]) = { - import c.universe._ - import internal._ - - val world = c.reifyTree(gen.mkRuntimeUniverseRef, EmptyTree, s.tree) - val greeting = c.reifyTree(gen.mkRuntimeUniverseRef, EmptyTree, c.typecheck(Apply(Select(Literal(Constant("hello ")), TermName("$plus")), List(c.unreifyTree(world))))) - val typedGreeting = c.Expr[String](greeting) - - c.universe.reify { - println("hello " + s.splice + " = " + typedGreeting.splice) - } - } - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-unreify/Test_2.scala b/tests/pending/run/macro-reify-unreify/Test_2.scala deleted file mode 100644 index 26b2c7d9f..000000000 --- a/tests/pending/run/macro-reify-unreify/Test_2.scala +++ /dev/null @@ -1,3 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - Macros.foo("world") -} \ No newline at end of file diff --git a/tests/pending/run/macro-repl-basic.check b/tests/pending/run/macro-repl-basic.check deleted file mode 100644 index fab03d155..000000000 --- a/tests/pending/run/macro-repl-basic.check +++ /dev/null @@ -1,52 +0,0 @@ -Type in expressions to have them evaluated. -Type :help for more information. - -scala> import language.experimental.macros -import language.experimental.macros - -scala> import scala.reflect.macros.blackbox.Context -import scala.reflect.macros.blackbox.Context - -scala> - -scala> object Impls { - def foo(c: Context)(x: c.Expr[Int]) = { - import c.universe._ - val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(1)))) - c.Expr[Int](body) - } - - def bar(c: Context)(x: c.Expr[Int]) = { - import c.universe._ - val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(2)))) - c.Expr[Int](body) - } - - def quux(c: Context)(x: c.Expr[Int]) = { - import c.universe._ - val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(3)))) - c.Expr[Int](body) - } -} -defined object Impls - -scala> object Macros { - object Shmacros { - def foo(x: Int): Int = macro Impls.foo - } - def bar(x: Int): Int = macro Impls.bar -}; class Macros { - def quux(x: Int): Int = macro Impls.quux -} -defined object Macros -defined class Macros - -scala> - -scala> import Macros.Shmacros._ -import Macros.Shmacros._ - -scala> println(foo(2) + Macros.bar(2) * new Macros().quux(4)) -31 - -scala> :quit diff --git a/tests/pending/run/macro-repl-basic.scala b/tests/pending/run/macro-repl-basic.scala deleted file mode 100644 index 217f3bc0e..000000000 --- a/tests/pending/run/macro-repl-basic.scala +++ /dev/null @@ -1,39 +0,0 @@ -import scala.tools.partest.ReplTest - -object Test extends ReplTest { - def code = """ - |import language.experimental.macros - |import scala.reflect.macros.blackbox.Context - | - |object Impls { - | def foo(c: Context)(x: c.Expr[Int]) = { - | import c.universe._ - | val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(1)))) - | c.Expr[Int](body) - | } - | - | def bar(c: Context)(x: c.Expr[Int]) = { - | import c.universe._ - | val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(2)))) - | c.Expr[Int](body) - | } - | - | def quux(c: Context)(x: c.Expr[Int]) = { - | import c.universe._ - | val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(3)))) - | c.Expr[Int](body) - | } - |} - |object Macros { - | object Shmacros { - | def foo(x: Int): Int = macro Impls.foo - | } - | def bar(x: Int): Int = macro Impls.bar - |}; class Macros { - | def quux(x: Int): Int = macro Impls.quux - |} - | - |import Macros.Shmacros._ - |println(foo(2) + Macros.bar(2) * new Macros().quux(4)) - |""".stripMargin -} diff --git a/tests/pending/run/macro-repl-dontexpand.check b/tests/pending/run/macro-repl-dontexpand.check deleted file mode 100644 index 6ecc9245f..000000000 --- a/tests/pending/run/macro-repl-dontexpand.check +++ /dev/null @@ -1,16 +0,0 @@ -Type in expressions to have them evaluated. -Type :help for more information. - -scala> def bar1(c: scala.reflect.macros.blackbox.Context) = ??? -bar1: (c: scala.reflect.macros.blackbox.Context)Nothing - -scala> def foo1 = macro bar1 -defined term macro foo1: Nothing - -scala> def bar2(c: scala.reflect.macros.whitebox.Context) = ??? -bar2: (c: scala.reflect.macros.whitebox.Context)Nothing - -scala> def foo2 = macro bar2 -defined term macro foo2: Nothing - -scala> :quit diff --git a/tests/pending/run/macro-repl-dontexpand.scala b/tests/pending/run/macro-repl-dontexpand.scala deleted file mode 100644 index 920f40084..000000000 --- a/tests/pending/run/macro-repl-dontexpand.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.tools.partest.ReplTest - -object Test extends ReplTest { - override def extraSettings = "-language:experimental.macros" - def code = """ - |def bar1(c: scala.reflect.macros.blackbox.Context) = ??? - |def foo1 = macro bar1 - |def bar2(c: scala.reflect.macros.whitebox.Context) = ??? - |def foo2 = macro bar2 - |""".stripMargin -} diff --git a/tests/pending/run/macro-settings.check b/tests/pending/run/macro-settings.check deleted file mode 100644 index 050d53cdb..000000000 --- a/tests/pending/run/macro-settings.check +++ /dev/null @@ -1 +0,0 @@ -List(hello=1) diff --git a/tests/pending/run/macro-settings.flags b/tests/pending/run/macro-settings.flags deleted file mode 100644 index 15479e30b..000000000 --- a/tests/pending/run/macro-settings.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros -Xmacro-settings:hello=1 \ No newline at end of file diff --git a/tests/pending/run/macro-settings/Impls_Macros_1.scala b/tests/pending/run/macro-settings/Impls_Macros_1.scala deleted file mode 100644 index 851a98720..000000000 --- a/tests/pending/run/macro-settings/Impls_Macros_1.scala +++ /dev/null @@ -1,14 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def impl(c: Context) = { - import c.universe._ - reify { - println(c.Expr[String](Literal(Constant(c.settings.toString))).splice) - } - } -} - -object Macros { - def foo = macro Impls.impl -} \ No newline at end of file diff --git a/tests/pending/run/macro-settings/Test_2.scala b/tests/pending/run/macro-settings/Test_2.scala deleted file mode 100644 index 0fc472aa6..000000000 --- a/tests/pending/run/macro-settings/Test_2.scala +++ /dev/null @@ -1,3 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - Macros.foo -} \ No newline at end of file diff --git a/tests/pending/run/macro-sip19-revised.check b/tests/pending/run/macro-sip19-revised.check deleted file mode 100644 index 86c3d819b..000000000 --- a/tests/pending/run/macro-sip19-revised.check +++ /dev/null @@ -1,5 +0,0 @@ -hey, i've been called from SourceLocation1(null,Test_2.scala,11,251) -hey, i've been called from SourceLocation1(SourceLocation1(null,Test_2.scala,11,251),Test_2.scala,8,222) -hey, i've been called from SourceLocation1(SourceLocation1(SourceLocation1(null,Test_2.scala,11,251),Test_2.scala,8,222),Test_2.scala,8,222) -hey, i've been called from SourceLocation1(SourceLocation1(SourceLocation1(SourceLocation1(null,Test_2.scala,11,251),Test_2.scala,8,222),Test_2.scala,8,222),Test_2.scala,6,180) -2 diff --git a/tests/pending/run/macro-sip19-revised.flags b/tests/pending/run/macro-sip19-revised.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-sip19-revised.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-sip19-revised/Impls_Macros_1.scala b/tests/pending/run/macro-sip19-revised/Impls_Macros_1.scala deleted file mode 100644 index ded4d85cf..000000000 --- a/tests/pending/run/macro-sip19-revised/Impls_Macros_1.scala +++ /dev/null @@ -1,35 +0,0 @@ -import scala.reflect.macros.whitebox.Context - -object Macros { - def impl(c: Context) = { - import c.universe._ - - val inscope = c.inferImplicitValue(c.mirror.staticClass("SourceLocation").toType) - val outer = c.Expr[SourceLocation](if (!inscope.isEmpty) inscope else Literal(Constant(null))) - - val Apply(fun, args) = c.enclosingImplicits(0).tree - val fileName = fun.pos.source.file.file.getName - val line = fun.pos.line - val charOffset = fun.pos.point - def literal[T](x: T) = c.Expr[T](Literal(Constant(x))) - c.universe.reify { SourceLocation1(outer.splice, literal(fileName).splice, literal(line).splice, literal(charOffset).splice) } - } - - implicit def sourceLocation: SourceLocation1 = macro impl -} - -trait SourceLocation { - /** Source location of the outermost call */ - val outer: SourceLocation - - /** The name of the source file */ - val fileName: String - - /** The line number */ - val line: Int - - /** The character offset */ - val charOffset: Int -} - -case class SourceLocation1(val outer: SourceLocation, val fileName: String, val line: Int, val charOffset: Int) extends SourceLocation \ No newline at end of file diff --git a/tests/pending/run/macro-sip19-revised/Test_2.scala b/tests/pending/run/macro-sip19-revised/Test_2.scala deleted file mode 100644 index 483665ae4..000000000 --- a/tests/pending/run/macro-sip19-revised/Test_2.scala +++ /dev/null @@ -1,12 +0,0 @@ -import Macros._ - -object Test extends dotty.runtime.LegacyApp { - def foo(x: Int, y: Int)(implicit loc: SourceLocation): Int = { - println("hey, i've been called from %s".format(loc)) - if (x < y) foo(y, x) - else if (y == 0) x - else foo(x - y, y) - } - - println(foo(4, 2)) -} diff --git a/tests/pending/run/macro-sip19.check b/tests/pending/run/macro-sip19.check deleted file mode 100644 index 07cfd8c1e..000000000 --- a/tests/pending/run/macro-sip19.check +++ /dev/null @@ -1,5 +0,0 @@ -hey, i've been called from SourceLocation(Test_2.scala,15,366) -hey, i've been called from SourceLocation(Test_2.scala,11,331) -hey, i've been called from SourceLocation(Test_2.scala,11,331) -hey, i've been called from SourceLocation(Test_2.scala,9,285) -2 diff --git a/tests/pending/run/macro-sip19.flags b/tests/pending/run/macro-sip19.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-sip19.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-sip19/Impls_Macros_1.scala b/tests/pending/run/macro-sip19/Impls_Macros_1.scala deleted file mode 100644 index f66ab7147..000000000 --- a/tests/pending/run/macro-sip19/Impls_Macros_1.scala +++ /dev/null @@ -1,26 +0,0 @@ -import scala.reflect.macros.whitebox.Context - -object Macros { - def impl(c: Context) = { - import c.universe._ - val Apply(fun, args) = c.enclosingImplicits(0).tree - val fileName = fun.pos.source.file.file.getName - val line = fun.pos.line - val charOffset = fun.pos.point - def literal[T](x: T) = c.Expr[T](Literal(Constant(x))) - c.universe.reify { SourceLocation(literal(fileName).splice, literal(line).splice, literal(charOffset).splice) } - } - - implicit def sourceLocation: SourceLocation = macro impl -} - -case class SourceLocation( - /** The name of the source file */ - val fileName: String, - - /** The line number */ - val line: Int, - - /** The character offset */ - val charOffset: Int -) \ No newline at end of file diff --git a/tests/pending/run/macro-sip19/Test_2.scala b/tests/pending/run/macro-sip19/Test_2.scala deleted file mode 100644 index 0255f1381..000000000 --- a/tests/pending/run/macro-sip19/Test_2.scala +++ /dev/null @@ -1,16 +0,0 @@ -import Macros._ - -object Test extends dotty.runtime.LegacyApp { - def foo(x: Int, y: Int)(implicit loc0: SourceLocation): Int = { - var loc = loc0; - { - var loc0 = 0 // shadow loc0 to disambiguate with the implicit macro - println("hey, i've been called from %s".format(loc)) - if (x < y) foo(y, x) - else if (y == 0) x - else foo(x - y, y) - } - } - - println(foo(4, 2)) -} diff --git a/tests/pending/run/macro-subpatterns.check b/tests/pending/run/macro-subpatterns.check deleted file mode 100644 index 4997146cf..000000000 --- a/tests/pending/run/macro-subpatterns.check +++ /dev/null @@ -1,3 +0,0 @@ -Some(List((a @ Extractor((b @ Extractor((c @ _))))))) -Some(List((b @ Extractor((c @ _))))) -Some(List((c @ _))) diff --git a/tests/pending/run/macro-subpatterns/Macro_1.scala b/tests/pending/run/macro-subpatterns/Macro_1.scala deleted file mode 100644 index e009e411a..000000000 --- a/tests/pending/run/macro-subpatterns/Macro_1.scala +++ /dev/null @@ -1,17 +0,0 @@ -import scala.reflect.macros.whitebox.Context -import language.experimental.macros - -object Extractor { - def unapply(x: Any): Any = macro unapplyImpl - def unapplyImpl(c: Context)(x: c.Tree) = { - import c.universe._ - import internal._ - q""" - new { - def isEmpty = false - def get = ${subpatterns(x).toString} - def unapply(x: Any) = this - }.unapply($x) - """ - } -} diff --git a/tests/pending/run/macro-subpatterns/Test_2.scala b/tests/pending/run/macro-subpatterns/Test_2.scala deleted file mode 100644 index b19bd9b9b..000000000 --- a/tests/pending/run/macro-subpatterns/Test_2.scala +++ /dev/null @@ -1,5 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - 42 match { - case Extractor(a @ Extractor(b @ Extractor(c))) => println(a); println(b); println(c) - } -} diff --git a/tests/pending/run/macro-system-properties.check b/tests/pending/run/macro-system-properties.check deleted file mode 100644 index e2e2bd32b..000000000 --- a/tests/pending/run/macro-system-properties.check +++ /dev/null @@ -1,22 +0,0 @@ -Type in expressions to have them evaluated. -Type :help for more information. - -scala> import scala.language.experimental._, scala.reflect.macros.blackbox.Context -import scala.language.experimental._ -import scala.reflect.macros.blackbox.Context - -scala> object GrabContext { - def lastContext = Option(System.getProperties.get("lastContext").asInstanceOf[reflect.macros.runtime.Context]) - // System.properties lets you stash true globals (unlike statics which are classloader scoped) - def impl(c: Context)() = { import c.universe._; System.getProperties.put("lastContext", c); c.Expr[Unit](q"()") } - def grab(): Unit = macro impl - } -defined object GrabContext - -scala> object Test { class C(implicit a: Any) { GrabContext.grab } } -defined object Test - -scala> object Test { class C(implicit a: Any) { GrabContext.grab } } -defined object Test - -scala> :quit diff --git a/tests/pending/run/macro-system-properties.scala b/tests/pending/run/macro-system-properties.scala deleted file mode 100644 index db88eb7df..000000000 --- a/tests/pending/run/macro-system-properties.scala +++ /dev/null @@ -1,16 +0,0 @@ -import scala.tools.nsc._ -import scala.tools.partest.ReplTest - -object Test extends ReplTest { - def code = """ - import scala.language.experimental._, scala.reflect.macros.blackbox.Context - object GrabContext { - def lastContext = Option(System.getProperties.get("lastContext").asInstanceOf[reflect.macros.runtime.Context]) - // System.properties lets you stash true globals (unlike statics which are classloader scoped) - def impl(c: Context)() = { import c.universe._; System.getProperties.put("lastContext", c); c.Expr[Unit](q"()") } - def grab(): Unit = macro impl - } - object Test { class C(implicit a: Any) { GrabContext.grab } } - object Test { class C(implicit a: Any) { GrabContext.grab } } - """ -} diff --git a/tests/pending/run/macro-term-declared-in-annotation.check b/tests/pending/run/macro-term-declared-in-annotation.check deleted file mode 100644 index 7658ad2c2..000000000 --- a/tests/pending/run/macro-term-declared-in-annotation.check +++ /dev/null @@ -1 +0,0 @@ -it works diff --git a/tests/pending/run/macro-term-declared-in-annotation.flags b/tests/pending/run/macro-term-declared-in-annotation.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-term-declared-in-annotation.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-annotation/Impls_1.scala b/tests/pending/run/macro-term-declared-in-annotation/Impls_1.scala deleted file mode 100644 index c4bcfbc1b..000000000 --- a/tests/pending/run/macro-term-declared-in-annotation/Impls_1.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo(c: Context) = { - import c.{prefix => prefix} - import c.universe._ - val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) - val body = Block(List(printPrefix), Literal(Constant("this is deprecated"))) - c.Expr[String](body) - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-annotation/Macros_2.scala b/tests/pending/run/macro-term-declared-in-annotation/Macros_2.scala deleted file mode 100644 index 40d71c62f..000000000 --- a/tests/pending/run/macro-term-declared-in-annotation/Macros_2.scala +++ /dev/null @@ -1,8 +0,0 @@ -class foo(val bar: String) extends annotation.StaticAnnotation - -object Api { - // foo in ann must have a different name - // otherwise, we get bitten by https://issues.scala-lang.org/browse/SI-5544 - @foo({def fooInAnn = macro Impls.foo; fooInAnn}) - def foo = println("it works") -} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-annotation/Test_3.scala b/tests/pending/run/macro-term-declared-in-annotation/Test_3.scala deleted file mode 100644 index 322ef9eb1..000000000 --- a/tests/pending/run/macro-term-declared-in-annotation/Test_3.scala +++ /dev/null @@ -1,3 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - Api.foo -} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-anonymous.check b/tests/pending/run/macro-term-declared-in-anonymous.check deleted file mode 100644 index 09b8d015a..000000000 --- a/tests/pending/run/macro-term-declared-in-anonymous.check +++ /dev/null @@ -1,2 +0,0 @@ -prefix = Expr[Nothing](Test.this.macros) -it works diff --git a/tests/pending/run/macro-term-declared-in-anonymous.flags b/tests/pending/run/macro-term-declared-in-anonymous.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-term-declared-in-anonymous.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-anonymous/Impls_1.scala b/tests/pending/run/macro-term-declared-in-anonymous/Impls_1.scala deleted file mode 100644 index c43f5f3f5..000000000 --- a/tests/pending/run/macro-term-declared-in-anonymous/Impls_1.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo(c: Context) = { - import c.{prefix => prefix} - import c.universe._ - val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) - val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))) - c.Expr[Unit](body) - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-anonymous/Macros_Test_2.scala b/tests/pending/run/macro-term-declared-in-anonymous/Macros_Test_2.scala deleted file mode 100644 index 894947e1e..000000000 --- a/tests/pending/run/macro-term-declared-in-anonymous/Macros_Test_2.scala +++ /dev/null @@ -1,6 +0,0 @@ -import scala.language.reflectiveCalls - -object Test extends dotty.runtime.LegacyApp { - val macros = new { def foo: Unit = macro Impls.foo } - macros.foo -} diff --git a/tests/pending/run/macro-term-declared-in-block.check b/tests/pending/run/macro-term-declared-in-block.check deleted file mode 100644 index 5e687db8b..000000000 --- a/tests/pending/run/macro-term-declared-in-block.check +++ /dev/null @@ -1,2 +0,0 @@ -prefix = Expr[Nothing]() -it works diff --git a/tests/pending/run/macro-term-declared-in-block.flags b/tests/pending/run/macro-term-declared-in-block.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-term-declared-in-block.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-block/Impls_1.scala b/tests/pending/run/macro-term-declared-in-block/Impls_1.scala deleted file mode 100644 index c43f5f3f5..000000000 --- a/tests/pending/run/macro-term-declared-in-block/Impls_1.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo(c: Context) = { - import c.{prefix => prefix} - import c.universe._ - val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) - val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))) - c.Expr[Unit](body) - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-block/Macros_Test_2.scala b/tests/pending/run/macro-term-declared-in-block/Macros_Test_2.scala deleted file mode 100644 index eba5e4961..000000000 --- a/tests/pending/run/macro-term-declared-in-block/Macros_Test_2.scala +++ /dev/null @@ -1,6 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - { - def foo: Unit = macro Impls.foo - foo - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-class-class.check b/tests/pending/run/macro-term-declared-in-class-class.check deleted file mode 100644 index 47248d7af..000000000 --- a/tests/pending/run/macro-term-declared-in-class-class.check +++ /dev/null @@ -1,2 +0,0 @@ -prefix = Expr[Nothing](new Test.this.outer.Macros()) -it works diff --git a/tests/pending/run/macro-term-declared-in-class-class.flags b/tests/pending/run/macro-term-declared-in-class-class.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-term-declared-in-class-class.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-class-class/Impls_1.scala b/tests/pending/run/macro-term-declared-in-class-class/Impls_1.scala deleted file mode 100644 index c43f5f3f5..000000000 --- a/tests/pending/run/macro-term-declared-in-class-class/Impls_1.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo(c: Context) = { - import c.{prefix => prefix} - import c.universe._ - val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) - val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))) - c.Expr[Unit](body) - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-class-class/Macros_Test_2.scala b/tests/pending/run/macro-term-declared-in-class-class/Macros_Test_2.scala deleted file mode 100644 index 7f813a30d..000000000 --- a/tests/pending/run/macro-term-declared-in-class-class/Macros_Test_2.scala +++ /dev/null @@ -1,10 +0,0 @@ -class Macros { - class Macros { - def foo: Unit = macro Impls.foo - } -} - -object Test extends dotty.runtime.LegacyApp { - val outer = new Macros() - new outer.Macros().foo -} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-class-object.check b/tests/pending/run/macro-term-declared-in-class-object.check deleted file mode 100644 index 35af59e40..000000000 --- a/tests/pending/run/macro-term-declared-in-class-object.check +++ /dev/null @@ -1,2 +0,0 @@ -prefix = Expr[Nothing](Test.this.outer.Macros) -it works diff --git a/tests/pending/run/macro-term-declared-in-class-object.flags b/tests/pending/run/macro-term-declared-in-class-object.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-term-declared-in-class-object.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-class-object/Impls_1.scala b/tests/pending/run/macro-term-declared-in-class-object/Impls_1.scala deleted file mode 100644 index c43f5f3f5..000000000 --- a/tests/pending/run/macro-term-declared-in-class-object/Impls_1.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo(c: Context) = { - import c.{prefix => prefix} - import c.universe._ - val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) - val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))) - c.Expr[Unit](body) - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-class-object/Macros_Test_2.scala b/tests/pending/run/macro-term-declared-in-class-object/Macros_Test_2.scala deleted file mode 100644 index 12c6328c9..000000000 --- a/tests/pending/run/macro-term-declared-in-class-object/Macros_Test_2.scala +++ /dev/null @@ -1,10 +0,0 @@ -class Macros { - object Macros { - def foo: Unit = macro Impls.foo - } -} - -object Test extends dotty.runtime.LegacyApp { - val outer = new Macros() - outer.Macros.foo -} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-class.check b/tests/pending/run/macro-term-declared-in-class.check deleted file mode 100644 index a1c1d7af8..000000000 --- a/tests/pending/run/macro-term-declared-in-class.check +++ /dev/null @@ -1,2 +0,0 @@ -prefix = Expr[Nothing](new Macros()) -it works diff --git a/tests/pending/run/macro-term-declared-in-class.flags b/tests/pending/run/macro-term-declared-in-class.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-term-declared-in-class.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-class/Impls_1.scala b/tests/pending/run/macro-term-declared-in-class/Impls_1.scala deleted file mode 100644 index c43f5f3f5..000000000 --- a/tests/pending/run/macro-term-declared-in-class/Impls_1.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo(c: Context) = { - import c.{prefix => prefix} - import c.universe._ - val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) - val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))) - c.Expr[Unit](body) - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-class/Macros_Test_2.scala b/tests/pending/run/macro-term-declared-in-class/Macros_Test_2.scala deleted file mode 100644 index 0c9a7ccf0..000000000 --- a/tests/pending/run/macro-term-declared-in-class/Macros_Test_2.scala +++ /dev/null @@ -1,7 +0,0 @@ -class Macros { - def foo: Unit = macro Impls.foo -} - -object Test extends dotty.runtime.LegacyApp { - new Macros().foo -} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-default-param.check b/tests/pending/run/macro-term-declared-in-default-param.check deleted file mode 100644 index 6decd7aa4..000000000 --- a/tests/pending/run/macro-term-declared-in-default-param.check +++ /dev/null @@ -1,5 +0,0 @@ -prefix = Expr[Nothing]() -it works -it works -prefix = Expr[Nothing]() -it works diff --git a/tests/pending/run/macro-term-declared-in-default-param.flags b/tests/pending/run/macro-term-declared-in-default-param.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-term-declared-in-default-param.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-default-param/Impls_1.scala b/tests/pending/run/macro-term-declared-in-default-param/Impls_1.scala deleted file mode 100644 index ef0f13613..000000000 --- a/tests/pending/run/macro-term-declared-in-default-param/Impls_1.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo(c: Context) = { - import c.{prefix => prefix} - import c.universe._ - val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) - val body = Block(List(printPrefix), Literal(Constant("it works"))) - c.Expr[String](body) - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-default-param/Macros_Test_2.scala b/tests/pending/run/macro-term-declared-in-default-param/Macros_Test_2.scala deleted file mode 100644 index 856a4e44f..000000000 --- a/tests/pending/run/macro-term-declared-in-default-param/Macros_Test_2.scala +++ /dev/null @@ -1,7 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - def foo(bar: String = { def foo: String = macro Impls.foo; foo }) = println(bar) - - foo() - foo("it works") - foo() -} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-implicit-class.check b/tests/pending/run/macro-term-declared-in-implicit-class.check deleted file mode 100644 index 5dc968c08..000000000 --- a/tests/pending/run/macro-term-declared-in-implicit-class.check +++ /dev/null @@ -1,2 +0,0 @@ -prefix = Expr[Nothing](Macros.foo("2")) -Some(2) diff --git a/tests/pending/run/macro-term-declared-in-implicit-class.flags b/tests/pending/run/macro-term-declared-in-implicit-class.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-term-declared-in-implicit-class.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-implicit-class/Impls_Macros_1.scala b/tests/pending/run/macro-term-declared-in-implicit-class/Impls_Macros_1.scala deleted file mode 100644 index ef00f6ff3..000000000 --- a/tests/pending/run/macro-term-declared-in-implicit-class/Impls_Macros_1.scala +++ /dev/null @@ -1,19 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def toOptionOfInt(c: Context) = { - import c.{prefix => prefix} - import c.universe._ - val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) - val body = Block(List(printPrefix), Apply(Ident(definitions.SomeModule), List(Select(Select(prefix.tree, TermName("x")), TermName("toInt"))))) - c.Expr[Option[Int]](body) - } -} - -object Macros { - implicit def foo(x: String): Foo = new Foo(x) - - class Foo(val x: String) { - def toOptionOfInt = macro Impls.toOptionOfInt - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-implicit-class/Test_2.scala b/tests/pending/run/macro-term-declared-in-implicit-class/Test_2.scala deleted file mode 100644 index fd67062be..000000000 --- a/tests/pending/run/macro-term-declared-in-implicit-class/Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - import Macros._ - println("2".toOptionOfInt) -} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-method.check b/tests/pending/run/macro-term-declared-in-method.check deleted file mode 100644 index 5e687db8b..000000000 --- a/tests/pending/run/macro-term-declared-in-method.check +++ /dev/null @@ -1,2 +0,0 @@ -prefix = Expr[Nothing]() -it works diff --git a/tests/pending/run/macro-term-declared-in-method.flags b/tests/pending/run/macro-term-declared-in-method.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-term-declared-in-method.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-method/Impls_1.scala b/tests/pending/run/macro-term-declared-in-method/Impls_1.scala deleted file mode 100644 index c43f5f3f5..000000000 --- a/tests/pending/run/macro-term-declared-in-method/Impls_1.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo(c: Context) = { - import c.{prefix => prefix} - import c.universe._ - val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) - val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))) - c.Expr[Unit](body) - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-method/Macros_Test_2.scala b/tests/pending/run/macro-term-declared-in-method/Macros_Test_2.scala deleted file mode 100644 index d40eb4c60..000000000 --- a/tests/pending/run/macro-term-declared-in-method/Macros_Test_2.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - def bar() = { - def foo: Unit = macro Impls.foo - foo - } - - bar() -} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-object-class.check b/tests/pending/run/macro-term-declared-in-object-class.check deleted file mode 100644 index 47248d7af..000000000 --- a/tests/pending/run/macro-term-declared-in-object-class.check +++ /dev/null @@ -1,2 +0,0 @@ -prefix = Expr[Nothing](new Test.this.outer.Macros()) -it works diff --git a/tests/pending/run/macro-term-declared-in-object-class.flags b/tests/pending/run/macro-term-declared-in-object-class.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-term-declared-in-object-class.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-object-class/Impls_1.scala b/tests/pending/run/macro-term-declared-in-object-class/Impls_1.scala deleted file mode 100644 index c43f5f3f5..000000000 --- a/tests/pending/run/macro-term-declared-in-object-class/Impls_1.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo(c: Context) = { - import c.{prefix => prefix} - import c.universe._ - val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) - val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))) - c.Expr[Unit](body) - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-object-class/Macros_Test_2.scala b/tests/pending/run/macro-term-declared-in-object-class/Macros_Test_2.scala deleted file mode 100644 index 89aed84c7..000000000 --- a/tests/pending/run/macro-term-declared-in-object-class/Macros_Test_2.scala +++ /dev/null @@ -1,10 +0,0 @@ -object Macros { - class Macros { - def foo: Unit = macro Impls.foo - } -} - -object Test extends dotty.runtime.LegacyApp { - val outer = Macros - new outer.Macros().foo -} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-object-object.check b/tests/pending/run/macro-term-declared-in-object-object.check deleted file mode 100644 index 35af59e40..000000000 --- a/tests/pending/run/macro-term-declared-in-object-object.check +++ /dev/null @@ -1,2 +0,0 @@ -prefix = Expr[Nothing](Test.this.outer.Macros) -it works diff --git a/tests/pending/run/macro-term-declared-in-object-object.flags b/tests/pending/run/macro-term-declared-in-object-object.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-term-declared-in-object-object.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-object-object/Impls_1.scala b/tests/pending/run/macro-term-declared-in-object-object/Impls_1.scala deleted file mode 100644 index c43f5f3f5..000000000 --- a/tests/pending/run/macro-term-declared-in-object-object/Impls_1.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo(c: Context) = { - import c.{prefix => prefix} - import c.universe._ - val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) - val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))) - c.Expr[Unit](body) - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-object-object/Macros_Test_2.scala b/tests/pending/run/macro-term-declared-in-object-object/Macros_Test_2.scala deleted file mode 100644 index c5950fe61..000000000 --- a/tests/pending/run/macro-term-declared-in-object-object/Macros_Test_2.scala +++ /dev/null @@ -1,10 +0,0 @@ -object Macros { - object Macros { - def foo: Unit = macro Impls.foo - } -} - -object Test extends dotty.runtime.LegacyApp { - val outer = Macros - outer.Macros.foo -} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-object.check b/tests/pending/run/macro-term-declared-in-object.check deleted file mode 100644 index 4d955a96b..000000000 --- a/tests/pending/run/macro-term-declared-in-object.check +++ /dev/null @@ -1,2 +0,0 @@ -prefix = Expr[Nothing](Macros) -it works diff --git a/tests/pending/run/macro-term-declared-in-object.flags b/tests/pending/run/macro-term-declared-in-object.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-term-declared-in-object.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-object/Impls_1.scala b/tests/pending/run/macro-term-declared-in-object/Impls_1.scala deleted file mode 100644 index c43f5f3f5..000000000 --- a/tests/pending/run/macro-term-declared-in-object/Impls_1.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo(c: Context) = { - import c.{prefix => prefix} - import c.universe._ - val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) - val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))) - c.Expr[Unit](body) - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-object/Macros_Test_2.scala b/tests/pending/run/macro-term-declared-in-object/Macros_Test_2.scala deleted file mode 100644 index f89a21d92..000000000 --- a/tests/pending/run/macro-term-declared-in-object/Macros_Test_2.scala +++ /dev/null @@ -1,7 +0,0 @@ -object Macros { - def foo: Unit = macro Impls.foo -} - -object Test extends dotty.runtime.LegacyApp { - Macros.foo -} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-package-object.check b/tests/pending/run/macro-term-declared-in-package-object.check deleted file mode 100644 index bc0069178..000000000 --- a/tests/pending/run/macro-term-declared-in-package-object.check +++ /dev/null @@ -1,2 +0,0 @@ -prefix = Expr[Nothing](Macros.`package`) -it works diff --git a/tests/pending/run/macro-term-declared-in-package-object.flags b/tests/pending/run/macro-term-declared-in-package-object.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-term-declared-in-package-object.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-package-object/Impls_1.scala b/tests/pending/run/macro-term-declared-in-package-object/Impls_1.scala deleted file mode 100644 index c43f5f3f5..000000000 --- a/tests/pending/run/macro-term-declared-in-package-object/Impls_1.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo(c: Context) = { - import c.{prefix => prefix} - import c.universe._ - val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) - val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))) - c.Expr[Unit](body) - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-package-object/Macros_Test_2.scala b/tests/pending/run/macro-term-declared-in-package-object/Macros_Test_2.scala deleted file mode 100644 index 69f3803ba..000000000 --- a/tests/pending/run/macro-term-declared-in-package-object/Macros_Test_2.scala +++ /dev/null @@ -1,8 +0,0 @@ -package object Macros { - def foo: Unit = macro Impls.foo -} - -object Test extends dotty.runtime.LegacyApp { - import Macros._ - foo -} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-refinement.check b/tests/pending/run/macro-term-declared-in-refinement.check deleted file mode 100644 index 09b8d015a..000000000 --- a/tests/pending/run/macro-term-declared-in-refinement.check +++ /dev/null @@ -1,2 +0,0 @@ -prefix = Expr[Nothing](Test.this.macros) -it works diff --git a/tests/pending/run/macro-term-declared-in-refinement.flags b/tests/pending/run/macro-term-declared-in-refinement.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-term-declared-in-refinement.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-refinement/Impls_1.scala b/tests/pending/run/macro-term-declared-in-refinement/Impls_1.scala deleted file mode 100644 index c43f5f3f5..000000000 --- a/tests/pending/run/macro-term-declared-in-refinement/Impls_1.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo(c: Context) = { - import c.{prefix => prefix} - import c.universe._ - val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) - val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))) - c.Expr[Unit](body) - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-refinement/Macros_Test_2.scala b/tests/pending/run/macro-term-declared-in-refinement/Macros_Test_2.scala deleted file mode 100644 index 49192291e..000000000 --- a/tests/pending/run/macro-term-declared-in-refinement/Macros_Test_2.scala +++ /dev/null @@ -1,8 +0,0 @@ -import scala.language.reflectiveCalls - -class Base - -object Test extends dotty.runtime.LegacyApp { - val macros = new Base { def foo: Unit = macro Impls.foo } - macros.foo -} diff --git a/tests/pending/run/macro-term-declared-in-trait.check b/tests/pending/run/macro-term-declared-in-trait.check deleted file mode 100644 index 0f3756ddb..000000000 --- a/tests/pending/run/macro-term-declared-in-trait.check +++ /dev/null @@ -1,15 +0,0 @@ -prefix = Expr[Nothing]({ - final class $anon extends AnyRef with Base { - def (): <$anon: Base> = { - $anon.super.(); - () - }; - - }; - new $anon() -}) -it works -prefix = Expr[Nothing](Macros) -it works -prefix = Expr[Nothing](new Macros()) -it works diff --git a/tests/pending/run/macro-term-declared-in-trait.flags b/tests/pending/run/macro-term-declared-in-trait.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-term-declared-in-trait.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-trait/Impls_1.scala b/tests/pending/run/macro-term-declared-in-trait/Impls_1.scala deleted file mode 100644 index c43f5f3f5..000000000 --- a/tests/pending/run/macro-term-declared-in-trait/Impls_1.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo(c: Context) = { - import c.{prefix => prefix} - import c.universe._ - val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) - val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))) - c.Expr[Unit](body) - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-trait/Macros_Test_2.scala b/tests/pending/run/macro-term-declared-in-trait/Macros_Test_2.scala deleted file mode 100644 index 5780aba45..000000000 --- a/tests/pending/run/macro-term-declared-in-trait/Macros_Test_2.scala +++ /dev/null @@ -1,13 +0,0 @@ -trait Base { - def foo: Unit = macro Impls.foo -} - -object Macros extends Base - -class Macros extends Base - -object Test extends dotty.runtime.LegacyApp { - (new Base {}).foo - Macros.foo - new Macros().foo -} \ No newline at end of file diff --git a/tests/pending/run/macro-typecheck-implicitsdisabled.check b/tests/pending/run/macro-typecheck-implicitsdisabled.check deleted file mode 100644 index 91d8fabd7..000000000 --- a/tests/pending/run/macro-typecheck-implicitsdisabled.check +++ /dev/null @@ -1,2 +0,0 @@ -scala.this.Predef.ArrowAssoc[Int](1).->[Int](2) -scala.reflect.macros.TypecheckException: value -> is not a member of Int diff --git a/tests/pending/run/macro-typecheck-implicitsdisabled.flags b/tests/pending/run/macro-typecheck-implicitsdisabled.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-typecheck-implicitsdisabled.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-typecheck-implicitsdisabled/Impls_Macros_1.scala b/tests/pending/run/macro-typecheck-implicitsdisabled/Impls_Macros_1.scala deleted file mode 100644 index 956331cfa..000000000 --- a/tests/pending/run/macro-typecheck-implicitsdisabled/Impls_Macros_1.scala +++ /dev/null @@ -1,28 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Macros { - def impl_with_implicits_enabled(c: Context) = { - import c.universe._ - - val tree1 = Apply(Select(Literal(Constant(1)), TermName("$minus$greater")), List(Literal(Constant(2)))) - val ttree1 = c.typecheck(tree1, withImplicitViewsDisabled = false) - c.Expr[String](Literal(Constant(ttree1.toString))) - } - - def foo_with_implicits_enabled = macro impl_with_implicits_enabled - - def impl_with_implicits_disabled(c: Context) = { - import c.universe._ - - try { - val tree2 = Apply(Select(Literal(Constant(1)), TermName("$minus$greater")), List(Literal(Constant(2)))) - val ttree2 = c.typecheck(tree2, withImplicitViewsDisabled = true) - c.Expr[String](Literal(Constant(ttree2.toString))) - } catch { - case ex: Throwable => - c.Expr[String](Literal(Constant(ex.toString))) - } - } - - def foo_with_implicits_disabled = macro impl_with_implicits_disabled -} \ No newline at end of file diff --git a/tests/pending/run/macro-typecheck-implicitsdisabled/Test_2.scala b/tests/pending/run/macro-typecheck-implicitsdisabled/Test_2.scala deleted file mode 100644 index 87d3148e9..000000000 --- a/tests/pending/run/macro-typecheck-implicitsdisabled/Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - println(Macros.foo_with_implicits_enabled) - println(Macros.foo_with_implicits_disabled) -} \ No newline at end of file diff --git a/tests/pending/run/macro-typecheck-macrosdisabled.check b/tests/pending/run/macro-typecheck-macrosdisabled.check deleted file mode 100644 index c618d22d8..000000000 --- a/tests/pending/run/macro-typecheck-macrosdisabled.check +++ /dev/null @@ -1,32 +0,0 @@ -({ - val $u: reflect.runtime.universe.type = scala.reflect.runtime.`package`.universe; - val $m: $u.Mirror = scala.reflect.runtime.`package`.universe.runtimeMirror(this.getClass().getClassLoader()); - $u.Expr.apply[Int(2)]($m, { - final class $treecreator1 extends TreeCreator { - def (): $treecreator1 = { - $treecreator1.super.(); - () - }; - def apply[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Tree = { - val $u: U = $m$untyped.universe; - val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror]; - $u.Literal.apply($u.Constant.apply(2)) - } - }; - new $treecreator1() - })($u.TypeTag.apply[Int(2)]($m, { - final class $typecreator2 extends TypeCreator { - def (): $typecreator2 = { - $typecreator2.super.(); - () - }; - def apply[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Type = { - val $u: U = $m$untyped.universe; - val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror]; - $u.internal.reificationSupport.ConstantType($u.Constant.apply(2)) - } - }; - new $typecreator2() - })) -}: reflect.runtime.universe.Expr[Int]) -ru.reify[Int](2) diff --git a/tests/pending/run/macro-typecheck-macrosdisabled.flags b/tests/pending/run/macro-typecheck-macrosdisabled.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-typecheck-macrosdisabled.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-typecheck-macrosdisabled/Impls_Macros_1.scala b/tests/pending/run/macro-typecheck-macrosdisabled/Impls_Macros_1.scala deleted file mode 100644 index 0e549f4ab..000000000 --- a/tests/pending/run/macro-typecheck-macrosdisabled/Impls_Macros_1.scala +++ /dev/null @@ -1,31 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Macros { - def impl_with_macros_enabled(c: Context) = { - import c.universe._ - - val ru = Select(Select(Select(Select(Ident(TermName("scala")), TermName("reflect")), TermName("runtime")), TermName("package")), TermName("universe")) - val tree1 = Apply(Select(ru, TermName("reify")), List(Literal(Constant(2)))) - val ttree1 = c.typecheck(tree1, withMacrosDisabled = false) - c.Expr[String](Literal(Constant(ttree1.toString))) - } - - def foo_with_macros_enabled = macro impl_with_macros_enabled - - def impl_with_macros_disabled(c: Context) = { - import c.universe._ - import internal._ - - val rupkg = c.mirror.staticModule("scala.reflect.runtime.package") - val rusym = reificationSupport.selectTerm(rupkg, "universe") - val NullaryMethodType(rutpe) = rusym.info - val ru = reificationSupport.newFreeTerm("ru", scala.reflect.runtime.universe) - reificationSupport.setInfo(ru, rutpe) - - val tree2 = Apply(Select(Ident(ru), TermName("reify")), List(Literal(Constant(2)))) - val ttree2 = c.typecheck(tree2, withMacrosDisabled = true) - c.Expr[String](Literal(Constant(ttree2.toString))) - } - - def foo_with_macros_disabled = macro impl_with_macros_disabled -} \ No newline at end of file diff --git a/tests/pending/run/macro-typecheck-macrosdisabled/Test_2.scala b/tests/pending/run/macro-typecheck-macrosdisabled/Test_2.scala deleted file mode 100644 index 887f28c8c..000000000 --- a/tests/pending/run/macro-typecheck-macrosdisabled/Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - println(Macros.foo_with_macros_enabled) - println(Macros.foo_with_macros_disabled) -} \ No newline at end of file diff --git a/tests/pending/run/macro-typecheck-macrosdisabled2.check b/tests/pending/run/macro-typecheck-macrosdisabled2.check deleted file mode 100644 index 2e862a608..000000000 --- a/tests/pending/run/macro-typecheck-macrosdisabled2.check +++ /dev/null @@ -1,32 +0,0 @@ -({ - val $u: reflect.runtime.universe.type = scala.reflect.runtime.`package`.universe; - val $m: $u.Mirror = scala.reflect.runtime.`package`.universe.runtimeMirror(this.getClass().getClassLoader()); - $u.Expr.apply[Array[Int]]($m, { - final class $treecreator1 extends TreeCreator { - def (): $treecreator1 = { - $treecreator1.super.(); - () - }; - def apply[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Tree = { - val $u: U = $m$untyped.universe; - val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror]; - $u.Apply.apply($u.Select.apply($u.internal.reificationSupport.mkIdent($m.staticModule("scala.Array")), $u.TermName.apply("apply")), scala.collection.immutable.List.apply[$u.Literal]($u.Literal.apply($u.Constant.apply(2)))) - } - }; - new $treecreator1() - })($u.TypeTag.apply[Array[Int]]($m, { - final class $typecreator2 extends TypeCreator { - def (): $typecreator2 = { - $typecreator2.super.(); - () - }; - def apply[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Type = { - val $u: U = $m$untyped.universe; - val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror]; - $u.internal.reificationSupport.TypeRef($u.internal.reificationSupport.ThisType($m.staticPackage("scala").asModule.moduleClass), $m.staticClass("scala.Array"), scala.collection.immutable.List.apply[$u.Type]($m.staticClass("scala.Int").asType.toTypeConstructor)) - } - }; - new $typecreator2() - })) -}: reflect.runtime.universe.Expr[Array[Int]]) -ru.reify[Array[Int]](scala.Array.apply(2)) diff --git a/tests/pending/run/macro-typecheck-macrosdisabled2.flags b/tests/pending/run/macro-typecheck-macrosdisabled2.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-typecheck-macrosdisabled2.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-typecheck-macrosdisabled2/Impls_Macros_1.scala b/tests/pending/run/macro-typecheck-macrosdisabled2/Impls_Macros_1.scala deleted file mode 100644 index f99f5d2f8..000000000 --- a/tests/pending/run/macro-typecheck-macrosdisabled2/Impls_Macros_1.scala +++ /dev/null @@ -1,31 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Macros { - def impl_with_macros_enabled(c: Context) = { - import c.universe._ - - val ru = Select(Select(Select(Select(Ident(TermName("scala")), TermName("reflect")), TermName("runtime")), TermName("package")), TermName("universe")) - val tree1 = Apply(Select(ru, TermName("reify")), List(Apply(Select(Ident(TermName("scala")), TermName("Array")), List(Literal(Constant(2)))))) - val ttree1 = c.typecheck(tree1, withMacrosDisabled = false) - c.Expr[String](Literal(Constant(ttree1.toString))) - } - - def foo_with_macros_enabled = macro impl_with_macros_enabled - - def impl_with_macros_disabled(c: Context) = { - import c.universe._ - import internal._ - - val rupkg = c.mirror.staticModule("scala.reflect.runtime.package") - val rusym = reificationSupport.selectTerm(rupkg, "universe") - val NullaryMethodType(rutpe) = rusym.info - val ru = reificationSupport.newFreeTerm("ru", scala.reflect.runtime.universe) - reificationSupport.setInfo(ru, rutpe) - - val tree2 = Apply(Select(Ident(ru), TermName("reify")), List(Apply(Select(Ident(TermName("scala")), TermName("Array")), List(Literal(Constant(2)))))) - val ttree2 = c.typecheck(tree2, withMacrosDisabled = true) - c.Expr[String](Literal(Constant(ttree2.toString))) - } - - def foo_with_macros_disabled = macro impl_with_macros_disabled -} diff --git a/tests/pending/run/macro-typecheck-macrosdisabled2/Test_2.scala b/tests/pending/run/macro-typecheck-macrosdisabled2/Test_2.scala deleted file mode 100644 index 887f28c8c..000000000 --- a/tests/pending/run/macro-typecheck-macrosdisabled2/Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - println(Macros.foo_with_macros_enabled) - println(Macros.foo_with_macros_disabled) -} \ No newline at end of file diff --git a/tests/pending/run/macro-undetparams-consfromsls.check b/tests/pending/run/macro-undetparams-consfromsls.check deleted file mode 100644 index 3fee58d9c..000000000 --- a/tests/pending/run/macro-undetparams-consfromsls.check +++ /dev/null @@ -1,5 +0,0 @@ -A = WeakTypeTag[Int] -B = WeakTypeTag[Nothing] -List(1) -A = WeakTypeTag[Any] -List(abc, 1) diff --git a/tests/pending/run/macro-undetparams-consfromsls.flags b/tests/pending/run/macro-undetparams-consfromsls.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-undetparams-consfromsls.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-undetparams-consfromsls/Impls_Macros_1.scala b/tests/pending/run/macro-undetparams-consfromsls/Impls_Macros_1.scala deleted file mode 100644 index 5df5f96aa..000000000 --- a/tests/pending/run/macro-undetparams-consfromsls/Impls_Macros_1.scala +++ /dev/null @@ -1,24 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.macros.blackbox.Context - -object Macros { - def cons_impl[A: c.WeakTypeTag](c: Context)(x: c.Expr[A], xs: c.Expr[List[A]]): c.Expr[List[A]] = { - import c.universe._ - reify { - println("A = " + c.Expr[String](Literal(Constant(implicitly[c.WeakTypeTag[A]].toString))).splice) - x.splice :: xs.splice - } - } - - def nil_impl[B: c.WeakTypeTag](c: Context): c.Expr[List[B]] = { - import c.universe._ - reify { - println("B = " + c.Expr[String](Literal(Constant(implicitly[c.WeakTypeTag[B]].toString))).splice) - Nil - } - } - - def cons[A](x: A, xs: List[A]): List[A] = macro cons_impl[A] - - def nil[B]: List[B] = macro nil_impl[B] -} \ No newline at end of file diff --git a/tests/pending/run/macro-undetparams-consfromsls/Test_2.scala b/tests/pending/run/macro-undetparams-consfromsls/Test_2.scala deleted file mode 100644 index 338684401..000000000 --- a/tests/pending/run/macro-undetparams-consfromsls/Test_2.scala +++ /dev/null @@ -1,7 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - import Macros._ - val xs = cons(1, nil) - println(xs) - val ys = cons("abc", xs) - println(ys) -} \ No newline at end of file diff --git a/tests/pending/run/macro-undetparams-macroitself.check b/tests/pending/run/macro-undetparams-macroitself.check deleted file mode 100644 index a9bf55423..000000000 --- a/tests/pending/run/macro-undetparams-macroitself.check +++ /dev/null @@ -1,2 +0,0 @@ -WeakTypeTag[Int] -WeakTypeTag[String] diff --git a/tests/pending/run/macro-undetparams-macroitself.flags b/tests/pending/run/macro-undetparams-macroitself.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/macro-undetparams-macroitself.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-undetparams-macroitself/Impls_Macros_1.scala b/tests/pending/run/macro-undetparams-macroitself/Impls_Macros_1.scala deleted file mode 100644 index 1eb257e1d..000000000 --- a/tests/pending/run/macro-undetparams-macroitself/Impls_Macros_1.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.macros.blackbox.Context - -object Macros { - def impl[T: c.WeakTypeTag](c: Context)(foo: c.Expr[T]): c.Expr[Unit] = { - import c.universe._ - reify { println(c.Expr[String](Literal(Constant(implicitly[c.WeakTypeTag[T]].toString))).splice) } - } - - def foo[T](foo: T) = macro impl[T] -} \ No newline at end of file diff --git a/tests/pending/run/macro-undetparams-macroitself/Test_2.scala b/tests/pending/run/macro-undetparams-macroitself/Test_2.scala deleted file mode 100644 index c315f3508..000000000 --- a/tests/pending/run/macro-undetparams-macroitself/Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - Macros.foo(42) - Macros.foo("42") -} \ No newline at end of file diff --git a/tests/pending/run/macro-vampire-false-warning.check b/tests/pending/run/macro-vampire-false-warning.check deleted file mode 100644 index 4792e70f3..000000000 --- a/tests/pending/run/macro-vampire-false-warning.check +++ /dev/null @@ -1,2 +0,0 @@ -2 -3 diff --git a/tests/pending/run/macro-vampire-false-warning.flags b/tests/pending/run/macro-vampire-false-warning.flags deleted file mode 100644 index e8fb65d50..000000000 --- a/tests/pending/run/macro-vampire-false-warning.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/tests/pending/run/macro-vampire-false-warning/Macros_1.scala b/tests/pending/run/macro-vampire-false-warning/Macros_1.scala deleted file mode 100644 index 63c34b3ab..000000000 --- a/tests/pending/run/macro-vampire-false-warning/Macros_1.scala +++ /dev/null @@ -1,52 +0,0 @@ -// As per http://meta.plasm.us/posts/2013/08/31/feeding-our-vampires/ - -import scala.annotation.StaticAnnotation -import scala.reflect.macros.whitebox.Context -import scala.language.experimental.macros - -class body(tree: Any) extends StaticAnnotation - -object Macros { - def selFieldImpl(c: Context) = { - import c.universe._ - val field = c.macroApplication.symbol - val bodyAnn = field.annotations.filter(_.tree.tpe <:< typeOf[body]).head - c.Expr[Any](bodyAnn.tree.children(1)) - } - - def mkObjectImpl(c: Context)(xs: c.Expr[Any]*) = { - import c.universe._ - import Flag._ - // val kvps = xs.toList map { case q"${_}(${Literal(Constant(name: String))}).->[${_}]($value)" => name -> value } - val kvps = xs.map(_.tree).toList map { case Apply(TypeApply(Select(Apply(_, List(Literal(Constant(name: String)))), _), _), List(value)) => name -> value } - // val fields = kvps map { case (k, v) => q"@body($v) def ${TermName(k)} = macro Macros.selFieldImpl" } - val fields = kvps map { case (k, v) => DefDef( - Modifiers(MACRO, typeNames.EMPTY, List(Apply(Select(New(Ident(TypeName("body"))), termNames.CONSTRUCTOR), List(v)))), - TermName(k), Nil, Nil, Ident(TypeName("Any")), Select(Ident(TermName("Macros")), TermName("selFieldImpl"))) } - // q"import scala.language.experimental.macros; class Workaround { ..$fields }; new Workaround{}" - c.Expr[Any](Block( - List( - Import(Select(Select(Ident(TermName("scala")), TermName("language")), TermName("experimental")), List(ImportSelector(TermName("macros"), 51, TermName("macros"), 51))), - ClassDef( - NoMods, TypeName("Workaround"), Nil, - Template( - List(Select(Ident(TermName("scala")), TypeName("AnyRef"))), noSelfType, - DefDef( - NoMods, termNames.CONSTRUCTOR, Nil, List(Nil), TypeTree(), - Block(List(Apply(Select(Super(This(typeNames.EMPTY), typeNames.EMPTY), termNames.CONSTRUCTOR), List())), Literal(Constant(())))) - +: fields)), - ClassDef( - Modifiers(FINAL), TypeName("$anon"), Nil, - Template( - List(Ident(TypeName("Workaround"))), noSelfType, - List( - DefDef( - NoMods, termNames.CONSTRUCTOR, Nil, List(Nil), TypeTree(), - Block(List(Apply(Select(Super(This(typeNames.EMPTY), typeNames.EMPTY), termNames.CONSTRUCTOR), List())), Literal(Constant(())))))))), - Apply(Select(New(Ident(TypeName("$anon"))), termNames.CONSTRUCTOR), List()))) - } -} - -object mkObject { - def apply(xs: Any*): Any = macro Macros.mkObjectImpl -} diff --git a/tests/pending/run/macro-vampire-false-warning/Test_2.scala b/tests/pending/run/macro-vampire-false-warning/Test_2.scala deleted file mode 100644 index d28849b88..000000000 --- a/tests/pending/run/macro-vampire-false-warning/Test_2.scala +++ /dev/null @@ -1,6 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - val foo = mkObject("x" -> "2", "y" -> 3) - println(foo.x) - println(foo.y) - // println(foo.z) => will result in a compilation error -} \ No newline at end of file diff --git a/tests/pending/run/macro-whitebox-dynamic-materialization.check b/tests/pending/run/macro-whitebox-dynamic-materialization.check deleted file mode 100644 index ccec8e5b2..000000000 --- a/tests/pending/run/macro-whitebox-dynamic-materialization.check +++ /dev/null @@ -1,2 +0,0 @@ -null -C2 diff --git a/tests/pending/run/macro-whitebox-dynamic-materialization/Macros_1.scala b/tests/pending/run/macro-whitebox-dynamic-materialization/Macros_1.scala deleted file mode 100644 index aaf27c289..000000000 --- a/tests/pending/run/macro-whitebox-dynamic-materialization/Macros_1.scala +++ /dev/null @@ -1,25 +0,0 @@ -import scala.reflect.macros.whitebox.Context -import scala.language.experimental.macros - -trait Foo[T] - -class C1(val x: Int) -class C2(val x: String) - -trait LowPriority { - implicit def lessSpecific[T]: Foo[T] = null -} - -object Foo extends LowPriority { - implicit def moreSpecific[T]: Foo[T] = macro Macros.impl[T] -} - -object Macros { - def impl[T: c.WeakTypeTag](c: Context) = { - import c.universe._ - val tpe = weakTypeOf[T] - if (tpe.members.exists(_.info =:= typeOf[Int])) - c.abort(c.enclosingPosition, "I don't like classes that contain integers") - q"new Foo[$tpe]{ override def toString = ${tpe.toString} }" - } -} diff --git a/tests/pending/run/macro-whitebox-dynamic-materialization/Test_2.scala b/tests/pending/run/macro-whitebox-dynamic-materialization/Test_2.scala deleted file mode 100644 index 10d89dd3c..000000000 --- a/tests/pending/run/macro-whitebox-dynamic-materialization/Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - println(implicitly[Foo[C1]]) - println(implicitly[Foo[C2]]) -} diff --git a/tests/pending/run/macro-whitebox-extractor.check b/tests/pending/run/macro-whitebox-extractor.check deleted file mode 100644 index d81cc0710..000000000 --- a/tests/pending/run/macro-whitebox-extractor.check +++ /dev/null @@ -1 +0,0 @@ -42 diff --git a/tests/pending/run/macro-whitebox-extractor/Macros_1.scala b/tests/pending/run/macro-whitebox-extractor/Macros_1.scala deleted file mode 100644 index d394c0241..000000000 --- a/tests/pending/run/macro-whitebox-extractor/Macros_1.scala +++ /dev/null @@ -1,21 +0,0 @@ -import scala.reflect.macros.whitebox.Context -import language.experimental.macros - -object Extractor { - def unapply(x: Int): Any = macro Macros.unapplyImpl -} - -object Macros { - def unapplyImpl(c: Context)(x: c.Tree) = { - import c.universe._ - q""" - new { - class Match(x: Int) { - def isEmpty = false - def get = x - } - def unapply(x: Int) = new Match(x) - }.unapply($x) - """ - } -} diff --git a/tests/pending/run/macro-whitebox-extractor/Test_2.scala b/tests/pending/run/macro-whitebox-extractor/Test_2.scala deleted file mode 100644 index 7c354ecd6..000000000 --- a/tests/pending/run/macro-whitebox-extractor/Test_2.scala +++ /dev/null @@ -1,5 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - 42 match { - case Extractor(x) => println(x) - } -} diff --git a/tests/pending/run/macro-whitebox-fundep-materialization.check b/tests/pending/run/macro-whitebox-fundep-materialization.check deleted file mode 100644 index bed742910..000000000 --- a/tests/pending/run/macro-whitebox-fundep-materialization.check +++ /dev/null @@ -1 +0,0 @@ -(23,foo,true) diff --git a/tests/pending/run/macro-whitebox-fundep-materialization/Macros_1.scala b/tests/pending/run/macro-whitebox-fundep-materialization/Macros_1.scala deleted file mode 100644 index 5e89e6b2f..000000000 --- a/tests/pending/run/macro-whitebox-fundep-materialization/Macros_1.scala +++ /dev/null @@ -1,39 +0,0 @@ -import scala.language.experimental.macros -import scala.reflect.macros.whitebox.Context - -trait Iso[T, U] { - def to(t : T) : U - // def from(u : U) : T -} - -object Iso { - implicit def materializeIso[T, U]: Iso[T, U] = macro impl[T, U] - def impl[T: c.WeakTypeTag, U: c.WeakTypeTag](c: Context): c.Expr[Iso[T, U]] = { - import c.universe._ - import definitions._ - import Flag._ - - val sym = c.weakTypeOf[T].typeSymbol - if (!sym.isClass || !sym.asClass.isCaseClass) c.abort(c.enclosingPosition, s"$sym is not a case class") - val fields = sym.info.decls.toList.collect{ case x: TermSymbol if x.isVal && x.isCaseAccessor => x } - - def mkTpt() = { - val core = Ident(TupleClass(fields.length) orElse UnitClass) - if (fields.length == 0) core - else AppliedTypeTree(core, fields map (f => TypeTree(f.info))) - } - - def mkFrom() = { - if (fields.length == 0) Literal(Constant(Unit)) - else Apply(Ident(newTermName("Tuple" + fields.length)), fields map (f => Select(Ident(newTermName("f")), newTermName(f.name.toString.trim)))) - } - - val evidenceClass = ClassDef(Modifiers(FINAL), newTypeName("$anon"), List(), Template( - List(AppliedTypeTree(Ident(newTypeName("Iso")), List(Ident(sym), mkTpt()))), - emptyValDef, - List( - DefDef(Modifiers(), termNames.CONSTRUCTOR, List(), List(List()), TypeTree(), Block(List(Apply(Select(Super(This(typeNames.EMPTY), typeNames.EMPTY), termNames.CONSTRUCTOR), List())), Literal(Constant(())))), - DefDef(Modifiers(), newTermName("to"), List(), List(List(ValDef(Modifiers(PARAM), newTermName("f"), Ident(sym), EmptyTree))), TypeTree(), mkFrom())))) - c.Expr[Iso[T, U]](Block(List(evidenceClass), Apply(Select(New(Ident(newTypeName("$anon"))), termNames.CONSTRUCTOR), List()))) - } -} diff --git a/tests/pending/run/macro-whitebox-fundep-materialization/Test_2.scala b/tests/pending/run/macro-whitebox-fundep-materialization/Test_2.scala deleted file mode 100644 index 72183ba86..000000000 --- a/tests/pending/run/macro-whitebox-fundep-materialization/Test_2.scala +++ /dev/null @@ -1,12 +0,0 @@ -// see the comments for macroExpand.onDelayed for an explanation of what's tested here -object Test extends dotty.runtime.LegacyApp { - case class Foo(i: Int, s: String, b: Boolean) - def foo[C, L](c: C)(implicit iso: Iso[C, L]): L = iso.to(c) - - { - val equiv = foo(Foo(23, "foo", true)) - def typed[T](t: => T) {} - typed[(Int, String, Boolean)](equiv) - println(equiv) - } -} \ No newline at end of file diff --git a/tests/pending/run/macro-whitebox-structural.check b/tests/pending/run/macro-whitebox-structural.check deleted file mode 100644 index 0cfbf0888..000000000 --- a/tests/pending/run/macro-whitebox-structural.check +++ /dev/null @@ -1 +0,0 @@ -2 diff --git a/tests/pending/run/macro-whitebox-structural/Impls_Macros_1.scala b/tests/pending/run/macro-whitebox-structural/Impls_Macros_1.scala deleted file mode 100644 index 45fdb79c3..000000000 --- a/tests/pending/run/macro-whitebox-structural/Impls_Macros_1.scala +++ /dev/null @@ -1,16 +0,0 @@ -import scala.reflect.macros.whitebox.Context -import scala.language.experimental.macros - -object Macros { - def impl(c: Context) = { - import c.universe._ - q""" - trait Foo { - def x = 2 - } - new Foo {} - """ - } - - def foo: Any = macro impl -} \ No newline at end of file diff --git a/tests/pending/run/macro-whitebox-structural/Test_2.scala b/tests/pending/run/macro-whitebox-structural/Test_2.scala deleted file mode 100644 index 6fa47e1dd..000000000 --- a/tests/pending/run/macro-whitebox-structural/Test_2.scala +++ /dev/null @@ -1,5 +0,0 @@ -import Macros._ - -object Test extends dotty.runtime.LegacyApp { - println(Macros.foo.x) -} \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-isBlackbox/Macros_2.scala b/tests/pending/run/macroPlugins-isBlackbox/Macros_2.scala deleted file mode 100644 index a90dd702d..000000000 --- a/tests/pending/run/macroPlugins-isBlackbox/Macros_2.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.language.experimental.macros -import scala.reflect.macros.blackbox.Context - -object Macros { - def impl(c: Context) = { - import c.universe._ - q"42" - } - - def foo: Any = macro impl -} \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-isBlackbox/Plugin_1.scala b/tests/pending/run/macroPlugins-isBlackbox/Plugin_1.scala deleted file mode 100644 index b78a18ea6..000000000 --- a/tests/pending/run/macroPlugins-isBlackbox/Plugin_1.scala +++ /dev/null @@ -1,21 +0,0 @@ -package isblackbox - -import scala.tools.nsc.Global -import scala.tools.nsc.plugins.{Plugin => NscPlugin} - -class Plugin(val global: Global) extends NscPlugin { - import global._ - import analyzer._ - import scala.reflect.internal.Mode - - val name = "isBlackbox" - val description = "A sample analyzer plugin that overrides isBlackbox." - val components = Nil - addMacroPlugin(MacroPlugin) - - object MacroPlugin extends MacroPlugin { - override def pluginsIsBlackbox(macroDef: Symbol): Option[Boolean] = { - Some(false) - } - } -} \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-isBlackbox/Test_3.flags b/tests/pending/run/macroPlugins-isBlackbox/Test_3.flags deleted file mode 100644 index 966df731d..000000000 --- a/tests/pending/run/macroPlugins-isBlackbox/Test_3.flags +++ /dev/null @@ -1 +0,0 @@ --Xplugin:. \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-isBlackbox/Test_3.scala b/tests/pending/run/macroPlugins-isBlackbox/Test_3.scala deleted file mode 100644 index f191e5de3..000000000 --- a/tests/pending/run/macroPlugins-isBlackbox/Test_3.scala +++ /dev/null @@ -1,3 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - val x: Int = Macros.foo -} \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-isBlackbox/scalac-plugin.xml b/tests/pending/run/macroPlugins-isBlackbox/scalac-plugin.xml deleted file mode 100644 index 09b9c1464..000000000 --- a/tests/pending/run/macroPlugins-isBlackbox/scalac-plugin.xml +++ /dev/null @@ -1,4 +0,0 @@ - - is-blackbox - isblackbox.Plugin - \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-macroArgs.check b/tests/pending/run/macroPlugins-macroArgs.check deleted file mode 100644 index a68f8069b..000000000 --- a/tests/pending/run/macroPlugins-macroArgs.check +++ /dev/null @@ -1,2 +0,0 @@ -hijacked 1 -hijacked 2 diff --git a/tests/pending/run/macroPlugins-macroArgs/Macros_2.scala b/tests/pending/run/macroPlugins-macroArgs/Macros_2.scala deleted file mode 100644 index b19b8f18d..000000000 --- a/tests/pending/run/macroPlugins-macroArgs/Macros_2.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.language.experimental.macros -import scala.reflect.macros.blackbox.Context - -object Macros { - def impl(c: Context)(arg: c.Tree) = { - import c.universe._ - q"""println($arg)""" - } - - def foo(arg: String): Unit = macro impl -} \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-macroArgs/Plugin_1.scala b/tests/pending/run/macroPlugins-macroArgs/Plugin_1.scala deleted file mode 100644 index 23e80ced3..000000000 --- a/tests/pending/run/macroPlugins-macroArgs/Plugin_1.scala +++ /dev/null @@ -1,21 +0,0 @@ -package macroArgs - -import scala.tools.nsc.Global -import scala.tools.nsc.plugins.{Plugin => NscPlugin} - -class Plugin(val global: Global) extends NscPlugin { - import global._ - import analyzer._ - - val name = "macroArgs" - val description = "A sample analyzer plugin that overrides macroArgs." - val components = Nil - addMacroPlugin(MacroPlugin) - - object MacroPlugin extends MacroPlugin { - override def pluginsMacroArgs(typer: Typer, expandee: Tree): Option[MacroArgs] = { - val MacroArgs(c, List(Literal(Constant(s: String)))) = standardMacroArgs(typer, expandee) - Some(MacroArgs(c, List(Literal(Constant("hijacked " + s))))) - } - } -} \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-macroArgs/Test_3.flags b/tests/pending/run/macroPlugins-macroArgs/Test_3.flags deleted file mode 100644 index 966df731d..000000000 --- a/tests/pending/run/macroPlugins-macroArgs/Test_3.flags +++ /dev/null @@ -1 +0,0 @@ --Xplugin:. \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-macroArgs/Test_3.scala b/tests/pending/run/macroPlugins-macroArgs/Test_3.scala deleted file mode 100644 index 8d3be78bb..000000000 --- a/tests/pending/run/macroPlugins-macroArgs/Test_3.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - Macros.foo("1") - Macros.foo("2") -} \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-macroArgs/scalac-plugin.xml b/tests/pending/run/macroPlugins-macroArgs/scalac-plugin.xml deleted file mode 100644 index 0849f0f4e..000000000 --- a/tests/pending/run/macroPlugins-macroArgs/scalac-plugin.xml +++ /dev/null @@ -1,4 +0,0 @@ - - macro-args - macroArgs.Plugin - \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-macroExpand.check b/tests/pending/run/macroPlugins-macroExpand.check deleted file mode 100644 index 6f685c2af..000000000 --- a/tests/pending/run/macroPlugins-macroExpand.check +++ /dev/null @@ -1,2 +0,0 @@ -expanded into println("impl1") -expanded into println("impl2") diff --git a/tests/pending/run/macroPlugins-macroExpand.flags b/tests/pending/run/macroPlugins-macroExpand.flags deleted file mode 100644 index ea7fc37e1..000000000 --- a/tests/pending/run/macroPlugins-macroExpand.flags +++ /dev/null @@ -1 +0,0 @@ --Yrangepos:false diff --git a/tests/pending/run/macroPlugins-macroExpand/Macros_2.scala b/tests/pending/run/macroPlugins-macroExpand/Macros_2.scala deleted file mode 100644 index c9c88ad2f..000000000 --- a/tests/pending/run/macroPlugins-macroExpand/Macros_2.scala +++ /dev/null @@ -1,18 +0,0 @@ -import scala.language.experimental.macros -import scala.reflect.macros.blackbox.Context - -object Macros { - def impl1(c: Context) = { - import c.universe._ - q"""println("impl1")""" - } - - def impl2(c: Context) = { - import c.universe._ - q"""println("impl2")""" - } - - def foo1: Unit = macro impl1 - - def foo2: Unit = macro impl2 -} \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-macroExpand/Plugin_1.scala b/tests/pending/run/macroPlugins-macroExpand/Plugin_1.scala deleted file mode 100644 index 13df85cb2..000000000 --- a/tests/pending/run/macroPlugins-macroExpand/Plugin_1.scala +++ /dev/null @@ -1,27 +0,0 @@ -package macroExpand - -import scala.tools.nsc.Global -import scala.tools.nsc.plugins.{Plugin => NscPlugin} - -class Plugin(val global: Global) extends NscPlugin { - import global._ - import analyzer._ - import scala.reflect.internal.Mode - - val name = "macroExpand" - val description = "A sample analyzer plugin that overrides macroExpand." - val components = Nil - addMacroPlugin(MacroPlugin) - - object MacroPlugin extends MacroPlugin { - override def pluginsMacroExpand(typer: Typer, expandee: Tree, mode: Mode, pt: Type): Option[Tree] = { - object expander extends DefMacroExpander(typer, expandee, mode, pt) { - override def onSuccess(expanded: Tree) = { - val message = s"expanded into ${expanded.toString}" - typer.typed(q"println($message)") - } - } - Some(expander(expandee)) - } - } -} \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-macroExpand/Test_3.flags b/tests/pending/run/macroPlugins-macroExpand/Test_3.flags deleted file mode 100644 index 966df731d..000000000 --- a/tests/pending/run/macroPlugins-macroExpand/Test_3.flags +++ /dev/null @@ -1 +0,0 @@ --Xplugin:. \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-macroExpand/Test_3.scala b/tests/pending/run/macroPlugins-macroExpand/Test_3.scala deleted file mode 100644 index a730821f2..000000000 --- a/tests/pending/run/macroPlugins-macroExpand/Test_3.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - Macros.foo1 - Macros.foo2 -} \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-macroExpand/scalac-plugin.xml b/tests/pending/run/macroPlugins-macroExpand/scalac-plugin.xml deleted file mode 100644 index 860150865..000000000 --- a/tests/pending/run/macroPlugins-macroExpand/scalac-plugin.xml +++ /dev/null @@ -1,4 +0,0 @@ - - macro-expand - macroExpand.Plugin - \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-macroRuntime.check b/tests/pending/run/macroPlugins-macroRuntime.check deleted file mode 100644 index af16d1ac3..000000000 --- a/tests/pending/run/macroPlugins-macroRuntime.check +++ /dev/null @@ -1,2 +0,0 @@ -hijacked -hijacked diff --git a/tests/pending/run/macroPlugins-macroRuntime/Macros_2.scala b/tests/pending/run/macroPlugins-macroRuntime/Macros_2.scala deleted file mode 100644 index b19b8f18d..000000000 --- a/tests/pending/run/macroPlugins-macroRuntime/Macros_2.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.language.experimental.macros -import scala.reflect.macros.blackbox.Context - -object Macros { - def impl(c: Context)(arg: c.Tree) = { - import c.universe._ - q"""println($arg)""" - } - - def foo(arg: String): Unit = macro impl -} \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-macroRuntime/Plugin_1.scala b/tests/pending/run/macroPlugins-macroRuntime/Plugin_1.scala deleted file mode 100644 index a55adadb4..000000000 --- a/tests/pending/run/macroPlugins-macroRuntime/Plugin_1.scala +++ /dev/null @@ -1,20 +0,0 @@ -package macroRuntime - -import scala.tools.nsc.Global -import scala.tools.nsc.plugins.{Plugin => NscPlugin} - -class Plugin(val global: Global) extends NscPlugin { - import global._ - import analyzer._ - - val name = "macroRuntime" - val description = "A sample analyzer plugin that overrides macroRuntime." - val components = Nil - addMacroPlugin(MacroPlugin) - - object MacroPlugin extends MacroPlugin { - override def pluginsMacroRuntime(expandee: Tree): Option[MacroRuntime] = Some({ - case MacroArgs(_, List(msg)) => q"""println("hijacked")""" - }) - } -} \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-macroRuntime/Test_3.flags b/tests/pending/run/macroPlugins-macroRuntime/Test_3.flags deleted file mode 100644 index 966df731d..000000000 --- a/tests/pending/run/macroPlugins-macroRuntime/Test_3.flags +++ /dev/null @@ -1 +0,0 @@ --Xplugin:. \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-macroRuntime/Test_3.scala b/tests/pending/run/macroPlugins-macroRuntime/Test_3.scala deleted file mode 100644 index 8d3be78bb..000000000 --- a/tests/pending/run/macroPlugins-macroRuntime/Test_3.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - Macros.foo("1") - Macros.foo("2") -} \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-macroRuntime/scalac-plugin.xml b/tests/pending/run/macroPlugins-macroRuntime/scalac-plugin.xml deleted file mode 100644 index 8001af105..000000000 --- a/tests/pending/run/macroPlugins-macroRuntime/scalac-plugin.xml +++ /dev/null @@ -1,4 +0,0 @@ - - macro-runtime - macroRuntime.Plugin - \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-namerHooks.check b/tests/pending/run/macroPlugins-namerHooks.check deleted file mode 100644 index c2db5935d..000000000 --- a/tests/pending/run/macroPlugins-namerHooks.check +++ /dev/null @@ -1,45 +0,0 @@ -enterSym(package { case class C extends scala.Product with scala.Serializable { val x: Int = _; val y: Int = _; def (x: Int, y: Int) = { super.(); () } } }) -enterSym(case class C extends scala.Product with scala.Serializable { val x: Int = _; val y: Int = _; def (x: Int, y: Int) = { super.(); () } }) -ensureCompanionObject(case class C extends scala.Product with scala.Serializable { val x: Int = _; val y: Int = _; def (x: Int, y: Int) = { super.(); () } }, ...) -enterSym( object C extends runtime.this.AbstractFunction2[Int, Int, C] { def () = { super.(); () }; final override def toString() = "C" }) -enterStat(case class C extends scala.Product with scala.Serializable { val x: Int = _; val y: Int = _; def (x: Int, y: Int) = { super.(); () } }) -enterSym( val x: Int = _) -enterSym( val y: Int = _) -enterSym(def (x: Int, y: Int) = { super.(); () }) -enterSym( def copy(x = x, y = y) = new C(x, y)) -enterStat( private[this] val x: Int = _) -enterStat( private[this] val y: Int = _) -enterStat(def (x: Int, y: Int) = { super.(); () }) -enterSym( private[this] val x: Int = _) -enterSym( private[this] val y: Int = _) -enterSym(def (x: Int, y: Int) = { super.(); () }) -enterSym(super.()) -enterStat(super.()) -enterSym( def copy$default$1 = x) -enterSym( def copy$default$2 = y) -enterSym( var acc: Int = -889275714) -enterSym(acc = Statics.this.mix(acc, x)) -enterSym(acc = Statics.this.mix(acc, y)) -enterStat( var acc: Int = -889275714) -enterStat(acc = Statics.this.mix(acc, x)) -enterStat(acc = Statics.this.mix(acc, y)) -enterSym( val C$1: C = x$1.asInstanceOf[C]) -enterStat( val C$1: C = x$1.asInstanceOf[C]) -enterSym(def () = { super.(); () }) -enterSym(final override def toString() = "C") -enterSym(case def apply(x: Int, y: Int): C = new C(x, y)) -enterSym(case def unapply(x$0: C) = if (x$0.==(null)) scala.this.None else Some(scala.Tuple2(x$0.x, x$0.y))) -enterStat(def () = { super.(); () }) -enterStat(final override def toString() = "C") -enterSym(def () = { super.(); () }) -enterSym(final override def toString() = "C") -enterSym(super.()) -enterStat(super.()) -enterSym(case val x1: Int = x$1) -enterStat(case val x1: Int = x$1) -enterSym(case val x1: Any = x$1) -enterSym(case5(){ if (x1.isInstanceOf[C]) matchEnd4(true) else case6() }) -enterSym(case6(){ matchEnd4(false) }) -enterStat(case val x1: Any = x$1) -enterStat(case5(){ if (x1.isInstanceOf[C]) matchEnd4(true) else case6() }) -enterStat(case6(){ matchEnd4(false) }) diff --git a/tests/pending/run/macroPlugins-namerHooks.scala b/tests/pending/run/macroPlugins-namerHooks.scala deleted file mode 100644 index 302429b19..000000000 --- a/tests/pending/run/macroPlugins-namerHooks.scala +++ /dev/null @@ -1,39 +0,0 @@ -import scala.tools.partest._ -import scala.tools.nsc._ - -object Test extends DirectTest { - override def extraSettings: String = "-usejavacp" - - def code = """ - case class C(x: Int, y: Int) - """.trim - - def show() { - val global = newCompiler() - import global._ - import analyzer._ - - val output = collection.mutable.ListBuffer[String]() - def log(what: String) = output += what.replace(String.format("%n"), " ") - - object macroPlugin extends MacroPlugin { - override def pluginsEnterSym(namer: Namer, tree: Tree): Boolean = { - log(s"enterSym($tree)") - namer.standardEnterSym(tree) - true - } - override def pluginsEnsureCompanionObject(namer: Namer, cdef: ClassDef, creator: ClassDef => Tree = companionModuleDef(_)): Option[Symbol] = { - log(s"ensureCompanionObject($cdef, ...)") - Some(namer.standardEnsureCompanionObject(cdef, creator)) - } - override def pluginsEnterStats(typer: Typer, stats: List[Tree]): List[Tree] = { - stats.foreach(stat => log(s"enterStat($stat)")) - stats - } - } - - addMacroPlugin(macroPlugin) - compileString(global)(code) - println(output.mkString("\n")) - } -} diff --git a/tests/pending/run/macroPlugins-typedMacroBody.check b/tests/pending/run/macroPlugins-typedMacroBody.check deleted file mode 100644 index b6f843618..000000000 --- a/tests/pending/run/macroPlugins-typedMacroBody.check +++ /dev/null @@ -1,2 +0,0 @@ -impl1 -impl2 diff --git a/tests/pending/run/macroPlugins-typedMacroBody.flags b/tests/pending/run/macroPlugins-typedMacroBody.flags deleted file mode 100644 index ea7fc37e1..000000000 --- a/tests/pending/run/macroPlugins-typedMacroBody.flags +++ /dev/null @@ -1 +0,0 @@ --Yrangepos:false diff --git a/tests/pending/run/macroPlugins-typedMacroBody/Macros_2.flags b/tests/pending/run/macroPlugins-typedMacroBody/Macros_2.flags deleted file mode 100644 index 966df731d..000000000 --- a/tests/pending/run/macroPlugins-typedMacroBody/Macros_2.flags +++ /dev/null @@ -1 +0,0 @@ --Xplugin:. \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-typedMacroBody/Macros_2.scala b/tests/pending/run/macroPlugins-typedMacroBody/Macros_2.scala deleted file mode 100644 index 80acfec65..000000000 --- a/tests/pending/run/macroPlugins-typedMacroBody/Macros_2.scala +++ /dev/null @@ -1,18 +0,0 @@ -import scala.language.experimental.macros -import scala.reflect.macros.blackbox.Context - -object Macros { - def impl1(c: Context) = { - import c.universe._ - q"""println("impl1")""" - } - - def impl2(c: Context) = { - import c.universe._ - q"""println("impl2")""" - } - - def foo1: Unit = macro 1 - - def foo2: Unit = macro 2 -} \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-typedMacroBody/Plugin_1.scala b/tests/pending/run/macroPlugins-typedMacroBody/Plugin_1.scala deleted file mode 100644 index e99cf7f75..000000000 --- a/tests/pending/run/macroPlugins-typedMacroBody/Plugin_1.scala +++ /dev/null @@ -1,21 +0,0 @@ -package typedMacroBody - -import scala.tools.nsc.Global -import scala.tools.nsc.plugins.{Plugin => NscPlugin} - -class Plugin(val global: Global) extends NscPlugin { - import global._ - import analyzer._ - - val name = "typedMacroBody" - val description = "A sample analyzer plugin that overrides typedMacroBody." - val components = Nil - addMacroPlugin(MacroPlugin) - - object MacroPlugin extends MacroPlugin { - override def pluginsTypedMacroBody(typer: Typer, ddef: DefDef): Option[Tree] = { - val DefDef(_, _, _, _, _, Literal(Constant(num: Int))) = ddef - Some(standardTypedMacroBody(typer, copyDefDef(ddef)(rhs = Ident(TermName("impl" + num))))) - } - } -} \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-typedMacroBody/Test_3.scala b/tests/pending/run/macroPlugins-typedMacroBody/Test_3.scala deleted file mode 100644 index a730821f2..000000000 --- a/tests/pending/run/macroPlugins-typedMacroBody/Test_3.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - Macros.foo1 - Macros.foo2 -} \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-typedMacroBody/scalac-plugin.xml b/tests/pending/run/macroPlugins-typedMacroBody/scalac-plugin.xml deleted file mode 100644 index e223fa5dc..000000000 --- a/tests/pending/run/macroPlugins-typedMacroBody/scalac-plugin.xml +++ /dev/null @@ -1,4 +0,0 @@ - - typed-macro-body - typedMacroBody.Plugin - \ No newline at end of file diff --git a/tests/pending/run/reflection-magicsymbols-invoke.check b/tests/pending/run/reflection-magicsymbols-invoke.check deleted file mode 100644 index f580296ae..000000000 --- a/tests/pending/run/reflection-magicsymbols-invoke.check +++ /dev/null @@ -1,119 +0,0 @@ -============ -Any -it's important to print the list of Any's members -if some of them change (possibly, adding and/or removing magic symbols), we must update this test -method !=: (x$1: Any)Boolean -method ##: ()Int -method ==: (x$1: Any)Boolean -method asInstanceOf: [T0]=> T0 -method equals: (x$1: Any)Boolean -method getClass: ()java.lang.Class[_] -method hashCode: ()Int -method isInstanceOf: [T0]=> Boolean -method toString: ()java.lang.String -testing Any.!=: false -testing Any.##: 50 -testing Any.==: true -testing Any.asInstanceOf: class scala.ScalaReflectionException: Any.asInstanceOf requires a type argument, it cannot be invoked with mirrors -testing Any.asInstanceOf: class scala.ScalaReflectionException: final def asInstanceOf[T0]: T0 takes 0 arguments -testing Any.equals: true -testing Any.getClass: class java.lang.String -testing Any.hashCode: 50 -testing Any.isInstanceOf: class scala.ScalaReflectionException: Any.isInstanceOf requires a type argument, it cannot be invoked with mirrors -testing Any.isInstanceOf: class scala.ScalaReflectionException: final def isInstanceOf[T0]: Boolean takes 0 arguments -testing Any.toString: 2 -============ -AnyVal -it's important to print the list of AnyVal's members -if some of them change (possibly, adding and/or removing magic symbols), we must update this test -constructor AnyVal: ()AnyVal -method getClass: ()Class[_ <: AnyVal] -testing AnyVal.: class scala.ScalaReflectionException: unsupported symbol constructor AnyVal when invoking bytecodeless method mirror for def (): AnyVal (bound to null) -testing AnyVal.getClass: class scala.ScalaReflectionException: expected a member of class Integer, you provided method scala.AnyVal.getClass -============ -AnyRef -it's important to print the list of AnyRef's members -if some of them change (possibly, adding and/or removing magic symbols), we must update this test -constructor Object: ()java.lang.Object -method !=: (x$1: Any)Boolean -method ##: ()Int -method $asInstanceOf: [T0]()T0 -method $isInstanceOf: [T0]()Boolean -method ==: (x$1: Any)Boolean -method asInstanceOf: [T0]=> T0 -method clone: ()java.lang.Object -method eq: (x$1: AnyRef)Boolean -method equals: (x$1: Any)Boolean -method finalize: ()Unit -method getClass: ()java.lang.Class[_] -method hashCode: ()Int -method isInstanceOf: [T0]=> Boolean -method ne: (x$1: AnyRef)Boolean -method notify: ()Unit -method notifyAll: ()Unit -method synchronized: [T0](x$1: T0)T0 -method toString: ()java.lang.String -method wait: ()Unit -method wait: (x$1: Long)Unit -method wait: (x$1: Long, x$2: Int)Unit -testing Object.!=: false -testing Object.##: 50 -testing Object.$asInstanceOf: class scala.ScalaReflectionException: AnyRef.$asInstanceOf is an internal method, it cannot be invoked with mirrors -testing Object.$asInstanceOf: class scala.ScalaReflectionException: final def $asInstanceOf[T0](): T0 takes 0 arguments -testing Object.$isInstanceOf: class scala.ScalaReflectionException: AnyRef.$isInstanceOf is an internal method, it cannot be invoked with mirrors -testing Object.$isInstanceOf: class scala.ScalaReflectionException: final def $isInstanceOf[T0](): Boolean takes 0 arguments -testing Object.==: true -testing Object.clone: class java.lang.CloneNotSupportedException: java.lang.String -testing Object.eq: true -testing Object.equals: true -testing Object.finalize: () -testing Object.getClass: class java.lang.String -testing Object.hashCode: 50 -testing Object.ne: false -testing Object.notify: class java.lang.IllegalMonitorStateException: null -testing Object.notifyAll: class java.lang.IllegalMonitorStateException: null -testing Object.synchronized: 2 -testing Object.toString: 2 -TODO: also test AnyRef.wait overloads -============ -Array -it's important to print the list of Array's members -if some of them change (possibly, adding and/or removing magic symbols), we must update this test -constructor Array: (_length: Int)Array[T] -method !=: (x$1: Any)Boolean -method ##: ()Int -method $asInstanceOf: [T0]()T0 -method $isInstanceOf: [T0]()Boolean -method ==: (x$1: Any)Boolean -method apply: (i: Int)T -method asInstanceOf: [T0]=> T0 -method clone: ()Array[T] -method eq: (x$1: AnyRef)Boolean -method equals: (x$1: Any)Boolean -method finalize: ()Unit -method getClass: ()java.lang.Class[_] -method hashCode: ()Int -method isInstanceOf: [T0]=> Boolean -method length: => Int -method ne: (x$1: AnyRef)Boolean -method notify: ()Unit -method notifyAll: ()Unit -method synchronized: [T0](x$1: T0)T0 -method toString: ()java.lang.String -method update: (i: Int, x: T)Unit -method wait: ()Unit -method wait: (x$1: Long)Unit -method wait: (x$1: Long, x$2: Int)Unit -value _length: Int -testing Array.length: 2 -testing Array.apply: 1 -testing Array.update: () -testing Array.clone: List(1, 2) -============ -Other -testing String.+: 23 -============ -CTM -testing Predef.classOf: class scala.ScalaReflectionException: Predef.classOf is a compile-time function, it cannot be invoked with mirrors -testing Predef.classOf: class scala.ScalaReflectionException: def classOf[T]: Class[T] takes 0 arguments -testing Universe.reify: class scala.ScalaReflectionException: scala.reflect.api.Universe.reify is a macro, i.e. a compile-time function, it cannot be invoked with mirrors diff --git a/tests/pending/run/reflection-magicsymbols-invoke.scala b/tests/pending/run/reflection-magicsymbols-invoke.scala deleted file mode 100644 index bbcf8f524..000000000 --- a/tests/pending/run/reflection-magicsymbols-invoke.scala +++ /dev/null @@ -1,100 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.universe.definitions._ -import scala.reflect.runtime.{currentMirror => cm} - -package scala { - object ExceptionUtils { - def unwrapThrowable(ex: Throwable): Throwable = scala.reflect.runtime.ReflectionUtils.unwrapThrowable(ex) - } -} - -object Test extends dotty.runtime.LegacyApp { - def key(sym: Symbol) = sym + ": " + sym.info - def test(tpe: Type, receiver: Any, method: String, args: Any*): Unit = { - def wrap[T](op: => T) = - try { - var result = op.asInstanceOf[AnyRef] - if (scala.runtime.ScalaRunTime.isArray(result)) - result = scala.runtime.ScalaRunTime.toObjectArray(result).toList - println(result) - } catch { - case ex: Throwable => - val realex = scala.ExceptionUtils.unwrapThrowable(ex) - println(realex.getClass + ": " + realex.getMessage) - } - print(s"testing ${tpe.typeSymbol.name}.$method: ") - wrap({ - if (method == termNames.CONSTRUCTOR.toString) { - val ctor = tpe.decl(termNames.CONSTRUCTOR).asMethod - cm.reflectClass(ctor.owner.asClass).reflectConstructor(ctor)(args: _*) - } else { - val meth = tpe.decl(TermName(method).encodedName.toTermName).asMethod - cm.reflect(receiver).reflectMethod(meth)(args: _*) - } - }) - } - - println("============\nAny") - println("it's important to print the list of Any's members") - println("if some of them change (possibly, adding and/or removing magic symbols), we must update this test") - typeOf[Any].members.toList.sortBy(key).foreach(sym => println(key(sym))) - test(typeOf[Any], "2", "!=", "2") - test(typeOf[Any], "2", "##") - test(typeOf[Any], "2", "==", "2") - test(typeOf[Any], "2", "asInstanceOf") - test(typeOf[Any], "2", "asInstanceOf", typeOf[String]) - test(typeOf[Any], "2", "equals", "2") - test(typeOf[Any], "2", "getClass") - test(typeOf[Any], "2", "hashCode") - test(typeOf[Any], "2", "isInstanceOf") - test(typeOf[Any], "2", "isInstanceOf", typeOf[String]) - test(typeOf[Any], "2", "toString") - - println("============\nAnyVal") - println("it's important to print the list of AnyVal's members") - println("if some of them change (possibly, adding and/or removing magic symbols), we must update this test") - typeOf[AnyVal].decls.toList.sortBy(key).foreach(sym => println(key(sym))) - test(typeOf[AnyVal], null, termNames.CONSTRUCTOR.toString) - test(typeOf[AnyVal], 2, "getClass") - - println("============\nAnyRef") - println("it's important to print the list of AnyRef's members") - println("if some of them change (possibly, adding and/or removing magic symbols), we must update this test") - typeOf[AnyRef].members.toList.sortBy(key).foreach(sym => println(key(sym))) - test(typeOf[AnyRef], "2", "!=", "2") - test(typeOf[AnyRef], "2", "##") - test(typeOf[AnyRef], "2", "$asInstanceOf") - test(typeOf[AnyRef], "2", "$asInstanceOf", typeOf[String]) - test(typeOf[AnyRef], "2", "$isInstanceOf") - test(typeOf[AnyRef], "2", "$isInstanceOf", typeOf[String]) - test(typeOf[AnyRef], "2", "==", "2") - test(typeOf[AnyRef], "2", "clone") - test(typeOf[AnyRef], "2", "eq", "2") - test(typeOf[AnyRef], "2", "equals", "2") - test(typeOf[AnyRef], "2", "finalize") - test(typeOf[AnyRef], "2", "getClass") - test(typeOf[AnyRef], "2", "hashCode") - test(typeOf[AnyRef], "2", "ne", "2") - test(typeOf[AnyRef], "2", "notify") - test(typeOf[AnyRef], "2", "notifyAll") - test(typeOf[AnyRef], "2", "synchronized", "2") - test(typeOf[AnyRef], "2", "toString") - println("TODO: also test AnyRef.wait overloads") - - println("============\nArray") - println("it's important to print the list of Array's members") - println("if some of them change (possibly, adding and/or removing magic symbols), we must update this test") - ArrayClass.info.members.toList.sortBy(key).foreach(sym => println(key(sym))) - test(ArrayClass.info, Array(1, 2), "length") - test(ArrayClass.info, Array(1, 2), "apply", 0) - test(ArrayClass.info, Array(1, 2), "update", 0, 0) - test(ArrayClass.info, Array(1, 2), "clone") - - println("============\nOther") - test(typeOf[String], "2", "+", 3) - - println("============\nCTM") - test(PredefModule.moduleClass.info, Predef, "classOf") - test(PredefModule.moduleClass.info, Predef, "classOf", typeOf[String]) - test(typeOf[scala.reflect.api.Universe], scala.reflect.runtime.universe, "reify", "2") -} diff --git a/tests/pending/run/reify-each-node-type.check b/tests/pending/run/reify-each-node-type.check deleted file mode 100644 index afc65add7..000000000 --- a/tests/pending/run/reify-each-node-type.check +++ /dev/null @@ -1,35 +0,0 @@ - 1 s Ident - 2 r.List Select - 3 r.List.apply() Apply - 4 r.List.apply(1) Literal - 5 r.List.apply[Int]() TypeApply - 6 (1: Int) Typed - 7 (null: r.List[Int]) AppliedTypeTree - 8 { (); () } Block - 9 { val x: Int = 0; () } ValDef -10 { val x = 0; () } TypeTree -11 if (true) () else () If -12 { def f: Unit = (); () } DefDef -13 { def m = NN.super.q; () } Super -14 { abstract trait A extends AnyRef; () } ClassDef Template -15 { def f(x: Any): Unit = (); () } EmptyTree -16 (null: r.D with r.E) CompoundTypeTree -17 { type T = Int; () } TypeDef -18 { type CC[T <: r.D] = r.C[T]; () } TypeBoundsTree -19 try { 0 } finally Predef.println("") Try -20 ((x: Int) => x) Function -21 { var v = 1; v = 2 } Assign -22 { class A extends AnyRef { def () = { super.(); This -23 new r.List[Int]() New -24 0: @unchecked Annotated -25 (null: r.Outer#Inner) SelectFromTypeTree -26 (null: Nil.type) SingletonTypeTree -27 (null: T forSome { type T }) ExistentialTypeTree -28 { import r.{A, B=>C}; () } Import -29 { def f: Int = return 0; () } Return -30 { object x extends AnyRef { def () = { super.(); ModuleDef -31 throw new Exception() Throw -32 0 match { case _ => 0 } Match CaseDef -33 0 match { case (1| 2) => 0 } Alternative -34 NN.q match { case (x @ r.List) => 0 } Bind -35 NN.q match { case r.UnSeq(1, (_)*) => 0 } Star diff --git a/tests/pending/run/reify-each-node-type.scala b/tests/pending/run/reify-each-node-type.scala deleted file mode 100644 index 43d32e59d..000000000 --- a/tests/pending/run/reify-each-node-type.scala +++ /dev/null @@ -1,110 +0,0 @@ - -import scala.language.{ existentials, postfixOps } -import scala.reflect.runtime.universe._ - -object r { - class A - class B - class List[+A] - object List { def apply[A](xs: A*): List[A] = new List[A] } - object Nil extends List[Nothing] - - trait OuterP[A] { - trait Inner - trait InnerP[B] - } - trait Outer { - trait Inner - trait InnerP[B] - } - object Un { def unapply(x: Any) = Some(5) } - object UnSeq { def unapplySeq(x: Any) = Some(Seq(5)) } - class C[T] - class D - trait E - - trait SN { - def q: Any = null - } -} - -object s { - import r._ - - trait NN extends SN { - def act[T](expr: Expr[T]): Unit - - act(reify { s /* Ident */ }) - act(reify { r.List /* Select */ }) - act(reify { List() /* Apply */ }) - act(reify { List(1) /* Literal */ }) - act(reify { List[Int]() /* TypeApply */ }) - act(reify { 1: Int /* Typed */ }) - act(reify { null: List[Int] /* AppliedTypeTree */ }) - act(reify { () ; () /* Block */ }) - act(reify { val x: Int = 0 /* ValDef */ }) - act(reify { val x = 0 /* TypeTree */ }) - act(reify { if (true) () /* If */ }) - act(reify { def f: Unit = { } /* DefDef */ }) - act(reify { def m = super.q /* Super */ }) - act(reify { trait A /* ClassDef Template */ }) - act(reify { def f(x: Any): Unit = { } /* EmptyTree */ }) - act(reify { null: D with E /* CompoundTypeTree */ }) - act(reify { type T = Int /* TypeDef */ }) - act(reify { type CC[T <: D] = C[T] /* TypeBoundsTree */ }) - act(reify { try 0 finally println("") /* Try */ }) - act(reify { (x: Int) => x /* Function */ }) - act(reify { var v = 1 ; v = 2 /* Assign */ }) - act(reify { class A() { def this(x: A) = this() } /* This */ }) - act(reify { new List[Int] /* New */ }) - act(reify { 0: @unchecked /* Annotated */ }) - act(reify { null: Outer#Inner /* SelectFromTypeTree */ }) - act(reify { null: Nil.type /* SingletonTypeTree */ }) - act(reify { null: (T forSome { type T }) /* ExistentialTypeTree */ }) - act(reify { import r.{ A, B => C }; /* Import */ }) - act(reify { def f: Int = return 0 /* Return */ }) - act(reify { object x /* ModuleDef */ }) - act(reify { throw new java.lang.Exception /* Throw */ }) - act(reify { 0 match { case _ => 0 } /* Match CaseDef */ }) - act(reify { 0 match { case 1 | 2 => 0 } /* Alternative */ }) - act(reify { q match { case x @ List => 0 } /* Bind */ }) - act(reify { q match { case UnSeq(1, _*) => 0 } /* Star */ }) - - // ``unexpected: bound type that doesn't have a tpe: Ident(newTypeName("Int"))'' - // act(reify { r.List[T forSome { type T <: Int }]() }) // Was crashing , no longer - // - // error: exception during macro expansion: - // scala.MatchError: collection.this.Seq.unapplySeq[A] (of class scala.reflect.internal.Trees$TypeApply) - // at scala.reflect.reify.phases.Reshape$$anon$1.extractExtractor$1(Reshape.scala:73) - // at scala.reflect.reify.phases.Reshape$$anon$1.transform(Reshape.scala:82) - // at scala.reflect.reify.phases.Reshape$$anon$1.transform(Reshape.scala:24) - // at scala.reflect.internal.Trees$class.itransform(Trees.scala:1290) - // - // act(reify { r.List[Any]() match { case Seq(1, _*) => 1 } } ) - - // act(reify { List[OuterP[Int]#InnerP[Byte]]() }) - // - // SI-7243 - // - // test/files/run/reify-each-node-type.scala:85: error: Cannot materialize r.List.apply[r.OuterP[Int]#InnerP[Byte]]() as { ... } because: - // scala.reflect.macros.TypecheckException: value TypeTreeWithDeferredRefCheck is not a member of type parameter U - // act(reify { List[OuterP[Int]#InnerP[Byte]]() }) - // ^ - // one error found - } -} - -object Test { - var idx = 0 - val seen = scala.collection.mutable.Set[String]() - - object N extends s.NN { - def act[T](expr: Expr[T]): Unit = { - idx += 1 - val ts = expr.tree filter (_ => true) map (_.getClass.getName split "[.$]" last) filterNot seen distinct; - println("%2d %60s %s".format(idx, expr.tree.toString.replaceAll("""\s+""", " ").take(60), ts mkString " ")) - seen ++= ts - } - } - def main(args: Array[String]): Unit = N -} diff --git a/tests/pending/run/reify-repl-fail-gracefully.check b/tests/pending/run/reify-repl-fail-gracefully.check deleted file mode 100644 index c9e69744d..000000000 --- a/tests/pending/run/reify-repl-fail-gracefully.check +++ /dev/null @@ -1,17 +0,0 @@ -Type in expressions to have them evaluated. -Type :help for more information. - -scala> import language.experimental.macros -import language.experimental.macros - -scala> import scala.reflect.runtime.universe._ -import scala.reflect.runtime.universe._ - -scala> - -scala> reify -:12: error: too few argument lists for macro invocation - reify - ^ - -scala> :quit diff --git a/tests/pending/run/reify-repl-fail-gracefully.scala b/tests/pending/run/reify-repl-fail-gracefully.scala deleted file mode 100644 index ed6d6cb6c..000000000 --- a/tests/pending/run/reify-repl-fail-gracefully.scala +++ /dev/null @@ -1,10 +0,0 @@ -import scala.tools.partest.ReplTest - -object Test extends ReplTest { - def code = """ - |import language.experimental.macros - |import scala.reflect.runtime.universe._ - | - |reify - """.stripMargin -} diff --git a/tests/pending/run/reify-staticXXX.check b/tests/pending/run/reify-staticXXX.check deleted file mode 100644 index 37102b29e..000000000 --- a/tests/pending/run/reify-staticXXX.check +++ /dev/null @@ -1,24 +0,0 @@ -object -object -class -class -object > object -object > object -object > class -object > class -package > object -package > object -package > class -package > class -object -object -class -class -object > object -object > object -object > class -object > class -package > object -package > object -package > class -package > class diff --git a/tests/pending/run/reify-staticXXX.scala b/tests/pending/run/reify-staticXXX.scala deleted file mode 100644 index cfbd756ec..000000000 --- a/tests/pending/run/reify-staticXXX.scala +++ /dev/null @@ -1,56 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object B { override def toString = "object" } -class C { override def toString = "class" } - -package foo1 { - object B { override def toString = "package > object" } - class C { override def toString = "package > class" } -} - -object Foo2 { - object B { override def toString = "object > object" } - class C { override def toString = "object > class" } -} - -object packageless { - def test = { - println(B) - println(reify(B).eval) - println(new C) - println(reify(new C).eval) - println(Foo2.B) - println(reify(Foo2.B).eval) - println(new Foo2.C) - println(reify(new Foo2.C).eval) - println(_root_.foo1.B) - println(reify(_root_.foo1.B).eval) - println(new _root_.foo1.C) - println(reify(new _root_.foo1.C).eval) - } -} - -package packageful { - object Test { - def test = { - println(B) - println(reify(B).eval) - println(new C) - println(reify(new C).eval) - println(Foo2.B) - println(reify(Foo2.B).eval) - println(new Foo2.C) - println(reify(new Foo2.C).eval) - println(_root_.foo1.B) - println(reify(_root_.foo1.B).eval) - println(new _root_.foo1.C) - println(reify(new _root_.foo1.C).eval) - } - } -} - -object Test extends dotty.runtime.LegacyApp { - packageless.test - packageful.Test.test -} diff --git a/tests/pending/run/reify_ann1a.check b/tests/pending/run/reify_ann1a.check deleted file mode 100644 index 71841ff83..000000000 --- a/tests/pending/run/reify_ann1a.check +++ /dev/null @@ -1,30 +0,0 @@ -{ - @new ann(List.apply("1a")) @new ann(List.apply("1b")) class C[@new ann(List.apply("2a")) @new ann(List.apply("2b")) T] extends AnyRef { - @new ann(List.apply("3a")) @new ann(List.apply("3b")) private[this] val x: T @ann(List.apply("4a")) @ann(List.apply("4b")) = _; - def (@new ann(List.apply("3a")) @new ann(List.apply("3b")) x: T @ann(List.apply("4a")) @ann(List.apply("4b"))) = { - super.(); - () - }; - @new ann(List.apply("5a")) @new ann(List.apply("5b")) def f(x: Int @ann(List.apply("6a")) @ann(List.apply("6b"))) = { - @new ann(List.apply("7a")) @new ann(List.apply("7b")) val r = x.$plus(3): @ann(List.apply("8a")): @ann(List.apply("8b")); - val s = (4: Int @ann(List.apply("9a")) @ann(List.apply("9b"))); - r.$plus(s) - } - }; - () -} -{ - @ann(List.apply[String]("1a")) @ann(List.apply[String]("1b")) class C[@ann(List.apply[String]("2a")) @ann(List.apply[String]("2b")) T] extends AnyRef { - @ann(List.apply[String]("3a")) @ann(List.apply[String]("3b")) private[this] val x: T @ann(List.apply[String]("4b")) @ann(List.apply[String]("4a")) = _; - def (@ann(List.apply[String]("3a")) @ann(List.apply[String]("3b")) x: T @ann(List.apply[String]("4b")) @ann(List.apply[String]("4a"))): C[T] = { - C.super.(); - () - }; - @ann(List.apply[String]("5a")) @ann(List.apply[String]("5b")) def f(x: Int @ann(List.apply[String]("6b")) @ann(List.apply[String]("6a"))): Int = { - @ann(List.apply[String]("7a")) @ann(List.apply[String]("7b")) val r: Int @ann(List.apply[String]("8b")) @ann(List.apply[String]("8a")) = ((x.+(3): Int @ann(List.apply[String]("8a"))): Int @ann(List.apply[String]("8b")) @ann(List.apply[String]("8a"))); - val s: Int @ann(List.apply[String]("9b")) @ann(List.apply[String]("9a")) = (4: Int @ann(List.apply[String]("9b")) @ann(List.apply[String]("9a"))); - r.+(s) - } - }; - () -} diff --git a/tests/pending/run/reify_ann1a.scala b/tests/pending/run/reify_ann1a.scala deleted file mode 100644 index 9252ddcf7..000000000 --- a/tests/pending/run/reify_ann1a.scala +++ /dev/null @@ -1,28 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -class ann(bar: List[String]) extends annotation.StaticAnnotation - -object Test extends dotty.runtime.LegacyApp { - // test 1: reify - val tree = reify{ - @ann(bar=List("1a")) @ann(bar=List("1b")) class C[@ann(bar=List("2a")) @ann(bar=List("2b")) T](@ann(bar=List("3a")) @ann(bar=List("3b")) x: T @ann(bar=List("4a")) @ann(bar=List("4b"))) { - @ann(bar=List("5a")) @ann(bar=List("5b")) def f(x: Int @ann(bar=List("6a")) @ann(bar=List("6b"))) = { - @ann(bar=List("7a")) @ann(bar=List("7b")) val r = (x + 3): @ann(bar=List("8a")) @ann(bar=List("8b")) - val s = 4: Int @ann(bar=List("9a")) @ann(bar=List("9b")) - r + s - } - } - }.tree - println(tree.toString) - - // test 2: import and typecheck - val toolbox = cm.mkToolBox() - val ttree = toolbox.typecheck(tree) - println(ttree.toString) - - // test 3: import and compile - toolbox.eval(tree) -} diff --git a/tests/pending/run/reify_ann1b.check b/tests/pending/run/reify_ann1b.check deleted file mode 100644 index a046dafea..000000000 --- a/tests/pending/run/reify_ann1b.check +++ /dev/null @@ -1,35 +0,0 @@ -reify_ann1b.scala:6: warning: Implementation restriction: subclassing Classfile does not -make your annotation visible at runtime. If that is what -you want, you must write the annotation class in Java. -class ann(bar: String) extends annotation.ClassfileAnnotation - ^ -{ - @new ann(bar = "1a") @new ann(bar = "1b") class C[@new ann(bar = "2a") @new ann(bar = "2b") T] extends AnyRef { - @new ann(bar = "3a") @new ann(bar = "3b") private[this] val x: T @ann(bar = "4a") @ann(bar = "4b") = _; - def (@new ann(bar = "3a") @new ann(bar = "3b") x: T @ann(bar = "4a") @ann(bar = "4b")) = { - super.(); - () - }; - @new ann(bar = "5a") @new ann(bar = "5b") def f(x: Int @ann(bar = "6a") @ann(bar = "6b")) = { - @new ann(bar = "7a") @new ann(bar = "7b") val r = x.$plus(3): @ann(bar = "8a"): @ann(bar = "8b"); - val s = (4: Int @ann(bar = "9a") @ann(bar = "9b")); - r.$plus(s) - } - }; - () -} -{ - @ann(bar = "1a") @ann(bar = "1b") class C[@ann(bar = "2a") @ann(bar = "2b") T] extends AnyRef { - @ann(bar = "3a") @ann(bar = "3b") private[this] val x: T @ann(bar = "4b") @ann(bar = "4a") = _; - def (@ann(bar = "3a") @ann(bar = "3b") x: T @ann(bar = "4b") @ann(bar = "4a")): C[T] = { - C.super.(); - () - }; - @ann(bar = "5a") @ann(bar = "5b") def f(x: Int @ann(bar = "6b") @ann(bar = "6a")): Int = { - @ann(bar = "7a") @ann(bar = "7b") val r: Int @ann(bar = "8b") @ann(bar = "8a") = ((x.+(3): Int @ann(bar = "8a")): Int @ann(bar = "8b") @ann(bar = "8a")); - val s: Int @ann(bar = "9b") @ann(bar = "9a") = (4: Int @ann(bar = "9b") @ann(bar = "9a")); - r.+(s) - } - }; - () -} diff --git a/tests/pending/run/reify_ann1b.scala b/tests/pending/run/reify_ann1b.scala deleted file mode 100644 index d3c6a4da3..000000000 --- a/tests/pending/run/reify_ann1b.scala +++ /dev/null @@ -1,28 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -class ann(bar: String) extends annotation.ClassfileAnnotation - -object Test extends dotty.runtime.LegacyApp { - // test 1: reify - val tree = reify{ - @ann(bar="1a") @ann(bar="1b") class C[@ann(bar="2a") @ann(bar="2b") T](@ann(bar="3a") @ann(bar="3b") x: T @ann(bar="4a") @ann(bar="4b")) { - @ann(bar="5a") @ann(bar="5b") def f(x: Int @ann(bar="6a") @ann(bar="6b")) = { - @ann(bar="7a") @ann(bar="7b") val r = (x + 3): @ann(bar="8a") @ann(bar="8b") - val s = 4: Int @ann(bar="9a") @ann(bar="9b") - r + s - } - } - }.tree - println(tree.toString) - - // test 2: import and typecheck - val toolbox = cm.mkToolBox() - val ttree = toolbox.typecheck(tree) - println(ttree.toString) - - // test 3: import and compile - toolbox.eval(tree) -} diff --git a/tests/pending/run/reify_ann2a.check b/tests/pending/run/reify_ann2a.check deleted file mode 100644 index a26fa4204..000000000 --- a/tests/pending/run/reify_ann2a.check +++ /dev/null @@ -1,44 +0,0 @@ -{ - class ann extends StaticAnnotation { - private[this] val bar: `package`.List[Predef.String] = _; - def (bar: `package`.List[Predef.String]) = { - super.(); - () - } - }; - @new ann(List.apply("1a")) @new ann(List.apply("1b")) class C[@new ann(List.apply("2a")) @new ann(List.apply("2b")) T] extends AnyRef { - @new ann(List.apply("3a")) @new ann(List.apply("3b")) private[this] val x: T @ann(List.apply("4a")) @ann(List.apply("4b")) = _; - def (@new ann(List.apply("3a")) @new ann(List.apply("3b")) x: T @ann(List.apply("4a")) @ann(List.apply("4b"))) = { - super.(); - () - }; - @new ann(List.apply("5a")) @new ann(List.apply("5b")) def f(x: Int @ann(List.apply("6a")) @ann(List.apply("6b"))) = { - @new ann(List.apply("7a")) @new ann(List.apply("7b")) val r = x.$plus(3): @ann(List.apply("8a")): @ann(List.apply("8b")); - val s = (4: Int @ann(List.apply("9a")) @ann(List.apply("9b"))); - r.$plus(s) - } - }; - () -} -{ - class ann extends scala.annotation.Annotation with scala.annotation.StaticAnnotation { - private[this] val bar: List[String] = _; - def (bar: List[String]): ann = { - ann.super.(); - () - } - }; - @ann(List.apply[String]("1a")) @ann(List.apply[String]("1b")) class C[@ann(List.apply[String]("2a")) @ann(List.apply[String]("2b")) T] extends AnyRef { - @ann(List.apply[String]("3a")) @ann(List.apply[String]("3b")) private[this] val x: T @ann(List.apply[String]("4b")) @ann(List.apply[String]("4a")) = _; - def (@ann(List.apply[String]("3a")) @ann(List.apply[String]("3b")) x: T @ann(List.apply[String]("4b")) @ann(List.apply[String]("4a"))): C[T] = { - C.super.(); - () - }; - @ann(List.apply[String]("5a")) @ann(List.apply[String]("5b")) def f(x: Int @ann(List.apply[String]("6b")) @ann(List.apply[String]("6a"))): Int = { - @ann(List.apply[String]("7a")) @ann(List.apply[String]("7b")) val r: Int @ann(List.apply[String]("8b")) @ann(List.apply[String]("8a")) = ((x.+(3): Int @ann(List.apply[String]("8a"))): Int @ann(List.apply[String]("8b")) @ann(List.apply[String]("8a"))); - val s: Int @ann(List.apply[String]("9b")) @ann(List.apply[String]("9a")) = (4: Int @ann(List.apply[String]("9b")) @ann(List.apply[String]("9a"))); - r.+(s) - } - }; - () -} diff --git a/tests/pending/run/reify_ann2a.scala b/tests/pending/run/reify_ann2a.scala deleted file mode 100644 index 861cb6297..000000000 --- a/tests/pending/run/reify_ann2a.scala +++ /dev/null @@ -1,28 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Test extends dotty.runtime.LegacyApp { - // test 1: reify - val tree = reify{ - class ann(bar: List[String]) extends annotation.StaticAnnotation - - @ann(bar=List("1a")) @ann(bar=List("1b")) class C[@ann(bar=List("2a")) @ann(bar=List("2b")) T](@ann(bar=List("3a")) @ann(bar=List("3b")) x: T @ann(bar=List("4a")) @ann(bar=List("4b"))) { - @ann(bar=List("5a")) @ann(bar=List("5b")) def f(x: Int @ann(bar=List("6a")) @ann(bar=List("6b"))) = { - @ann(bar=List("7a")) @ann(bar=List("7b")) val r = (x + 3): @ann(bar=List("8a")) @ann(bar=List("8b")) - val s = 4: Int @ann(bar=List("9a")) @ann(bar=List("9b")) - r + s - } - } - }.tree - println(tree.toString) - - // test 2: import and typecheck - val toolbox = cm.mkToolBox() - val ttree = toolbox.typecheck(tree) - println(ttree.toString) - - // test 3: import and compile - toolbox.eval(tree) -} diff --git a/tests/pending/run/reify_ann3.check b/tests/pending/run/reify_ann3.check deleted file mode 100644 index 4f1c61cf0..000000000 --- a/tests/pending/run/reify_ann3.check +++ /dev/null @@ -1,21 +0,0 @@ -{ - class Tree[A, +B] extends AnyRef { - @new inline @getter() final val key: A = _; - def (key: A) = { - super.(); - () - } - }; - () -} -{ - class Tree[A, +B] extends AnyRef { - final private[this] val key: A = _; - @inline @scala.annotation.meta.getter final def key: A = Tree.this.key; - def (key: A): Tree[A,B] = { - Tree.super.(); - () - } - }; - () -} diff --git a/tests/pending/run/reify_ann3.scala b/tests/pending/run/reify_ann3.scala deleted file mode 100644 index 7eadd569b..000000000 --- a/tests/pending/run/reify_ann3.scala +++ /dev/null @@ -1,22 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox -import scala.annotation._ -import scala.annotation.meta._ - -object Test extends dotty.runtime.LegacyApp { - // test 1: reify - val tree = reify{ - class Tree[A, +B](@(inline @getter) final val key: A) - }.tree - println(tree.toString) - - // test 2: import and typecheck - val toolbox = cm.mkToolBox() - val ttree = toolbox.typecheck(tree) - println(ttree.toString) - - // test 3: import and compile - toolbox.eval(tree) -} diff --git a/tests/pending/run/reify_ann4.check b/tests/pending/run/reify_ann4.check deleted file mode 100644 index 8bf5fe324..000000000 --- a/tests/pending/run/reify_ann4.check +++ /dev/null @@ -1,32 +0,0 @@ -{ - class D extends StaticAnnotation { - def () = { - super.(); - () - } - }; - class C extends AnyRef { - def () = { - super.(); - () - } - }; - val c1 = new C @D(); - () -} -{ - class D extends scala.annotation.Annotation with scala.annotation.StaticAnnotation { - def (): D = { - D.super.(); - () - } - }; - class C extends AnyRef { - def (): C = { - C.super.(); - () - } - }; - val c1: C = new C @D(); - () -} diff --git a/tests/pending/run/reify_ann4.scala b/tests/pending/run/reify_ann4.scala deleted file mode 100644 index 074ceb815..000000000 --- a/tests/pending/run/reify_ann4.scala +++ /dev/null @@ -1,26 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox -import scala.annotation._ -import scala.annotation.meta._ - -object Test extends dotty.runtime.LegacyApp { - // test 1: reify - val tree = reify{ - class D extends StaticAnnotation - class C - val c1 = new C @D - //val c2 = (new C) @D // illegal syntax - //val c3 = c1 @D // illegal syntax - }.tree - println(tree.toString) - - // test 2: import and typecheck - val toolbox = cm.mkToolBox() - val ttree = toolbox.typecheck(tree) - println(ttree.toString) - - // test 3: import and compile - toolbox.eval(tree) -} diff --git a/tests/pending/run/reify_ann5.check b/tests/pending/run/reify_ann5.check deleted file mode 100644 index 1ec0457e5..000000000 --- a/tests/pending/run/reify_ann5.check +++ /dev/null @@ -1,22 +0,0 @@ -{ - class C extends AnyRef { - @new inline @beanGetter() @new BeanProperty() val x: Int = _; - def (x: Int) = { - super.(); - () - } - }; - () -} -{ - class C extends AnyRef { - @scala.beans.BeanProperty private[this] val x: Int = _; - def x: Int = C.this.x; - def (x: Int): C = { - C.super.(); - () - }; - @inline @scala.annotation.meta.beanGetter def getX(): Int = C.this.x - }; - () -} diff --git a/tests/pending/run/reify_ann5.scala b/tests/pending/run/reify_ann5.scala deleted file mode 100644 index 84e5bda9c..000000000 --- a/tests/pending/run/reify_ann5.scala +++ /dev/null @@ -1,23 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox -import scala.annotation._ -import scala.annotation.meta._ -import scala.beans._ - -object Test extends dotty.runtime.LegacyApp { - // test 1: reify - val tree = reify{ - class C(@BeanProperty @(inline @beanGetter) val x: Int) - }.tree - println(tree.toString) - - // test 2: import and typecheck - val toolbox = cm.mkToolBox() - val ttree = toolbox.typecheck(tree) - println(ttree.toString) - - // test 3: import and compile - toolbox.eval(tree) -} diff --git a/tests/pending/run/reify_anonymous.check b/tests/pending/run/reify_anonymous.check deleted file mode 100644 index b8626c4cf..000000000 --- a/tests/pending/run/reify_anonymous.check +++ /dev/null @@ -1 +0,0 @@ -4 diff --git a/tests/pending/run/reify_anonymous.scala b/tests/pending/run/reify_anonymous.scala deleted file mode 100644 index a7aad4065..000000000 --- a/tests/pending/run/reify_anonymous.scala +++ /dev/null @@ -1,8 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - println(new {def x = 2; def y = x * x}.y) - }.eval -} diff --git a/tests/pending/run/reify_classfileann_a.check b/tests/pending/run/reify_classfileann_a.check deleted file mode 100644 index 51f255b23..000000000 --- a/tests/pending/run/reify_classfileann_a.check +++ /dev/null @@ -1,23 +0,0 @@ -reify_classfileann_a.scala:6: warning: Implementation restriction: subclassing Classfile does not -make your annotation visible at runtime. If that is what -you want, you must write the annotation class in Java. -class ann(bar: String, quux: Array[String] = Array(), baz: ann = null) extends annotation.ClassfileAnnotation - ^ -{ - @new ann(bar = "1", quux = Array("2", "3"), baz = new ann(bar = "4")) class C extends AnyRef { - def () = { - super.(); - () - } - }; - () -} -{ - @ann(bar = "1", quux = ["2", "3"], baz = ann(bar = "4")) class C extends AnyRef { - def (): C = { - C.super.(); - () - } - }; - () -} diff --git a/tests/pending/run/reify_classfileann_a.scala b/tests/pending/run/reify_classfileann_a.scala deleted file mode 100644 index 74546df37..000000000 --- a/tests/pending/run/reify_classfileann_a.scala +++ /dev/null @@ -1,22 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -class ann(bar: String, quux: Array[String] = Array(), baz: ann = null) extends annotation.ClassfileAnnotation - -object Test extends dotty.runtime.LegacyApp { - // test 1: reify - val tree = reify{ - @ann(bar="1", quux=Array("2", "3"), baz = new ann(bar = "4")) class C - }.tree - println(tree.toString) - - // test 2: import and typecheck - val toolbox = cm.mkToolBox() - val ttree = toolbox.typecheck(tree) - println(ttree.toString) - - // test 3: import and compile - toolbox.eval(tree) -} diff --git a/tests/pending/run/reify_classfileann_b.check b/tests/pending/run/reify_classfileann_b.check deleted file mode 100644 index 05f2e5bfc..000000000 --- a/tests/pending/run/reify_classfileann_b.check +++ /dev/null @@ -1,25 +0,0 @@ -reify_classfileann_b.scala:6: warning: Implementation restriction: subclassing Classfile does not -make your annotation visible at runtime. If that is what -you want, you must write the annotation class in Java. -class ann(bar: String, quux: Array[String] = Array(), baz: ann = null) extends annotation.ClassfileAnnotation - ^ -{ - class C extends AnyRef { - def () = { - super.(); - () - }; - def x: Int = 2: @ann(bar = "1",quux = Array("2", "3"),baz = new ann(bar = "4")) - }; - () -} -{ - class C extends AnyRef { - def (): C = { - C.super.(); - () - }; - def x: Int = (2: Int(2) @ann(bar = "1", quux = ["2", "3"], baz = ann(bar = "4"))) - }; - () -} diff --git a/tests/pending/run/reify_classfileann_b.scala b/tests/pending/run/reify_classfileann_b.scala deleted file mode 100644 index 920d671f9..000000000 --- a/tests/pending/run/reify_classfileann_b.scala +++ /dev/null @@ -1,26 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -class ann(bar: String, quux: Array[String] = Array(), baz: ann = null) extends annotation.ClassfileAnnotation - -object Test extends dotty.runtime.LegacyApp { - // test 1: reify - val tree = reify{ - class C { - def x: Int = { - 2: @ann(bar="1", quux=Array("2", "3"), baz = new ann(bar = "4")) - } - } - }.tree - println(tree.toString) - - // test 2: import and typecheck - val toolbox = cm.mkToolBox() - val ttree = toolbox.typecheck(tree) - println(ttree.toString) - - // test 3: import and compile - toolbox.eval(tree) -} diff --git a/tests/pending/run/reify_closure1.check b/tests/pending/run/reify_closure1.check deleted file mode 100644 index b2f7f08c1..000000000 --- a/tests/pending/run/reify_closure1.check +++ /dev/null @@ -1,2 +0,0 @@ -10 -10 diff --git a/tests/pending/run/reify_closure1.scala b/tests/pending/run/reify_closure1.scala deleted file mode 100644 index 6a5684b2a..000000000 --- a/tests/pending/run/reify_closure1.scala +++ /dev/null @@ -1,19 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Test extends dotty.runtime.LegacyApp { - def foo[T](ys: List[T]): Int => Int = { - val fun = reify{(x: Int) => { - x - }} - - val toolbox = cm.mkToolBox() - val dyn = toolbox.eval(fun.tree) - dyn.asInstanceOf[Int => Int] - } - - println(foo(List(1, 2, 3))(10)) - println(foo(List(1, 2, 3, 4))(10)) -} diff --git a/tests/pending/run/reify_closure2a.check b/tests/pending/run/reify_closure2a.check deleted file mode 100644 index c1f3abd7e..000000000 --- a/tests/pending/run/reify_closure2a.check +++ /dev/null @@ -1,2 +0,0 @@ -11 -12 diff --git a/tests/pending/run/reify_closure2a.scala b/tests/pending/run/reify_closure2a.scala deleted file mode 100644 index cc194bc6d..000000000 --- a/tests/pending/run/reify_closure2a.scala +++ /dev/null @@ -1,19 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Test extends dotty.runtime.LegacyApp { - def foo(y: Int): Int => Int = { - val fun = reify{(x: Int) => { - x + y - }} - - val toolbox = cm.mkToolBox() - val dyn = toolbox.eval(fun.tree) - dyn.asInstanceOf[Int => Int] - } - - println(foo(1)(10)) - println(foo(2)(10)) -} diff --git a/tests/pending/run/reify_closure3a.check b/tests/pending/run/reify_closure3a.check deleted file mode 100644 index c1f3abd7e..000000000 --- a/tests/pending/run/reify_closure3a.check +++ /dev/null @@ -1,2 +0,0 @@ -11 -12 diff --git a/tests/pending/run/reify_closure3a.scala b/tests/pending/run/reify_closure3a.scala deleted file mode 100644 index 0d540d1dd..000000000 --- a/tests/pending/run/reify_closure3a.scala +++ /dev/null @@ -1,21 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Test extends dotty.runtime.LegacyApp { - def foo(y: Int): Int => Int = { - def y1 = y - - val fun = reify{(x: Int) => { - x + y1 - }} - - val toolbox = cm.mkToolBox() - val dyn = toolbox.eval(fun.tree) - dyn.asInstanceOf[Int => Int] - } - - println(foo(1)(10)) - println(foo(2)(10)) -} diff --git a/tests/pending/run/reify_closure4a.check b/tests/pending/run/reify_closure4a.check deleted file mode 100644 index c1f3abd7e..000000000 --- a/tests/pending/run/reify_closure4a.check +++ /dev/null @@ -1,2 +0,0 @@ -11 -12 diff --git a/tests/pending/run/reify_closure4a.scala b/tests/pending/run/reify_closure4a.scala deleted file mode 100644 index 373c3b2fa..000000000 --- a/tests/pending/run/reify_closure4a.scala +++ /dev/null @@ -1,21 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Test extends dotty.runtime.LegacyApp { - def foo(y: Int): Int => Int = { - val y1 = y - - val fun = reify{(x: Int) => { - x + y1 - }} - - val toolbox = cm.mkToolBox() - val dyn = toolbox.eval(fun.tree) - dyn.asInstanceOf[Int => Int] - } - - println(foo(1)(10)) - println(foo(2)(10)) -} diff --git a/tests/pending/run/reify_closure5a.check b/tests/pending/run/reify_closure5a.check deleted file mode 100644 index df9e19c59..000000000 --- a/tests/pending/run/reify_closure5a.check +++ /dev/null @@ -1,2 +0,0 @@ -13 -14 diff --git a/tests/pending/run/reify_closure5a.scala b/tests/pending/run/reify_closure5a.scala deleted file mode 100644 index e2bd24ad2..000000000 --- a/tests/pending/run/reify_closure5a.scala +++ /dev/null @@ -1,21 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Test extends dotty.runtime.LegacyApp { - def foo[T: TypeTag](ys: List[T]): Int => Int = { - val fun = reify{(x: Int) => { - x + ys.length - }} - - val toolbox = cm.mkToolBox() - val dyn = toolbox.eval(fun.tree) - dyn.asInstanceOf[Int => Int] - } - - var fun1 = foo(List(1, 2, 3)) - println(fun1(10)) - var fun2 = foo(List(1, 2, 3, 4)) - println(fun2(10)) -} diff --git a/tests/pending/run/reify_closure6.check b/tests/pending/run/reify_closure6.check deleted file mode 100644 index b9de4c6ba..000000000 --- a/tests/pending/run/reify_closure6.check +++ /dev/null @@ -1,7 +0,0 @@ -q = 1 -y = 1 -first invocation = 15 -q = 2 -y = 1 -second invocation = 17 -q after second invocation = 2 \ No newline at end of file diff --git a/tests/pending/run/reify_closure6.scala b/tests/pending/run/reify_closure6.scala deleted file mode 100644 index 1c3589cdf..000000000 --- a/tests/pending/run/reify_closure6.scala +++ /dev/null @@ -1,29 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Test extends dotty.runtime.LegacyApp { - var q = 0 - def foo[T: TypeTag](ys: List[T]): Int => Int = { - val z = 1 - var y = 0 - val fun = reify{(x: Int) => { - y += 1 - q += 1 - println("q = " + q) - println("y = " + y) - x + ys.length * z + q + y - }} - - val toolbox = cm.mkToolBox() - val dyn = toolbox.eval(fun.tree) - dyn.asInstanceOf[Int => Int] - } - - val fun1 = foo(List(1, 2, 3)) - println("first invocation = " + fun1(10)) - val fun2 = foo(List(1, 2, 3, 4)) - println("second invocation = " + fun2(10)) - println("q after second invocation = " + q) -} diff --git a/tests/pending/run/reify_closure7.check b/tests/pending/run/reify_closure7.check deleted file mode 100644 index bf58b52bc..000000000 --- a/tests/pending/run/reify_closure7.check +++ /dev/null @@ -1,6 +0,0 @@ -q = 1 -y = 1 -first invocation = 15 -q = 2 -y = 2 -second invocation = 17 diff --git a/tests/pending/run/reify_closure7.scala b/tests/pending/run/reify_closure7.scala deleted file mode 100644 index 93f2f22a4..000000000 --- a/tests/pending/run/reify_closure7.scala +++ /dev/null @@ -1,33 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Test extends dotty.runtime.LegacyApp { - var q = 0 - var clo: Int => Int = null - def foo[T: TypeTag](ys: List[T]): Int => Int = { - val z = 1 - var y = 0 - val fun = reify{(x: Int) => { - y += 1 - q += 1 - println("q = " + q) - println("y = " + y) - x + ys.length * z + q + y - }} - - if (clo == null) { - val toolbox = cm.mkToolBox() - val dyn = toolbox.eval(fun.tree) - clo = dyn.asInstanceOf[Int => Int] - } - - clo - } - - val fun1 = foo(List(1, 2, 3)) - println("first invocation = " + fun1(10)) - val fun2 = foo(List(1, 2, 3, 4)) - println("second invocation = " + fun2(10)) -} diff --git a/tests/pending/run/reify_closure8a.check b/tests/pending/run/reify_closure8a.check deleted file mode 100644 index 9a037142a..000000000 --- a/tests/pending/run/reify_closure8a.check +++ /dev/null @@ -1 +0,0 @@ -10 \ No newline at end of file diff --git a/tests/pending/run/reify_closure8a.scala b/tests/pending/run/reify_closure8a.scala deleted file mode 100644 index ad343dd15..000000000 --- a/tests/pending/run/reify_closure8a.scala +++ /dev/null @@ -1,15 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Test extends dotty.runtime.LegacyApp { - class Foo(val y: Int) { - def fun = reify{y} - } - - val toolbox = cm.mkToolBox() - val dyn = toolbox.eval(new Foo(10).fun.tree) - val foo = dyn.asInstanceOf[Int] - println(foo) -} diff --git a/tests/pending/run/reify_closure8b.check b/tests/pending/run/reify_closure8b.check deleted file mode 100644 index 5d48d3ab3..000000000 --- a/tests/pending/run/reify_closure8b.check +++ /dev/null @@ -1,3 +0,0 @@ -scala.tools.reflect.ToolBoxError: reflective compilation has failed: - -value y is not a member of Test.Foo diff --git a/tests/pending/run/reify_closure8b.scala b/tests/pending/run/reify_closure8b.scala deleted file mode 100644 index f28b18e01..000000000 --- a/tests/pending/run/reify_closure8b.scala +++ /dev/null @@ -1,21 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Test extends dotty.runtime.LegacyApp { - // will fail because y is a private field - // reification doesn't magically make unavailable stuff available - class Foo(y: Int) { - def fun = reify{y} - } - - try { - val dyn = cm.mkToolBox().eval(new Foo(10).fun.tree) - val foo = dyn.asInstanceOf[Int] - println(foo) - } catch { - case ex: Throwable => - println(ex) - } -} diff --git a/tests/pending/run/reify_closures10.check b/tests/pending/run/reify_closures10.check deleted file mode 100644 index fd3c81a4d..000000000 --- a/tests/pending/run/reify_closures10.check +++ /dev/null @@ -1,2 +0,0 @@ -5 -5 diff --git a/tests/pending/run/reify_closures10.scala b/tests/pending/run/reify_closures10.scala deleted file mode 100644 index 9c486e436..000000000 --- a/tests/pending/run/reify_closures10.scala +++ /dev/null @@ -1,13 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Test extends dotty.runtime.LegacyApp { - val x = 2 - val y = 3 - val code = reify{println(x + y); x + y} - - val toolbox = cm.mkToolBox() - println(toolbox.eval(code.tree)) -} diff --git a/tests/pending/run/reify_complex.check b/tests/pending/run/reify_complex.check deleted file mode 100644 index 7df35e33a..000000000 --- a/tests/pending/run/reify_complex.check +++ /dev/null @@ -1 +0,0 @@ -3.0+4.0*i diff --git a/tests/pending/run/reify_complex.scala b/tests/pending/run/reify_complex.scala deleted file mode 100644 index 45b72d899..000000000 --- a/tests/pending/run/reify_complex.scala +++ /dev/null @@ -1,25 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - class Complex(val re: Double, val im: Double) { - def + (that: Complex) = - new Complex(re + that.re, im + that.im) - def - (that: Complex) = - new Complex(re - that.re, im - that.im) - def * (that: Complex) = - new Complex(re * that.re - im * that.im, - re * that.im + im * that.re) - def / (that: Complex) = { - val denom = that.re * that.re + that.im * that.im - new Complex((re * that.re + im * that.im) / denom, - (im * that.re - re * that.im) / denom) - } - override def toString = - re + (if (im < 0) "-" + (-im) else "+" + im) + "*i" - } - val x = new Complex(2, 1); val y = new Complex(1, 3) - println(x + y) - }.eval -} diff --git a/tests/pending/run/reify_copypaste1.check b/tests/pending/run/reify_copypaste1.check deleted file mode 100644 index b204f9c45..000000000 --- a/tests/pending/run/reify_copypaste1.check +++ /dev/null @@ -1,2 +0,0 @@ -List(1, 2) - diff --git a/tests/pending/run/reify_copypaste1.scala b/tests/pending/run/reify_copypaste1.scala deleted file mode 100644 index e255403ad..000000000 --- a/tests/pending/run/reify_copypaste1.scala +++ /dev/null @@ -1,19 +0,0 @@ -import scala.reflect.runtime._ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.universe.definitions._ -import scala.reflect.runtime.universe.Flag._ -import scala.tools.reflect.ToolBox - -object Test extends dotty.runtime.LegacyApp { - val stdout = System.out - val output = new java.io.ByteArrayOutputStream() - System.setOut(new java.io.PrintStream(output)) - val toolBox = currentMirror.mkToolBox(options = "-Yreify-copypaste") - val reify = Select(Select(Select(Select(Ident(ScalaPackage), TermName("reflect")), TermName("runtime")), TermName("universe")), TermName("reify")) - val reifee = Block(List(ValDef(Modifiers(LAZY), TermName("x"), TypeTree(), Apply(Ident(ListModule), List(Literal(Constant(1)), Literal(Constant(2)))))), Ident(TermName("x"))) - toolBox.eval(Apply(reify, List(reifee))) - val Block(List(tpeCopypaste, exprCopypaste @ ModuleDef(_, _, Template(_, _, (_ :: stats) :+ expr))), Literal(Constant(()))) = toolBox.parse(output.toString()) - output.reset() - toolBox.eval(Block(stats, expr)) - stdout.println(output.toString) -} diff --git a/tests/pending/run/reify_copypaste2.check b/tests/pending/run/reify_copypaste2.check deleted file mode 100644 index f5c107696..000000000 --- a/tests/pending/run/reify_copypaste2.check +++ /dev/null @@ -1 +0,0 @@ -`package`.universe.reify(Test.this.x) diff --git a/tests/pending/run/reify_copypaste2.scala b/tests/pending/run/reify_copypaste2.scala deleted file mode 100644 index 2f9bea1fe..000000000 --- a/tests/pending/run/reify_copypaste2.scala +++ /dev/null @@ -1,10 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Test extends dotty.runtime.LegacyApp { - val x = 2 - val outer = reify{reify{x}} - println(outer.tree) -} diff --git a/tests/pending/run/reify_csv.check b/tests/pending/run/reify_csv.check deleted file mode 100644 index b56f4bb50..000000000 --- a/tests/pending/run/reify_csv.check +++ /dev/null @@ -1,10 +0,0 @@ -List(phase name, id, description) -record(parser,1,parse source into ASTs, perform simple desugaring) -record(namer,2,resolve names, attach symbols to named trees) -record(packageobjects,3,load package objects) -record(typer,4,the meat and potatoes: type the trees) -record(superaccessors,5,add super accessors in traits and nested classes) -record(pickler,6,serialize symbol tables) -record(refchecks,7,reference/override checking, translate nested objects) -record(selectiveanf,8,) -record(liftcode,9,reify trees) diff --git a/tests/pending/run/reify_csv.scala b/tests/pending/run/reify_csv.scala deleted file mode 100644 index 1c567c904..000000000 --- a/tests/pending/run/reify_csv.scala +++ /dev/null @@ -1,36 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - val csv = """ - | phase name; id; description - | parser; 1; parse source into ASTs, perform simple desugaring - | namer; 2; resolve names, attach symbols to named trees - |packageobjects; 3; load package objects - | typer; 4; the meat and potatoes: type the trees - |superaccessors; 5; add super accessors in traits and nested classes - | pickler; 6; serialize symbol tables - | refchecks; 7; reference/override checking, translate nested objects - | selectiveanf; 8; - | liftcode; 9; reify trees""".stripMargin.split("\n").map{_.trim()}.drop(1).toList - - val fields = csv.head.split(";").map{_.trim()}.toList - println(fields) - - reify({ - object Csv { - case class record(`phase name`: String, id: String, description: String) - - object record { - def parse(lines: List[String]) = { - lines drop(1) map { line => line.split(";", -1).toList match { - case phase$whitespace$name :: id :: description :: _ => record(phase$whitespace$name.trim(), id.trim(), description.trim()) - case _ => throw new Exception("format error") - }} - } - } - } - - Csv.record.parse(csv) foreach println - }).eval -} diff --git a/tests/pending/run/reify_extendbuiltins.check b/tests/pending/run/reify_extendbuiltins.check deleted file mode 100644 index a48033a30..000000000 --- a/tests/pending/run/reify_extendbuiltins.check +++ /dev/null @@ -1 +0,0 @@ -10! = 3628800 diff --git a/tests/pending/run/reify_extendbuiltins.scala b/tests/pending/run/reify_extendbuiltins.scala deleted file mode 100644 index 3056db6e4..000000000 --- a/tests/pending/run/reify_extendbuiltins.scala +++ /dev/null @@ -1,17 +0,0 @@ - -import scala.language.{ implicitConversions, postfixOps } -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - def fact(n: Int): BigInt = - if (n == 0) 1 else fact(n-1) * n - class Factorizer(n: Int) { - def ! = fact(n) - } - implicit def int2fact(n: Int) = new Factorizer(n) - - println("10! = " + (10!)) - }.eval -} diff --git a/tests/pending/run/reify_for1.scala b/tests/pending/run/reify_for1.scala deleted file mode 100644 index 1233782ad..000000000 --- a/tests/pending/run/reify_for1.scala +++ /dev/null @@ -1,10 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - val sumOfSquares1 = (for (i <- 1 to 100; if (i % 3 == 0)) yield Math.pow(i, 2)).sum - val sumOfSquares2 = (1 to 100).filter(_ % 3 == 0).map(Math.pow(_, 2)).sum - assert(sumOfSquares1 == sumOfSquares2) - }.eval -} diff --git a/tests/pending/run/reify_fors_newpatmat.check b/tests/pending/run/reify_fors_newpatmat.check deleted file mode 100644 index eefddedc2..000000000 --- a/tests/pending/run/reify_fors_newpatmat.check +++ /dev/null @@ -1,5 +0,0 @@ -Persons over 20: John Richard -divisors(34) = List(1, 2, 17, 34) -findNums(15) = (4,1) (5,2) (6,1) (7,4) (8,3) (8,5) (9,2) (9,4) (10,1) (10,3) (10,7) (11,2) (11,6) (11,8) (12,1) (12,5) (12,7) (13,4) (13,6) (13,10) (14,3) (14,5) (14,9) -average(List(3.5, 5.0, 4.5)) = 4.333333333333333 -scalProd(List(3.5, 5.0, 4.5), List(2.0, 1.0, 3.0)) = 25.5 diff --git a/tests/pending/run/reify_fors_newpatmat.scala b/tests/pending/run/reify_fors_newpatmat.scala deleted file mode 100644 index d366169a4..000000000 --- a/tests/pending/run/reify_fors_newpatmat.scala +++ /dev/null @@ -1,101 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - object Persons { - /** A list of persons. To create a list, we use Predef.List - * which takes a variable number of arguments and constructs - * a list out of them. - */ - val persons = List( - new Person("Bob", 17), - new Person("John", 40), - new Person("Richard", 68) - ) - - /** A Person class. 'val' constructor parameters become - * public members of the class. - */ - class Person(val name: String, val age: Int) - - /** Return an iterator over persons that are older than 20. - */ - def olderThan20(xs: Seq[Person]): Iterator[String] = - olderThan20(xs.iterator) - - /** Return an iterator over persons older than 20, given - * an iterator over persons. - */ - def olderThan20(xs: Iterator[Person]): Iterator[String] = { - - // The first expression is called a 'generator' and makes - // 'p' take values from 'xs'. The second expression is - // called a 'filter' and it is a boolean expression which - // selects only persons older than 20. There can be more than - // one generator and filter. The 'yield' expression is evaluated - // for each 'p' which satisfies the filters and used to assemble - // the resulting iterator - for (p <- xs if p.age > 20) yield p.name - } - } - - /** Some functions over lists of numbers which demonstrate - * the use of for comprehensions. - */ - object Numeric { - - /** Return the divisors of n. */ - def divisors(n: Int): List[Int] = - for (i <- List.range(1, n+1) if n % i == 0) yield i - - /** Is 'n' a prime number? */ - def isPrime(n: Int) = divisors(n).length == 2 - - /** Return pairs of numbers whose sum is prime. */ - def findNums(n: Int): Iterable[(Int, Int)] = { - - // a for comprehension using two generators - for (i <- 1 until n; - j <- 1 until (i-1); - if isPrime(i + j)) yield (i, j) - } - - /** Return the sum of the elements of 'xs'. */ - def sum(xs: List[Double]): Double = - xs.foldLeft(0.0) { (x, y) => x + y } - - /** Return the sum of pairwise product of the two lists. */ - def scalProd(xs: List[Double], ys: List[Double]) = - sum(for((x, y) <- xs zip ys) yield x * y); - - /** Remove duplicate elements in 'xs'. */ - def removeDuplicates[A](xs: List[A]): List[A] = - if (xs.isEmpty) - xs - else - xs.head :: removeDuplicates(for (x <- xs.tail if x != xs.head) yield x) - } - - // import all members of object 'persons' in the current scope - import Persons._ - - print("Persons over 20:") - olderThan20(persons) foreach { x => print(" " + x) } - println - - import Numeric._ - - println("divisors(34) = " + divisors(34)) - - print("findNums(15) =") - findNums(15) foreach { x => print(" " + x) } - println - - val xs = List(3.5, 5.0, 4.5) - println("average(" + xs + ") = " + sum(xs) / xs.length) - - val ys = List(2.0, 1.0, 3.0) - println("scalProd(" + xs + ", " + ys +") = " + scalProd(xs, ys)) - }.eval -} diff --git a/tests/pending/run/reify_fors_oldpatmat.check b/tests/pending/run/reify_fors_oldpatmat.check deleted file mode 100644 index eefddedc2..000000000 --- a/tests/pending/run/reify_fors_oldpatmat.check +++ /dev/null @@ -1,5 +0,0 @@ -Persons over 20: John Richard -divisors(34) = List(1, 2, 17, 34) -findNums(15) = (4,1) (5,2) (6,1) (7,4) (8,3) (8,5) (9,2) (9,4) (10,1) (10,3) (10,7) (11,2) (11,6) (11,8) (12,1) (12,5) (12,7) (13,4) (13,6) (13,10) (14,3) (14,5) (14,9) -average(List(3.5, 5.0, 4.5)) = 4.333333333333333 -scalProd(List(3.5, 5.0, 4.5), List(2.0, 1.0, 3.0)) = 25.5 diff --git a/tests/pending/run/reify_fors_oldpatmat.scala b/tests/pending/run/reify_fors_oldpatmat.scala deleted file mode 100644 index d366169a4..000000000 --- a/tests/pending/run/reify_fors_oldpatmat.scala +++ /dev/null @@ -1,101 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - object Persons { - /** A list of persons. To create a list, we use Predef.List - * which takes a variable number of arguments and constructs - * a list out of them. - */ - val persons = List( - new Person("Bob", 17), - new Person("John", 40), - new Person("Richard", 68) - ) - - /** A Person class. 'val' constructor parameters become - * public members of the class. - */ - class Person(val name: String, val age: Int) - - /** Return an iterator over persons that are older than 20. - */ - def olderThan20(xs: Seq[Person]): Iterator[String] = - olderThan20(xs.iterator) - - /** Return an iterator over persons older than 20, given - * an iterator over persons. - */ - def olderThan20(xs: Iterator[Person]): Iterator[String] = { - - // The first expression is called a 'generator' and makes - // 'p' take values from 'xs'. The second expression is - // called a 'filter' and it is a boolean expression which - // selects only persons older than 20. There can be more than - // one generator and filter. The 'yield' expression is evaluated - // for each 'p' which satisfies the filters and used to assemble - // the resulting iterator - for (p <- xs if p.age > 20) yield p.name - } - } - - /** Some functions over lists of numbers which demonstrate - * the use of for comprehensions. - */ - object Numeric { - - /** Return the divisors of n. */ - def divisors(n: Int): List[Int] = - for (i <- List.range(1, n+1) if n % i == 0) yield i - - /** Is 'n' a prime number? */ - def isPrime(n: Int) = divisors(n).length == 2 - - /** Return pairs of numbers whose sum is prime. */ - def findNums(n: Int): Iterable[(Int, Int)] = { - - // a for comprehension using two generators - for (i <- 1 until n; - j <- 1 until (i-1); - if isPrime(i + j)) yield (i, j) - } - - /** Return the sum of the elements of 'xs'. */ - def sum(xs: List[Double]): Double = - xs.foldLeft(0.0) { (x, y) => x + y } - - /** Return the sum of pairwise product of the two lists. */ - def scalProd(xs: List[Double], ys: List[Double]) = - sum(for((x, y) <- xs zip ys) yield x * y); - - /** Remove duplicate elements in 'xs'. */ - def removeDuplicates[A](xs: List[A]): List[A] = - if (xs.isEmpty) - xs - else - xs.head :: removeDuplicates(for (x <- xs.tail if x != xs.head) yield x) - } - - // import all members of object 'persons' in the current scope - import Persons._ - - print("Persons over 20:") - olderThan20(persons) foreach { x => print(" " + x) } - println - - import Numeric._ - - println("divisors(34) = " + divisors(34)) - - print("findNums(15) =") - findNums(15) foreach { x => print(" " + x) } - println - - val xs = List(3.5, 5.0, 4.5) - println("average(" + xs + ") = " + sum(xs) / xs.length) - - val ys = List(2.0, 1.0, 3.0) - println("scalProd(" + xs + ", " + ys +") = " + scalProd(xs, ys)) - }.eval -} diff --git a/tests/pending/run/reify_generic.check b/tests/pending/run/reify_generic.check deleted file mode 100644 index b8626c4cf..000000000 --- a/tests/pending/run/reify_generic.check +++ /dev/null @@ -1 +0,0 @@ -4 diff --git a/tests/pending/run/reify_generic.scala b/tests/pending/run/reify_generic.scala deleted file mode 100644 index 4221dbf6c..000000000 --- a/tests/pending/run/reify_generic.scala +++ /dev/null @@ -1,9 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - val product = List(1, 2, 3).head * List[Any](4, 2, 0).head.asInstanceOf[Int] - println(product) - }.eval -} diff --git a/tests/pending/run/reify_generic2.check b/tests/pending/run/reify_generic2.check deleted file mode 100644 index b8626c4cf..000000000 --- a/tests/pending/run/reify_generic2.check +++ /dev/null @@ -1 +0,0 @@ -4 diff --git a/tests/pending/run/reify_generic2.scala b/tests/pending/run/reify_generic2.scala deleted file mode 100644 index 6941d9ff7..000000000 --- a/tests/pending/run/reify_generic2.scala +++ /dev/null @@ -1,10 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - class C - val product = List(new C, new C).length * List[C](new C, new C).length - println(product) - }.eval -} diff --git a/tests/pending/run/reify_getter.check b/tests/pending/run/reify_getter.check deleted file mode 100644 index 5ef4ff4d0..000000000 --- a/tests/pending/run/reify_getter.check +++ /dev/null @@ -1 +0,0 @@ -evaluated = 2 diff --git a/tests/pending/run/reify_getter.scala b/tests/pending/run/reify_getter.scala deleted file mode 100644 index 18c9a1a32..000000000 --- a/tests/pending/run/reify_getter.scala +++ /dev/null @@ -1,18 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Test extends dotty.runtime.LegacyApp { - val code = reify { - class C { - val x = 2 - } - - new C().x - } - - val toolbox = cm.mkToolBox() - val evaluated = toolbox.eval(code.tree) - println("evaluated = " + evaluated) -} diff --git a/tests/pending/run/reify_implicits-new.check b/tests/pending/run/reify_implicits-new.check deleted file mode 100644 index e3aeb20f6..000000000 --- a/tests/pending/run/reify_implicits-new.check +++ /dev/null @@ -1 +0,0 @@ -x = List(1, 2, 3, 4) diff --git a/tests/pending/run/reify_implicits-new.scala b/tests/pending/run/reify_implicits-new.scala deleted file mode 100644 index 5ff90871a..000000000 --- a/tests/pending/run/reify_implicits-new.scala +++ /dev/null @@ -1,18 +0,0 @@ - -import scala.language.{ implicitConversions, reflectiveCalls } -import scala.reflect.{ClassTag, classTag} -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - implicit def arrayWrapper[A : ClassTag](x: Array[A]) = - new { - def sort(p: (A, A) => Boolean) = { - util.Sorting.stableSort(x, p); x - } - } - val x = Array(2, 3, 1, 4) - println("x = "+ x.sort((x: Int, y: Int) => x < y).toList) - }.eval -} diff --git a/tests/pending/run/reify_implicits-old.check b/tests/pending/run/reify_implicits-old.check deleted file mode 100644 index e3aeb20f6..000000000 --- a/tests/pending/run/reify_implicits-old.check +++ /dev/null @@ -1 +0,0 @@ -x = List(1, 2, 3, 4) diff --git a/tests/pending/run/reify_implicits-old.scala b/tests/pending/run/reify_implicits-old.scala deleted file mode 100644 index ccd9375d6..000000000 --- a/tests/pending/run/reify_implicits-old.scala +++ /dev/null @@ -1,17 +0,0 @@ - -import scala.language.{ implicitConversions, reflectiveCalls } -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - implicit def arrayWrapper[A : ClassManifest](x: Array[A]) = - new { - def sort(p: (A, A) => Boolean) = { - util.Sorting.stableSort(x, p); x - } - } - val x = Array(2, 3, 1, 4) - println("x = "+ x.sort((x: Int, y: Int) => x < y).toList) - }.eval -} diff --git a/tests/pending/run/reify_inheritance.check b/tests/pending/run/reify_inheritance.check deleted file mode 100644 index 25bf17fc5..000000000 --- a/tests/pending/run/reify_inheritance.check +++ /dev/null @@ -1 +0,0 @@ -18 \ No newline at end of file diff --git a/tests/pending/run/reify_inheritance.scala b/tests/pending/run/reify_inheritance.scala deleted file mode 100644 index f4fb49edc..000000000 --- a/tests/pending/run/reify_inheritance.scala +++ /dev/null @@ -1,17 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - class C { - def x = 2 - def y = x * x - } - - class D extends C { - override def x = 3 - } - - println(new D().y * new C().x) - }.eval -} diff --git a/tests/pending/run/reify_inner1.check b/tests/pending/run/reify_inner1.check deleted file mode 100644 index d8263ee98..000000000 --- a/tests/pending/run/reify_inner1.check +++ /dev/null @@ -1 +0,0 @@ -2 \ No newline at end of file diff --git a/tests/pending/run/reify_inner1.scala b/tests/pending/run/reify_inner1.scala deleted file mode 100644 index bae49f910..000000000 --- a/tests/pending/run/reify_inner1.scala +++ /dev/null @@ -1,16 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - class C { - class D { - val x = 2 - } - } - - val outer = new C() - val inner = new outer.D() - println(inner.x) - }.eval -} diff --git a/tests/pending/run/reify_inner2.check b/tests/pending/run/reify_inner2.check deleted file mode 100644 index d8263ee98..000000000 --- a/tests/pending/run/reify_inner2.check +++ /dev/null @@ -1 +0,0 @@ -2 \ No newline at end of file diff --git a/tests/pending/run/reify_inner2.scala b/tests/pending/run/reify_inner2.scala deleted file mode 100644 index fbe54b072..000000000 --- a/tests/pending/run/reify_inner2.scala +++ /dev/null @@ -1,16 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - class C { - object D { - val x = 2 - } - } - - val outer = new C() - val inner = outer.D - println(inner.x) - }.eval -} diff --git a/tests/pending/run/reify_inner3.check b/tests/pending/run/reify_inner3.check deleted file mode 100644 index d8263ee98..000000000 --- a/tests/pending/run/reify_inner3.check +++ /dev/null @@ -1 +0,0 @@ -2 \ No newline at end of file diff --git a/tests/pending/run/reify_inner3.scala b/tests/pending/run/reify_inner3.scala deleted file mode 100644 index 004041b7d..000000000 --- a/tests/pending/run/reify_inner3.scala +++ /dev/null @@ -1,16 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - object C { - class D { - val x = 2 - } - } - - val outer = C - val inner = new outer.D - println(inner.x) - }.eval -} diff --git a/tests/pending/run/reify_inner4.check b/tests/pending/run/reify_inner4.check deleted file mode 100644 index d8263ee98..000000000 --- a/tests/pending/run/reify_inner4.check +++ /dev/null @@ -1 +0,0 @@ -2 \ No newline at end of file diff --git a/tests/pending/run/reify_inner4.scala b/tests/pending/run/reify_inner4.scala deleted file mode 100644 index 5292cf040..000000000 --- a/tests/pending/run/reify_inner4.scala +++ /dev/null @@ -1,16 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - object C { - object D { - val x = 2 - } - } - - val outer = C - val inner = outer.D - println(inner.x) - }.eval -} diff --git a/tests/pending/run/reify_lazyevaluation.check b/tests/pending/run/reify_lazyevaluation.check deleted file mode 100644 index 1c7f96cd9..000000000 --- a/tests/pending/run/reify_lazyevaluation.check +++ /dev/null @@ -1,8 +0,0 @@ -s = Susp(?) -evaluating... -s() = 3 -s = Susp(3) -2 + s = 5 -sl2 = Susp(?) -sl2() = Some(3) -sl2 = Susp(Some(3)) diff --git a/tests/pending/run/reify_lazyevaluation.scala b/tests/pending/run/reify_lazyevaluation.scala deleted file mode 100644 index 564e7f1cd..000000000 --- a/tests/pending/run/reify_lazyevaluation.scala +++ /dev/null @@ -1,61 +0,0 @@ - -import scala.language.{ implicitConversions } -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - object lazyLib { - - /** Delay the evaluation of an expression until it is needed. */ - def delay[A](value: => A): Susp[A] = new SuspImpl[A](value) - - /** Get the value of a delayed expression. */ - implicit def force[A](s: Susp[A]): A = s() - - /** - * Data type of suspended computations. (The name froms from ML.) - */ - abstract class Susp[+A] extends Function0[A] - - /** - * Implementation of suspended computations, separated from the - * abstract class so that the type parameter can be invariant. - */ - class SuspImpl[A](lazyValue: => A) extends Susp[A] { - private var maybeValue: Option[A] = None - - override def apply() = maybeValue match { - case None => - val value = lazyValue - maybeValue = Some(value) - value - case Some(value) => - value - } - - override def toString() = maybeValue match { - case None => "Susp(?)" - case Some(value) => "Susp(" + value + ")" - } - } - } - - import lazyLib._ - - val s: Susp[Int] = delay { println("evaluating..."); 3 } - - println("s = " + s) // show that s is unevaluated - println("s() = " + s()) // evaluate s - println("s = " + s) // show that the value is saved - println("2 + s = " + (2 + s)) // implicit call to force() - - val sl = delay { Some(3) } - val sl1: Susp[Some[Int]] = sl - val sl2: Susp[Option[Int]] = sl1 // the type is covariant - - println("sl2 = " + sl2) - println("sl2() = " + sl2()) - println("sl2 = " + sl2) - }.eval -} diff --git a/tests/pending/run/reify_lazyunit.check b/tests/pending/run/reify_lazyunit.check deleted file mode 100644 index 579ecfe8a..000000000 --- a/tests/pending/run/reify_lazyunit.check +++ /dev/null @@ -1,6 +0,0 @@ -reify_lazyunit.scala:6: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses - lazy val x = { 0; println("12")} - ^ -12 -one -two diff --git a/tests/pending/run/reify_lazyunit.scala b/tests/pending/run/reify_lazyunit.scala deleted file mode 100644 index 70caf4f33..000000000 --- a/tests/pending/run/reify_lazyunit.scala +++ /dev/null @@ -1,13 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - lazy val x = { 0; println("12")} - x - println("one") - x - println("two") - }.eval -} - diff --git a/tests/pending/run/reify_maps_newpatmat.check b/tests/pending/run/reify_maps_newpatmat.check deleted file mode 100644 index 08cbbb135..000000000 --- a/tests/pending/run/reify_maps_newpatmat.check +++ /dev/null @@ -1,4 +0,0 @@ -red has code: 16711680 -Unknown color: green -Unknown color: blue -turquoise has code: 65535 diff --git a/tests/pending/run/reify_maps_newpatmat.scala b/tests/pending/run/reify_maps_newpatmat.scala deleted file mode 100644 index 18adb5c36..000000000 --- a/tests/pending/run/reify_maps_newpatmat.scala +++ /dev/null @@ -1,20 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - val colors = Map("red" -> 0xFF0000, - "turquoise" -> 0x00FFFF, - "black" -> 0x000000, - "orange" -> 0xFF8040, - "brown" -> 0x804000) - for (name <- List("red", "green", "blue", "turquoise")) println( - colors.get(name) match { - case Some(code) => - name + " has code: " + code - case None => - "Unknown color: " + name - } - ) - }.eval -} diff --git a/tests/pending/run/reify_maps_oldpatmat.check b/tests/pending/run/reify_maps_oldpatmat.check deleted file mode 100644 index 08cbbb135..000000000 --- a/tests/pending/run/reify_maps_oldpatmat.check +++ /dev/null @@ -1,4 +0,0 @@ -red has code: 16711680 -Unknown color: green -Unknown color: blue -turquoise has code: 65535 diff --git a/tests/pending/run/reify_maps_oldpatmat.scala b/tests/pending/run/reify_maps_oldpatmat.scala deleted file mode 100644 index 18adb5c36..000000000 --- a/tests/pending/run/reify_maps_oldpatmat.scala +++ /dev/null @@ -1,20 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - val colors = Map("red" -> 0xFF0000, - "turquoise" -> 0x00FFFF, - "black" -> 0x000000, - "orange" -> 0xFF8040, - "brown" -> 0x804000) - for (name <- List("red", "green", "blue", "turquoise")) println( - colors.get(name) match { - case Some(code) => - name + " has code: " + code - case None => - "Unknown color: " + name - } - ) - }.eval -} diff --git a/tests/pending/run/reify_metalevel_breach_+0_refers_to_1.check b/tests/pending/run/reify_metalevel_breach_+0_refers_to_1.check deleted file mode 100644 index 5bfed17f8..000000000 --- a/tests/pending/run/reify_metalevel_breach_+0_refers_to_1.check +++ /dev/null @@ -1 +0,0 @@ -evaluated = 2 \ No newline at end of file diff --git a/tests/pending/run/reify_metalevel_breach_+0_refers_to_1.scala b/tests/pending/run/reify_metalevel_breach_+0_refers_to_1.scala deleted file mode 100644 index 2f930c25e..000000000 --- a/tests/pending/run/reify_metalevel_breach_+0_refers_to_1.scala +++ /dev/null @@ -1,18 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - val code = reify{ - val x = 2 - val inner = reify{x} -// was: inner.splice - inner.eval - }; - - val toolbox = cm.mkToolBox() - val evaluated = toolbox.eval(code.tree) - println("evaluated = " + evaluated) -} diff --git a/tests/pending/run/reify_metalevel_breach_-1_refers_to_0_a.check b/tests/pending/run/reify_metalevel_breach_-1_refers_to_0_a.check deleted file mode 100644 index 5bfed17f8..000000000 --- a/tests/pending/run/reify_metalevel_breach_-1_refers_to_0_a.check +++ /dev/null @@ -1 +0,0 @@ -evaluated = 2 \ No newline at end of file diff --git a/tests/pending/run/reify_metalevel_breach_-1_refers_to_0_a.scala b/tests/pending/run/reify_metalevel_breach_-1_refers_to_0_a.scala deleted file mode 100644 index 526ed3d13..000000000 --- a/tests/pending/run/reify_metalevel_breach_-1_refers_to_0_a.scala +++ /dev/null @@ -1,16 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - val x = 2 - val outer = reify{reify{x}} -// was: val code = reify{outer.splice.splice} - val code = reify{outer.eval.eval} - - val toolbox = cm.mkToolBox() - val evaluated = toolbox.eval(code.tree) - println("evaluated = " + evaluated) -} diff --git a/tests/pending/run/reify_metalevel_breach_-1_refers_to_0_b.check b/tests/pending/run/reify_metalevel_breach_-1_refers_to_0_b.check deleted file mode 100644 index 5bfed17f8..000000000 --- a/tests/pending/run/reify_metalevel_breach_-1_refers_to_0_b.check +++ /dev/null @@ -1 +0,0 @@ -evaluated = 2 \ No newline at end of file diff --git a/tests/pending/run/reify_metalevel_breach_-1_refers_to_0_b.scala b/tests/pending/run/reify_metalevel_breach_-1_refers_to_0_b.scala deleted file mode 100644 index 96793c634..000000000 --- a/tests/pending/run/reify_metalevel_breach_-1_refers_to_0_b.scala +++ /dev/null @@ -1,21 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - val x = 2 - val code = reify{ - { - val inner = reify{reify{x}} -// was: inner.splice - inner.eval -// was: }.splice - }.eval - } - - val toolbox = cm.mkToolBox() - val evaluated = toolbox.eval(code.tree) - println("evaluated = " + evaluated) -} diff --git a/tests/pending/run/reify_metalevel_breach_-1_refers_to_1.check b/tests/pending/run/reify_metalevel_breach_-1_refers_to_1.check deleted file mode 100644 index 5bfed17f8..000000000 --- a/tests/pending/run/reify_metalevel_breach_-1_refers_to_1.check +++ /dev/null @@ -1 +0,0 @@ -evaluated = 2 \ No newline at end of file diff --git a/tests/pending/run/reify_metalevel_breach_-1_refers_to_1.scala b/tests/pending/run/reify_metalevel_breach_-1_refers_to_1.scala deleted file mode 100644 index 0fc985b6a..000000000 --- a/tests/pending/run/reify_metalevel_breach_-1_refers_to_1.scala +++ /dev/null @@ -1,18 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - val code = reify{ - val x = 2 - val inner = reify{reify{x}} -// was: inner.splice.splice - inner.eval.eval - }; - - val toolbox = cm.mkToolBox() - val evaluated = toolbox.eval(code.tree) - println("evaluated = " + evaluated) -} diff --git a/tests/pending/run/reify_nested_inner_refers_to_global.check b/tests/pending/run/reify_nested_inner_refers_to_global.check deleted file mode 100644 index 5ef4ff4d0..000000000 --- a/tests/pending/run/reify_nested_inner_refers_to_global.check +++ /dev/null @@ -1 +0,0 @@ -evaluated = 2 diff --git a/tests/pending/run/reify_nested_inner_refers_to_global.scala b/tests/pending/run/reify_nested_inner_refers_to_global.scala deleted file mode 100644 index 41d378e91..000000000 --- a/tests/pending/run/reify_nested_inner_refers_to_global.scala +++ /dev/null @@ -1,17 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Test extends dotty.runtime.LegacyApp { - val code = { - val x = 2 - reify{ - reify{x}.splice - } - } - - val toolbox = cm.mkToolBox() - val evaluated = toolbox.eval(code.tree) - println("evaluated = " + evaluated) -} diff --git a/tests/pending/run/reify_nested_inner_refers_to_local.check b/tests/pending/run/reify_nested_inner_refers_to_local.check deleted file mode 100644 index 5bfed17f8..000000000 --- a/tests/pending/run/reify_nested_inner_refers_to_local.check +++ /dev/null @@ -1 +0,0 @@ -evaluated = 2 \ No newline at end of file diff --git a/tests/pending/run/reify_nested_inner_refers_to_local.scala b/tests/pending/run/reify_nested_inner_refers_to_local.scala deleted file mode 100644 index 102278c84..000000000 --- a/tests/pending/run/reify_nested_inner_refers_to_local.scala +++ /dev/null @@ -1,17 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - val code = reify{ - val x = 2 -// was: reify{x}.eval - reify{x}.eval - }; - - val toolbox = cm.mkToolBox() - val evaluated = toolbox.eval(code.tree) - println("evaluated = " + evaluated) -} diff --git a/tests/pending/run/reify_nested_outer_refers_to_global.check b/tests/pending/run/reify_nested_outer_refers_to_global.check deleted file mode 100644 index 5ef4ff4d0..000000000 --- a/tests/pending/run/reify_nested_outer_refers_to_global.check +++ /dev/null @@ -1 +0,0 @@ -evaluated = 2 diff --git a/tests/pending/run/reify_nested_outer_refers_to_global.scala b/tests/pending/run/reify_nested_outer_refers_to_global.scala deleted file mode 100644 index bff5dc407..000000000 --- a/tests/pending/run/reify_nested_outer_refers_to_global.scala +++ /dev/null @@ -1,19 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Test extends dotty.runtime.LegacyApp { - val code = { - val x = 2 - val outer = reify{x} - reify{ - val x = 42 - outer.splice - }; - } - - val toolbox = cm.mkToolBox() - val evaluated = toolbox.eval(code.tree) - println("evaluated = " + evaluated) -} diff --git a/tests/pending/run/reify_nested_outer_refers_to_local.check b/tests/pending/run/reify_nested_outer_refers_to_local.check deleted file mode 100644 index 5ef4ff4d0..000000000 --- a/tests/pending/run/reify_nested_outer_refers_to_local.check +++ /dev/null @@ -1 +0,0 @@ -evaluated = 2 diff --git a/tests/pending/run/reify_nested_outer_refers_to_local.scala b/tests/pending/run/reify_nested_outer_refers_to_local.scala deleted file mode 100644 index 70c400bc2..000000000 --- a/tests/pending/run/reify_nested_outer_refers_to_local.scala +++ /dev/null @@ -1,19 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Test extends dotty.runtime.LegacyApp { - val outer = { - val x = 2 - reify{x} - } - val code = reify{ - val x = 42 - outer.splice - }; - - val toolbox = cm.mkToolBox() - val evaluated = toolbox.eval(code.tree) - println("evaluated = " + evaluated) -} diff --git a/tests/pending/run/reify_newimpl_01.check b/tests/pending/run/reify_newimpl_01.check deleted file mode 100644 index d8263ee98..000000000 --- a/tests/pending/run/reify_newimpl_01.check +++ /dev/null @@ -1 +0,0 @@ -2 \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_01.scala b/tests/pending/run/reify_newimpl_01.scala deleted file mode 100644 index 1a5f96b53..000000000 --- a/tests/pending/run/reify_newimpl_01.scala +++ /dev/null @@ -1,13 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - { - val x = 2 - val code = reify { - x - } - println(code.eval) - } -} diff --git a/tests/pending/run/reify_newimpl_02.check b/tests/pending/run/reify_newimpl_02.check deleted file mode 100644 index d8263ee98..000000000 --- a/tests/pending/run/reify_newimpl_02.check +++ /dev/null @@ -1 +0,0 @@ -2 \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_02.scala b/tests/pending/run/reify_newimpl_02.scala deleted file mode 100644 index 1ef3f03ed..000000000 --- a/tests/pending/run/reify_newimpl_02.scala +++ /dev/null @@ -1,13 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - { - var x = 2 - val code = reify { - x - } - println(code.eval) - } -} diff --git a/tests/pending/run/reify_newimpl_03.check b/tests/pending/run/reify_newimpl_03.check deleted file mode 100644 index d8263ee98..000000000 --- a/tests/pending/run/reify_newimpl_03.check +++ /dev/null @@ -1 +0,0 @@ -2 \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_03.scala b/tests/pending/run/reify_newimpl_03.scala deleted file mode 100644 index 531bc76fe..000000000 --- a/tests/pending/run/reify_newimpl_03.scala +++ /dev/null @@ -1,13 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - { - val code = reify { - val x = 2 - reify{x}.eval - } - println(code.eval) - } -} diff --git a/tests/pending/run/reify_newimpl_04.check b/tests/pending/run/reify_newimpl_04.check deleted file mode 100644 index d8263ee98..000000000 --- a/tests/pending/run/reify_newimpl_04.check +++ /dev/null @@ -1 +0,0 @@ -2 \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_04.scala b/tests/pending/run/reify_newimpl_04.scala deleted file mode 100644 index b6071f843..000000000 --- a/tests/pending/run/reify_newimpl_04.scala +++ /dev/null @@ -1,13 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - { - val code = reify { - var x = 2 - reify{x}.eval - } - println(code.eval) - } -} diff --git a/tests/pending/run/reify_newimpl_05.check b/tests/pending/run/reify_newimpl_05.check deleted file mode 100644 index d8263ee98..000000000 --- a/tests/pending/run/reify_newimpl_05.check +++ /dev/null @@ -1 +0,0 @@ -2 \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_05.scala b/tests/pending/run/reify_newimpl_05.scala deleted file mode 100644 index 0ff5bb07c..000000000 --- a/tests/pending/run/reify_newimpl_05.scala +++ /dev/null @@ -1,14 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - { - val code = reify { - var x = 2 - def y = x // forcibly captures x - reify{x}.eval - } - println(code.eval) - } -} diff --git a/tests/pending/run/reify_newimpl_06.check b/tests/pending/run/reify_newimpl_06.check deleted file mode 100644 index d8263ee98..000000000 --- a/tests/pending/run/reify_newimpl_06.check +++ /dev/null @@ -1 +0,0 @@ -2 \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_06.scala b/tests/pending/run/reify_newimpl_06.scala deleted file mode 100644 index 8743da100..000000000 --- a/tests/pending/run/reify_newimpl_06.scala +++ /dev/null @@ -1,13 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - class C(val y: Int) { - val code = reify { - reify{y}.eval - } - } - - println(new C(2).code.eval) -} diff --git a/tests/pending/run/reify_newimpl_11.check b/tests/pending/run/reify_newimpl_11.check deleted file mode 100644 index c019c6db2..000000000 --- a/tests/pending/run/reify_newimpl_11.check +++ /dev/null @@ -1,4 +0,0 @@ -scala.tools.reflect.ToolBoxError: reflective toolbox failed due to unresolved free type variables: - T defined by C in reify_newimpl_11.scala:6:11 -have you forgotten to use TypeTag annotations for type parameters external to a reifee? -if you have troubles tracking free type variables, consider using -Xlog-free-types diff --git a/tests/pending/run/reify_newimpl_11.scala b/tests/pending/run/reify_newimpl_11.scala deleted file mode 100644 index bb08808c2..000000000 --- a/tests/pending/run/reify_newimpl_11.scala +++ /dev/null @@ -1,19 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - class C[T] { - val code = reify { - List[T](2.asInstanceOf[T]) - } - println(code.eval) - } - - try { - new C[Int] - } catch { - case ex: Throwable => - println(ex) - } -} diff --git a/tests/pending/run/reify_newimpl_12.check b/tests/pending/run/reify_newimpl_12.check deleted file mode 100644 index 220bd6875..000000000 --- a/tests/pending/run/reify_newimpl_12.check +++ /dev/null @@ -1 +0,0 @@ -List(2) \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_12.scala b/tests/pending/run/reify_newimpl_12.scala deleted file mode 100644 index c2b9d42ca..000000000 --- a/tests/pending/run/reify_newimpl_12.scala +++ /dev/null @@ -1,14 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - class C[T: TypeTag] { - val code = reify { - List[T](2.asInstanceOf[T]) - } - println(code.eval) - } - - new C[Int] -} diff --git a/tests/pending/run/reify_newimpl_13.check b/tests/pending/run/reify_newimpl_13.check deleted file mode 100644 index 13e3c9af1..000000000 --- a/tests/pending/run/reify_newimpl_13.check +++ /dev/null @@ -1,4 +0,0 @@ -scala.tools.reflect.ToolBoxError: reflective toolbox failed due to unresolved free type variables: - T defined by C in reify_newimpl_13.scala:7:13 -have you forgotten to use TypeTag annotations for type parameters external to a reifee? -if you have troubles tracking free type variables, consider using -Xlog-free-types diff --git a/tests/pending/run/reify_newimpl_13.scala b/tests/pending/run/reify_newimpl_13.scala deleted file mode 100644 index 79a99c334..000000000 --- a/tests/pending/run/reify_newimpl_13.scala +++ /dev/null @@ -1,21 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - { - class C[T] { - val code = reify { - List[T](2.asInstanceOf[T]) - } - println(code.eval) - } - - try { - new C[Int] - } catch { - case ex: Throwable => - println(ex) - } - } -} diff --git a/tests/pending/run/reify_newimpl_14.check b/tests/pending/run/reify_newimpl_14.check deleted file mode 100644 index 220bd6875..000000000 --- a/tests/pending/run/reify_newimpl_14.check +++ /dev/null @@ -1 +0,0 @@ -List(2) \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_14.scala b/tests/pending/run/reify_newimpl_14.scala deleted file mode 100644 index af2c7f136..000000000 --- a/tests/pending/run/reify_newimpl_14.scala +++ /dev/null @@ -1,16 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - { - class C[T: TypeTag] { - val code = reify { - List[T](2.asInstanceOf[T]) - } - println(code.eval) - } - - new C[Int] - } -} diff --git a/tests/pending/run/reify_newimpl_15.check b/tests/pending/run/reify_newimpl_15.check deleted file mode 100644 index 220bd6875..000000000 --- a/tests/pending/run/reify_newimpl_15.check +++ /dev/null @@ -1 +0,0 @@ -List(2) \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_15.scala b/tests/pending/run/reify_newimpl_15.scala deleted file mode 100644 index 4bcfc7107..000000000 --- a/tests/pending/run/reify_newimpl_15.scala +++ /dev/null @@ -1,15 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - class C { - type T = Int - val code = reify { - List[T](2) - } - println(code.eval) - } - - new C -} diff --git a/tests/pending/run/reify_newimpl_18.check b/tests/pending/run/reify_newimpl_18.check deleted file mode 100644 index c23af69b0..000000000 --- a/tests/pending/run/reify_newimpl_18.check +++ /dev/null @@ -1 +0,0 @@ -List(2) diff --git a/tests/pending/run/reify_newimpl_18.scala b/tests/pending/run/reify_newimpl_18.scala deleted file mode 100644 index e60bed8c7..000000000 --- a/tests/pending/run/reify_newimpl_18.scala +++ /dev/null @@ -1,15 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - class C[U: TypeTag] { - type T = U - val code = reify { - List[T](2.asInstanceOf[T]) - } - println(code.eval) - } - - new C[Int] -} diff --git a/tests/pending/run/reify_newimpl_19.check b/tests/pending/run/reify_newimpl_19.check deleted file mode 100644 index c749d4f10..000000000 --- a/tests/pending/run/reify_newimpl_19.check +++ /dev/null @@ -1,4 +0,0 @@ -scala.tools.reflect.ToolBoxError: reflective toolbox failed due to unresolved free type variables: - T defined by C in reify_newimpl_19.scala:7:10 -have you forgotten to use TypeTag annotations for type parameters external to a reifee? -if you have troubles tracking free type variables, consider using -Xlog-free-types diff --git a/tests/pending/run/reify_newimpl_19.scala b/tests/pending/run/reify_newimpl_19.scala deleted file mode 100644 index eaa6ca206..000000000 --- a/tests/pending/run/reify_newimpl_19.scala +++ /dev/null @@ -1,20 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - class C { - type T - val code = reify { - List[T](2.asInstanceOf[T]) - } - println(code.eval) - } - - try { - new C { val T = Int } - } catch { - case ex: Throwable => - println(ex) - } -} diff --git a/tests/pending/run/reify_newimpl_20.check b/tests/pending/run/reify_newimpl_20.check deleted file mode 100644 index c23af69b0..000000000 --- a/tests/pending/run/reify_newimpl_20.check +++ /dev/null @@ -1 +0,0 @@ -List(2) diff --git a/tests/pending/run/reify_newimpl_20.scala b/tests/pending/run/reify_newimpl_20.scala deleted file mode 100644 index c483e0b7e..000000000 --- a/tests/pending/run/reify_newimpl_20.scala +++ /dev/null @@ -1,16 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - class C { - type T - implicit val tt: TypeTag[T] = implicitly[TypeTag[Int]].asInstanceOf[TypeTag[T]] - val code = reify { - List[T](2.asInstanceOf[T]) - } - println(code.eval) - } - - new C { type T = String } // this "mistake" is made for a reason! -} diff --git a/tests/pending/run/reify_newimpl_21.check b/tests/pending/run/reify_newimpl_21.check deleted file mode 100644 index c23af69b0..000000000 --- a/tests/pending/run/reify_newimpl_21.check +++ /dev/null @@ -1 +0,0 @@ -List(2) diff --git a/tests/pending/run/reify_newimpl_21.scala b/tests/pending/run/reify_newimpl_21.scala deleted file mode 100644 index 0875ede6b..000000000 --- a/tests/pending/run/reify_newimpl_21.scala +++ /dev/null @@ -1,20 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - trait C { - type T - implicit val tt: TypeTag[T] - lazy val code = reify { - List[T](2.asInstanceOf[T]) - } - } - - class D extends C { - type T = String // this "mistake" is made for a reason! - override val tt: TypeTag[T] = implicitly[TypeTag[Int]].asInstanceOf[TypeTag[T]] - } - - println((new D).code.eval) -} diff --git a/tests/pending/run/reify_newimpl_22.check b/tests/pending/run/reify_newimpl_22.check deleted file mode 100644 index 952f384a1..000000000 --- a/tests/pending/run/reify_newimpl_22.check +++ /dev/null @@ -1,25 +0,0 @@ -Type in expressions to have them evaluated. -Type :help for more information. - -scala> import scala.reflect.runtime.universe._ -import scala.reflect.runtime.universe._ - -scala> import scala.tools.reflect.ToolBox -import scala.tools.reflect.ToolBox - -scala> import scala.tools.reflect.Eval -import scala.tools.reflect.Eval - -scala> { - val x = 2 - val code = reify { - x - } - println(code.eval) -} -:15: free term: Ident(TermName("x")) defined by res0 in :14:21 - val code = reify { - ^ -2 - -scala> :quit diff --git a/tests/pending/run/reify_newimpl_22.scala b/tests/pending/run/reify_newimpl_22.scala deleted file mode 100644 index 8512620a1..000000000 --- a/tests/pending/run/reify_newimpl_22.scala +++ /dev/null @@ -1,17 +0,0 @@ -import scala.tools.partest.ReplTest - -object Test extends ReplTest { - override def extraSettings = "-Xlog-free-terms" - def code = """ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval -{ - val x = 2 - val code = reify { - x - } - println(code.eval) -} - """ -} \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_23.check b/tests/pending/run/reify_newimpl_23.check deleted file mode 100644 index b7e9bfdfb..000000000 --- a/tests/pending/run/reify_newimpl_23.check +++ /dev/null @@ -1,24 +0,0 @@ -Type in expressions to have them evaluated. -Type :help for more information. - -scala> import scala.reflect.runtime.universe._ -import scala.reflect.runtime.universe._ - -scala> import scala.tools.reflect.ToolBox -import scala.tools.reflect.ToolBox - -scala> import scala.tools.reflect.Eval -import scala.tools.reflect.Eval - -scala> def foo[T]{ - val code = reify { - List[T]() - } - println(code.eval) -} -:13: free type: Ident(TypeName("T")) defined by foo in :12:16 - val code = reify { - ^ -foo: [T]=> Unit - -scala> :quit diff --git a/tests/pending/run/reify_newimpl_23.scala b/tests/pending/run/reify_newimpl_23.scala deleted file mode 100644 index d4c2a68ce..000000000 --- a/tests/pending/run/reify_newimpl_23.scala +++ /dev/null @@ -1,16 +0,0 @@ -import scala.tools.partest.ReplTest - -object Test extends ReplTest { - override def extraSettings = "-Xlog-free-types" - def code = """ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval -def foo[T]{ - val code = reify { - List[T]() - } - println(code.eval) -} - """ -} \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_27.check b/tests/pending/run/reify_newimpl_27.check deleted file mode 100644 index c23af69b0..000000000 --- a/tests/pending/run/reify_newimpl_27.check +++ /dev/null @@ -1 +0,0 @@ -List(2) diff --git a/tests/pending/run/reify_newimpl_27.scala b/tests/pending/run/reify_newimpl_27.scala deleted file mode 100644 index 332dbec91..000000000 --- a/tests/pending/run/reify_newimpl_27.scala +++ /dev/null @@ -1,15 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - object C { - type T = Int - val code = reify { - List[T](2) - } - println(code.eval) - } - - C -} diff --git a/tests/pending/run/reify_newimpl_29.check b/tests/pending/run/reify_newimpl_29.check deleted file mode 100644 index c23af69b0..000000000 --- a/tests/pending/run/reify_newimpl_29.check +++ /dev/null @@ -1 +0,0 @@ -List(2) diff --git a/tests/pending/run/reify_newimpl_29.scala b/tests/pending/run/reify_newimpl_29.scala deleted file mode 100644 index 1865075f4..000000000 --- a/tests/pending/run/reify_newimpl_29.scala +++ /dev/null @@ -1,15 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - class C { - type T = Int - val code = reify { - List[C#T](2) - } - println(code.eval) - } - - new C -} diff --git a/tests/pending/run/reify_newimpl_30.check b/tests/pending/run/reify_newimpl_30.check deleted file mode 100644 index 7557c750a..000000000 --- a/tests/pending/run/reify_newimpl_30.check +++ /dev/null @@ -1,4 +0,0 @@ -reflective toolbox failed due to unresolved free type variables: - C defined by in reify_newimpl_30.scala:7:11 -have you forgotten to use TypeTag annotations for type parameters external to a reifee? -if you have troubles tracking free type variables, consider using -Xlog-free-types diff --git a/tests/pending/run/reify_newimpl_30.scala b/tests/pending/run/reify_newimpl_30.scala deleted file mode 100644 index afc199d50..000000000 --- a/tests/pending/run/reify_newimpl_30.scala +++ /dev/null @@ -1,18 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.{ ToolBox, ToolBoxError } -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - { - class C { - type T = Int - val code = reify { - List[C#T](2) - } - try { println(code.eval) } - catch { case e: ToolBoxError => println(e.getMessage) } - } - - new C - } -} diff --git a/tests/pending/run/reify_newimpl_31.check b/tests/pending/run/reify_newimpl_31.check deleted file mode 100644 index c23af69b0..000000000 --- a/tests/pending/run/reify_newimpl_31.check +++ /dev/null @@ -1 +0,0 @@ -List(2) diff --git a/tests/pending/run/reify_newimpl_31.scala b/tests/pending/run/reify_newimpl_31.scala deleted file mode 100644 index 535c9b67b..000000000 --- a/tests/pending/run/reify_newimpl_31.scala +++ /dev/null @@ -1,15 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - object C { - type T = Int - val code = reify { - List[C.T](2) - } - println(code.eval) - } - - C -} diff --git a/tests/pending/run/reify_newimpl_33.check b/tests/pending/run/reify_newimpl_33.check deleted file mode 100644 index c23af69b0..000000000 --- a/tests/pending/run/reify_newimpl_33.check +++ /dev/null @@ -1 +0,0 @@ -List(2) diff --git a/tests/pending/run/reify_newimpl_33.scala b/tests/pending/run/reify_newimpl_33.scala deleted file mode 100644 index 55a808eda..000000000 --- a/tests/pending/run/reify_newimpl_33.scala +++ /dev/null @@ -1,16 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - object C { - type T = Int - val c = C - val code = reify { - List[c.T](2) - } - println(code.eval) - } - - C -} diff --git a/tests/pending/run/reify_newimpl_35.check b/tests/pending/run/reify_newimpl_35.check deleted file mode 100644 index bd9b3a2fb..000000000 --- a/tests/pending/run/reify_newimpl_35.check +++ /dev/null @@ -1,13 +0,0 @@ -Type in expressions to have them evaluated. -Type :help for more information. - -scala> import scala.reflect.runtime.universe._ -import scala.reflect.runtime.universe._ - -scala> def foo[T: TypeTag] = reify{List[T]()} -foo: [T](implicit evidence$1: reflect.runtime.universe.TypeTag[T])reflect.runtime.universe.Expr[List[T]] - -scala> println(foo) -Expr[List[Nothing]](Nil) - -scala> :quit diff --git a/tests/pending/run/reify_newimpl_35.scala b/tests/pending/run/reify_newimpl_35.scala deleted file mode 100644 index f2ebf5181..000000000 --- a/tests/pending/run/reify_newimpl_35.scala +++ /dev/null @@ -1,10 +0,0 @@ -import scala.tools.partest.ReplTest - -object Test extends ReplTest { - override def extraSettings = "-Xlog-free-types" - def code = """ -import scala.reflect.runtime.universe._ -def foo[T: TypeTag] = reify{List[T]()} -println(foo) - """ -} diff --git a/tests/pending/run/reify_newimpl_36.check b/tests/pending/run/reify_newimpl_36.check deleted file mode 100644 index d81cc0710..000000000 --- a/tests/pending/run/reify_newimpl_36.check +++ /dev/null @@ -1 +0,0 @@ -42 diff --git a/tests/pending/run/reify_newimpl_36.scala b/tests/pending/run/reify_newimpl_36.scala deleted file mode 100644 index 19f8617c6..000000000 --- a/tests/pending/run/reify_newimpl_36.scala +++ /dev/null @@ -1,15 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - { - val x = 42 - def foo() = reify(reify(x)); - { - val x = 2 - val code1 = foo() - val code2 = code1.eval - println(code2.eval) - } - } -} diff --git a/tests/pending/run/reify_newimpl_37.check b/tests/pending/run/reify_newimpl_37.check deleted file mode 100644 index d81cc0710..000000000 --- a/tests/pending/run/reify_newimpl_37.check +++ /dev/null @@ -1 +0,0 @@ -42 diff --git a/tests/pending/run/reify_newimpl_37.scala b/tests/pending/run/reify_newimpl_37.scala deleted file mode 100644 index 5eeda2125..000000000 --- a/tests/pending/run/reify_newimpl_37.scala +++ /dev/null @@ -1,16 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - { - val x = 42 - def foo() = reify(reify(reify(x))); - { - val x = 2 - val code1 = foo() - val code2 = code1.eval - val code3 = code2.eval - println(code3.eval) - } - } -} diff --git a/tests/pending/run/reify_newimpl_38.check b/tests/pending/run/reify_newimpl_38.check deleted file mode 100644 index d81cc0710..000000000 --- a/tests/pending/run/reify_newimpl_38.check +++ /dev/null @@ -1 +0,0 @@ -42 diff --git a/tests/pending/run/reify_newimpl_38.scala b/tests/pending/run/reify_newimpl_38.scala deleted file mode 100644 index a313b7d8d..000000000 --- a/tests/pending/run/reify_newimpl_38.scala +++ /dev/null @@ -1,15 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - { - val x = 42 - def foo() = reify{ val y = x; reify(y) }; - { - val x = 2 - val code1 = foo() - val code2 = code1.eval - println(code2.eval) - } - } -} diff --git a/tests/pending/run/reify_newimpl_39.check b/tests/pending/run/reify_newimpl_39.check deleted file mode 100644 index d81cc0710..000000000 --- a/tests/pending/run/reify_newimpl_39.check +++ /dev/null @@ -1 +0,0 @@ -42 diff --git a/tests/pending/run/reify_newimpl_39.scala b/tests/pending/run/reify_newimpl_39.scala deleted file mode 100644 index 4b779fc07..000000000 --- a/tests/pending/run/reify_newimpl_39.scala +++ /dev/null @@ -1,16 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - { - val x = 42 - def foo() = reify{ val y = x; reify{ val z = y; reify(z) } }; - { - val x = 2 - val code1 = foo() - val code2 = code1.eval - val code3 = code2.eval - println(code3.eval) - } - } -} diff --git a/tests/pending/run/reify_newimpl_40.check b/tests/pending/run/reify_newimpl_40.check deleted file mode 100644 index cc0001ab3..000000000 --- a/tests/pending/run/reify_newimpl_40.check +++ /dev/null @@ -1 +0,0 @@ -74088 diff --git a/tests/pending/run/reify_newimpl_40.scala b/tests/pending/run/reify_newimpl_40.scala deleted file mode 100644 index 1bc37973f..000000000 --- a/tests/pending/run/reify_newimpl_40.scala +++ /dev/null @@ -1,16 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - { - val x = 42 - def foo() = reify{ val y = x; reify{ val z = y * x; reify(z * x) } }; - { - val x = 2 - val code1 = foo() - val code2 = code1.eval - val code3 = code2.eval - println(code3.eval) - } - } -} diff --git a/tests/pending/run/reify_newimpl_41.check b/tests/pending/run/reify_newimpl_41.check deleted file mode 100644 index 0b427f2ee..000000000 --- a/tests/pending/run/reify_newimpl_41.check +++ /dev/null @@ -1,3 +0,0 @@ -42 -44 -43 \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_41.scala b/tests/pending/run/reify_newimpl_41.scala deleted file mode 100644 index 514e206a3..000000000 --- a/tests/pending/run/reify_newimpl_41.scala +++ /dev/null @@ -1,18 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - { - var _x = 42 - def x = { val x0 = _x; _x += 1; x0 } - var _y = 1 - def y = { val y0 = _y + _x; _y += y0; y0 } - val code = reify { - def foo = y // ensures that y is the first freevar we find - println(x) - println(y) - println(x) - } - code.eval - } -} diff --git a/tests/pending/run/reify_newimpl_42.check b/tests/pending/run/reify_newimpl_42.check deleted file mode 100644 index 0b427f2ee..000000000 --- a/tests/pending/run/reify_newimpl_42.check +++ /dev/null @@ -1,3 +0,0 @@ -42 -44 -43 \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_42.scala b/tests/pending/run/reify_newimpl_42.scala deleted file mode 100644 index 64c1cf345..000000000 --- a/tests/pending/run/reify_newimpl_42.scala +++ /dev/null @@ -1,17 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - { - var _x = 42 - def x = { val x0 = _x; _x += 1; x0 } - var _y = 1 - def y = { val y0 = _y + _x; _y += y0; y0 } - val code = reify { - println(x) - println(y) - println(x) - } - code.eval - } -} diff --git a/tests/pending/run/reify_newimpl_43.check b/tests/pending/run/reify_newimpl_43.check deleted file mode 100644 index 7a754f414..000000000 --- a/tests/pending/run/reify_newimpl_43.check +++ /dev/null @@ -1,2 +0,0 @@ -1 -2 \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_43.scala b/tests/pending/run/reify_newimpl_43.scala deleted file mode 100644 index 736536cb3..000000000 --- a/tests/pending/run/reify_newimpl_43.scala +++ /dev/null @@ -1,16 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - { - var counter = 0 - lazy val x = { counter += 1; counter } - lazy val y = { counter += 1; counter } - val code = reify { - def foo = y // ensures that y is the first freevar we find - println(x) - println(y) - } - code.eval - } -} diff --git a/tests/pending/run/reify_newimpl_44.check b/tests/pending/run/reify_newimpl_44.check deleted file mode 100644 index 7a754f414..000000000 --- a/tests/pending/run/reify_newimpl_44.check +++ /dev/null @@ -1,2 +0,0 @@ -1 -2 \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_44.scala b/tests/pending/run/reify_newimpl_44.scala deleted file mode 100644 index 736536cb3..000000000 --- a/tests/pending/run/reify_newimpl_44.scala +++ /dev/null @@ -1,16 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - { - var counter = 0 - lazy val x = { counter += 1; counter } - lazy val y = { counter += 1; counter } - val code = reify { - def foo = y // ensures that y is the first freevar we find - println(x) - println(y) - } - code.eval - } -} diff --git a/tests/pending/run/reify_newimpl_45.check b/tests/pending/run/reify_newimpl_45.check deleted file mode 100644 index 6e14f71e2..000000000 --- a/tests/pending/run/reify_newimpl_45.check +++ /dev/null @@ -1,2 +0,0 @@ -List(free type T) -ima worx: 2 \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_45.scala b/tests/pending/run/reify_newimpl_45.scala deleted file mode 100644 index cfda46a6a..000000000 --- a/tests/pending/run/reify_newimpl_45.scala +++ /dev/null @@ -1,16 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox -import internal._ - -object Test extends dotty.runtime.LegacyApp { - class C[T >: Null] { - val code = reify{val x: T = "2".asInstanceOf[T]; println("ima worx: %s".format(x)); x} - println(freeTypes(code.tree)) - val tree = substituteSymbols(code.tree, freeTypes(code.tree), List(definitions.StringClass)) - cm.mkToolBox().eval(tree) - } - - new C[String] -} diff --git a/tests/pending/run/reify_newimpl_47.check b/tests/pending/run/reify_newimpl_47.check deleted file mode 100644 index d8263ee98..000000000 --- a/tests/pending/run/reify_newimpl_47.check +++ /dev/null @@ -1 +0,0 @@ -2 \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_47.scala b/tests/pending/run/reify_newimpl_47.scala deleted file mode 100644 index c0ad6cbe5..000000000 --- a/tests/pending/run/reify_newimpl_47.scala +++ /dev/null @@ -1,17 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - val outer = { - val x = 2 - reify{x} - } - - val code = reify{ - val x = 42 - outer.splice - } - - println(code.eval) -} diff --git a/tests/pending/run/reify_newimpl_48.check b/tests/pending/run/reify_newimpl_48.check deleted file mode 100644 index f11c82a4c..000000000 --- a/tests/pending/run/reify_newimpl_48.check +++ /dev/null @@ -1 +0,0 @@ -9 \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_48.scala b/tests/pending/run/reify_newimpl_48.scala deleted file mode 100644 index 7d1c1d642..000000000 --- a/tests/pending/run/reify_newimpl_48.scala +++ /dev/null @@ -1,22 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - val outer1 = { - val x = 2 - reify{x} - } - - val outer2 = { - val x = 3 - reify{x} - } - - val code = reify{ - val x = 4 - x + outer1.splice + outer2.splice - } - - println(code.eval) -} diff --git a/tests/pending/run/reify_newimpl_49.check b/tests/pending/run/reify_newimpl_49.check deleted file mode 100644 index d8a621df0..000000000 --- a/tests/pending/run/reify_newimpl_49.check +++ /dev/null @@ -1,3 +0,0 @@ -3 -3 -5 \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_49.scala b/tests/pending/run/reify_newimpl_49.scala deleted file mode 100644 index 61ddfafa3..000000000 --- a/tests/pending/run/reify_newimpl_49.scala +++ /dev/null @@ -1,16 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - { - var y = 1 - def x = { y += 2; y } - val code = reify { - def foo = y // ensures that y is the first freevar we find - println(x) - println(y) - println(x) - } - code.eval - } -} diff --git a/tests/pending/run/reify_newimpl_50.check b/tests/pending/run/reify_newimpl_50.check deleted file mode 100644 index d8a621df0..000000000 --- a/tests/pending/run/reify_newimpl_50.check +++ /dev/null @@ -1,3 +0,0 @@ -3 -3 -5 \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_50.scala b/tests/pending/run/reify_newimpl_50.scala deleted file mode 100644 index 8ecdeb55c..000000000 --- a/tests/pending/run/reify_newimpl_50.scala +++ /dev/null @@ -1,15 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - { - var y = 1 - def x = { y += 2; y } - val code = reify { - println(x) - println(y) - println(x) - } - code.eval - } -} diff --git a/tests/pending/run/reify_newimpl_51.check b/tests/pending/run/reify_newimpl_51.check deleted file mode 100644 index 9a4ddeacd..000000000 --- a/tests/pending/run/reify_newimpl_51.check +++ /dev/null @@ -1,3 +0,0 @@ -2 -1 -2 \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_51.scala b/tests/pending/run/reify_newimpl_51.scala deleted file mode 100644 index 8a4a325f0..000000000 --- a/tests/pending/run/reify_newimpl_51.scala +++ /dev/null @@ -1,18 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - { - var counter = 0 - lazy val x = { counter += 1; counter } - lazy val y = { counter += 1; counter } - val code = reify { - def foo = y // ensures that y is the first freevar we find - val bar = reify { println(x * y) } - bar.eval - println(x) - println(y) - } - code.eval - } -} diff --git a/tests/pending/run/reify_newimpl_52.check b/tests/pending/run/reify_newimpl_52.check deleted file mode 100644 index 9359a2b21..000000000 --- a/tests/pending/run/reify_newimpl_52.check +++ /dev/null @@ -1,3 +0,0 @@ -2 -2 -1 \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_52.scala b/tests/pending/run/reify_newimpl_52.scala deleted file mode 100644 index 4dc82b145..000000000 --- a/tests/pending/run/reify_newimpl_52.scala +++ /dev/null @@ -1,18 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - { - var counter = 0 - lazy val x = { counter += 1; counter } - lazy val y = { counter += 1; counter } - val code = reify { - def foo = y // ensures that y is the first freevar we find - val bar = reify { println(y * x) } - bar.eval - println(x) - println(y) - } - code.eval - } -} diff --git a/tests/pending/run/reify_printf.check b/tests/pending/run/reify_printf.check deleted file mode 100644 index 3b18e512d..000000000 --- a/tests/pending/run/reify_printf.check +++ /dev/null @@ -1 +0,0 @@ -hello world diff --git a/tests/pending/run/reify_printf.scala b/tests/pending/run/reify_printf.scala deleted file mode 100644 index b957c41bb..000000000 --- a/tests/pending/run/reify_printf.scala +++ /dev/null @@ -1,71 +0,0 @@ -import java.io.{ ByteArrayOutputStream, PrintStream } -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox -import scala.reflect.api._ -import scala.reflect.api.Trees -import scala.reflect.internal.Types -import scala.util.matching.Regex - -object Test extends dotty.runtime.LegacyApp { - //val output = new ByteArrayOutputStream() - //Console.setOut(new PrintStream(output)) - val toolbox = cm.mkToolBox() - - val tree = tree_printf(reify("hello %s").tree, reify("world").tree) - val evaluated = toolbox.eval(tree) - //assert(output.toString() == "hello world", output.toString() +" == hello world") - - /* - // upd. Oh, good old times, our very-very first experiments with macros :) - macro def printf(format: String, params: Any*) : String = tree_printf(format: Tree, (params: Seq[Tree]): _*) - */ - - var i = 0 - def gensym(name: String) = { i += 1; TermName(name + i) } - - def createTempValDef( value : Tree, tpe : Type ) : (Option[Tree],Tree) = { - val local = gensym("temp") - ( - Some( - ValDef( - NoMods - , local - , TypeTree(tpe) - , value - ) - ) - , Ident(local) - ) - } - - def tree_printf(format: Tree, params: Tree*) = { - val Literal(Constant(s_format: String)) = format - val paramsStack = scala.collection.mutable.Stack(params: _*) - val parsed = s_format.split("(?<=%[\\w%])|(?=%[\\w%])") map { - case "%d" => createTempValDef( paramsStack.pop, typeOf[Int] ) - case "%s" => createTempValDef( paramsStack.pop, typeOf[String] ) - case "%%" => { - (None:Option[Tree], Literal(Constant("%"))) - } - case part => { - (None:Option[Tree], Literal(Constant(part))) - } - } - - val evals = for ((Some(eval), _) <- parsed if eval != None) yield (eval: Tree) - val prints = for ((_, ref) <- parsed) yield - Apply( - Select( - Select( - Ident( TermName("scala") ) - , TermName("Predef") - ) - , TermName("print") - ) - , List(ref) - ): Tree - Block((evals ++ prints).toList, Literal(Constant(()))) - } -} diff --git a/tests/pending/run/reify_properties.check b/tests/pending/run/reify_properties.check deleted file mode 100644 index d769bea4b..000000000 --- a/tests/pending/run/reify_properties.check +++ /dev/null @@ -1,2 +0,0 @@ -user1: MR. ROBERT -user2: MR. BOB KUZ diff --git a/tests/pending/run/reify_properties.scala b/tests/pending/run/reify_properties.scala deleted file mode 100644 index b6ce5f305..000000000 --- a/tests/pending/run/reify_properties.scala +++ /dev/null @@ -1,57 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - /** A mutable property whose getter and setter may be customized. */ - case class Property[T](init: T) { - private var value: T = init - - /** The getter function, defaults to identity. */ - private var setter: T => T = identity[T] - - /** The setter function, defaults to identity. */ - private var getter: T => T = identity[T] - - /** Retrive the value held in this property. */ - def apply(): T = getter(value) - - /** Update the value held in this property, through the setter. */ - def update(newValue: T) = value = setter(newValue) - - /** Change the getter. */ - def get(newGetter: T => T) = { getter = newGetter; this } - - /** Change the setter */ - def set(newSetter: T => T) = { setter = newSetter; this } - } - - class User { - // Create a property with custom getter and setter - val firstname = Property("") - .get { v => v.toUpperCase() } - .set { v => "Mr. " + v } - val lastname = Property("") - - /** Scala provides syntactic sugar for calling 'apply'. Simply - * adding a list of arguments between parenthesis (in this case, - * an empty list) is translated to a call to 'apply' with those - * arguments. - */ - override def toString() = firstname() + " " + lastname() - } - - val user1 = new User - - // Syntactic sugar for 'update': an assignment is translated to a - // call to method 'update' - user1.firstname() = "Robert" - - val user2 = new User - user2.firstname() = "bob" - user2.lastname() = "KUZ" - - println("user1: " + user1) - println("user2: " + user2) - }.eval -} diff --git a/tests/pending/run/reify_renamed_term_basic.check b/tests/pending/run/reify_renamed_term_basic.check deleted file mode 100644 index e78f94fff..000000000 --- a/tests/pending/run/reify_renamed_term_basic.check +++ /dev/null @@ -1 +0,0 @@ -((),(),()) diff --git a/tests/pending/run/reify_renamed_term_basic.scala b/tests/pending/run/reify_renamed_term_basic.scala deleted file mode 100644 index 7971d3d11..000000000 --- a/tests/pending/run/reify_renamed_term_basic.scala +++ /dev/null @@ -1,20 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object A { - object B { - val c = () - } -} - -object Test extends dotty.runtime.LegacyApp { - import A.{B => X} - import A.B.{c => y} - import X.{c => z} - - val expr = reify ( - X.c, y, z - ) - - println(expr.eval) -} diff --git a/tests/pending/run/reify_renamed_term_local_to_reifee.check b/tests/pending/run/reify_renamed_term_local_to_reifee.check deleted file mode 100644 index e78f94fff..000000000 --- a/tests/pending/run/reify_renamed_term_local_to_reifee.check +++ /dev/null @@ -1 +0,0 @@ -((),(),()) diff --git a/tests/pending/run/reify_renamed_term_local_to_reifee.scala b/tests/pending/run/reify_renamed_term_local_to_reifee.scala deleted file mode 100644 index b93279376..000000000 --- a/tests/pending/run/reify_renamed_term_local_to_reifee.scala +++ /dev/null @@ -1,20 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object A { - object B { - val c = () - } -} - -object Test extends dotty.runtime.LegacyApp { - val expr = reify { - import A.{B => X} - import A.B.{c => y} - import X.{c => z} - - (X.c, y, z) - } - - println(expr.eval) -} diff --git a/tests/pending/run/reify_renamed_term_overloaded_method.check b/tests/pending/run/reify_renamed_term_overloaded_method.check deleted file mode 100644 index 48082f72f..000000000 --- a/tests/pending/run/reify_renamed_term_overloaded_method.check +++ /dev/null @@ -1 +0,0 @@ -12 diff --git a/tests/pending/run/reify_renamed_term_overloaded_method.scala b/tests/pending/run/reify_renamed_term_overloaded_method.scala deleted file mode 100644 index 1f7897679..000000000 --- a/tests/pending/run/reify_renamed_term_overloaded_method.scala +++ /dev/null @@ -1,17 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object O { - def show(i: Int) = i.toString - def show(s: String) = s -} - -object Test extends dotty.runtime.LegacyApp { - import O.{show => s} - - val expr = reify { - s("1") + s(2) - } - - println(expr.eval) -} diff --git a/tests/pending/run/reify_renamed_term_t5841.check b/tests/pending/run/reify_renamed_term_t5841.check deleted file mode 100644 index 6031277b7..000000000 --- a/tests/pending/run/reify_renamed_term_t5841.check +++ /dev/null @@ -1 +0,0 @@ -class scala.reflect.runtime.JavaUniverse diff --git a/tests/pending/run/reify_renamed_term_t5841.scala b/tests/pending/run/reify_renamed_term_t5841.scala deleted file mode 100644 index d4c051c1b..000000000 --- a/tests/pending/run/reify_renamed_term_t5841.scala +++ /dev/null @@ -1,7 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - println(reify{ru}.eval.getClass) -} diff --git a/tests/pending/run/reify_renamed_type_basic.check b/tests/pending/run/reify_renamed_type_basic.check deleted file mode 100644 index 6a452c185..000000000 --- a/tests/pending/run/reify_renamed_type_basic.check +++ /dev/null @@ -1 +0,0 @@ -() diff --git a/tests/pending/run/reify_renamed_type_basic.scala b/tests/pending/run/reify_renamed_type_basic.scala deleted file mode 100644 index 50506e144..000000000 --- a/tests/pending/run/reify_renamed_type_basic.scala +++ /dev/null @@ -1,16 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object O { - type A = Unit -} - -object Test extends dotty.runtime.LegacyApp { - import O.{A => X} - - def expr = reify { - val a: X = () - } - - println(expr.eval) -} diff --git a/tests/pending/run/reify_renamed_type_local_to_reifee.check b/tests/pending/run/reify_renamed_type_local_to_reifee.check deleted file mode 100644 index 6a452c185..000000000 --- a/tests/pending/run/reify_renamed_type_local_to_reifee.check +++ /dev/null @@ -1 +0,0 @@ -() diff --git a/tests/pending/run/reify_renamed_type_local_to_reifee.scala b/tests/pending/run/reify_renamed_type_local_to_reifee.scala deleted file mode 100644 index 01280e993..000000000 --- a/tests/pending/run/reify_renamed_type_local_to_reifee.scala +++ /dev/null @@ -1,24 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object O { - type A = Unit -} - -object Test extends dotty.runtime.LegacyApp { - val expr = reify { - import O.{A => X} - - val a: X = () - - object P { - type B = Unit - } - - import P.{B => Y} - - val b: Y = () - } - - println(expr.eval) -} diff --git a/tests/pending/run/reify_renamed_type_spliceable.check b/tests/pending/run/reify_renamed_type_spliceable.check deleted file mode 100644 index 6a452c185..000000000 --- a/tests/pending/run/reify_renamed_type_spliceable.check +++ /dev/null @@ -1 +0,0 @@ -() diff --git a/tests/pending/run/reify_renamed_type_spliceable.scala b/tests/pending/run/reify_renamed_type_spliceable.scala deleted file mode 100644 index 6a34d1722..000000000 --- a/tests/pending/run/reify_renamed_type_spliceable.scala +++ /dev/null @@ -1,21 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -abstract class C { - type T >: Null -} - -object Test extends dotty.runtime.LegacyApp { - def foo(c: C) = { - import c.{T => U} - reify { - val x: U = null - } - } - - val expr = foo(new C { - type T = AnyRef - }) - - println(expr.eval) -} diff --git a/tests/pending/run/reify_sort.check b/tests/pending/run/reify_sort.check deleted file mode 100644 index 375536cc2..000000000 --- a/tests/pending/run/reify_sort.check +++ /dev/null @@ -1,2 +0,0 @@ -[6,2,8,5,1] -[1,2,5,6,8] diff --git a/tests/pending/run/reify_sort.scala b/tests/pending/run/reify_sort.scala deleted file mode 100644 index b484111ed..000000000 --- a/tests/pending/run/reify_sort.scala +++ /dev/null @@ -1,51 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - /** Nested methods can use and even update everything - * visible in their scope (including local variables or - * arguments of enclosing methods). - */ - def sort(a: Array[Int]): Unit = { - - def swap(i: Int, j: Int): Unit = { - val t = a(i); a(i) = a(j); a(j) = t - } - - def sort1(l: Int, r: Int): Unit = { - val pivot = a((l + r) / 2) - var i = l - var j = r - while (i <= j) { - while (a(i) < pivot) i += 1 - while (a(j) > pivot) j -= 1 - if (i <= j) { - swap(i, j) - i += 1 - j -= 1 - } - } - if (l < j) sort1(l, j) - if (j < r) sort1(i, r) - } - - if (a.length > 0) - sort1(0, a.length - 1) - } - - def println(ar: Array[Int]): Unit = { - def print1 = { - def iter(i: Int): String = - ar(i) + (if (i < ar.length-1) "," + iter(i+1) else "") - if (ar.length == 0) "" else iter(0) - } - Console.println("[" + print1 + "]") - } - - val ar = Array(6, 2, 8, 5, 1) - println(ar) - sort(ar) - println(ar) - }.eval -} diff --git a/tests/pending/run/reify_sort1.check b/tests/pending/run/reify_sort1.check deleted file mode 100644 index 0d3080514..000000000 --- a/tests/pending/run/reify_sort1.check +++ /dev/null @@ -1,2 +0,0 @@ -List(6, 2, 8, 5, 1) -List(1, 2, 5, 6, 8) diff --git a/tests/pending/run/reify_sort1.scala b/tests/pending/run/reify_sort1.scala deleted file mode 100644 index 24ca06283..000000000 --- a/tests/pending/run/reify_sort1.scala +++ /dev/null @@ -1,21 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - def sort(a: List[Int]): List[Int] = { - if (a.length < 2) - a - else { - val pivot = a(a.length / 2) - sort(a.filter(_ < pivot)) ::: - a.filter(_ == pivot) ::: - sort(a.filter(_ > pivot)) - } - } - - val xs = List(6, 2, 8, 5, 1) - println(xs) - println(sort(xs)) - }.eval -} diff --git a/tests/pending/run/reify_this.check b/tests/pending/run/reify_this.check deleted file mode 100644 index af3d0652a..000000000 --- a/tests/pending/run/reify_this.check +++ /dev/null @@ -1,5 +0,0 @@ -foo -false -2 -bar -2 \ No newline at end of file diff --git a/tests/pending/run/reify_this.scala b/tests/pending/run/reify_this.scala deleted file mode 100644 index 339fcca54..000000000 --- a/tests/pending/run/reify_this.scala +++ /dev/null @@ -1,20 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -trait Transvaal { - def eval(tree: Expr[_]) = tree.eval -} - -object Test extends dotty.runtime.LegacyApp with Transvaal { - // select a value from package - eval(reify{println("foo")}) - eval(reify{println((new Object).toString == (new Object).toString)}) - - // select a type from package - eval(reify{val x: Any = 2; println(x)}) - eval(reify{val x: Object = "bar"; println(x)}) - - // select a value from module - val x = 2 - eval(reify{println(x)}) -} diff --git a/tests/pending/run/reify_timeofday.check b/tests/pending/run/reify_timeofday.check deleted file mode 100644 index 3fd3b76a6..000000000 --- a/tests/pending/run/reify_timeofday.check +++ /dev/null @@ -1 +0,0 @@ -DateError diff --git a/tests/pending/run/reify_timeofday.scala b/tests/pending/run/reify_timeofday.scala deleted file mode 100644 index ff30a962b..000000000 --- a/tests/pending/run/reify_timeofday.scala +++ /dev/null @@ -1,42 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - class DateError extends Exception - - /** Simulating properties in Scala - * (example 4.2.1 in ScalaReference.pdf) - */ - class TimeOfDayVar { - private var h, m, s: Int = 0 - - def hours = h - - /** A method 'ident_=' is a setter for 'ident'. 'code.ident = ...' will - * be translated to a call to 'ident_=' - */ - def hours_= (h: Int) = - if (0 <= h && h < 24) this.h = h - else throw new DateError() - - def minutes = m - def minutes_= (m: Int) = - if (0 <= m && m < 60) this.m = m - else throw new DateError() - - def seconds = s - def seconds_= (s: Int) = - if (0 <= s && s < 60) this.s = s - else throw new DateError() - } - - val d = new TimeOfDayVar - d.hours = 8; d.minutes = 30; d.seconds = 0 - try { d.hours = 25 // throws a DateError exception - } catch { - case de: DateError => println("DateError") - case e: Exception => println("Exception") - } - }.eval -} diff --git a/tests/pending/run/reify_typerefs_1a.check b/tests/pending/run/reify_typerefs_1a.check deleted file mode 100644 index 919c298ba..000000000 --- a/tests/pending/run/reify_typerefs_1a.check +++ /dev/null @@ -1 +0,0 @@ -evaluated = List(Expression, Expression) \ No newline at end of file diff --git a/tests/pending/run/reify_typerefs_1a.scala b/tests/pending/run/reify_typerefs_1a.scala deleted file mode 100644 index b4f608a95..000000000 --- a/tests/pending/run/reify_typerefs_1a.scala +++ /dev/null @@ -1,18 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -class Expression { - override def toString = "Expression" -} - -object Test extends dotty.runtime.LegacyApp { - val code = reify { - List(new Expression, new Expression) - }; - - val toolbox = cm.mkToolBox() - val evaluated = toolbox.eval(code.tree) - println("evaluated = " + evaluated) -} diff --git a/tests/pending/run/reify_typerefs_1b.check b/tests/pending/run/reify_typerefs_1b.check deleted file mode 100644 index 919c298ba..000000000 --- a/tests/pending/run/reify_typerefs_1b.check +++ /dev/null @@ -1 +0,0 @@ -evaluated = List(Expression, Expression) \ No newline at end of file diff --git a/tests/pending/run/reify_typerefs_1b.scala b/tests/pending/run/reify_typerefs_1b.scala deleted file mode 100644 index 7c4d025f0..000000000 --- a/tests/pending/run/reify_typerefs_1b.scala +++ /dev/null @@ -1,18 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Expression { - override def toString = "Expression" -} - -object Test extends dotty.runtime.LegacyApp { - val code = reify { - List(Expression, Expression) - }; - - val toolbox = cm.mkToolBox() - val evaluated = toolbox.eval(code.tree) - println("evaluated = " + evaluated) -} diff --git a/tests/pending/run/reify_typerefs_2a.check b/tests/pending/run/reify_typerefs_2a.check deleted file mode 100644 index 919c298ba..000000000 --- a/tests/pending/run/reify_typerefs_2a.check +++ /dev/null @@ -1 +0,0 @@ -evaluated = List(Expression, Expression) \ No newline at end of file diff --git a/tests/pending/run/reify_typerefs_2a.scala b/tests/pending/run/reify_typerefs_2a.scala deleted file mode 100644 index a2d5676c0..000000000 --- a/tests/pending/run/reify_typerefs_2a.scala +++ /dev/null @@ -1,20 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -package foo { - class Expression { - override def toString = "Expression" - } -} - -object Test extends dotty.runtime.LegacyApp { - val code = reify { - List(new foo.Expression, new foo.Expression) - }; - - val toolbox = cm.mkToolBox() - val evaluated = toolbox.eval(code.tree) - println("evaluated = " + evaluated) -} diff --git a/tests/pending/run/reify_typerefs_2b.check b/tests/pending/run/reify_typerefs_2b.check deleted file mode 100644 index 919c298ba..000000000 --- a/tests/pending/run/reify_typerefs_2b.check +++ /dev/null @@ -1 +0,0 @@ -evaluated = List(Expression, Expression) \ No newline at end of file diff --git a/tests/pending/run/reify_typerefs_2b.scala b/tests/pending/run/reify_typerefs_2b.scala deleted file mode 100644 index f5543eaf6..000000000 --- a/tests/pending/run/reify_typerefs_2b.scala +++ /dev/null @@ -1,20 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -package foo { - object Expression { - override def toString = "Expression" - } -} - -object Test extends dotty.runtime.LegacyApp { - val code = reify { - List(foo.Expression, foo.Expression) - }; - - val toolbox = cm.mkToolBox() - val evaluated = toolbox.eval(code.tree) - println("evaluated = " + evaluated) -} diff --git a/tests/pending/run/reify_typerefs_3a.check b/tests/pending/run/reify_typerefs_3a.check deleted file mode 100644 index 919c298ba..000000000 --- a/tests/pending/run/reify_typerefs_3a.check +++ /dev/null @@ -1 +0,0 @@ -evaluated = List(Expression, Expression) \ No newline at end of file diff --git a/tests/pending/run/reify_typerefs_3a.scala b/tests/pending/run/reify_typerefs_3a.scala deleted file mode 100644 index 8d81721f1..000000000 --- a/tests/pending/run/reify_typerefs_3a.scala +++ /dev/null @@ -1,20 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object foo { - class Expression { - override def toString = "Expression" - } -} - -object Test extends dotty.runtime.LegacyApp { - val code = reify { - List(new foo.Expression, new foo.Expression) - }; - - val toolbox = cm.mkToolBox() - val evaluated = toolbox.eval(code.tree) - println("evaluated = " + evaluated) -} diff --git a/tests/pending/run/reify_typerefs_3b.check b/tests/pending/run/reify_typerefs_3b.check deleted file mode 100644 index 919c298ba..000000000 --- a/tests/pending/run/reify_typerefs_3b.check +++ /dev/null @@ -1 +0,0 @@ -evaluated = List(Expression, Expression) \ No newline at end of file diff --git a/tests/pending/run/reify_typerefs_3b.scala b/tests/pending/run/reify_typerefs_3b.scala deleted file mode 100644 index 212f40fc0..000000000 --- a/tests/pending/run/reify_typerefs_3b.scala +++ /dev/null @@ -1,20 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object foo { - object Expression { - override def toString = "Expression" - } -} - -object Test extends dotty.runtime.LegacyApp { - val code = reify { - List(foo.Expression, foo.Expression) - }; - - val toolbox = cm.mkToolBox() - val evaluated = toolbox.eval(code.tree) - println("evaluated = " + evaluated) -} diff --git a/tests/pending/run/reify_varargs.check b/tests/pending/run/reify_varargs.check deleted file mode 100644 index e300a570a..000000000 --- a/tests/pending/run/reify_varargs.check +++ /dev/null @@ -1 +0,0 @@ -Message=On the fifth of August there was a disturbance in the Force on planet Hoth. diff --git a/tests/pending/run/reify_varargs.scala b/tests/pending/run/reify_varargs.scala deleted file mode 100644 index 36777fe98..000000000 --- a/tests/pending/run/reify_varargs.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - val msg = java.text.MessageFormat.format( - "On {1} there was {2} on planet {0}.", - "Hoth", "the fifth of August", "a disturbance in the Force") - println("Message="+msg) - }.eval -} diff --git a/tests/pending/run/repl-term-macros.check b/tests/pending/run/repl-term-macros.check deleted file mode 100644 index 2cd0b93cd..000000000 --- a/tests/pending/run/repl-term-macros.check +++ /dev/null @@ -1,40 +0,0 @@ -Type in expressions to have them evaluated. -Type :help for more information. - -scala> import scala.reflect.macros.blackbox.Context -import scala.reflect.macros.blackbox.Context - -scala> import language.experimental.macros -import language.experimental.macros - -scala> - -scala> def impl1(c: Context) = { import c.universe._; c.Expr[Unit](q"()") } -impl1: (c: scala.reflect.macros.blackbox.Context)c.Expr[Unit] - -scala> def foo1: Unit = macro impl1 -defined term macro foo1: Unit - -scala> foo1 - -scala> - -scala> def impl2(c: Context)() = { import c.universe._; c.Expr[Unit](q"()") } -impl2: (c: scala.reflect.macros.blackbox.Context)()c.Expr[Unit] - -scala> def foo2(): Unit = macro impl2 -defined term macro foo2: ()Unit - -scala> foo2() - -scala> - -scala> def impl3(c: Context)(x: c.Expr[Int])(y: c.Expr[Int]) = { import c.universe._; c.Expr[Unit](q"()") } -impl3: (c: scala.reflect.macros.blackbox.Context)(x: c.Expr[Int])(y: c.Expr[Int])c.Expr[Unit] - -scala> def foo3(x: Int)(y: Int): Unit = macro impl3 -defined term macro foo3: (x: Int)(y: Int)Unit - -scala> foo3(2)(3) - -scala> :quit diff --git a/tests/pending/run/repl-term-macros.scala b/tests/pending/run/repl-term-macros.scala deleted file mode 100644 index 32892b731..000000000 --- a/tests/pending/run/repl-term-macros.scala +++ /dev/null @@ -1,20 +0,0 @@ -import scala.tools.partest.ReplTest - -object Test extends ReplTest { - def code = """ - import scala.reflect.macros.blackbox.Context -import language.experimental.macros - -def impl1(c: Context) = { import c.universe._; c.Expr[Unit](q"()") } -def foo1: Unit = macro impl1 -foo1 - -def impl2(c: Context)() = { import c.universe._; c.Expr[Unit](q"()") } -def foo2(): Unit = macro impl2 -foo2() - -def impl3(c: Context)(x: c.Expr[Int])(y: c.Expr[Int]) = { import c.universe._; c.Expr[Unit](q"()") } -def foo3(x: Int)(y: Int): Unit = macro impl3 -foo3(2)(3) - """ -} \ No newline at end of file diff --git a/tests/pending/run/runtimeEval1.check b/tests/pending/run/runtimeEval1.check deleted file mode 100644 index d8263ee98..000000000 --- a/tests/pending/run/runtimeEval1.check +++ /dev/null @@ -1 +0,0 @@ -2 \ No newline at end of file diff --git a/tests/pending/run/runtimeEval1.scala b/tests/pending/run/runtimeEval1.scala deleted file mode 100644 index 0202dfd06..000000000 --- a/tests/pending/run/runtimeEval1.scala +++ /dev/null @@ -1,9 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - val x = 2 - println(x) - }.eval -} diff --git a/tests/pending/run/runtimeEval2.check b/tests/pending/run/runtimeEval2.check deleted file mode 100644 index 0cfbf0888..000000000 --- a/tests/pending/run/runtimeEval2.check +++ /dev/null @@ -1 +0,0 @@ -2 diff --git a/tests/pending/run/runtimeEval2.scala b/tests/pending/run/runtimeEval2.scala deleted file mode 100644 index 2708f9dbc..000000000 --- a/tests/pending/run/runtimeEval2.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - val x = 2 - val outer = reify{reify{x}} - println(outer.eval.eval) -} diff --git a/tests/pending/run/showdecl.check b/tests/pending/run/showdecl.check deleted file mode 100644 index b8d7f94c5..000000000 --- a/tests/pending/run/showdecl.check +++ /dev/null @@ -1,34 +0,0 @@ -compile-time -uninitialized D: class D extends -initialized D: class D extends C -uninitialized x: val x: -initialized x: val x: Int -uninitialized y: lazy val y: -initialized y: lazy val y: Int -uninitialized z: def z: -initialized z: def z: Int -uninitialized t: def t: -initialized t: def t[T <: Int](x: D)(y: x.W): Int -uninitialized W: type W = String -initialized W: type W = String -uninitialized C: class C extends -initialized C: class C extends D -uninitialized O: object O -initialized O: object O -runtime -autoinitialized D: class D extends C -autoinitialized D: class D extends C -autoinitialized x: val x: Int -autoinitialized x: val x: Int -autoinitialized y: lazy val y: Int -autoinitialized y: lazy val y: Int -autoinitialized z: def z: Int -autoinitialized z: def z: Int -autoinitialized t: def t[T <: Int](x: D)(y: x.W): Int -autoinitialized t: def t[T <: Int](x: D)(y: x.W): Int -autoinitialized W: type W = String -autoinitialized W: type W = String -autoinitialized C: class C extends D -autoinitialized C: class C extends D -autoinitialized O: object O -autoinitialized O: object O diff --git a/tests/pending/run/showdecl/Macros_1.scala b/tests/pending/run/showdecl/Macros_1.scala deleted file mode 100644 index c68dd275d..000000000 --- a/tests/pending/run/showdecl/Macros_1.scala +++ /dev/null @@ -1,30 +0,0 @@ -import scala.reflect.macros.whitebox._ -import scala.language.experimental.macros - -object Macros { - def impl(c: Context) = { - var messages = List[String]() - def println(msg: String) = messages :+= msg - - import c.universe._ - def test(sym: Symbol): Unit = { - println(s"uninitialized ${sym.name}: ${showDecl(sym)}") - sym.info - println(s"initialized ${sym.name}: ${showDecl(sym)}") - } - - println("compile-time") - test(c.mirror.staticClass("D")) - test(c.mirror.staticClass("D").info.member(TermName("x"))) - test(c.mirror.staticClass("D").info.member(TermName("y"))) - test(c.mirror.staticClass("D").info.member(TermName("z"))) - test(c.mirror.staticClass("D").info.member(TermName("t"))) - test(c.mirror.staticClass("D").info.member(TypeName("W"))) - test(c.mirror.staticClass("D").info.member(TypeName("C"))) - test(c.mirror.staticClass("D").info.member(TermName("O"))) - - q"..${messages.map(msg => q"println($msg)")}" - } - - def foo: Any = macro impl -} \ No newline at end of file diff --git a/tests/pending/run/showdecl/Test_2.scala b/tests/pending/run/showdecl/Test_2.scala deleted file mode 100644 index fc212ab05..000000000 --- a/tests/pending/run/showdecl/Test_2.scala +++ /dev/null @@ -1,32 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{currentMirror => cm} - -object Test extends dotty.runtime.LegacyApp { - def test(sym: Symbol): Unit = { - println(s"autoinitialized ${sym.name}: ${showDecl(sym)}") - sym.info - println(s"autoinitialized ${sym.name}: ${showDecl(sym)}") - } - - Macros.foo - println("runtime") - test(symbolOf[D]) - test(typeOf[D].member(TermName("x"))) - test(typeOf[D].member(TermName("y"))) - test(typeOf[D].member(TermName("z"))) - test(typeOf[D].member(TermName("t"))) - test(typeOf[D].member(TypeName("W"))) - test(typeOf[D].member(TypeName("C"))) - test(typeOf[D].member(TermName("O"))) -} - -class C -class D extends C { - val x = 2 - lazy val y = 3 - var z = 4 - def t[T <: Int](x: D)(y: x.W) = 5 - type W = String - class C extends D - object O extends C -} diff --git a/tests/pending/run/showraw_mods.check b/tests/pending/run/showraw_mods.check deleted file mode 100644 index 4d3416042..000000000 --- a/tests/pending/run/showraw_mods.check +++ /dev/null @@ -1 +0,0 @@ -Block(List(ClassDef(Modifiers(ABSTRACT | DEFAULTPARAM/TRAIT), TypeName("C"), List(), Template(List(Ident(TypeName("AnyRef"))), noSelfType, List(DefDef(Modifiers(), TermName("$init$"), List(), List(List()), TypeTree(), Block(List(), Literal(Constant(())))), ValDef(Modifiers(PRIVATE | LOCAL), TermName("x"), TypeTree(), Literal(Constant(2))), ValDef(Modifiers(MUTABLE), TermName("y"), TypeTree(), Select(This(TypeName("C")), TermName("x"))), ValDef(Modifiers(LAZY), TermName("z"), TypeTree(), Select(This(TypeName("C")), TermName("y"))))))), Literal(Constant(()))) diff --git a/tests/pending/run/showraw_mods.scala b/tests/pending/run/showraw_mods.scala deleted file mode 100644 index 872685c37..000000000 --- a/tests/pending/run/showraw_mods.scala +++ /dev/null @@ -1,6 +0,0 @@ -import scala.reflect.runtime.universe._ - -object Test extends dotty.runtime.LegacyApp { - val tree = reify{trait C { private[this] val x = 2; var y = x; lazy val z = y }} - println(showRaw(tree.tree)) -} diff --git a/tests/pending/run/showraw_tree.check b/tests/pending/run/showraw_tree.check deleted file mode 100644 index d8cb1fde0..000000000 --- a/tests/pending/run/showraw_tree.check +++ /dev/null @@ -1,2 +0,0 @@ -Apply(Select(New(AppliedTypeTree(Ident(scala.collection.immutable.HashMap), List(Select(Ident(scala.Predef), TypeName("String")), Select(Ident(scala.Predef), TypeName("String"))))), termNames.CONSTRUCTOR), List()) -Apply(Select(New(AppliedTypeTree(Ident(scala.collection.mutable.HashMap), List(Select(Ident(scala.Predef), TypeName("String")), Select(Ident(scala.Predef), TypeName("String"))))), termNames.CONSTRUCTOR), List()) diff --git a/tests/pending/run/showraw_tree.scala b/tests/pending/run/showraw_tree.scala deleted file mode 100644 index fbd4c1dfa..000000000 --- a/tests/pending/run/showraw_tree.scala +++ /dev/null @@ -1,8 +0,0 @@ -import scala.reflect.runtime.universe._ - -object Test extends dotty.runtime.LegacyApp { - val tree1 = reify(new collection.immutable.HashMap[String, String]) - val tree2 = reify(new collection.mutable.HashMap[String, String]) - println(showRaw(tree1.tree)) - println(showRaw(tree2.tree)) -} diff --git a/tests/pending/run/showraw_tree_ids.check b/tests/pending/run/showraw_tree_ids.check deleted file mode 100644 index d7a7aa595..000000000 --- a/tests/pending/run/showraw_tree_ids.check +++ /dev/null @@ -1,2 +0,0 @@ -Apply(Select(New(AppliedTypeTree(Ident(scala.collection.immutable.HashMap#), List(Select(Ident(scala.Predef#), TypeName("String")), Select(Ident(scala.Predef#), TypeName("String"))))), termNames.CONSTRUCTOR), List()) -Apply(Select(New(AppliedTypeTree(Ident(scala.collection.mutable.HashMap#), List(Select(Ident(scala.Predef#), TypeName("String")), Select(Ident(scala.Predef#), TypeName("String"))))), termNames.CONSTRUCTOR), List()) diff --git a/tests/pending/run/showraw_tree_ids.scala b/tests/pending/run/showraw_tree_ids.scala deleted file mode 100644 index 739ea55b5..000000000 --- a/tests/pending/run/showraw_tree_ids.scala +++ /dev/null @@ -1,9 +0,0 @@ -import scala.reflect.runtime.universe._ - -object Test extends dotty.runtime.LegacyApp { - val tree1 = reify(new collection.immutable.HashMap[String, String]) - val tree2 = reify(new collection.mutable.HashMap[String, String]) - def stabilize(s: String) = """#\d+""".r.replaceAllIn(s, "#") - println(stabilize(showRaw(tree1.tree, printIds = true))) - println(stabilize(showRaw(tree2.tree, printIds = true))) -} diff --git a/tests/pending/run/showraw_tree_kinds.check b/tests/pending/run/showraw_tree_kinds.check deleted file mode 100644 index 85939b02f..000000000 --- a/tests/pending/run/showraw_tree_kinds.check +++ /dev/null @@ -1,2 +0,0 @@ -Apply(Select(New(AppliedTypeTree(Ident(scala.collection.immutable.HashMap#CLS), List(Select(Ident(scala.Predef#MOD), TypeName("String")), Select(Ident(scala.Predef#MOD), TypeName("String"))))), termNames.CONSTRUCTOR), List()) -Apply(Select(New(AppliedTypeTree(Ident(scala.collection.mutable.HashMap#CLS), List(Select(Ident(scala.Predef#MOD), TypeName("String")), Select(Ident(scala.Predef#MOD), TypeName("String"))))), termNames.CONSTRUCTOR), List()) diff --git a/tests/pending/run/showraw_tree_kinds.scala b/tests/pending/run/showraw_tree_kinds.scala deleted file mode 100644 index 0891015ac..000000000 --- a/tests/pending/run/showraw_tree_kinds.scala +++ /dev/null @@ -1,8 +0,0 @@ -import scala.reflect.runtime.universe._ - -object Test extends dotty.runtime.LegacyApp { - val tree1 = reify(new collection.immutable.HashMap[String, String]) - val tree2 = reify(new collection.mutable.HashMap[String, String]) - println(showRaw(tree1.tree, printKinds = true)) - println(showRaw(tree2.tree, printKinds = true)) -} diff --git a/tests/pending/run/showraw_tree_types_ids.check b/tests/pending/run/showraw_tree_types_ids.check deleted file mode 100644 index 75347463c..000000000 --- a/tests/pending/run/showraw_tree_types_ids.check +++ /dev/null @@ -1,12 +0,0 @@ -Apply[1](Select[2](New[1](TypeTree[1]().setOriginal(AppliedTypeTree(Ident[3](scala.collection.immutable.HashMap#), List(TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef#), TypeName("String")#)), TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef#), TypeName("String")#)))))), termNames.CONSTRUCTOR#), List()) -[1] TypeRef(ThisType(scala.collection.immutable#), scala.collection.immutable.HashMap#, List(TypeRef(SingleType(ThisType(scala#), scala.Predef#), TypeName("String")#, List()), TypeRef(SingleType(ThisType(scala#), scala.Predef#), TypeName("String")#, List()))) -[2] MethodType(List(), TypeRef(ThisType(scala.collection.immutable#), scala.collection.immutable.HashMap#, List(TypeRef(SingleType(ThisType(scala#), scala.Predef#), TypeName("String")#, List()), TypeRef(SingleType(ThisType(scala#), scala.Predef#), TypeName("String")#, List())))) -[3] TypeRef(ThisType(scala.collection.immutable#), scala.collection.immutable.HashMap#, List()) -[4] TypeRef(SingleType(ThisType(scala#), scala.Predef#), TypeName("String")#, List()) -[5] SingleType(ThisType(scala#), scala.Predef#) -Apply[6](Select[7](New[6](TypeTree[6]().setOriginal(AppliedTypeTree(Ident[8](scala.collection.mutable.HashMap#), List(TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef#), TypeName("String")#)), TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef#), TypeName("String")#)))))), termNames.CONSTRUCTOR#), List()) -[4] TypeRef(SingleType(ThisType(scala#), scala.Predef#), TypeName("String")#, List()) -[5] SingleType(ThisType(scala#), scala.Predef#) -[6] TypeRef(ThisType(scala.collection.mutable#), scala.collection.mutable.HashMap#, List(TypeRef(SingleType(ThisType(scala#), scala.Predef#), TypeName("String")#, List()), TypeRef(SingleType(ThisType(scala#), scala.Predef#), TypeName("String")#, List()))) -[7] MethodType(List(), TypeRef(ThisType(scala.collection.mutable#), scala.collection.mutable.HashMap#, List(TypeRef(SingleType(ThisType(scala#), scala.Predef#), TypeName("String")#, List()), TypeRef(SingleType(ThisType(scala#), scala.Predef#), TypeName("String")#, List())))) -[8] TypeRef(ThisType(scala.collection.mutable#), scala.collection.mutable.HashMap#, List()) diff --git a/tests/pending/run/showraw_tree_types_ids.scala b/tests/pending/run/showraw_tree_types_ids.scala deleted file mode 100644 index 30f51c549..000000000 --- a/tests/pending/run/showraw_tree_types_ids.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox - -object Test extends dotty.runtime.LegacyApp { - val tb = runtimeMirror(getClass.getClassLoader).mkToolBox() - val tree1 = reify(new collection.immutable.HashMap[String, String]) - val tree2 = reify(new collection.mutable.HashMap[String, String]) - def stabilize(s: String) = """#\d+""".r.replaceAllIn(s, "#") - println(stabilize(showRaw(tb.typecheck(tree1.tree), printIds = true, printTypes = true))) - println(stabilize(showRaw(tb.typecheck(tree2.tree), printIds = true, printTypes = true))) -} diff --git a/tests/pending/run/showraw_tree_types_typed.check b/tests/pending/run/showraw_tree_types_typed.check deleted file mode 100644 index de691e369..000000000 --- a/tests/pending/run/showraw_tree_types_typed.check +++ /dev/null @@ -1,12 +0,0 @@ -Apply[1](Select[2](New[1](TypeTree[1]().setOriginal(AppliedTypeTree(Ident[3](scala.collection.immutable.HashMap), List(TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef), TypeName("String"))), TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef), TypeName("String"))))))), termNames.CONSTRUCTOR), List()) -[1] TypeRef(ThisType(scala.collection.immutable), scala.collection.immutable.HashMap, List(TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List()), TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List()))) -[2] MethodType(List(), TypeRef(ThisType(scala.collection.immutable), scala.collection.immutable.HashMap, List(TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List()), TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List())))) -[3] TypeRef(ThisType(scala.collection.immutable), scala.collection.immutable.HashMap, List()) -[4] TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List()) -[5] SingleType(ThisType(scala), scala.Predef) -Apply[6](Select[7](New[6](TypeTree[6]().setOriginal(AppliedTypeTree(Ident[8](scala.collection.mutable.HashMap), List(TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef), TypeName("String"))), TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef), TypeName("String"))))))), termNames.CONSTRUCTOR), List()) -[4] TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List()) -[5] SingleType(ThisType(scala), scala.Predef) -[6] TypeRef(ThisType(scala.collection.mutable), scala.collection.mutable.HashMap, List(TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List()), TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List()))) -[7] MethodType(List(), TypeRef(ThisType(scala.collection.mutable), scala.collection.mutable.HashMap, List(TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List()), TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List())))) -[8] TypeRef(ThisType(scala.collection.mutable), scala.collection.mutable.HashMap, List()) diff --git a/tests/pending/run/showraw_tree_types_typed.scala b/tests/pending/run/showraw_tree_types_typed.scala deleted file mode 100644 index e24eac9f8..000000000 --- a/tests/pending/run/showraw_tree_types_typed.scala +++ /dev/null @@ -1,10 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox - -object Test extends dotty.runtime.LegacyApp { - val tb = runtimeMirror(getClass.getClassLoader).mkToolBox() - val tree1 = reify(new collection.immutable.HashMap[String, String]) - val tree2 = reify(new collection.mutable.HashMap[String, String]) - println(showRaw(tb.typecheck(tree1.tree), printTypes = true)) - println(showRaw(tb.typecheck(tree2.tree), printTypes = true)) -} diff --git a/tests/pending/run/showraw_tree_types_untyped.check b/tests/pending/run/showraw_tree_types_untyped.check deleted file mode 100644 index d8cb1fde0..000000000 --- a/tests/pending/run/showraw_tree_types_untyped.check +++ /dev/null @@ -1,2 +0,0 @@ -Apply(Select(New(AppliedTypeTree(Ident(scala.collection.immutable.HashMap), List(Select(Ident(scala.Predef), TypeName("String")), Select(Ident(scala.Predef), TypeName("String"))))), termNames.CONSTRUCTOR), List()) -Apply(Select(New(AppliedTypeTree(Ident(scala.collection.mutable.HashMap), List(Select(Ident(scala.Predef), TypeName("String")), Select(Ident(scala.Predef), TypeName("String"))))), termNames.CONSTRUCTOR), List()) diff --git a/tests/pending/run/showraw_tree_types_untyped.scala b/tests/pending/run/showraw_tree_types_untyped.scala deleted file mode 100644 index 87dfd7242..000000000 --- a/tests/pending/run/showraw_tree_types_untyped.scala +++ /dev/null @@ -1,8 +0,0 @@ -import scala.reflect.runtime.universe._ - -object Test extends dotty.runtime.LegacyApp { - val tree1 = reify(new collection.immutable.HashMap[String, String]) - val tree2 = reify(new collection.mutable.HashMap[String, String]) - println(showRaw(tree1.tree, printTypes = true)) - println(showRaw(tree2.tree, printTypes = true)) -} diff --git a/tests/pending/run/showraw_tree_ultimate.check b/tests/pending/run/showraw_tree_ultimate.check deleted file mode 100644 index 81efcc05a..000000000 --- a/tests/pending/run/showraw_tree_ultimate.check +++ /dev/null @@ -1,12 +0,0 @@ -Apply[1](Select[2](New[1](TypeTree[1]().setOriginal(AppliedTypeTree(Ident[3](scala.collection.immutable.HashMap##CLS), List(TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef##MOD), TypeName("String")##TPE)), TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef##MOD), TypeName("String")##TPE)))))), termNames.CONSTRUCTOR##PCTOR), List()) -[1] TypeRef(ThisType(scala.collection.immutable##PKC), scala.collection.immutable.HashMap##CLS, List(TypeRef(SingleType(ThisType(scala##PKC), scala.Predef##MOD), TypeName("String")##TPE, List()), TypeRef(SingleType(ThisType(scala##PKC), scala.Predef##MOD), TypeName("String")##TPE, List()))) -[2] MethodType(List(), TypeRef(ThisType(scala.collection.immutable##PKC), scala.collection.immutable.HashMap##CLS, List(TypeRef(SingleType(ThisType(scala##PKC), scala.Predef##MOD), TypeName("String")##TPE, List()), TypeRef(SingleType(ThisType(scala##PKC), scala.Predef##MOD), TypeName("String")##TPE, List())))) -[3] TypeRef(ThisType(scala.collection.immutable##PKC), scala.collection.immutable.HashMap##CLS, List()) -[4] TypeRef(SingleType(ThisType(scala##PKC), scala.Predef##MOD), TypeName("String")##TPE, List()) -[5] SingleType(ThisType(scala##PKC), scala.Predef##MOD) -Apply[6](Select[7](New[6](TypeTree[6]().setOriginal(AppliedTypeTree(Ident[8](scala.collection.mutable.HashMap##CLS), List(TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef##MOD), TypeName("String")##TPE)), TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef##MOD), TypeName("String")##TPE)))))), termNames.CONSTRUCTOR##CTOR), List()) -[4] TypeRef(SingleType(ThisType(scala##PKC), scala.Predef##MOD), TypeName("String")##TPE, List()) -[5] SingleType(ThisType(scala##PKC), scala.Predef##MOD) -[6] TypeRef(ThisType(scala.collection.mutable##PKC), scala.collection.mutable.HashMap##CLS, List(TypeRef(SingleType(ThisType(scala##PKC), scala.Predef##MOD), TypeName("String")##TPE, List()), TypeRef(SingleType(ThisType(scala##PKC), scala.Predef##MOD), TypeName("String")##TPE, List()))) -[7] MethodType(List(), TypeRef(ThisType(scala.collection.mutable##PKC), scala.collection.mutable.HashMap##CLS, List(TypeRef(SingleType(ThisType(scala##PKC), scala.Predef##MOD), TypeName("String")##TPE, List()), TypeRef(SingleType(ThisType(scala##PKC), scala.Predef##MOD), TypeName("String")##TPE, List())))) -[8] TypeRef(ThisType(scala.collection.mutable##PKC), scala.collection.mutable.HashMap##CLS, List()) diff --git a/tests/pending/run/showraw_tree_ultimate.scala b/tests/pending/run/showraw_tree_ultimate.scala deleted file mode 100644 index 0a97622ad..000000000 --- a/tests/pending/run/showraw_tree_ultimate.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox - -object Test extends dotty.runtime.LegacyApp { - val tb = runtimeMirror(getClass.getClassLoader).mkToolBox() - val tree1 = reify(new collection.immutable.HashMap[String, String]) - val tree2 = reify(new collection.mutable.HashMap[String, String]) - def stabilize(s: String) = """#\d+""".r.replaceAllIn(s, "#") - println(stabilize(showRaw(tb.typecheck(tree1.tree), printIds = true, printKinds = true, printTypes = true))) - println(stabilize(showRaw(tb.typecheck(tree2.tree), printIds = true, printKinds = true, printTypes = true))) -} diff --git a/tests/pending/run/t2886.check b/tests/pending/run/t2886.check deleted file mode 100644 index 61e36948b..000000000 --- a/tests/pending/run/t2886.check +++ /dev/null @@ -1,5 +0,0 @@ -((x: Predef.String) => { - val x$1 = x; - val x$2 = x; - Test.this.test(x$2, x$1) -}) diff --git a/tests/pending/run/t2886.scala b/tests/pending/run/t2886.scala deleted file mode 100644 index 44783a5d8..000000000 --- a/tests/pending/run/t2886.scala +++ /dev/null @@ -1,9 +0,0 @@ -import scala.reflect.runtime.universe._ - -object Test { - def test(name: String, address: String) = null - def main(args: Array[String]) = { - val tree = reify((x:String) => test(address=x,name=x)).tree - println(tree) - } -} diff --git a/tests/pending/run/t5224.check b/tests/pending/run/t5224.check deleted file mode 100644 index b11480acd..000000000 --- a/tests/pending/run/t5224.check +++ /dev/null @@ -1,14 +0,0 @@ -t5224.scala:3: warning: Implementation restriction: subclassing Classfile does not -make your annotation visible at runtime. If that is what -you want, you must write the annotation class in Java. -class Foo(bar: String) extends annotation.ClassfileAnnotation - ^ -{ - @new Foo(bar = "qwe") class C extends AnyRef { - def () = { - super.(); - () - } - }; - () -} diff --git a/tests/pending/run/t5224.scala b/tests/pending/run/t5224.scala deleted file mode 100644 index d0cd9a455..000000000 --- a/tests/pending/run/t5224.scala +++ /dev/null @@ -1,8 +0,0 @@ -import scala.reflect.runtime.universe._ - -class Foo(bar: String) extends annotation.ClassfileAnnotation - -object Test extends dotty.runtime.LegacyApp { - val tree = reify{@Foo(bar = "qwe") class C}.tree - println(tree.toString) -} diff --git a/tests/pending/run/t5225_1.check b/tests/pending/run/t5225_1.check deleted file mode 100644 index 1a47aacfd..000000000 --- a/tests/pending/run/t5225_1.check +++ /dev/null @@ -1,4 +0,0 @@ -{ - @new transient() @new volatile() var x = 2; - () -} diff --git a/tests/pending/run/t5225_1.scala b/tests/pending/run/t5225_1.scala deleted file mode 100644 index a553e83ce..000000000 --- a/tests/pending/run/t5225_1.scala +++ /dev/null @@ -1,6 +0,0 @@ -import scala.reflect.runtime.universe._ - -object Test extends dotty.runtime.LegacyApp { - val tree = reify{@transient @volatile var x = 2}.tree - println(tree.toString) -} diff --git a/tests/pending/run/t5225_2.check b/tests/pending/run/t5225_2.check deleted file mode 100644 index 477ea4eb6..000000000 --- a/tests/pending/run/t5225_2.check +++ /dev/null @@ -1,4 +0,0 @@ -{ - def foo(@new elidable(0) x: Int) = ""; - () -} diff --git a/tests/pending/run/t5225_2.scala b/tests/pending/run/t5225_2.scala deleted file mode 100644 index 54e7fec1f..000000000 --- a/tests/pending/run/t5225_2.scala +++ /dev/null @@ -1,6 +0,0 @@ -import scala.reflect.runtime.universe._ - -object Test extends dotty.runtime.LegacyApp { - val tree = reify{def foo(@annotation.elidable(0) x: Int) = ""}.tree - println(tree.toString) -} diff --git a/tests/pending/run/t5229_1.scala b/tests/pending/run/t5229_1.scala deleted file mode 100644 index 62341fdbb..000000000 --- a/tests/pending/run/t5229_1.scala +++ /dev/null @@ -1,8 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - object C - }.eval -} diff --git a/tests/pending/run/t5229_2.check b/tests/pending/run/t5229_2.check deleted file mode 100644 index 43c25b96a..000000000 --- a/tests/pending/run/t5229_2.check +++ /dev/null @@ -1,2 +0,0 @@ -2 -evaluated = () diff --git a/tests/pending/run/t5229_2.scala b/tests/pending/run/t5229_2.scala deleted file mode 100644 index a9cd08947..000000000 --- a/tests/pending/run/t5229_2.scala +++ /dev/null @@ -1,18 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Test extends dotty.runtime.LegacyApp { - val code = reify { - object C { - val x = 2 - } - - println(C.x) - }; - - val toolbox = cm.mkToolBox() - val evaluated = toolbox.eval(code.tree) - println("evaluated = " + evaluated) -} diff --git a/tests/pending/run/t5230.check b/tests/pending/run/t5230.check deleted file mode 100644 index 43c25b96a..000000000 --- a/tests/pending/run/t5230.check +++ /dev/null @@ -1,2 +0,0 @@ -2 -evaluated = () diff --git a/tests/pending/run/t5230.scala b/tests/pending/run/t5230.scala deleted file mode 100644 index 5c934c345..000000000 --- a/tests/pending/run/t5230.scala +++ /dev/null @@ -1,18 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Test extends dotty.runtime.LegacyApp { - val code = reify { - class C { - val x = 2 - } - - println(new C().x) - }; - - val toolbox = cm.mkToolBox() - val evaluated = toolbox.eval(code.tree) - println("evaluated = " + evaluated) -} diff --git a/tests/pending/run/t5258a.check b/tests/pending/run/t5258a.check deleted file mode 100644 index 4e0b2da04..000000000 --- a/tests/pending/run/t5258a.check +++ /dev/null @@ -1 +0,0 @@ -int \ No newline at end of file diff --git a/tests/pending/run/t5258a.scala b/tests/pending/run/t5258a.scala deleted file mode 100644 index 5a22a251c..000000000 --- a/tests/pending/run/t5258a.scala +++ /dev/null @@ -1,8 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - println(classOf[Int]) - }.eval -} diff --git a/tests/pending/run/t5266_1.check b/tests/pending/run/t5266_1.check deleted file mode 100644 index 35f20802e..000000000 --- a/tests/pending/run/t5266_1.check +++ /dev/null @@ -1,2 +0,0 @@ -2 -evaluated = () \ No newline at end of file diff --git a/tests/pending/run/t5266_1.scala b/tests/pending/run/t5266_1.scala deleted file mode 100644 index 5ed943ee6..000000000 --- a/tests/pending/run/t5266_1.scala +++ /dev/null @@ -1,15 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Test extends dotty.runtime.LegacyApp { - val code = reify { - def x = 2 - println(x) - }; - - val toolbox = cm.mkToolBox() - val evaluated = toolbox.eval(code.tree) - println("evaluated = " + evaluated) -} diff --git a/tests/pending/run/t5266_2.check b/tests/pending/run/t5266_2.check deleted file mode 100644 index 35f20802e..000000000 --- a/tests/pending/run/t5266_2.check +++ /dev/null @@ -1,2 +0,0 @@ -2 -evaluated = () \ No newline at end of file diff --git a/tests/pending/run/t5266_2.scala b/tests/pending/run/t5266_2.scala deleted file mode 100644 index c8c3ab824..000000000 --- a/tests/pending/run/t5266_2.scala +++ /dev/null @@ -1,16 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Test extends dotty.runtime.LegacyApp { - val code = reify { - def x = 2 - def y = x - println(y) - }; - - val toolbox = cm.mkToolBox() - val evaluated = toolbox.eval(code.tree) - println("evaluated = " + evaluated) -} diff --git a/tests/pending/run/t5269.check b/tests/pending/run/t5269.check deleted file mode 100644 index 0cfbf0888..000000000 --- a/tests/pending/run/t5269.check +++ /dev/null @@ -1 +0,0 @@ -2 diff --git a/tests/pending/run/t5269.scala b/tests/pending/run/t5269.scala deleted file mode 100644 index dbaa1d1d8..000000000 --- a/tests/pending/run/t5269.scala +++ /dev/null @@ -1,16 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - trait Z { - val z = 2 - } - - class X extends Z { - def println() = Predef.println(z) - } - - new X().println() - }.eval -} diff --git a/tests/pending/run/t5270.check b/tests/pending/run/t5270.check deleted file mode 100644 index 08839f6bb..000000000 --- a/tests/pending/run/t5270.check +++ /dev/null @@ -1 +0,0 @@ -200 diff --git a/tests/pending/run/t5270.scala b/tests/pending/run/t5270.scala deleted file mode 100644 index 03ba765fd..000000000 --- a/tests/pending/run/t5270.scala +++ /dev/null @@ -1,20 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - class Y { - def y = 100 - } - - trait Z { this: Y => - val z = 2 * y - } - - class X extends Y with Z { - def println() = Predef.println(z) - } - - new X().println() - }.eval -} diff --git a/tests/pending/run/t5271_1.check b/tests/pending/run/t5271_1.check deleted file mode 100644 index 544b4d276..000000000 --- a/tests/pending/run/t5271_1.check +++ /dev/null @@ -1,12 +0,0 @@ -{ - case class C extends Product with Serializable { - val foo: Int = _; - val bar: Int = _; - def (foo: Int, bar: Int) = { - super.(); - () - } - }; - () -} -() diff --git a/tests/pending/run/t5271_1.scala b/tests/pending/run/t5271_1.scala deleted file mode 100644 index cdae3df58..000000000 --- a/tests/pending/run/t5271_1.scala +++ /dev/null @@ -1,15 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - val code = reify { - case class C(foo: Int, bar: Int) - }; - - val toolbox = cm.mkToolBox() - println(code.tree) - println(code.eval) -} diff --git a/tests/pending/run/t5271_2.check b/tests/pending/run/t5271_2.check deleted file mode 100644 index 1df88872a..000000000 --- a/tests/pending/run/t5271_2.check +++ /dev/null @@ -1,14 +0,0 @@ -{ - case class C extends Product with Serializable { - val foo: Int = _; - val bar: Int = _; - def (foo: Int, bar: Int) = { - super.(); - () - } - }; - val c = C.apply(2, 2); - Predef.println(c.foo.$times(c.bar)) -} -4 -() diff --git a/tests/pending/run/t5271_2.scala b/tests/pending/run/t5271_2.scala deleted file mode 100644 index 654fa7b30..000000000 --- a/tests/pending/run/t5271_2.scala +++ /dev/null @@ -1,17 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - val code = reify { - case class C(foo: Int, bar: Int) - val c = C(2, 2) - println(c.foo * c.bar) - }; - - val toolbox = cm.mkToolBox() - println(code.tree) - println(code.eval) -} diff --git a/tests/pending/run/t5271_3.check b/tests/pending/run/t5271_3.check deleted file mode 100644 index 99aacc2ce..000000000 --- a/tests/pending/run/t5271_3.check +++ /dev/null @@ -1,21 +0,0 @@ -{ - object C extends AnyRef { - def () = { - super.(); - () - }; - def qwe = 4 - }; - case class C extends Product with Serializable { - val foo: Int = _; - val bar: Int = _; - def (foo: Int, bar: Int) = { - super.(); - () - } - }; - val c = C.apply(2, 2); - Predef.println(c.foo.$times(c.bar).$eq$eq(C.qwe)) -} -true -() diff --git a/tests/pending/run/t5271_3.scala b/tests/pending/run/t5271_3.scala deleted file mode 100644 index 2fa4cea77..000000000 --- a/tests/pending/run/t5271_3.scala +++ /dev/null @@ -1,18 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - val code = reify { - object C { def qwe = 4 } - case class C(foo: Int, bar: Int) - val c = C(2, 2) - println(c.foo * c.bar == C.qwe) - }; - - val toolbox = cm.mkToolBox() - println(code.tree) - println(code.eval) -} diff --git a/tests/pending/run/t5271_4.scala b/tests/pending/run/t5271_4.scala deleted file mode 100644 index 03cca7c48..000000000 --- a/tests/pending/run/t5271_4.scala +++ /dev/null @@ -1,8 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - case object C - }.eval -} diff --git a/tests/pending/run/t5272_1_newpatmat.check b/tests/pending/run/t5272_1_newpatmat.check deleted file mode 100644 index 9f8d6f24e..000000000 --- a/tests/pending/run/t5272_1_newpatmat.check +++ /dev/null @@ -1 +0,0 @@ -okay \ No newline at end of file diff --git a/tests/pending/run/t5272_1_newpatmat.scala b/tests/pending/run/t5272_1_newpatmat.scala deleted file mode 100644 index 30d0c875d..000000000 --- a/tests/pending/run/t5272_1_newpatmat.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - 2 match { - case 2 => println("okay") - case _ => println("not okay") - } - }.eval -} diff --git a/tests/pending/run/t5272_1_oldpatmat.check b/tests/pending/run/t5272_1_oldpatmat.check deleted file mode 100644 index 9f8d6f24e..000000000 --- a/tests/pending/run/t5272_1_oldpatmat.check +++ /dev/null @@ -1 +0,0 @@ -okay \ No newline at end of file diff --git a/tests/pending/run/t5272_1_oldpatmat.scala b/tests/pending/run/t5272_1_oldpatmat.scala deleted file mode 100644 index 30d0c875d..000000000 --- a/tests/pending/run/t5272_1_oldpatmat.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - 2 match { - case 2 => println("okay") - case _ => println("not okay") - } - }.eval -} diff --git a/tests/pending/run/t5272_2_newpatmat.check b/tests/pending/run/t5272_2_newpatmat.check deleted file mode 100644 index 549f3f3af..000000000 --- a/tests/pending/run/t5272_2_newpatmat.check +++ /dev/null @@ -1 +0,0 @@ -okay2 \ No newline at end of file diff --git a/tests/pending/run/t5272_2_newpatmat.scala b/tests/pending/run/t5272_2_newpatmat.scala deleted file mode 100644 index 436f0fd4f..000000000 --- a/tests/pending/run/t5272_2_newpatmat.scala +++ /dev/null @@ -1,10 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - 2 match { - case x => println("okay" + x) - } - }.eval -} diff --git a/tests/pending/run/t5272_2_oldpatmat.check b/tests/pending/run/t5272_2_oldpatmat.check deleted file mode 100644 index 549f3f3af..000000000 --- a/tests/pending/run/t5272_2_oldpatmat.check +++ /dev/null @@ -1 +0,0 @@ -okay2 \ No newline at end of file diff --git a/tests/pending/run/t5272_2_oldpatmat.scala b/tests/pending/run/t5272_2_oldpatmat.scala deleted file mode 100644 index 436f0fd4f..000000000 --- a/tests/pending/run/t5272_2_oldpatmat.scala +++ /dev/null @@ -1,10 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - 2 match { - case x => println("okay" + x) - } - }.eval -} diff --git a/tests/pending/run/t5273_1_newpatmat.check b/tests/pending/run/t5273_1_newpatmat.check deleted file mode 100644 index 0cfbf0888..000000000 --- a/tests/pending/run/t5273_1_newpatmat.check +++ /dev/null @@ -1 +0,0 @@ -2 diff --git a/tests/pending/run/t5273_1_newpatmat.scala b/tests/pending/run/t5273_1_newpatmat.scala deleted file mode 100644 index 1ed2ce79a..000000000 --- a/tests/pending/run/t5273_1_newpatmat.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - List(1, 2, 3) match { - case foo :: bar :: _ => println(foo * bar) - case _ => println("this is getting out of hand!") - } - }.eval -} diff --git a/tests/pending/run/t5273_1_oldpatmat.check b/tests/pending/run/t5273_1_oldpatmat.check deleted file mode 100644 index 0cfbf0888..000000000 --- a/tests/pending/run/t5273_1_oldpatmat.check +++ /dev/null @@ -1 +0,0 @@ -2 diff --git a/tests/pending/run/t5273_1_oldpatmat.scala b/tests/pending/run/t5273_1_oldpatmat.scala deleted file mode 100644 index 1ed2ce79a..000000000 --- a/tests/pending/run/t5273_1_oldpatmat.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - List(1, 2, 3) match { - case foo :: bar :: _ => println(foo * bar) - case _ => println("this is getting out of hand!") - } - }.eval -} diff --git a/tests/pending/run/t5273_2a_newpatmat.check b/tests/pending/run/t5273_2a_newpatmat.check deleted file mode 100644 index d8263ee98..000000000 --- a/tests/pending/run/t5273_2a_newpatmat.check +++ /dev/null @@ -1 +0,0 @@ -2 \ No newline at end of file diff --git a/tests/pending/run/t5273_2a_newpatmat.scala b/tests/pending/run/t5273_2a_newpatmat.scala deleted file mode 100644 index cb4c15146..000000000 --- a/tests/pending/run/t5273_2a_newpatmat.scala +++ /dev/null @@ -1,9 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - val foo :: bar :: _ = List(1, 2, 3) - println(foo * bar) - }.eval -} diff --git a/tests/pending/run/t5273_2a_oldpatmat.check b/tests/pending/run/t5273_2a_oldpatmat.check deleted file mode 100644 index d8263ee98..000000000 --- a/tests/pending/run/t5273_2a_oldpatmat.check +++ /dev/null @@ -1 +0,0 @@ -2 \ No newline at end of file diff --git a/tests/pending/run/t5273_2a_oldpatmat.scala b/tests/pending/run/t5273_2a_oldpatmat.scala deleted file mode 100644 index cb4c15146..000000000 --- a/tests/pending/run/t5273_2a_oldpatmat.scala +++ /dev/null @@ -1,9 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - val foo :: bar :: _ = List(1, 2, 3) - println(foo * bar) - }.eval -} diff --git a/tests/pending/run/t5273_2b_newpatmat.check b/tests/pending/run/t5273_2b_newpatmat.check deleted file mode 100644 index c551774ca..000000000 --- a/tests/pending/run/t5273_2b_newpatmat.check +++ /dev/null @@ -1 +0,0 @@ -name = American Dollar, shortname = USD, value = 2,8567 diff --git a/tests/pending/run/t5273_2b_newpatmat.scala b/tests/pending/run/t5273_2b_newpatmat.scala deleted file mode 100644 index ca4a31566..000000000 --- a/tests/pending/run/t5273_2b_newpatmat.scala +++ /dev/null @@ -1,10 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - val RegexParser = """(.*) \d+([A-Z]+) \| (.*) \|.*""".r - val RegexParser(name, shortname, value) = "American Dollar 1USD | 2,8567 | sometext" - println("name = %s, shortname = %s, value = %s".format(name, shortname, value)) - }.eval -} diff --git a/tests/pending/run/t5273_2b_oldpatmat.check b/tests/pending/run/t5273_2b_oldpatmat.check deleted file mode 100644 index c551774ca..000000000 --- a/tests/pending/run/t5273_2b_oldpatmat.check +++ /dev/null @@ -1 +0,0 @@ -name = American Dollar, shortname = USD, value = 2,8567 diff --git a/tests/pending/run/t5273_2b_oldpatmat.scala b/tests/pending/run/t5273_2b_oldpatmat.scala deleted file mode 100644 index ca4a31566..000000000 --- a/tests/pending/run/t5273_2b_oldpatmat.scala +++ /dev/null @@ -1,10 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - val RegexParser = """(.*) \d+([A-Z]+) \| (.*) \|.*""".r - val RegexParser(name, shortname, value) = "American Dollar 1USD | 2,8567 | sometext" - println("name = %s, shortname = %s, value = %s".format(name, shortname, value)) - }.eval -} diff --git a/tests/pending/run/t5274_1.check b/tests/pending/run/t5274_1.check deleted file mode 100644 index fca8bc3d3..000000000 --- a/tests/pending/run/t5274_1.check +++ /dev/null @@ -1,3 +0,0 @@ -50! = 30414093201713378043612608166064768844377641568960512000000000000 -49! = 608281864034267560872252163321295376887552831379210240000000000 -50!/49! = 50 diff --git a/tests/pending/run/t5274_1.scala b/tests/pending/run/t5274_1.scala deleted file mode 100644 index bc0ba99e4..000000000 --- a/tests/pending/run/t5274_1.scala +++ /dev/null @@ -1,14 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - def factorial(n: BigInt): BigInt = - if (n == 0) 1 else n * factorial(n-1) - - val f50 = factorial(50); val f49 = factorial(49) - println("50! = " + f50) - println("49! = " + f49) - println("50!/49! = " + (f50 / f49)) - }.eval -} diff --git a/tests/pending/run/t5274_2.check b/tests/pending/run/t5274_2.check deleted file mode 100644 index 375536cc2..000000000 --- a/tests/pending/run/t5274_2.check +++ /dev/null @@ -1,2 +0,0 @@ -[6,2,8,5,1] -[1,2,5,6,8] diff --git a/tests/pending/run/t5274_2.scala b/tests/pending/run/t5274_2.scala deleted file mode 100644 index b484111ed..000000000 --- a/tests/pending/run/t5274_2.scala +++ /dev/null @@ -1,51 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - /** Nested methods can use and even update everything - * visible in their scope (including local variables or - * arguments of enclosing methods). - */ - def sort(a: Array[Int]): Unit = { - - def swap(i: Int, j: Int): Unit = { - val t = a(i); a(i) = a(j); a(j) = t - } - - def sort1(l: Int, r: Int): Unit = { - val pivot = a((l + r) / 2) - var i = l - var j = r - while (i <= j) { - while (a(i) < pivot) i += 1 - while (a(j) > pivot) j -= 1 - if (i <= j) { - swap(i, j) - i += 1 - j -= 1 - } - } - if (l < j) sort1(l, j) - if (j < r) sort1(i, r) - } - - if (a.length > 0) - sort1(0, a.length - 1) - } - - def println(ar: Array[Int]): Unit = { - def print1 = { - def iter(i: Int): String = - ar(i) + (if (i < ar.length-1) "," + iter(i+1) else "") - if (ar.length == 0) "" else iter(0) - } - Console.println("[" + print1 + "]") - } - - val ar = Array(6, 2, 8, 5, 1) - println(ar) - sort(ar) - println(ar) - }.eval -} diff --git a/tests/pending/run/t5275.check b/tests/pending/run/t5275.check deleted file mode 100644 index 0cfbf0888..000000000 --- a/tests/pending/run/t5275.check +++ /dev/null @@ -1 +0,0 @@ -2 diff --git a/tests/pending/run/t5275.scala b/tests/pending/run/t5275.scala deleted file mode 100644 index 38b77abab..000000000 --- a/tests/pending/run/t5275.scala +++ /dev/null @@ -1,9 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - class C(val foo: Int) - println(new C(2).foo) - }.eval -} diff --git a/tests/pending/run/t5276_1a.check b/tests/pending/run/t5276_1a.check deleted file mode 100644 index d8263ee98..000000000 --- a/tests/pending/run/t5276_1a.check +++ /dev/null @@ -1 +0,0 @@ -2 \ No newline at end of file diff --git a/tests/pending/run/t5276_1a.scala b/tests/pending/run/t5276_1a.scala deleted file mode 100644 index ad76b2e69..000000000 --- a/tests/pending/run/t5276_1a.scala +++ /dev/null @@ -1,9 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - lazy val x = 2 - println(x) - }.eval -} diff --git a/tests/pending/run/t5276_1b.check b/tests/pending/run/t5276_1b.check deleted file mode 100644 index d8263ee98..000000000 --- a/tests/pending/run/t5276_1b.check +++ /dev/null @@ -1 +0,0 @@ -2 \ No newline at end of file diff --git a/tests/pending/run/t5276_1b.scala b/tests/pending/run/t5276_1b.scala deleted file mode 100644 index 8f11bdc6e..000000000 --- a/tests/pending/run/t5276_1b.scala +++ /dev/null @@ -1,9 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - implicit lazy val x = 2 - println(implicitly[Int]) - }.eval -} diff --git a/tests/pending/run/t5276_2a.check b/tests/pending/run/t5276_2a.check deleted file mode 100644 index d8263ee98..000000000 --- a/tests/pending/run/t5276_2a.check +++ /dev/null @@ -1 +0,0 @@ -2 \ No newline at end of file diff --git a/tests/pending/run/t5276_2a.scala b/tests/pending/run/t5276_2a.scala deleted file mode 100644 index 7086fc983..000000000 --- a/tests/pending/run/t5276_2a.scala +++ /dev/null @@ -1,12 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - class C { - lazy val x = 2 - } - - println(new C().x) - }.eval -} diff --git a/tests/pending/run/t5276_2b.check b/tests/pending/run/t5276_2b.check deleted file mode 100644 index d8263ee98..000000000 --- a/tests/pending/run/t5276_2b.check +++ /dev/null @@ -1 +0,0 @@ -2 \ No newline at end of file diff --git a/tests/pending/run/t5276_2b.scala b/tests/pending/run/t5276_2b.scala deleted file mode 100644 index cccc76a2d..000000000 --- a/tests/pending/run/t5276_2b.scala +++ /dev/null @@ -1,13 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - class C { - implicit lazy val x = 2 - def y = implicitly[Int] - } - - println(new C().y) - }.eval -} diff --git a/tests/pending/run/t5277_1.check b/tests/pending/run/t5277_1.check deleted file mode 100644 index a48033a30..000000000 --- a/tests/pending/run/t5277_1.check +++ /dev/null @@ -1 +0,0 @@ -10! = 3628800 diff --git a/tests/pending/run/t5277_1.scala b/tests/pending/run/t5277_1.scala deleted file mode 100644 index 580098666..000000000 --- a/tests/pending/run/t5277_1.scala +++ /dev/null @@ -1,16 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -import scala.language.{ implicitConversions, postfixOps } -object Test extends dotty.runtime.LegacyApp { - reify { - def fact(n: Int): BigInt = - if (n == 0) 1 else fact(n-1) * n - class Factorizer(n: Int) { - def ! = fact(n) - } - implicit def int2fact(n: Int) = new Factorizer(n) - - println("10! = " + (10!)) - }.eval -} diff --git a/tests/pending/run/t5277_2.check b/tests/pending/run/t5277_2.check deleted file mode 100644 index ca017e2a4..000000000 --- a/tests/pending/run/t5277_2.check +++ /dev/null @@ -1,2 +0,0 @@ -2() -1() diff --git a/tests/pending/run/t5277_2.scala b/tests/pending/run/t5277_2.scala deleted file mode 100644 index 33e31da27..000000000 --- a/tests/pending/run/t5277_2.scala +++ /dev/null @@ -1,12 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - def p(implicit i: Int) = print(i) - implicit val v = 2 - - println(p) - println(p(1)) - }.eval -} diff --git a/tests/pending/run/t5279.check b/tests/pending/run/t5279.check deleted file mode 100644 index f599e28b8..000000000 --- a/tests/pending/run/t5279.check +++ /dev/null @@ -1 +0,0 @@ -10 diff --git a/tests/pending/run/t5279.scala b/tests/pending/run/t5279.scala deleted file mode 100644 index ed1510204..000000000 --- a/tests/pending/run/t5279.scala +++ /dev/null @@ -1,8 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - println(new Integer(10)) - }.eval -} diff --git a/tests/pending/run/t5334_1.check b/tests/pending/run/t5334_1.check deleted file mode 100644 index 96d80cd6c..000000000 --- a/tests/pending/run/t5334_1.check +++ /dev/null @@ -1 +0,0 @@ -C \ No newline at end of file diff --git a/tests/pending/run/t5334_1.scala b/tests/pending/run/t5334_1.scala deleted file mode 100644 index 58954c2f9..000000000 --- a/tests/pending/run/t5334_1.scala +++ /dev/null @@ -1,15 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Test extends dotty.runtime.LegacyApp { - val code = reify { - class C { override def toString = "C" } - val ret = new C - ret.asInstanceOf[Object] - }; - - val toolbox = cm.mkToolBox() - println(toolbox.eval(code.tree)) -} diff --git a/tests/pending/run/t5334_2.check b/tests/pending/run/t5334_2.check deleted file mode 100644 index 613d286a1..000000000 --- a/tests/pending/run/t5334_2.check +++ /dev/null @@ -1 +0,0 @@ -List((C,C)) \ No newline at end of file diff --git a/tests/pending/run/t5334_2.scala b/tests/pending/run/t5334_2.scala deleted file mode 100644 index 105819405..000000000 --- a/tests/pending/run/t5334_2.scala +++ /dev/null @@ -1,15 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Test extends dotty.runtime.LegacyApp { - val code = reify { - class C { override def toString() = "C" } - val ret = List((new C, new C)) - ret.asInstanceOf[List[Any]] - }; - - val toolbox = cm.mkToolBox() - println(toolbox.eval(code.tree)) -} diff --git a/tests/pending/run/t5335.check b/tests/pending/run/t5335.check deleted file mode 100644 index 0cfbf0888..000000000 --- a/tests/pending/run/t5335.check +++ /dev/null @@ -1 +0,0 @@ -2 diff --git a/tests/pending/run/t5335.scala b/tests/pending/run/t5335.scala deleted file mode 100644 index c85c5730e..000000000 --- a/tests/pending/run/t5335.scala +++ /dev/null @@ -1,8 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - println(new {def x = 2}.x) - }.eval -} diff --git a/tests/pending/run/t5415.scala b/tests/pending/run/t5415.scala deleted file mode 100644 index cdc90b8ae..000000000 --- a/tests/pending/run/t5415.scala +++ /dev/null @@ -1,12 +0,0 @@ -object Test extends dotty.runtime.LegacyApp{ - case class Queryable2[T]() { def filter(predicate: T => Boolean) = ??? } - trait CoffeesTable{ def sales : Int } - val q = Queryable2[CoffeesTable]() - import scala.reflect.runtime.universe._ - import scala.reflect.runtime.{universe => ru} - val code = reify{q.filter(_.sales > 5)} - import scala.reflect.runtime.{currentMirror => cm} - import scala.tools.reflect.ToolBox - val toolbox = cm.mkToolBox() - val ttree = toolbox.typecheck(code.tree) -} diff --git a/tests/pending/run/t5418.scala b/tests/pending/run/t5418.scala deleted file mode 100644 index beec4370d..000000000 --- a/tests/pending/run/t5418.scala +++ /dev/null @@ -1,8 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - new Object().getClass - }.eval -} diff --git a/tests/pending/run/t5418a.check b/tests/pending/run/t5418a.check deleted file mode 100644 index 527022936..000000000 --- a/tests/pending/run/t5418a.check +++ /dev/null @@ -1 +0,0 @@ -Expr[Class[_ <: java.lang.Object]](new Object().getClass()) diff --git a/tests/pending/run/t5418a.scala b/tests/pending/run/t5418a.scala deleted file mode 100644 index 722348685..000000000 --- a/tests/pending/run/t5418a.scala +++ /dev/null @@ -1,3 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - println(scala.reflect.runtime.universe.reify(new Object().getClass)) -} diff --git a/tests/pending/run/t5418b.check b/tests/pending/run/t5418b.check deleted file mode 100644 index f036a4be8..000000000 --- a/tests/pending/run/t5418b.check +++ /dev/null @@ -1,2 +0,0 @@ -new Object().getClass() -TypeRef(ThisType(java.lang), java.lang.Class, List(TypeRef(NoPrefix, TypeName("?0"), List()))) diff --git a/tests/pending/run/t5418b.scala b/tests/pending/run/t5418b.scala deleted file mode 100644 index 650700ae2..000000000 --- a/tests/pending/run/t5418b.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Test extends dotty.runtime.LegacyApp { - val tb = cm.mkToolBox() - val untyped = reify(new Object().getClass).tree - val typed = tb.typecheck(untyped) - println(typed) - println(showRaw(typed.tpe)) -} diff --git a/tests/pending/run/t5419.check b/tests/pending/run/t5419.check deleted file mode 100644 index a9c0f262e..000000000 --- a/tests/pending/run/t5419.check +++ /dev/null @@ -1 +0,0 @@ -5: @Foo.asInstanceOf[Int] diff --git a/tests/pending/run/t5419.scala b/tests/pending/run/t5419.scala deleted file mode 100644 index e0ee02a5c..000000000 --- a/tests/pending/run/t5419.scala +++ /dev/null @@ -1,8 +0,0 @@ -import scala.reflect.runtime.universe._ - -class Foo extends annotation.StaticAnnotation - -object Test extends dotty.runtime.LegacyApp { - val tree = reify{(5: @Foo).asInstanceOf[Int]}.tree - println(tree.toString) -} diff --git a/tests/pending/run/t5704.check b/tests/pending/run/t5704.check deleted file mode 100644 index 102e3209c..000000000 --- a/tests/pending/run/t5704.check +++ /dev/null @@ -1 +0,0 @@ -String diff --git a/tests/pending/run/t5704.flags b/tests/pending/run/t5704.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/t5704.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/t5704.scala b/tests/pending/run/t5704.scala deleted file mode 100644 index b9765ebb6..000000000 --- a/tests/pending/run/t5704.scala +++ /dev/null @@ -1,19 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Test extends dotty.runtime.LegacyApp { - class MyQuerycollection{ - def findUserByName( name:String ) = { - val tree = reify{ "test" == name }.tree - val toolbox = cm.mkToolBox() - toolbox.typecheck(tree) match{ - case Apply(Select(lhs,op),rhs::Nil) => - println(rhs.tpe) - } - } - } - val qc = new MyQuerycollection - qc.findUserByName("some value") -} diff --git a/tests/pending/run/t5710-1.check b/tests/pending/run/t5710-1.check deleted file mode 100644 index eac2025ae..000000000 --- a/tests/pending/run/t5710-1.check +++ /dev/null @@ -1 +0,0 @@ -evaluated = (abc,abc) diff --git a/tests/pending/run/t5710-1.scala b/tests/pending/run/t5710-1.scala deleted file mode 100644 index 5548ca4ca..000000000 --- a/tests/pending/run/t5710-1.scala +++ /dev/null @@ -1,15 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Test extends dotty.runtime.LegacyApp { - val code = reify { - val (x, y) = ("abc": Any) match { case x => (x, x) } - (x, y) - }; - - val toolbox = cm.mkToolBox() - val evaluated = toolbox.eval(code.tree) - println("evaluated = " + evaluated) -} diff --git a/tests/pending/run/t5710-2.check b/tests/pending/run/t5710-2.check deleted file mode 100644 index eac2025ae..000000000 --- a/tests/pending/run/t5710-2.check +++ /dev/null @@ -1 +0,0 @@ -evaluated = (abc,abc) diff --git a/tests/pending/run/t5710-2.scala b/tests/pending/run/t5710-2.scala deleted file mode 100644 index c5129ce34..000000000 --- a/tests/pending/run/t5710-2.scala +++ /dev/null @@ -1,15 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Test extends dotty.runtime.LegacyApp { - val code = reify { - val (x, y) = "abc" match { case x => (x, x) } - (x, y) - }; - - val toolbox = cm.mkToolBox() - val evaluated = toolbox.eval(code.tree) - println("evaluated = " + evaluated) -} diff --git a/tests/pending/run/t5713.check b/tests/pending/run/t5713.check deleted file mode 100644 index 1419eb9d7..000000000 --- a/tests/pending/run/t5713.check +++ /dev/null @@ -1 +0,0 @@ -err diff --git a/tests/pending/run/t5713.flags b/tests/pending/run/t5713.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/t5713.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/t5713/Impls_Macros_1.scala b/tests/pending/run/t5713/Impls_Macros_1.scala deleted file mode 100644 index 7b04197cf..000000000 --- a/tests/pending/run/t5713/Impls_Macros_1.scala +++ /dev/null @@ -1,28 +0,0 @@ -package m - -import language.experimental.macros -import scala.reflect.macros.blackbox.Context - -object Level extends Enumeration { - val Error = Value(5) -} - -object Logger { - def error(message: String): Unit = macro LoggerMacros.error -} - -private object LoggerMacros { - - type LoggerContext = Context { type PrefixType = Logger.type } - - def error(c: LoggerContext)(message: c.Expr[String]): c.Expr[Unit] = - log(c)(c.universe.reify(Level.Error), message) - - private def log(c: LoggerContext)(level: c.Expr[Level.Value], message: c.Expr[String]): c.Expr[Unit] = -// was: if (level.splice.id < 4) // TODO Remove hack! - if (c.eval(level).id < 4) // TODO Remove hack! - c.universe.reify(()) - else { - c.universe.reify(println(message.splice)) - } -} \ No newline at end of file diff --git a/tests/pending/run/t5713/Test_2.scala b/tests/pending/run/t5713/Test_2.scala deleted file mode 100644 index 7e4d02a80..000000000 --- a/tests/pending/run/t5713/Test_2.scala +++ /dev/null @@ -1,5 +0,0 @@ -import m._ - -object Test extends dotty.runtime.LegacyApp { - Logger.error("err") -} \ No newline at end of file diff --git a/tests/pending/run/t5753_1.check b/tests/pending/run/t5753_1.check deleted file mode 100644 index f70d7bba4..000000000 --- a/tests/pending/run/t5753_1.check +++ /dev/null @@ -1 +0,0 @@ -42 \ No newline at end of file diff --git a/tests/pending/run/t5753_1.flags b/tests/pending/run/t5753_1.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/t5753_1.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/t5753_1/Impls_Macros_1.scala b/tests/pending/run/t5753_1/Impls_Macros_1.scala deleted file mode 100644 index ce0713885..000000000 --- a/tests/pending/run/t5753_1/Impls_Macros_1.scala +++ /dev/null @@ -1,10 +0,0 @@ -import scala.reflect.macros.blackbox.Context -import language.experimental.macros - -trait Impls { - def impl(c: Context)(x: c.Expr[Any]) = x -} - -object Macros extends Impls { - def foo(x: Any) = macro impl -} \ No newline at end of file diff --git a/tests/pending/run/t5753_1/Test_2.scala b/tests/pending/run/t5753_1/Test_2.scala deleted file mode 100644 index 413eefff3..000000000 --- a/tests/pending/run/t5753_1/Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - import Macros._ - println(foo(42)) -} \ No newline at end of file diff --git a/tests/pending/run/t5753_2.check b/tests/pending/run/t5753_2.check deleted file mode 100644 index f70d7bba4..000000000 --- a/tests/pending/run/t5753_2.check +++ /dev/null @@ -1 +0,0 @@ -42 \ No newline at end of file diff --git a/tests/pending/run/t5753_2.flags b/tests/pending/run/t5753_2.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/t5753_2.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/t5753_2/Impls_Macros_1.scala b/tests/pending/run/t5753_2/Impls_Macros_1.scala deleted file mode 100644 index d446d37bd..000000000 --- a/tests/pending/run/t5753_2/Impls_Macros_1.scala +++ /dev/null @@ -1,10 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -trait Macro_T { - def foo[T](c: Context)(s: c.Expr[T]) = s -} - -object Macros { - def foo[T](s: T) = macro Impls.foo[T] - object Impls extends Macro_T -} diff --git a/tests/pending/run/t5753_2/Test_2.scala b/tests/pending/run/t5753_2/Test_2.scala deleted file mode 100644 index 413eefff3..000000000 --- a/tests/pending/run/t5753_2/Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - import Macros._ - println(foo(42)) -} \ No newline at end of file diff --git a/tests/pending/run/t5770.check b/tests/pending/run/t5770.check deleted file mode 100644 index f00c965d8..000000000 --- a/tests/pending/run/t5770.check +++ /dev/null @@ -1,10 +0,0 @@ -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 diff --git a/tests/pending/run/t5770.scala b/tests/pending/run/t5770.scala deleted file mode 100644 index 409efb2d1..000000000 --- a/tests/pending/run/t5770.scala +++ /dev/null @@ -1,25 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect._ - -object Test extends dotty.runtime.LegacyApp { - var i = 0 - val action = reify { i += 1; println(i) }.tree - - val tb1 = cm.mkToolBox() - tb1.eval(action) - tb1.eval(action) - tb1.eval(action) - tb1.frontEnd.reset() - tb1.eval(action) - tb1.eval(action) - - val tb2 = cm.mkToolBox() - tb2.eval(action) - tb2.frontEnd.reset() - tb2.eval(action) - tb2.eval(action) - tb2.frontEnd.reset() - tb2.eval(action) - tb2.eval(action) -} diff --git a/tests/pending/run/t5816.check b/tests/pending/run/t5816.check deleted file mode 100644 index 8e58ace9b..000000000 --- a/tests/pending/run/t5816.check +++ /dev/null @@ -1 +0,0 @@ -5.+(Test.this.y) diff --git a/tests/pending/run/t5816.scala b/tests/pending/run/t5816.scala deleted file mode 100644 index 4c2a5bcb7..000000000 --- a/tests/pending/run/t5816.scala +++ /dev/null @@ -1,17 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Test extends dotty.runtime.LegacyApp { - val toolbox = cm.mkToolBox() - - def printSource[T](expr: Expr[T]): Unit = { - val ttree = toolbox typecheck expr.tree - println(ttree.toString) - } - - var y = 3 - printSource(reify { - 5 + y - }) -} diff --git a/tests/pending/run/t5824.check b/tests/pending/run/t5824.check deleted file mode 100644 index 3774da60e..000000000 --- a/tests/pending/run/t5824.check +++ /dev/null @@ -1 +0,0 @@ -a b c diff --git a/tests/pending/run/t5824.scala b/tests/pending/run/t5824.scala deleted file mode 100644 index c5cfc280f..000000000 --- a/tests/pending/run/t5824.scala +++ /dev/null @@ -1,8 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends dotty.runtime.LegacyApp { - reify { - println("%s %s %s".format(List("a", "b", "c"): _*)) - }.eval -} diff --git a/tests/pending/run/t5840.scala b/tests/pending/run/t5840.scala deleted file mode 100644 index ba2376f0f..000000000 --- a/tests/pending/run/t5840.scala +++ /dev/null @@ -1,7 +0,0 @@ -import scala.reflect.runtime.universe._ - -object Test extends dotty.runtime.LegacyApp { - reify { - class C[T <: String with Singleton] - } -} diff --git a/tests/pending/run/t5894.scala b/tests/pending/run/t5894.scala deleted file mode 100644 index c67a46def..000000000 --- a/tests/pending/run/t5894.scala +++ /dev/null @@ -1,18 +0,0 @@ -import scala.reflect.macros.blackbox.Context -import scala.language.experimental.macros - -class Test - -object Test { - def foo: Unit = macro fooImpl - def fooImpl(c: Context) = { import c.universe._; c.Expr[Unit](q"()") } - - def main(args: Array[String]): Unit = { - try { - val method = classOf[Test].getMethod("foo") - sys.error("Static forwarder generated for macro: " + method) - } catch { - case _: NoSuchMethodException => // okay - } - } -} diff --git a/tests/pending/run/t5903a.check b/tests/pending/run/t5903a.check deleted file mode 100644 index ce6efd812..000000000 --- a/tests/pending/run/t5903a.check +++ /dev/null @@ -1 +0,0 @@ -(SomeTree,SomeTree) diff --git a/tests/pending/run/t5903a.flags b/tests/pending/run/t5903a.flags deleted file mode 100644 index 02ecab49e..000000000 --- a/tests/pending/run/t5903a.flags +++ /dev/null @@ -1 +0,0 @@ --Xlog-reflective-calls \ No newline at end of file diff --git a/tests/pending/run/t5903a/Macros_1.scala b/tests/pending/run/t5903a/Macros_1.scala deleted file mode 100644 index 5d084ceed..000000000 --- a/tests/pending/run/t5903a/Macros_1.scala +++ /dev/null @@ -1,28 +0,0 @@ -import scala.reflect.macros.whitebox.Context -import language.experimental.macros - -trait Tree -case object SomeTree extends Tree - -object NewQuasiquotes { - implicit class QuasiquoteInterpolation(c: StringContext) { - object nq { - def unapply(t: Tree): Any = macro QuasiquoteMacros.unapplyImpl - } - } -} - -object QuasiquoteMacros { - def unapplyImpl(c: Context)(t: c.Tree) = { - import c.universe._ - q""" - new { - def isEmpty = false - def get = this - def _1 = SomeTree - def _2 = SomeTree - def unapply(t: Tree) = this - }.unapply($t) - """ - } -} diff --git a/tests/pending/run/t5903a/Test_2.scala b/tests/pending/run/t5903a/Test_2.scala deleted file mode 100644 index 55a8320b3..000000000 --- a/tests/pending/run/t5903a/Test_2.scala +++ /dev/null @@ -1,6 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - import NewQuasiquotes._ - SomeTree match { - case nq"$x + $y" => println((x, y)) - } -} diff --git a/tests/pending/run/t5903b.check b/tests/pending/run/t5903b.check deleted file mode 100644 index 75891bc67..000000000 --- a/tests/pending/run/t5903b.check +++ /dev/null @@ -1 +0,0 @@ -oops diff --git a/tests/pending/run/t5903b.flags b/tests/pending/run/t5903b.flags deleted file mode 100644 index 02ecab49e..000000000 --- a/tests/pending/run/t5903b.flags +++ /dev/null @@ -1 +0,0 @@ --Xlog-reflective-calls \ No newline at end of file diff --git a/tests/pending/run/t5903b/Macros_1.scala b/tests/pending/run/t5903b/Macros_1.scala deleted file mode 100644 index 29a05f7fe..000000000 --- a/tests/pending/run/t5903b/Macros_1.scala +++ /dev/null @@ -1,25 +0,0 @@ -import scala.reflect.macros.whitebox.Context -import language.experimental.macros - -object Interpolation { - implicit class TestInterpolation(c: StringContext) { - object t { - def unapply[T](x: T): Any = macro Macros.unapplyImpl[T] - } - } -} - -object Macros { - def unapplyImpl[T: c.WeakTypeTag](c: Context)(x: c.Tree) = { - import c.universe._ - q""" - new { - def isEmpty = false - def get = this - def _1 = 2 - def unapply(x: Int) = this - override def toString = "oops" - }.unapply($x) - """ - } -} diff --git a/tests/pending/run/t5903b/Test_2.scala b/tests/pending/run/t5903b/Test_2.scala deleted file mode 100644 index 23a92225d..000000000 --- a/tests/pending/run/t5903b/Test_2.scala +++ /dev/null @@ -1,6 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - import Interpolation._ - 2 match { - case t"$x" => println(x) - } -} diff --git a/tests/pending/run/t5903c.check b/tests/pending/run/t5903c.check deleted file mode 100644 index 0cfbf0888..000000000 --- a/tests/pending/run/t5903c.check +++ /dev/null @@ -1 +0,0 @@ -2 diff --git a/tests/pending/run/t5903c.flags b/tests/pending/run/t5903c.flags deleted file mode 100644 index 02ecab49e..000000000 --- a/tests/pending/run/t5903c.flags +++ /dev/null @@ -1 +0,0 @@ --Xlog-reflective-calls \ No newline at end of file diff --git a/tests/pending/run/t5903c/Macros_1.scala b/tests/pending/run/t5903c/Macros_1.scala deleted file mode 100644 index 34fe1d880..000000000 --- a/tests/pending/run/t5903c/Macros_1.scala +++ /dev/null @@ -1,23 +0,0 @@ -import scala.reflect.macros.whitebox.Context -import language.experimental.macros - -object Interpolation { - implicit class TestInterpolation(c: StringContext) { - object t { - def unapply[T](x: T): Any = macro Macros.unapplyImpl[T] - } - } -} - -object Macros { - def unapplyImpl[T: c.WeakTypeTag](c: Context)(x: c.Tree) = { - import c.universe._ - q""" - new { - def isEmpty = false - def get = 2 - def unapply(x: Int) = this - }.unapply($x) - """ - } -} diff --git a/tests/pending/run/t5903c/Test_2.scala b/tests/pending/run/t5903c/Test_2.scala deleted file mode 100644 index 23a92225d..000000000 --- a/tests/pending/run/t5903c/Test_2.scala +++ /dev/null @@ -1,6 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - import Interpolation._ - 2 match { - case t"$x" => println(x) - } -} diff --git a/tests/pending/run/t5903d.check b/tests/pending/run/t5903d.check deleted file mode 100644 index d81cc0710..000000000 --- a/tests/pending/run/t5903d.check +++ /dev/null @@ -1 +0,0 @@ -42 diff --git a/tests/pending/run/t5903d.flags b/tests/pending/run/t5903d.flags deleted file mode 100644 index 02ecab49e..000000000 --- a/tests/pending/run/t5903d.flags +++ /dev/null @@ -1 +0,0 @@ --Xlog-reflective-calls \ No newline at end of file diff --git a/tests/pending/run/t5903d/Macros_1.scala b/tests/pending/run/t5903d/Macros_1.scala deleted file mode 100644 index f1f8dc1fd..000000000 --- a/tests/pending/run/t5903d/Macros_1.scala +++ /dev/null @@ -1,25 +0,0 @@ -import scala.reflect.macros.whitebox.Context -import language.experimental.macros - -object Interpolation { - implicit class TestInterpolation(c: StringContext) { - object t { - def unapply(x: Int): Any = macro Macros.unapplyImpl - } - } -} - -object Macros { - def unapplyImpl(c: Context)(x: c.Tree) = { - import c.universe._ - q""" - new { - class Match(x: Int) { - def isEmpty = false - def get = x - } - def unapply(x: Int) = new Match(x) - }.unapply($x) - """ - } -} diff --git a/tests/pending/run/t5903d/Test_2.scala b/tests/pending/run/t5903d/Test_2.scala deleted file mode 100644 index 5df60f024..000000000 --- a/tests/pending/run/t5903d/Test_2.scala +++ /dev/null @@ -1,6 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - import Interpolation._ - 42 match { - case t"$x" => println(x) - } -} diff --git a/tests/pending/run/t5923a.check b/tests/pending/run/t5923a.check deleted file mode 100644 index 7165b734a..000000000 --- a/tests/pending/run/t5923a.check +++ /dev/null @@ -1,3 +0,0 @@ -C(Int) -C(String) -C(Nothing) diff --git a/tests/pending/run/t5923a/Macros_1.scala b/tests/pending/run/t5923a/Macros_1.scala deleted file mode 100644 index 9050fd4b1..000000000 --- a/tests/pending/run/t5923a/Macros_1.scala +++ /dev/null @@ -1,53 +0,0 @@ -import scala.reflect.macros.whitebox.Context -import language.experimental.macros - -case class C[T](t: String) -object C { - implicit def foo[T]: C[T] = macro Macros.impl[T] -} - -object Macros { - def impl[T](c: Context)(ttag: c.WeakTypeTag[T]) = { - import c.universe._ - import internal._ - val ttag0 = ttag; - { - // When we're expanding implicitly[C[Nothing]], the type inferencer will see - // that foo[T] returns C[T] and that we request an implicit of type C[Nothing]. - // - // Then the type inferencer will try to match C[T] against C[Nothing] and infer everything it can infer - // from that match, but not more (e.g. if we were returning Iso[T, U] and the type we were looking at was Iso[Foo, L], - // we wouldn't want U to be auto-inferred to Nothing, as it usually happens with normal methods, - // but would rather want it to remain unknown, so that our macro could take a stab at inferring it: - // see the comments in this commit for more information). - // - // Equipped with common sense, in our case of C[T] and C[Nothing] we would expect T to be inferred as Nothing, and then we - // would expect T in the corresponding macro invocation to be Nothing. Unfortunately it is not that simple. - // - // Internally the type inferencer uses Nothing as a dummy value, which stands for "don't know how to - // infer this type parameter". In the Iso example, matching Iso[T, U] against Iso[Foo, L] would result in - // T being inferred as Foo and U being inferred as Nothing (!!). Then the type inferencer will think: - // "Aha! U ended up being Nothing. This means that I failed to infer it, - // therefore the result of my work is: T -> Foo, U -> still unknown". - // - // That's all very good and works very well until Nothing is a genuine result of type inference, - // as in our original example of inferring T in C[T] from C[Nothing]. In that case, the inferencer becomes confused - // and here in the macro implementation we get weakTypeOf[T] equal to some dummy type carrying a type parameter - // instead of Nothing. - // - // This eccentric behavior of the type inferencer is a long-standing problem in scalac, - // so the best one can do for now until it's fixed is to work around, manually converting - // suspicious T's into Nothings. Of course, this means that we would have to approximate, - // because there's no way to know whether having T here stands for a failed attempt to infer Nothing - // or for a failed attempt to infer anything, but at least we're in full control of making the best - // of this sad situation. - implicit def ttag: WeakTypeTag[T] = { - val tpe = ttag0.tpe - val sym = tpe.typeSymbol.asType - if (sym.isParameter && !isSkolem(sym)) TypeTag.Nothing.asInstanceOf[TypeTag[T]] - else ttag0 - } - reify(C[T](c.Expr[String](Literal(Constant(weakTypeOf[T].toString))).splice)) - } - } -} \ No newline at end of file diff --git a/tests/pending/run/t5923a/Test_2.scala b/tests/pending/run/t5923a/Test_2.scala deleted file mode 100644 index 1f0413bdf..000000000 --- a/tests/pending/run/t5923a/Test_2.scala +++ /dev/null @@ -1,5 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - println(implicitly[C[Int]]) - println(implicitly[C[String]]) - println(implicitly[C[Nothing]]) -} \ No newline at end of file diff --git a/tests/pending/run/t5923d/Macros_1.scala b/tests/pending/run/t5923d/Macros_1.scala deleted file mode 100644 index 1400674d4..000000000 --- a/tests/pending/run/t5923d/Macros_1.scala +++ /dev/null @@ -1,9 +0,0 @@ -import scala.language.experimental.macros -import scala.reflect.macros.blackbox.Context - -trait MappedRow -trait RowMapper[T <: MappedRow] -object RowMapper { - implicit def mapper[T <: MappedRow]: RowMapper[T] = macro impl[T] - def impl[T <: MappedRow : c.WeakTypeTag](c: Context) = c.universe.reify(new RowMapper[T]{}) -} \ No newline at end of file diff --git a/tests/pending/run/t5923d/Test_2.scala b/tests/pending/run/t5923d/Test_2.scala deleted file mode 100644 index e9c446209..000000000 --- a/tests/pending/run/t5923d/Test_2.scala +++ /dev/null @@ -1,7 +0,0 @@ -class RowA extends MappedRow -class RowB extends MappedRow - -object Test extends dotty.runtime.LegacyApp { - implicitly[RowMapper[RowA]] - implicitly[RowMapper[RowB]] -} \ No newline at end of file diff --git a/tests/pending/run/t5940.scala b/tests/pending/run/t5940.scala deleted file mode 100644 index 856070821..000000000 --- a/tests/pending/run/t5940.scala +++ /dev/null @@ -1,41 +0,0 @@ -import scala.tools.partest._ - -object Test extends DirectTest { - def code = ??? - - def macros_1 = """ - import scala.reflect.macros.blackbox.Context - - object Impls { - def impl(c: Context) = { import c.universe._; c.Expr[Unit](q"()") } - } - - object Macros { - //import Impls._ - def impl(c: Context) = { import c.universe._; c.Expr[Unit](q"()") } - def foo: Unit = macro impl - } - """ - def compileMacros() = { - val classpath = List(sys.props("partest.lib"), sys.props("partest.reflect")) mkString sys.props("path.separator") - compileString(newCompiler("-language:experimental.macros", "-cp", classpath, "-d", testOutput.path))(macros_1) - } - - def test_2 = """ - object Test extends dotty.runtime.LegacyApp { - println(Macros.foo) - } - """ - def compileTest() = { - val classpath = List(sys.props("partest.lib"), testOutput.path) mkString sys.props("path.separator") - compileString(newCompiler("-cp", classpath, "-d", testOutput.path))(test_2) - } - - def show(): Unit = { - log("Compiling Macros_1...") - if (compileMacros()) { - log("Compiling Test_2...") - if (compileTest()) log("Success!") else log("Failed...") - } - } -} \ No newline at end of file diff --git a/tests/pending/run/t6023.check b/tests/pending/run/t6023.check deleted file mode 100644 index ee9356523..000000000 --- a/tests/pending/run/t6023.check +++ /dev/null @@ -1,12 +0,0 @@ -{ - abstract trait Foo extends AnyRef { - def a: Int - }; - () -} -{ - abstract trait Foo extends AnyRef { - def a: Int - }; - () -} diff --git a/tests/pending/run/t6023.scala b/tests/pending/run/t6023.scala deleted file mode 100644 index 9ec8724a4..000000000 --- a/tests/pending/run/t6023.scala +++ /dev/null @@ -1,17 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Test extends dotty.runtime.LegacyApp { - // test 1: reify - val tree = reify{ trait Foo { val a: Int } }.tree - println(tree.toString) - - // test 2: import and typecheck - val toolbox = cm.mkToolBox() - val ttree = toolbox.typecheck(tree) - println(ttree.toString) - - // test 3: import and compile - toolbox.eval(tree) -} diff --git a/tests/pending/run/t6187.check b/tests/pending/run/t6187.check deleted file mode 100644 index 9a9e266ec..000000000 --- a/tests/pending/run/t6187.check +++ /dev/null @@ -1,32 +0,0 @@ -Type in expressions to have them evaluated. -Type :help for more information. - -scala> import scala.language.experimental.macros, scala.reflect.macros.blackbox.Context -import scala.language.experimental.macros -import scala.reflect.macros.blackbox.Context - -scala> def macroImpl[T: c.WeakTypeTag](c: Context)(t: c.Expr[T]): c.Expr[List[T]] = { - val r = c.universe.reify { List(t.splice) } - c.Expr[List[T]]( c.untypecheck(r.tree) ) -} -macroImpl: [T](c: scala.reflect.macros.blackbox.Context)(t: c.Expr[T])(implicit evidence$1: c.WeakTypeTag[T])c.Expr[List[T]] - -scala> def demo[T](t: T): List[T] = macro macroImpl[T] -defined term macro demo: [T](t: T)List[T] - -scala> def m[T](t: T): List[List[T]] = - demo( List((t,true)) collect { case (x,true) => x } ) -m: [T](t: T)List[List[T]] - -scala> m(List(1)) -res0: List[List[List[Int]]] = List(List(List(1))) - -scala> // Showing we haven't added unreachable warnings - -scala> List(1) collect { case x => x } -res1: List[Int] = List(1) - -scala> List("") collect { case x => x } -res2: List[String] = List("") - -scala> :quit diff --git a/tests/pending/run/t6187.scala b/tests/pending/run/t6187.scala deleted file mode 100644 index 7a39cfd9e..000000000 --- a/tests/pending/run/t6187.scala +++ /dev/null @@ -1,18 +0,0 @@ -import scala.tools.partest.ReplTest - -object Test extends ReplTest { - override def code = """ -import scala.language.experimental.macros, scala.reflect.macros.blackbox.Context -def macroImpl[T: c.WeakTypeTag](c: Context)(t: c.Expr[T]): c.Expr[List[T]] = { - val r = c.universe.reify { List(t.splice) } - c.Expr[List[T]]( c.untypecheck(r.tree) ) -} -def demo[T](t: T): List[T] = macro macroImpl[T] -def m[T](t: T): List[List[T]] = - demo( List((t,true)) collect { case (x,true) => x } ) -m(List(1)) -// Showing we haven't added unreachable warnings -List(1) collect { case x => x } -List("") collect { case x => x } - """.trim -} diff --git a/tests/pending/run/t6187b.scala b/tests/pending/run/t6187b.scala deleted file mode 100644 index 412880f38..000000000 --- a/tests/pending/run/t6187b.scala +++ /dev/null @@ -1,5 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - val x: PartialFunction[Int, Int] = { case 1 => 1 } - val o: Any = "" - assert(x.applyOrElse(0, (_: Int) => o) == "") -} diff --git a/tests/pending/run/t6221.check b/tests/pending/run/t6221.check deleted file mode 100644 index aa1bdd0e6..000000000 --- a/tests/pending/run/t6221.check +++ /dev/null @@ -1 +0,0 @@ -((x) => x.$percent(2).$eq$eq(0)) diff --git a/tests/pending/run/t6221/Macros_1.scala b/tests/pending/run/t6221/Macros_1.scala deleted file mode 100644 index 0aeaa00c8..000000000 --- a/tests/pending/run/t6221/Macros_1.scala +++ /dev/null @@ -1,23 +0,0 @@ -import language.experimental.macros -import language.implicitConversions -import scala.reflect.macros.blackbox.Context -import scala.reflect.runtime.universe.Tree - -class ReflectiveClosure[A, B](val tree: Tree, fn: A => B) extends (A => B) { - def apply(x: A) = fn(x) -} - -object ReflectiveClosure { - implicit def reflectClosure[A, B](f: A => B): ReflectiveClosure[A, B] = macro Macros.reflectiveClosureImpl[A, B] -} - -object Macros { - def reflectiveClosureImpl[A, B](c: Context)(f: c.Expr[A => B]): c.Expr[ReflectiveClosure[A, B]] = { - import c.universe._ - import internal._ - val u = gen.mkRuntimeUniverseRef - val m = EmptyTree - val tree = c.Expr[scala.reflect.runtime.universe.Tree](Select(c.reifyTree(u, m, f.tree), newTermName("tree"))) - c.universe.reify(new ReflectiveClosure(tree.splice, f.splice)) - } -} diff --git a/tests/pending/run/t6221/Test_2.scala b/tests/pending/run/t6221/Test_2.scala deleted file mode 100644 index bc295d437..000000000 --- a/tests/pending/run/t6221/Test_2.scala +++ /dev/null @@ -1,10 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - implicit class PimpedList[T](val list: List[T]) { - def query(predicate: ReflectiveClosure[T, Boolean]): List[T] = { - println(predicate.tree) - list filter predicate - } - } - - List(1, 2, 3).query(x => x % 2 == 0) -} \ No newline at end of file diff --git a/tests/pending/run/t6379.check b/tests/pending/run/t6379.check deleted file mode 100644 index 3e5dfec62..000000000 --- a/tests/pending/run/t6379.check +++ /dev/null @@ -1,14 +0,0 @@ -compile-time -uninitialized close: List(class IOException) -initialized close: List(class IOException) -uninitialized productElement: List(class IndexOutOfBoundsException) -initialized productElement: List(class IndexOutOfBoundsException) -uninitialized read: List(class IOException) -initialized read: List(class IOException) -runtime -uninitialized close: List(class IOException) -initialized close: List(class IOException) -uninitialized productElement: List(class IndexOutOfBoundsException) -initialized productElement: List(class IndexOutOfBoundsException) -uninitialized read: List(class IOException) -initialized read: List(class IOException) diff --git a/tests/pending/run/t6379/Macros_1.scala b/tests/pending/run/t6379/Macros_1.scala deleted file mode 100644 index 4f3daf497..000000000 --- a/tests/pending/run/t6379/Macros_1.scala +++ /dev/null @@ -1,26 +0,0 @@ -import scala.reflect.macros.whitebox._ -import scala.language.experimental.macros -import java.io._ - -object Macros { - def impl(c: Context) = { - var messages = List[String]() - def println(msg: String) = messages :+= msg - - import c.universe._ - def test(sym: MethodSymbol): Unit = { - println(s"uninitialized ${sym.name}: ${sym.exceptions}") - sym.info - println(s"initialized ${sym.name}: ${sym.exceptions}") - } - - println("compile-time") - test(typeOf[Closeable].declaration(TermName("close")).asMethod) - test(typeOf[Product1[_]].declaration(TermName("productElement")).asMethod) - test(c.mirror.staticClass("Reader").info.decl(TermName("read")).asMethod) - - q"..${messages.map(msg => q"println($msg)")}" - } - - def foo: Any = macro impl -} \ No newline at end of file diff --git a/tests/pending/run/t6379/Test_2.scala b/tests/pending/run/t6379/Test_2.scala deleted file mode 100644 index 05bdd5575..000000000 --- a/tests/pending/run/t6379/Test_2.scala +++ /dev/null @@ -1,22 +0,0 @@ -import java.io._ -import scala.reflect.runtime.universe._ - -class Reader(fname: String) { - private val in = new BufferedReader(new FileReader(fname)) - @throws[IOException]("if the file doesn't exist") - def read() = in.read() -} - -object Test extends dotty.runtime.LegacyApp { - def test(sym: MethodSymbol): Unit = { - println(s"uninitialized ${sym.name}: ${sym.exceptions}") - sym.info - println(s"initialized ${sym.name}: ${sym.exceptions}") - } - - Macros.foo - println("runtime") - test(typeOf[Closeable].decl(TermName("close")).asMethod) - test(typeOf[Product1[_]].decl(TermName("productElement")).asMethod) - test(typeOf[Reader].decl(TermName("read")).asMethod) -} diff --git a/tests/pending/run/t6381.check b/tests/pending/run/t6381.check deleted file mode 100644 index 49c6a784a..000000000 --- a/tests/pending/run/t6381.check +++ /dev/null @@ -1,19 +0,0 @@ -Type in expressions to have them evaluated. -Type :help for more information. - -scala> import scala.language.experimental.macros -import scala.language.experimental.macros - -scala> def pos_impl(c: scala.reflect.macros.blackbox.Context): c.Expr[String] = { - import c.universe._ - c.Expr[String](Literal(Constant(c.enclosingPosition.getClass.toString))) -} -pos_impl: (c: scala.reflect.macros.blackbox.Context)c.Expr[String] - -scala> def pos: String = macro pos_impl -defined term macro pos: String - -scala> pos -res0: String = class scala.reflect.internal.util.RangePosition - -scala> :quit diff --git a/tests/pending/run/t6381.scala b/tests/pending/run/t6381.scala deleted file mode 100644 index 5a687c10c..000000000 --- a/tests/pending/run/t6381.scala +++ /dev/null @@ -1,15 +0,0 @@ -import scala.tools.partest.ReplTest - -object Test extends ReplTest { - def code = """ - |import scala.language.experimental.macros - |def pos_impl(c: scala.reflect.macros.blackbox.Context): c.Expr[String] = { - | import c.universe._ - | c.Expr[String](Literal(Constant(c.enclosingPosition.getClass.toString))) - |} - |def pos: String = macro pos_impl - |pos - |""".stripMargin.trim - - override def extraSettings: String = "-Yrangepos" -} diff --git a/tests/pending/run/t6394a.check b/tests/pending/run/t6394a.check deleted file mode 100644 index 2a02d41ce..000000000 --- a/tests/pending/run/t6394a.check +++ /dev/null @@ -1 +0,0 @@ -TEST diff --git a/tests/pending/run/t6394a.flags b/tests/pending/run/t6394a.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/t6394a.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/t6394a/Macros_1.scala b/tests/pending/run/t6394a/Macros_1.scala deleted file mode 100644 index 376d85ba6..000000000 --- a/tests/pending/run/t6394a/Macros_1.scala +++ /dev/null @@ -1,12 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Macros { - def impl(c:Context): c.Expr[Any] = { - import c.universe._ - - val selfTree = This(c.enclosingImpl.symbol.asModule.moduleClass) - c.Expr[AnyRef](selfTree) - } - - def foo: Any = macro impl -} \ No newline at end of file diff --git a/tests/pending/run/t6394a/Test_2.scala b/tests/pending/run/t6394a/Test_2.scala deleted file mode 100644 index 989ab3031..000000000 --- a/tests/pending/run/t6394a/Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - println(Macros.foo) - override def toString = "TEST" -} \ No newline at end of file diff --git a/tests/pending/run/t6394b.check b/tests/pending/run/t6394b.check deleted file mode 100644 index 2a02d41ce..000000000 --- a/tests/pending/run/t6394b.check +++ /dev/null @@ -1 +0,0 @@ -TEST diff --git a/tests/pending/run/t6394b.flags b/tests/pending/run/t6394b.flags deleted file mode 100644 index cd66464f2..000000000 --- a/tests/pending/run/t6394b.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/t6394b/Macros_1.scala b/tests/pending/run/t6394b/Macros_1.scala deleted file mode 100644 index 1a747816e..000000000 --- a/tests/pending/run/t6394b/Macros_1.scala +++ /dev/null @@ -1,12 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Macros { - def impl(c:Context): c.Expr[Any] = { - import c.universe._ - - val selfTree = This(typeNames.EMPTY) - c.Expr[AnyRef](selfTree) - } - - def foo: Any = macro impl -} \ No newline at end of file diff --git a/tests/pending/run/t6394b/Test_2.scala b/tests/pending/run/t6394b/Test_2.scala deleted file mode 100644 index 989ab3031..000000000 --- a/tests/pending/run/t6394b/Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - println(Macros.foo) - override def toString = "TEST" -} \ No newline at end of file diff --git a/tests/pending/run/t6591_1.check b/tests/pending/run/t6591_1.check deleted file mode 100644 index d1d448f28..000000000 --- a/tests/pending/run/t6591_1.check +++ /dev/null @@ -1 +0,0 @@ -Block(List(ValDef(Modifiers(), TermName("v"), Select(Ident(A), TypeName("I")), Select(Ident(A), TermName("impl")))), Ident(TermName("v"))) diff --git a/tests/pending/run/t6591_1.scala b/tests/pending/run/t6591_1.scala deleted file mode 100644 index 8c152f68a..000000000 --- a/tests/pending/run/t6591_1.scala +++ /dev/null @@ -1,19 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -trait O { trait I } - -object A extends O { - val impl = new I {} -} - -object Test extends dotty.runtime.LegacyApp { - val code = reify { - val v: A.I = A.impl - v - } - println(showRaw(code.tree)) - - val v: A.I = code.eval -} diff --git a/tests/pending/run/t6591_2.check b/tests/pending/run/t6591_2.check deleted file mode 100644 index a2930b174..000000000 --- a/tests/pending/run/t6591_2.check +++ /dev/null @@ -1 +0,0 @@ -Block(List(ValDef(Modifiers(), TermName("v"), SelectFromTypeTree(Ident(A), TypeName("I")), Select(Apply(Select(New(Ident(A)), termNames.CONSTRUCTOR), List()), TermName("impl")))), Ident(TermName("v"))) diff --git a/tests/pending/run/t6591_2.scala b/tests/pending/run/t6591_2.scala deleted file mode 100644 index 9e6c917e8..000000000 --- a/tests/pending/run/t6591_2.scala +++ /dev/null @@ -1,19 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -trait O { trait I } - -class A extends O { - val impl = new I {} -} - -object Test extends dotty.runtime.LegacyApp { - val code = reify { - val v: A#I = (new A).impl - v - } - println(showRaw(code.tree)) - - val v: A#I = code.eval -} diff --git a/tests/pending/run/t6591_3.check b/tests/pending/run/t6591_3.check deleted file mode 100644 index 362aafd11..000000000 --- a/tests/pending/run/t6591_3.check +++ /dev/null @@ -1 +0,0 @@ -Block(List(ValDef(Modifiers(), TermName("v"), Select(This(TypeName("A")), TypeName("I")), Apply(Select(New(Select(This(TypeName("A")), TypeName("I"))), termNames.CONSTRUCTOR), List()))), Ident(TermName("v"))) diff --git a/tests/pending/run/t6591_3.scala b/tests/pending/run/t6591_3.scala deleted file mode 100644 index 5069b800e..000000000 --- a/tests/pending/run/t6591_3.scala +++ /dev/null @@ -1,17 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -class O { class I } - -object A extends O { - val code = reify { - val v: I = new I - v - } - println(showRaw(code.tree)) -} - -object Test extends dotty.runtime.LegacyApp { - val v: A.I = A.code.eval -} diff --git a/tests/pending/run/t6591_5.check b/tests/pending/run/t6591_5.check deleted file mode 100644 index 4ebc2236a..000000000 --- a/tests/pending/run/t6591_5.check +++ /dev/null @@ -1 +0,0 @@ -Expr(Block(List(ValDef(Modifiers(), TermName("v"), Select(Select(This(TypeName("A")), TermName("x")), TypeName("I")), Select(Ident(scala.Predef), TermName("$qmark$qmark$qmark")))), Ident(TermName("v")))) diff --git a/tests/pending/run/t6591_5.scala b/tests/pending/run/t6591_5.scala deleted file mode 100644 index dfb4cd5ad..000000000 --- a/tests/pending/run/t6591_5.scala +++ /dev/null @@ -1,23 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval -import java.lang.reflect.InvocationTargetException - -class O { class I } - -object A extends O { - val x = new O - val code = reify { - val v: x.I = ??? - v - } - println(showRaw(code)) -} - -object Test extends dotty.runtime.LegacyApp { - try { - val v: A.x.I = A.code.eval - } catch { - case ex: InvocationTargetException if ex.getCause.isInstanceOf[NotImplementedError] => - } -} diff --git a/tests/pending/run/t6591_6.check b/tests/pending/run/t6591_6.check deleted file mode 100644 index 940e2026f..000000000 --- a/tests/pending/run/t6591_6.check +++ /dev/null @@ -1 +0,0 @@ -Expr(Block(List(ValDef(Modifiers(), TermName("v"), Select(Select(Ident(TermName("A")), TermName("x")), TypeName("I")), Select(Ident(scala.Predef), TermName("$qmark$qmark$qmark")))), Ident(TermName("v")))) diff --git a/tests/pending/run/t6591_6.scala b/tests/pending/run/t6591_6.scala deleted file mode 100644 index afb2da229..000000000 --- a/tests/pending/run/t6591_6.scala +++ /dev/null @@ -1,24 +0,0 @@ -import scala.language.existentials -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval -import java.lang.reflect.InvocationTargetException - -class O { class I } - -class A extends O { - val x = new O - val code = reify { - val v: x.I = ??? - v - } - println(showRaw(code)) -} - -object Test extends dotty.runtime.LegacyApp { - try { - val v = (new A).code.eval - } catch { - case ex: InvocationTargetException if ex.getCause.isInstanceOf[NotImplementedError] => - } -} diff --git a/tests/pending/run/t6591_7.check b/tests/pending/run/t6591_7.check deleted file mode 100644 index e21a3669b..000000000 --- a/tests/pending/run/t6591_7.check +++ /dev/null @@ -1,4 +0,0 @@ -name = x, stable = true -name = y, stable = true -name = z, stable = false -name = C, stable = true diff --git a/tests/pending/run/t6591_7.scala b/tests/pending/run/t6591_7.scala deleted file mode 100644 index cec0d2cda..000000000 --- a/tests/pending/run/t6591_7.scala +++ /dev/null @@ -1,27 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval -import internal._ - -object Test extends dotty.runtime.LegacyApp { - locally { - val x = 2 - def y = 3 - var z = 4 - class C { - var w = 5 - locally { - val expr = reify(x + y + z + w) - // blocked by SI-7103, though it's not the focus of this test - // therefore I'm just commenting out the evaluation - // println(expr.eval) - freeTerms(expr.tree) foreach (ft => { - // blocked by SI-7104, though it's not the focus of this test - // therefore I'm just commenting out the call to info - // println(s"name = ${ft.name}, sig = ${ft.info}, stable = ${ft.isStable}") - println(s"name = ${ft.name}, stable = ${ft.isStable}") - }) - } - } - new C() - } -} diff --git a/tests/pending/run/t6662.check b/tests/pending/run/t6662.check deleted file mode 100644 index 6a452c185..000000000 --- a/tests/pending/run/t6662.check +++ /dev/null @@ -1 +0,0 @@ -() diff --git a/tests/pending/run/t6662/Macro_1.scala b/tests/pending/run/t6662/Macro_1.scala deleted file mode 100644 index 419859772..000000000 --- a/tests/pending/run/t6662/Macro_1.scala +++ /dev/null @@ -1,8 +0,0 @@ -import language.experimental.macros -import scala.reflect.macros.blackbox.Context - -object Demo { - def id[T](a: T): T = macro idImpl[T] - - def idImpl[T: c.WeakTypeTag](c: Context)(a: c.Expr[T]): c.Expr[T] = a -} diff --git a/tests/pending/run/t6662/Test_2.scala b/tests/pending/run/t6662/Test_2.scala deleted file mode 100644 index 82ac54cb4..000000000 --- a/tests/pending/run/t6662/Test_2.scala +++ /dev/null @@ -1,8 +0,0 @@ -// Macro usage: - -object Test { - def main(args: Array[String]) { - val s = Demo id (()) - println(s) - } -} diff --git a/tests/pending/run/t6814.check b/tests/pending/run/t6814.check deleted file mode 100644 index 97ada7720..000000000 --- a/tests/pending/run/t6814.check +++ /dev/null @@ -1,7 +0,0 @@ -List[Int] -scala.collection.immutable.List.type -object java.lang.RuntimeException is not a value -List[Int] -List -scala.collection.immutable.List.type -scala.collection.immutable.List.type does not take parameters diff --git a/tests/pending/run/t6814/Macros_1.scala b/tests/pending/run/t6814/Macros_1.scala deleted file mode 100644 index 0257f451d..000000000 --- a/tests/pending/run/t6814/Macros_1.scala +++ /dev/null @@ -1,24 +0,0 @@ -import scala.language.experimental.macros -import scala.reflect.macros.blackbox.Context - -object Macros { - def impl(c: Context) = { - import c.universe._ - - def test(tree: Tree, mode: c.TypecheckMode): String = { - try c.typecheck(tree, mode, silent = false).tpe.toString - catch { case c.TypecheckException(_, msg) => msg } - } - - q""" - println(${test(q"List(1, 2)", c.TERMmode)}) - println(${test(q"List", c.TERMmode)}) - println(${test(q"RuntimeException", c.TERMmode)}) - println(${test(tq"List[Int]", c.TYPEmode)}) - println(${test(tq"List", c.TYPEmode)}) - println(${test(q"List", c.TYPEmode)}) - println(${test(q"List(1, 2)", c.TYPEmode)}) - """ - } - def foo: Unit = macro impl -} \ No newline at end of file diff --git a/tests/pending/run/t6814/Test_2.scala b/tests/pending/run/t6814/Test_2.scala deleted file mode 100644 index 0fc472aa6..000000000 --- a/tests/pending/run/t6814/Test_2.scala +++ /dev/null @@ -1,3 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - Macros.foo -} \ No newline at end of file diff --git a/tests/pending/run/t6992.check b/tests/pending/run/t6992.check deleted file mode 100644 index 021f32ec9..000000000 --- a/tests/pending/run/t6992.check +++ /dev/null @@ -1,4 +0,0 @@ -Test.foo.T -Int -42 -42 diff --git a/tests/pending/run/t6992/Macros_1.scala b/tests/pending/run/t6992/Macros_1.scala deleted file mode 100644 index f578f2b3c..000000000 --- a/tests/pending/run/t6992/Macros_1.scala +++ /dev/null @@ -1,75 +0,0 @@ -import scala.language.experimental.macros -import scala.reflect.macros.whitebox.Context - -object Macros { - def foo(name: String): Any = macro foo_impl - def foo_impl(c: Context)(name: c.Expr[String]) = { - import c.universe._ - - val Literal(Constant(lit: String)) = name.tree - val anon = newTypeName(c.fresh) - - c.Expr(Block( - ClassDef( - Modifiers(Flag.FINAL), anon, Nil, Template( - Nil, noSelfType, List( - DefDef(Modifiers(), termNames.CONSTRUCTOR, List(), List(List()), TypeTree(), Block(List(pendingSuperCall), Literal(Constant(())))), - TypeDef(Modifiers(), TypeName(lit), Nil, TypeTree(typeOf[Int])) - ) - ) - ), - Apply(Select(New(Ident(anon)), termNames.CONSTRUCTOR), Nil) - )) - } - - def bar(name: String): Any = macro bar_impl - def bar_impl(c: Context)(name: c.Expr[String]) = { - import c.universe._ - - val Literal(Constant(lit: String)) = name.tree - val anon = newTypeName(c.fresh) - - c.Expr(Block( - ClassDef( - Modifiers(Flag.FINAL), anon, Nil, Template( - Nil, noSelfType, List( - DefDef(Modifiers(), termNames.CONSTRUCTOR, List(), List(List()), TypeTree(), Block(List(pendingSuperCall), Literal(Constant(())))), - DefDef( - Modifiers(), TermName(lit), Nil, Nil, TypeTree(), - c.literal(42).tree - ) - ) - ) - ), - Apply(Select(New(Ident(anon)), termNames.CONSTRUCTOR), Nil) - )) - } - - def baz(name: String): Any = macro baz_impl - def baz_impl(c: Context)(name: c.Expr[String]) = { - import c.universe._ - - val Literal(Constant(lit: String)) = name.tree - val anon = newTypeName(c.fresh) - val wrapper = newTypeName(c.fresh) - - c.Expr(Block( - ClassDef( - Modifiers(), anon, Nil, Template( - Nil, emptyValDef, List( - DefDef(Modifiers(), termNames.CONSTRUCTOR, List(), List(List()), TypeTree(), Block(List(pendingSuperCall), Literal(Constant(())))), - DefDef( - Modifiers(), TermName(lit), Nil, Nil, TypeTree(), - c.literal(42).tree - ) - ) - ) - ), - ClassDef( - Modifiers(Flag.FINAL), wrapper, Nil, - Template(Ident(anon) :: Nil, noSelfType, DefDef(Modifiers(), termNames.CONSTRUCTOR, List(), List(List()), TypeTree(), Block(List(pendingSuperCall), Literal(Constant(())))) :: Nil) - ), - Apply(Select(New(Ident(wrapper)), termNames.CONSTRUCTOR), Nil) - )) - } -} \ No newline at end of file diff --git a/tests/pending/run/t6992/Test_2.scala b/tests/pending/run/t6992/Test_2.scala deleted file mode 100644 index 5d1a64eac..000000000 --- a/tests/pending/run/t6992/Test_2.scala +++ /dev/null @@ -1,14 +0,0 @@ -import scala.language.reflectiveCalls - -object Test extends dotty.runtime.LegacyApp { - val foo = Macros.foo("T") - val ttpe = scala.reflect.runtime.universe.weakTypeOf[foo.T] - println(ttpe) - println(ttpe.typeSymbol.info) - - val bar = Macros.bar("test") - println(bar.test) - - val baz = Macros.baz("test") - println(baz.test) -} \ No newline at end of file diff --git a/tests/pending/run/t7008-scala-defined.check b/tests/pending/run/t7008-scala-defined.check deleted file mode 100644 index 84ed62619..000000000 --- a/tests/pending/run/t7008-scala-defined.check +++ /dev/null @@ -1,7 +0,0 @@ -: List(throws[NullPointerException]("")) -bar: List(throws[E1]("")) -baz: List(throws[IllegalStateException]("")) -============= -: List(throws[NullPointerException]("")) -bar: List(throws[E1]("")) -baz: List(throws[IllegalStateException]("")) diff --git a/tests/pending/run/t7008-scala-defined.flags b/tests/pending/run/t7008-scala-defined.flags deleted file mode 100644 index 49f2d2c4c..000000000 --- a/tests/pending/run/t7008-scala-defined.flags +++ /dev/null @@ -1 +0,0 @@ --Ybackend:GenASM diff --git a/tests/pending/run/t7008-scala-defined/Impls_Macros_2.scala b/tests/pending/run/t7008-scala-defined/Impls_Macros_2.scala deleted file mode 100644 index 330db8da7..000000000 --- a/tests/pending/run/t7008-scala-defined/Impls_Macros_2.scala +++ /dev/null @@ -1,13 +0,0 @@ -import language.experimental.macros -import scala.reflect.macros.blackbox.Context - -object Macros { - def impl(c: Context) = { - import c.universe._ - val decls = c.typeOf[ScalaClassWithCheckedExceptions_1[_]].decls.toList - val s = decls.sortBy(_.name.toString).map(decl => (s"${decl.name}: ${decl.annotations}")).mkString(scala.compat.Platform.EOL) - reify(println(c.Expr[String](Literal(Constant(s))).splice)) - } - - def foo = macro impl -} \ No newline at end of file diff --git a/tests/pending/run/t7008-scala-defined/ScalaClassWithCheckedExceptions_1.scala b/tests/pending/run/t7008-scala-defined/ScalaClassWithCheckedExceptions_1.scala deleted file mode 100644 index 7783c873e..000000000 --- a/tests/pending/run/t7008-scala-defined/ScalaClassWithCheckedExceptions_1.scala +++ /dev/null @@ -1,6 +0,0 @@ -class ScalaClassWithCheckedExceptions_1[E1 <: Exception] @throws[NullPointerException]("") () { - @throws[E1]("") def bar() {} - @throws[IllegalStateException]("") def baz(x: Int) {} - // FIXME: SI-7066 - // @throws[E2]("") def foo[E2 <: Exception] {} -} \ No newline at end of file diff --git a/tests/pending/run/t7008-scala-defined/Test_3.scala b/tests/pending/run/t7008-scala-defined/Test_3.scala deleted file mode 100644 index 23adb88b2..000000000 --- a/tests/pending/run/t7008-scala-defined/Test_3.scala +++ /dev/null @@ -1,9 +0,0 @@ -import scala.reflect.runtime.universe._ - -object Test extends dotty.runtime.LegacyApp { - Macros.foo - println("=============") - - val decls = typeOf[ScalaClassWithCheckedExceptions_1[_]].decls.toList - decls sortBy (_.name.toString) foreach (decl => println(s"${decl.name}: ${decl.annotations}")) -} \ No newline at end of file diff --git a/tests/pending/run/t7008.check b/tests/pending/run/t7008.check deleted file mode 100644 index ee077f90f..000000000 --- a/tests/pending/run/t7008.check +++ /dev/null @@ -1,9 +0,0 @@ -: List(throws[NullPointerException](classOf[java.lang.NullPointerException])) -bar: List(throws[Exception](classOf[java.lang.Exception])) -baz: List(throws[IllegalStateException](classOf[java.lang.IllegalStateException])) -foo: List(throws[Exception](classOf[java.lang.Exception])) -============= -: List(throws[java.lang.NullPointerException](classOf[java.lang.NullPointerException])) -bar: List(throws[java.lang.Exception](classOf[java.lang.Exception])) -baz: List(throws[java.lang.IllegalStateException](classOf[java.lang.IllegalStateException])) -foo: List(throws[java.lang.Exception](classOf[java.lang.Exception])) diff --git a/tests/pending/run/t7008/Impls_Macros_2.scala b/tests/pending/run/t7008/Impls_Macros_2.scala deleted file mode 100644 index 3c6fe116c..000000000 --- a/tests/pending/run/t7008/Impls_Macros_2.scala +++ /dev/null @@ -1,13 +0,0 @@ -import language.experimental.macros -import scala.reflect.macros.blackbox.Context - -object Macros { - def impl(c: Context) = { - import c.universe._ - val decls = c.typeOf[JavaClassWithCheckedExceptions_1[_]].decls.toList - val s = decls.sortBy(_.name.toString).map(decl => (s"${decl.name}: ${decl.annotations}")).mkString(scala.compat.Platform.EOL) - reify(println(c.Expr[String](Literal(Constant(s))).splice)) - } - - def foo = macro impl -} \ No newline at end of file diff --git a/tests/pending/run/t7008/JavaClassWithCheckedExceptions_1.java b/tests/pending/run/t7008/JavaClassWithCheckedExceptions_1.java deleted file mode 100644 index dda212830..000000000 --- a/tests/pending/run/t7008/JavaClassWithCheckedExceptions_1.java +++ /dev/null @@ -1,7 +0,0 @@ -class JavaClassWithCheckedExceptions_1 { - public JavaClassWithCheckedExceptions_1() throws NullPointerException {} - - public void bar() throws E1 {} - public void baz(int x) throws IllegalStateException {} - public void foo() throws E2 {} -} \ No newline at end of file diff --git a/tests/pending/run/t7008/Test_3.scala b/tests/pending/run/t7008/Test_3.scala deleted file mode 100644 index 00e0eb684..000000000 --- a/tests/pending/run/t7008/Test_3.scala +++ /dev/null @@ -1,9 +0,0 @@ -import scala.reflect.runtime.universe._ - -object Test extends dotty.runtime.LegacyApp { - Macros.foo - println("=============") - - val decls = typeOf[JavaClassWithCheckedExceptions_1[_]].decls.toList - decls sortBy (_.name.toString) foreach (decl => println(s"${decl.name}: ${decl.annotations}")) -} \ No newline at end of file diff --git a/tests/pending/run/t7044.check b/tests/pending/run/t7044.check deleted file mode 100644 index ab523873b..000000000 --- a/tests/pending/run/t7044.check +++ /dev/null @@ -1,14 +0,0 @@ -compile-time -uninitialized File: -initialized File: -uninitialized BitSet: -initialized BitSet: -uninitialized C: Test_2.scala -initialized C: Test_2.scala -runtime -autoinitialized File: true -autoinitialized File: true -autoinitialized BitSet: true -autoinitialized BitSet: true -autoinitialized C: true -autoinitialized C: true diff --git a/tests/pending/run/t7044/Macros_1.scala b/tests/pending/run/t7044/Macros_1.scala deleted file mode 100644 index 3b3f8c338..000000000 --- a/tests/pending/run/t7044/Macros_1.scala +++ /dev/null @@ -1,26 +0,0 @@ -import scala.reflect.macros.whitebox._ -import scala.language.experimental.macros - -object Macros { - def impl(c: Context) = { - var messages = List[String]() - def println(msg: String) = messages :+= msg - - import c.universe._ - def test(tpe: Type): Unit = { - val sym = tpe.typeSymbol - println(s"uninitialized ${sym.name}: ${sym.pos.source.file.name}") - internal.initialize(sym) - println(s"initialized ${sym.name}: ${sym.pos.source.file.name}") - } - - println("compile-time") - test(typeOf[java.io.File]) - test(typeOf[scala.collection.BitSet]) - test(c.mirror.staticClass("C").toType) - - q"..${messages.map(msg => q"println($msg)")}" - } - - def foo: Any = macro impl -} \ No newline at end of file diff --git a/tests/pending/run/t7044/Test_2.scala b/tests/pending/run/t7044/Test_2.scala deleted file mode 100644 index e7a34d04c..000000000 --- a/tests/pending/run/t7044/Test_2.scala +++ /dev/null @@ -1,19 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{currentMirror => cm} - -class C - -object Test extends dotty.runtime.LegacyApp { - def test(tpe: Type): Unit = { - val sym = tpe.typeSymbol - println(s"autoinitialized ${sym.name}: ${sym.pos.source.file.name} ${sym.pos.source.file.sizeOption.nonEmpty}") - internal.initialize(sym) - println(s"autoinitialized ${sym.name}: ${sym.pos.source.file.name} ${sym.pos.source.file.sizeOption.nonEmpty}") - } - - Macros.foo - println("runtime") - test(typeOf[java.io.File]) - test(typeOf[scala.collection.BitSet]) - test(typeOf[C]) -} diff --git a/tests/pending/run/t7047.check b/tests/pending/run/t7047.check deleted file mode 100644 index 32bd58109..000000000 --- a/tests/pending/run/t7047.check +++ /dev/null @@ -1,3 +0,0 @@ -Test_2.scala:2: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses - Macros.foo - ^ diff --git a/tests/pending/run/t7047/Impls_Macros_1.scala b/tests/pending/run/t7047/Impls_Macros_1.scala deleted file mode 100644 index 787ea6cfe..000000000 --- a/tests/pending/run/t7047/Impls_Macros_1.scala +++ /dev/null @@ -1,19 +0,0 @@ -import scala.reflect.macros.blackbox.Context -import language.experimental.macros - -class Foo - -object Macros { - def impl(c: Context) = { - import c.universe._ - try { - c.inferImplicitValue(typeOf[Foo], silent = false) - c.abort(c.enclosingPosition, "silent=false is not working") - } catch { - case _: Exception => - } - c.Expr[Null](Literal(Constant(null))) - } - - def foo = macro impl -} \ No newline at end of file diff --git a/tests/pending/run/t7047/Test_2.scala b/tests/pending/run/t7047/Test_2.scala deleted file mode 100644 index 0fc472aa6..000000000 --- a/tests/pending/run/t7047/Test_2.scala +++ /dev/null @@ -1,3 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - Macros.foo -} \ No newline at end of file diff --git a/tests/pending/run/t7157.check b/tests/pending/run/t7157.check deleted file mode 100644 index d00491fd7..000000000 --- a/tests/pending/run/t7157.check +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/tests/pending/run/t7157/Impls_Macros_1.scala b/tests/pending/run/t7157/Impls_Macros_1.scala deleted file mode 100644 index cc258b016..000000000 --- a/tests/pending/run/t7157/Impls_Macros_1.scala +++ /dev/null @@ -1,15 +0,0 @@ -import scala.reflect.macros.blackbox.Context -import language.experimental.macros - -object Macros { - object AImpl { - def a(ctx: Context)(args: ctx.Expr[Any]*): ctx.Expr[Unit] = { - import ctx.universe._ - ctx.Expr[Unit](Apply(Ident(TermName("println")), List(Literal(Constant(1))))) - } - } - - implicit class A(context: StringContext) { - def a(args: Any*): Unit = macro AImpl.a - } -} \ No newline at end of file diff --git a/tests/pending/run/t7157/Test_2.scala b/tests/pending/run/t7157/Test_2.scala deleted file mode 100644 index be0d54d75..000000000 --- a/tests/pending/run/t7157/Test_2.scala +++ /dev/null @@ -1,5 +0,0 @@ -import Macros._ - -object Test extends dotty.runtime.LegacyApp { - a"" -} \ No newline at end of file diff --git a/tests/pending/run/t7185.check b/tests/pending/run/t7185.check deleted file mode 100644 index e4f80a8ff..000000000 --- a/tests/pending/run/t7185.check +++ /dev/null @@ -1,32 +0,0 @@ -Type in expressions to have them evaluated. -Type :help for more information. - -scala> import scala.tools.reflect.ToolBox -import scala.tools.reflect.ToolBox - -scala> import scala.reflect.runtime.universe._ -import scala.reflect.runtime.universe._ - -scala> object O { def apply() = 0 } -defined object O - -scala> val ORef = reify { O }.tree -ORef: reflect.runtime.universe.Tree = $read.O - -scala> val tree = Apply(Block(Nil, Block(Nil, ORef)), Nil) -tree: reflect.runtime.universe.Apply = -{ - { - $read.O - } -}() - -scala> {val tb = reflect.runtime.currentMirror.mkToolBox(); tb.typecheck(tree): Any} -res0: Any = -{ - { - $read.O.apply() - } -} - -scala> :quit diff --git a/tests/pending/run/t7185.scala b/tests/pending/run/t7185.scala deleted file mode 100644 index 62d64246b..000000000 --- a/tests/pending/run/t7185.scala +++ /dev/null @@ -1,12 +0,0 @@ -import scala.tools.partest.ReplTest - -object Test extends ReplTest { - override def code = """ -import scala.tools.reflect.ToolBox -import scala.reflect.runtime.universe._ -object O { def apply() = 0 } -val ORef = reify { O }.tree -val tree = Apply(Block(Nil, Block(Nil, ORef)), Nil) -{val tb = reflect.runtime.currentMirror.mkToolBox(); tb.typecheck(tree): Any} -""" -} diff --git a/tests/pending/run/t7235.check b/tests/pending/run/t7235.check deleted file mode 100644 index 9cb9c55a0..000000000 --- a/tests/pending/run/t7235.check +++ /dev/null @@ -1,4 +0,0 @@ -C -List(C) -private val _ = _ -List() diff --git a/tests/pending/run/t7235.scala b/tests/pending/run/t7235.scala deleted file mode 100644 index 2e6af545d..000000000 --- a/tests/pending/run/t7235.scala +++ /dev/null @@ -1,14 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -class C - -object Test extends dotty.runtime.LegacyApp { - val Block(List(ValDef(_, _, tpt: CompoundTypeTree, _)), _) = reify{ val x: C{} = ??? }.tree - println(tpt) - println(tpt.templ.parents) - println(tpt.templ.self) - println(tpt.templ.body) -} diff --git a/tests/pending/run/t7240/Macros_1.scala b/tests/pending/run/t7240/Macros_1.scala deleted file mode 100644 index b24b607d1..000000000 --- a/tests/pending/run/t7240/Macros_1.scala +++ /dev/null @@ -1,48 +0,0 @@ -package bakery - -import scala.language.experimental.macros -import scala.reflect.macros.blackbox.Context - -trait FailureCake { - implicit def liftAnyFails[T: Manifest]: Any = ??? - - // This works - // implicit def liftAny[T]: Any = ??? -} - -object Bakery { - - def failure: Any = macro failureImpl - def failureImpl(c: Context): c.Expr[Any] = { - import c.universe._ - - def dslTrait(dslName: String) = { - val names = dslName.split("\\.").toList.reverse - assert(names.length >= 1, "DSL trait name must be in the valid format. DSL trait name is " + dslName) - - val tpeName = newTypeName(names.head) - names.tail.reverse match { - case head :: tail ⇒ - Select(tail.foldLeft[Tree](Ident(newTermName(head)))((tree, name) ⇒ Select(tree, newTermName(name))), tpeName) - case Nil ⇒ - Ident(tpeName) - } - } - - def composeDSL(transformedBody: Tree) = - ClassDef(Modifiers(), newTypeName("eval"), List(), Template( - List(dslTrait("bakery.FailureCake")), - emptyValDef, - List( - DefDef(Modifiers(), termNames.CONSTRUCTOR, List(), List(List()), TypeTree(), - Block(List(Apply(Select(Super(This(typeNames.EMPTY), typeNames.EMPTY), termNames.CONSTRUCTOR), List())), Literal(Constant(())))), - DefDef(Modifiers(), newTermName("main"), List(), List(List()), Ident(newTypeName("Any")), transformedBody)))) - - def constructor = Apply(Select(New(Ident(newTypeName("eval"))), termNames.CONSTRUCTOR), List()) - - c.eval(c.Expr[Any]( - c.untypecheck(Block(composeDSL(Literal(Constant(1))), constructor)))) - - c.Expr[Any](Literal(Constant(1))) - } -} \ No newline at end of file diff --git a/tests/pending/run/t7240/Test_2.scala b/tests/pending/run/t7240/Test_2.scala deleted file mode 100644 index 27d2893d3..000000000 --- a/tests/pending/run/t7240/Test_2.scala +++ /dev/null @@ -1,3 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - val v = bakery.Bakery.failure -} diff --git a/tests/pending/run/t7375b.check b/tests/pending/run/t7375b.check deleted file mode 100644 index d7578e28b..000000000 --- a/tests/pending/run/t7375b.check +++ /dev/null @@ -1,4 +0,0 @@ -Predef.this.classOf[C1] -Predef.this.classOf[C2] -Predef.this.classOf[C1] -Predef.this.classOf[C2] diff --git a/tests/pending/run/t7375b/Macros_1.scala b/tests/pending/run/t7375b/Macros_1.scala deleted file mode 100644 index b6090e730..000000000 --- a/tests/pending/run/t7375b/Macros_1.scala +++ /dev/null @@ -1,18 +0,0 @@ -import language.experimental.macros -import scala.reflect.macros.blackbox.Context - -class C1(val n: Int) extends AnyVal -class C2(val n: Int) extends AnyRef - -object Macros { - type F1 = C1 - type F2 = C2 - - def foo = macro impl - def impl(c: Context) = { - import c.universe._ - def test[T: c.TypeTag] = reify(println(c.Expr[String](Literal(Constant(c.reifyRuntimeClass(c.typeOf[T]).toString))).splice)).tree - def tests = Block(List(test[C1], test[C2], test[F1], test[F2]), Literal(Constant(()))) - c.Expr[Unit](tests) - } -} \ No newline at end of file diff --git a/tests/pending/run/t7375b/Test_2.scala b/tests/pending/run/t7375b/Test_2.scala deleted file mode 100644 index 0fc472aa6..000000000 --- a/tests/pending/run/t7375b/Test_2.scala +++ /dev/null @@ -1,3 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - Macros.foo -} \ No newline at end of file diff --git a/tests/pending/run/t7558.scala b/tests/pending/run/t7558.scala deleted file mode 100644 index 26163555f..000000000 --- a/tests/pending/run/t7558.scala +++ /dev/null @@ -1,9 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - val cm = reflect.runtime.currentMirror - val u = cm.universe - import scala.tools.reflect.ToolBox - val tb = cm.mkToolBox() - val t = { var x = "ab".toList; u.reify { x = x.reverse; x }.tree } - val evaluated = tb.eval(t) - assert(evaluated == "ba".toList, evaluated) -} diff --git a/tests/pending/run/t7617a.check b/tests/pending/run/t7617a.check deleted file mode 100644 index 94954abda..000000000 --- a/tests/pending/run/t7617a.check +++ /dev/null @@ -1,2 +0,0 @@ -hello -world diff --git a/tests/pending/run/t7617a/Macros_1.scala b/tests/pending/run/t7617a/Macros_1.scala deleted file mode 100644 index 77b18c20e..000000000 --- a/tests/pending/run/t7617a/Macros_1.scala +++ /dev/null @@ -1,22 +0,0 @@ -import scala.reflect.macros.blackbox.Context -import language.experimental.macros - -object Macros { - def getValueImpl[T](c: Context): c.Expr[T] = { - import c.universe._ - c.Expr[T](Apply(Select(c.prefix.tree, newTermName("getVal")), Nil)) - } - def setValueImpl[T](c: Context)(value: c.Expr[T]): c.Expr[Unit] = { - import c.universe._ - c.Expr[Unit](Apply(Select(c.prefix.tree, newTermName("setVal")), List(value.tree))) - } -} - -object Module { - private var _val: String = "hello" - def setVal(value: String): Unit = this._val = value - def getVal(): String = this._val - - def value: String = macro Macros.getValueImpl[String] - def value_=(value: String): Unit = macro Macros.setValueImpl[String] -} diff --git a/tests/pending/run/t7617a/Test_2.scala b/tests/pending/run/t7617a/Test_2.scala deleted file mode 100644 index aaf268a8c..000000000 --- a/tests/pending/run/t7617a/Test_2.scala +++ /dev/null @@ -1,5 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - println(Module.value) - Module.value = "world" - println(Module.value) -} \ No newline at end of file diff --git a/tests/pending/run/t7617b.check b/tests/pending/run/t7617b.check deleted file mode 100644 index 81ec7e8b7..000000000 --- a/tests/pending/run/t7617b.check +++ /dev/null @@ -1 +0,0 @@ -foo = 2 diff --git a/tests/pending/run/t7617b/Macros_1.scala b/tests/pending/run/t7617b/Macros_1.scala deleted file mode 100644 index 90fcfda47..000000000 --- a/tests/pending/run/t7617b/Macros_1.scala +++ /dev/null @@ -1,8 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Macros { - def impl(c: Context)(name: c.Expr[String])(value: c.Expr[Any]) = { - import c.universe._ - reify(println(s"${name.splice} = ${value.splice}")) - } -} \ No newline at end of file diff --git a/tests/pending/run/t7617b/Test_2.scala b/tests/pending/run/t7617b/Test_2.scala deleted file mode 100644 index 0ce77a1c7..000000000 --- a/tests/pending/run/t7617b/Test_2.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.language.dynamics -import language.experimental.macros - -class C extends Dynamic { - def updateDynamic(name: String)(value: Any): Unit = macro Macros.impl -} - -object Test extends dotty.runtime.LegacyApp { - val c = new C - c.foo = 2 -} \ No newline at end of file diff --git a/tests/pending/run/t7657.check b/tests/pending/run/t7657.check deleted file mode 100644 index c25d8d1c1..000000000 --- a/tests/pending/run/t7657.check +++ /dev/null @@ -1,3 +0,0 @@ -() -() -() diff --git a/tests/pending/run/t7657/Macros_1.scala b/tests/pending/run/t7657/Macros_1.scala deleted file mode 100644 index a883f76bc..000000000 --- a/tests/pending/run/t7657/Macros_1.scala +++ /dev/null @@ -1,8 +0,0 @@ -import scala.reflect.macros.blackbox.Context -import language.experimental.macros - -trait T { def t(): Unit } -abstract class A extends T { override def t(): Unit = () } - -object Macro { def t(c: Context)(): c.Expr[Unit] = c.universe.reify(()) } -class C extends A { override def t(): Unit = macro Macro.t } diff --git a/tests/pending/run/t7657/Test_2.scala b/tests/pending/run/t7657/Test_2.scala deleted file mode 100644 index 68dfb5c8b..000000000 --- a/tests/pending/run/t7657/Test_2.scala +++ /dev/null @@ -1,6 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - val c = new C() - println(c.t()) - println((c: T).t()) - println((c: A).t()) -} diff --git a/tests/pending/run/t7777.check b/tests/pending/run/t7777.check deleted file mode 100644 index 162ff2d2a..000000000 --- a/tests/pending/run/t7777.check +++ /dev/null @@ -1,7 +0,0 @@ -foo(1, 2) -bar(4, 5) -foo(3) -bar(7) -apply(6) -apply(9) -foo(8) diff --git a/tests/pending/run/t7777/Macros_1.scala b/tests/pending/run/t7777/Macros_1.scala deleted file mode 100644 index 1dc6d6740..000000000 --- a/tests/pending/run/t7777/Macros_1.scala +++ /dev/null @@ -1,17 +0,0 @@ -import scala.language.experimental.macros -import scala.language.dynamics -import scala.reflect.macros.whitebox.Context - -class DynMacro extends Dynamic { - def applyDynamic(s: String)(xs: Any*): DynMacro = - macro DynMacro.applyDynamicMacro -} - -object DynMacro extends DynMacro { - def applyDynamicMacro(c: Context)(s: c.Expr[String])(xs: c.Expr[Any]*): c.Expr[DynMacro] = { - import c.universe._ - val Literal(Constant(n: String)) = s.tree - val args = xs.map(_.tree.toString).mkString("(", ", ", ")") - c.Expr(q"println(${ n + args }); ${c.prefix.tree}") - } -} \ No newline at end of file diff --git a/tests/pending/run/t7777/Test_2.scala b/tests/pending/run/t7777/Test_2.scala deleted file mode 100644 index 7f84f64e4..000000000 --- a/tests/pending/run/t7777/Test_2.scala +++ /dev/null @@ -1,6 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - DynMacro.foo(1, 2) // prints "foo(1, 2)" - DynMacro.foo(3).bar(4, 5) // prints "bar(4, 5)", then "foo(3)" - DynMacro(6).bar(7) // prints "bar(7)", then "apply(6)" - DynMacro.foo(8)(9) // Fails! -} \ No newline at end of file diff --git a/tests/pending/run/t7868b.check b/tests/pending/run/t7868b.check deleted file mode 100644 index 6577c4bc4..000000000 --- a/tests/pending/run/t7868b.check +++ /dev/null @@ -1,6 +0,0 @@ -Expr[Int]({ - val x = (0: Short): @unchecked match { - case A((x @ _)) => x - }; - x -}) diff --git a/tests/pending/run/t7868b.scala b/tests/pending/run/t7868b.scala deleted file mode 100644 index 33d33f10a..000000000 --- a/tests/pending/run/t7868b.scala +++ /dev/null @@ -1,11 +0,0 @@ -object A { - def unapply(n: Int): Option[Int] = Some(1) -} - -object Test extends dotty.runtime.LegacyApp { - import reflect.runtime.universe._ - println(reify { - val A(x) = (0: Short) - x - }) -} diff --git a/tests/pending/run/t7871.check b/tests/pending/run/t7871.check deleted file mode 100644 index ce6efd812..000000000 --- a/tests/pending/run/t7871.check +++ /dev/null @@ -1 +0,0 @@ -(SomeTree,SomeTree) diff --git a/tests/pending/run/t7871/Macros_1.scala b/tests/pending/run/t7871/Macros_1.scala deleted file mode 100644 index dca250812..000000000 --- a/tests/pending/run/t7871/Macros_1.scala +++ /dev/null @@ -1,27 +0,0 @@ -import scala.reflect.macros.whitebox.Context -import language.experimental.macros - -trait Tree -case object SomeTree extends Tree - -object NewQuasiquotes { - implicit class QuasiquoteInterpolation(c: StringContext) { - object nq { - def unapply(t: Tree): Any = macro QuasiquoteMacros.unapplyImpl - } - } -} - -object QuasiquoteMacros { - def unapplyImpl(c: Context)(t: c.Tree) = { - import c.universe._ - q""" - new { - def unapply(t: Tree) = t match { - case SomeTree => Some((SomeTree, SomeTree)) - case _ => None - } - }.unapply($t) - """ - } -} diff --git a/tests/pending/run/t7871/Test_2.scala b/tests/pending/run/t7871/Test_2.scala deleted file mode 100644 index 55a8320b3..000000000 --- a/tests/pending/run/t7871/Test_2.scala +++ /dev/null @@ -1,6 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - import NewQuasiquotes._ - SomeTree match { - case nq"$x + $y" => println((x, y)) - } -} diff --git a/tests/pending/run/t8048a.check b/tests/pending/run/t8048a.check deleted file mode 100644 index 8fb9e26e8..000000000 --- a/tests/pending/run/t8048a.check +++ /dev/null @@ -1 +0,0 @@ -Some(2) diff --git a/tests/pending/run/t8048a/Macros_1.scala b/tests/pending/run/t8048a/Macros_1.scala deleted file mode 100644 index d13e851d9..000000000 --- a/tests/pending/run/t8048a/Macros_1.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.reflect.macros.whitebox.Context -import scala.language.experimental.macros - -object Macros { - def impl(c: Context) = { - import c.universe._ - q"if (true) Some(2) else None" - } - - def foo: Any = macro impl -} \ No newline at end of file diff --git a/tests/pending/run/t8048a/Test_2.scala b/tests/pending/run/t8048a/Test_2.scala deleted file mode 100644 index 623a22a3a..000000000 --- a/tests/pending/run/t8048a/Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - val x: Option[Int] = Macros.foo - println(x) -} \ No newline at end of file diff --git a/tests/pending/run/t8048b.check b/tests/pending/run/t8048b.check deleted file mode 100644 index 083edaac2..000000000 --- a/tests/pending/run/t8048b.check +++ /dev/null @@ -1,3 +0,0 @@ -2 -2 -2 diff --git a/tests/pending/run/t8048b/Macros_1.scala b/tests/pending/run/t8048b/Macros_1.scala deleted file mode 100644 index 520a6fac0..000000000 --- a/tests/pending/run/t8048b/Macros_1.scala +++ /dev/null @@ -1,37 +0,0 @@ -// see the following discussions to understand what's being tested here: -// * https://issues.scala-lang.org/browse/SI-6992 -// * https://issues.scala-lang.org/browse/SI-8048 -// * http://stackoverflow.com/questions/14370842/getting-a-structural-type-with-an-anonymous-classs-methods-from-a-macro -// * http://stackoverflow.com/questions/18480707/method-cannot-be-accessed-in-macro-generated-class/18485004#18485004 -// * https://groups.google.com/forum/#!topic/scala-internals/eXQt-BPm4i8 - -import scala.language.experimental.macros -import scala.reflect.macros.whitebox.Context - -object Macros { - def impl1(c: Context) = { - import c.universe._ - q""" - trait Foo { def x = 2 } - new Foo {} - """ - } - def foo1: Any = macro impl1 - - def impl2(c: Context) = { - import c.universe._ - q""" - class Foo { def x = 2 } - new Foo - """ - } - def foo2: Any = macro impl2 - - def impl3(c: Context) = { - import c.universe._ - q""" - new { def x = 2 } - """ - } - def foo3: Any = macro impl3 -} \ No newline at end of file diff --git a/tests/pending/run/t8048b/Test_2.scala b/tests/pending/run/t8048b/Test_2.scala deleted file mode 100644 index 8474a34ec..000000000 --- a/tests/pending/run/t8048b/Test_2.scala +++ /dev/null @@ -1,5 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - println(Macros.foo1.x) - println(Macros.foo2.x) - println(Macros.foo3.x) -} \ No newline at end of file diff --git a/tests/pending/run/t8104.check b/tests/pending/run/t8104.check deleted file mode 100644 index 40523a286..000000000 --- a/tests/pending/run/t8104.check +++ /dev/null @@ -1,2 +0,0 @@ -WeakTypeTag[.this.Repr] -(Int, Int) diff --git a/tests/pending/run/t8104/Macros_1.scala b/tests/pending/run/t8104/Macros_1.scala deleted file mode 100644 index e135bd807..000000000 --- a/tests/pending/run/t8104/Macros_1.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.reflect.macros.whitebox.Context - -object Macros { - def impl[T](c: Context)(implicit T: c.WeakTypeTag[T]) = { - import c.universe._ - import definitions._ - val fields = T.tpe.decls.toList.collect{ case x: TermSymbol if x.isVal && x.isCaseAccessor => x } - val Repr = appliedType(TupleClass(fields.length).asType.toType, fields.map(_.info)) - q"new Generic[$T]{ type Repr = $Repr }" - } -} \ No newline at end of file diff --git a/tests/pending/run/t8104/Test_2.scala b/tests/pending/run/t8104/Test_2.scala deleted file mode 100644 index 4e97cdf9d..000000000 --- a/tests/pending/run/t8104/Test_2.scala +++ /dev/null @@ -1,19 +0,0 @@ -trait Generic[T] { type Repr } -object Generic { - type Aux[T, Repr0] = Generic[T] { type Repr = Repr0 } - import scala.language.experimental.macros - implicit def materializeGeneric[T, Repr]: Generic.Aux[T, Repr] = macro Macros.impl[T] -} - -object Test extends dotty.runtime.LegacyApp { - case class C(x: Int, y: Int) - - import scala.reflect.runtime.universe._ - def reprify[T, Repr](x: T)(implicit generic: Generic.Aux[T, Repr], tag: WeakTypeTag[Repr]) = { - println(tag) - println(tag.tpe.typeSymbol.info) - } - reprify(C(40, 2)) - - implicitly[Generic.Aux[C, (Int, Int)]] -} diff --git a/tests/pending/run/t8192.check b/tests/pending/run/t8192.check deleted file mode 100644 index 2423a7acb..000000000 --- a/tests/pending/run/t8192.check +++ /dev/null @@ -1,32 +0,0 @@ -compile-time -package scala -primary constructor: NoSymbol -object List -primary constructor: def (): scala.collection.immutable.List.type => true -def (): scala.collection.immutable.List.type => true -trait Product1 -primary constructor: def $init$(): Unit => true -class UninitializedFieldError -primary constructor: def (msg: String): UninitializedFieldError => true -def (msg: String): UninitializedFieldError => true -def (obj: Any): UninitializedFieldError => false -class C -primary constructor: def (x: Int): C => true -def (x: Int): C => true -def (x: String): C => false -runtime -package scala -primary constructor: NoSymbol -object List -primary constructor: def (): scala.collection.immutable.List.type => true -def (): scala.collection.immutable.List.type => true -trait Product1 -primary constructor: def $init$(): Unit => true -class UninitializedFieldError -primary constructor: def (msg: String): UninitializedFieldError => true -def (msg: String): UninitializedFieldError => true -def (obj: Any): UninitializedFieldError => false -class C -primary constructor: def (x: Int): C => true -def (x: Int): C => true -def (x: String): C => false diff --git a/tests/pending/run/t8192/Macros_1.scala b/tests/pending/run/t8192/Macros_1.scala deleted file mode 100644 index 72fb2cf31..000000000 --- a/tests/pending/run/t8192/Macros_1.scala +++ /dev/null @@ -1,45 +0,0 @@ -import scala.reflect.macros.whitebox._ -import scala.language.experimental.macros -import java.io._ - -object Macros { - def impl(c: Context) = { - var messages = List[String]() - def println(msg: String) = messages :+= msg - - import c.universe._ - def test(sym: ClassSymbol): Unit = { - def fullyInitializeSymbol(sym: Symbol): Unit = { - val internal = c.universe.asInstanceOf[scala.reflect.internal.SymbolTable] - internal.definitions.fullyInitializeSymbol(sym.asInstanceOf[internal.Symbol]) - } - def defString(sym: Symbol): String = { - val internal = c.universe.asInstanceOf[scala.reflect.internal.SymbolTable] - sym.asInstanceOf[internal.Symbol].defString - } - def showCtor(sym: Symbol): String = { - fullyInitializeSymbol(sym) - if (sym == NoSymbol) "NoSymbol" - else s"${defString(sym)} => ${sym.asMethod.isPrimaryConstructor}" - } - sym.info - println(sym.toString) - println(s"primary constructor: ${showCtor(sym.primaryConstructor)}") - val ctors = sym.info.members.filter(_.name == termNames.CONSTRUCTOR).map(sym => showCtor(sym)) - ctors.toList.sorted.foreach(println) - } - - println("compile-time") - // SI-8367 primaryConstructor for Java-defined classes is unstable, so I'm commenting this out - // test(typeOf[File].typeSymbol.asClass) - test(definitions.ScalaPackageClass) - test(definitions.ListModule.moduleClass.asClass) - test(typeOf[Product1[_]].typeSymbol.asClass) - test(typeOf[UninitializedFieldError].typeSymbol.asClass) - test(c.mirror.staticClass("C").asClass) - - q"..${messages.map(msg => q"println($msg)")}" - } - - def foo: Any = macro impl -} \ No newline at end of file diff --git a/tests/pending/run/t8192/Test_2.scala b/tests/pending/run/t8192/Test_2.scala deleted file mode 100644 index dec90ab66..000000000 --- a/tests/pending/run/t8192/Test_2.scala +++ /dev/null @@ -1,40 +0,0 @@ -import java.io._ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} - -class C(x: Int) { - def this(x: String) = this(x.toInt) -} - -object Test extends dotty.runtime.LegacyApp { - def test(sym: ClassSymbol): Unit = { - def fullyInitializeSymbol(sym: Symbol): Unit = { - val internal = ru.asInstanceOf[scala.reflect.internal.SymbolTable] - internal.definitions.fullyInitializeSymbol(sym.asInstanceOf[internal.Symbol]) - } - def defString(sym: Symbol): String = { - val internal = ru.asInstanceOf[scala.reflect.internal.SymbolTable] - sym.asInstanceOf[internal.Symbol].defString - } - def showCtor(sym: Symbol): String = { - fullyInitializeSymbol(sym) - if (sym == NoSymbol) "NoSymbol" - else s"${defString(sym)} => ${sym.asMethod.isPrimaryConstructor}" - } - sym.info - println(sym.toString) - println(s"primary constructor: ${showCtor(sym.primaryConstructor)}") - val ctors = sym.info.members.filter(_.name == termNames.CONSTRUCTOR).map(sym => showCtor(sym)) - ctors.toList.sorted.foreach(println) - } - - Macros.foo - println("runtime") - // SI-8367 primaryConstructor for Java-defined classes is unstable, so I'm commenting this out - // test(typeOf[File].typeSymbol.asClass) - test(definitions.ScalaPackageClass) - test(definitions.ListModule.moduleClass.asClass) - test(typeOf[Product1[_]].typeSymbol.asClass) - test(typeOf[UninitializedFieldError].typeSymbol.asClass) - test(typeOf[C].typeSymbol.asClass) -} diff --git a/tests/pending/run/t8321.check b/tests/pending/run/t8321.check deleted file mode 100644 index 0cfbf0888..000000000 --- a/tests/pending/run/t8321.check +++ /dev/null @@ -1 +0,0 @@ -2 diff --git a/tests/pending/run/t8321/Macros_1.scala b/tests/pending/run/t8321/Macros_1.scala deleted file mode 100644 index 70e44fc76..000000000 --- a/tests/pending/run/t8321/Macros_1.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.reflect.macros.whitebox._ -import scala.language.experimental.macros - -class Bundle(val c: Context) { - import c.universe._ - def impl = q"new { val x = 2 }" -} - -object Macros { - def foo: Any = macro Bundle.impl -} \ No newline at end of file diff --git a/tests/pending/run/t8321/Test_2.scala b/tests/pending/run/t8321/Test_2.scala deleted file mode 100644 index d49442117..000000000 --- a/tests/pending/run/t8321/Test_2.scala +++ /dev/null @@ -1,3 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - println(Macros.foo.x) -} \ No newline at end of file diff --git a/tests/pending/run/t8425.check b/tests/pending/run/t8425.check deleted file mode 100644 index 8379fa0a7..000000000 --- a/tests/pending/run/t8425.check +++ /dev/null @@ -1 +0,0 @@ -List(fresh$macro$1, $macro$2) diff --git a/tests/pending/run/t8425/Macros_1.scala b/tests/pending/run/t8425/Macros_1.scala deleted file mode 100644 index 71a96518e..000000000 --- a/tests/pending/run/t8425/Macros_1.scala +++ /dev/null @@ -1,12 +0,0 @@ -import scala.language.experimental.macros -import scala.reflect.macros.blackbox.Context - -object Macros { - def foo: Unit = macro impl - def impl(c: Context) = { - import c.universe._ - val test1 = c.freshName() - val test2 = c.freshName("$") - q"println(List($test1, $test2))" - } -} \ No newline at end of file diff --git a/tests/pending/run/t8425/Test_2.scala b/tests/pending/run/t8425/Test_2.scala deleted file mode 100644 index 0fc472aa6..000000000 --- a/tests/pending/run/t8425/Test_2.scala +++ /dev/null @@ -1,3 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - Macros.foo -} \ No newline at end of file diff --git a/tests/pending/run/t8437.check b/tests/pending/run/t8437.check deleted file mode 100644 index fd3c81a4d..000000000 --- a/tests/pending/run/t8437.check +++ /dev/null @@ -1,2 +0,0 @@ -5 -5 diff --git a/tests/pending/run/t8437/Macros_1.scala b/tests/pending/run/t8437/Macros_1.scala deleted file mode 100644 index 6286ea2a8..000000000 --- a/tests/pending/run/t8437/Macros_1.scala +++ /dev/null @@ -1,18 +0,0 @@ -import scala.language.experimental.macros -import scala.reflect.macros._ - -abstract class AbstractBundle(val c: blackbox.Context) { - import c.Expr - import c.universe._ - def foo: Expr[Int] = Expr[Int](q"5") -} - -class ConcreteBundle(override val c: blackbox.Context) extends AbstractBundle(c) { - import c.Expr - val bar: Expr[Int] = foo -} - -object InvokeBundle { - def foo: Int = macro ConcreteBundle.foo // nope - def bar: Int = macro ConcreteBundle.bar // yep -} \ No newline at end of file diff --git a/tests/pending/run/t8437/Test_2.scala b/tests/pending/run/t8437/Test_2.scala deleted file mode 100644 index fef54005f..000000000 --- a/tests/pending/run/t8437/Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - println(InvokeBundle.foo) - println(InvokeBundle.bar) -} \ No newline at end of file diff --git a/tests/pending/run/toolbox_console_reporter.check b/tests/pending/run/toolbox_console_reporter.check deleted file mode 100644 index 1395c6874..000000000 --- a/tests/pending/run/toolbox_console_reporter.check +++ /dev/null @@ -1,8 +0,0 @@ -hello -============compiler console============= -warning: method foo in object Utils is deprecated: test - -========================================= -============compiler messages============ -Info(NoPosition,method foo in object Utils is deprecated: test,WARNING) -========================================= diff --git a/tests/pending/run/toolbox_console_reporter.scala b/tests/pending/run/toolbox_console_reporter.scala deleted file mode 100644 index 53cbcb0fb..000000000 --- a/tests/pending/run/toolbox_console_reporter.scala +++ /dev/null @@ -1,28 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.{ToolBox, mkConsoleFrontEnd} - -object Test extends dotty.runtime.LegacyApp { - //val oldErr = Console.err; - val baos = new java.io.ByteArrayOutputStream() - val errs = new java.io.PrintStream(baos) - (Console withErr errs) { - val toolbox = cm.mkToolBox(frontEnd = mkConsoleFrontEnd(), options = "-deprecation") - toolbox.eval(reify{ - object Utils { - @deprecated("test", "2.10.0") - def foo: Unit = { println("hello") } - } - - Utils.foo - }.tree) - println("============compiler console=============") - errs.flush() - println(baos.toString); - println("=========================================") - println("============compiler messages============") - toolbox.frontEnd.infos.foreach(println(_)) - println("=========================================") - } -} diff --git a/tests/pending/run/toolbox_current_run_compiles.check b/tests/pending/run/toolbox_current_run_compiles.check deleted file mode 100644 index da29283aa..000000000 --- a/tests/pending/run/toolbox_current_run_compiles.check +++ /dev/null @@ -1,2 +0,0 @@ -true -false diff --git a/tests/pending/run/toolbox_current_run_compiles.scala b/tests/pending/run/toolbox_current_run_compiles.scala deleted file mode 100644 index 702741c2e..000000000 --- a/tests/pending/run/toolbox_current_run_compiles.scala +++ /dev/null @@ -1,28 +0,0 @@ -package pkg { - import scala.reflect.macros.blackbox.Context - import scala.language.experimental.macros - - object Macros { - def impl[T: c.WeakTypeTag](c: Context) = { - import c.universe._ - val sym = c.weakTypeOf[T].typeSymbol - val g = c.universe.asInstanceOf[scala.tools.nsc.Global] - c.Expr[Boolean](Literal(Constant(g.currentRun.compiles(sym.asInstanceOf[g.Symbol])))) - } - def compiles[T]: Boolean = macro impl[T] - } -} - -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.tools.reflect.ToolBox - -object Test extends dotty.runtime.LegacyApp { - val cm = ru.runtimeMirror(getClass.getClassLoader) - val toolbox = cm.mkToolBox() - toolbox.eval(toolbox.parse("""{ - class C - println(pkg.Macros.compiles[C]) - println(pkg.Macros.compiles[Object]) - }""")) -} diff --git a/tests/pending/run/toolbox_default_reporter_is_silent.check b/tests/pending/run/toolbox_default_reporter_is_silent.check deleted file mode 100644 index ce0136250..000000000 --- a/tests/pending/run/toolbox_default_reporter_is_silent.check +++ /dev/null @@ -1 +0,0 @@ -hello diff --git a/tests/pending/run/toolbox_default_reporter_is_silent.scala b/tests/pending/run/toolbox_default_reporter_is_silent.scala deleted file mode 100644 index 694720721..000000000 --- a/tests/pending/run/toolbox_default_reporter_is_silent.scala +++ /dev/null @@ -1,16 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Test extends dotty.runtime.LegacyApp { - val toolbox = cm.mkToolBox() - toolbox.eval(reify{ - object Utils { - @deprecated("test", "2.10.0") - def foo: Unit = { println("hello") } - } - - Utils.foo - }.tree) -} diff --git a/tests/pending/run/toolbox_silent_reporter.check b/tests/pending/run/toolbox_silent_reporter.check deleted file mode 100644 index 2d05b1e3f..000000000 --- a/tests/pending/run/toolbox_silent_reporter.check +++ /dev/null @@ -1,4 +0,0 @@ -hello -============compiler messages============ -Info(NoPosition,method foo in object Utils is deprecated: test,WARNING) -========================================= diff --git a/tests/pending/run/toolbox_silent_reporter.scala b/tests/pending/run/toolbox_silent_reporter.scala deleted file mode 100644 index 72109b822..000000000 --- a/tests/pending/run/toolbox_silent_reporter.scala +++ /dev/null @@ -1,19 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.{ToolBox, mkSilentFrontEnd} - -object Test extends dotty.runtime.LegacyApp { - val toolbox = cm.mkToolBox(options = "-deprecation", frontEnd = mkSilentFrontEnd()) - toolbox.eval(reify{ - object Utils { - @deprecated("test", "2.10.0") - def foo: Unit = { println("hello") } - } - - Utils.foo - }.tree) - println("============compiler messages============") - toolbox.frontEnd.infos.foreach(println(_)) - println("=========================================") -} diff --git a/tests/pending/run/toolbox_typecheck_macrosdisabled.check b/tests/pending/run/toolbox_typecheck_macrosdisabled.check deleted file mode 100644 index 62de37582..000000000 --- a/tests/pending/run/toolbox_typecheck_macrosdisabled.check +++ /dev/null @@ -1,41 +0,0 @@ -({ - val $u: ru.type = ru; - val $m: $u.Mirror = ru.runtimeMirror({ - final class $anon extends scala.AnyRef { - def (): <$anon: AnyRef> = { - $anon.super.(); - () - }; - () - }; - new $anon() -}.getClass().getClassLoader()); - $u.Expr.apply[Int(2)]($m, { - final class $treecreator1 extends TreeCreator { - def (): $treecreator1 = { - $treecreator1.super.(); - () - }; - def apply[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Tree = { - val $u: U = $m$untyped.universe; - val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror]; - $u.Literal.apply($u.Constant.apply(2)) - } - }; - new $treecreator1() - })($u.TypeTag.apply[Int(2)]($m, { - final class $typecreator2 extends TypeCreator { - def (): $typecreator2 = { - $typecreator2.super.(); - () - }; - def apply[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Type = { - val $u: U = $m$untyped.universe; - val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror]; - $u.internal.reificationSupport.ConstantType($u.Constant.apply(2)) - } - }; - new $typecreator2() - })) -}: ru.Expr[Int]) -ru.reify[Int](2) diff --git a/tests/pending/run/toolbox_typecheck_macrosdisabled.scala b/tests/pending/run/toolbox_typecheck_macrosdisabled.scala deleted file mode 100644 index 2aa0202e7..000000000 --- a/tests/pending/run/toolbox_typecheck_macrosdisabled.scala +++ /dev/null @@ -1,26 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox -import internal._ - -// Note: If you're looking at this test and you don't know why, you may -// have accidentally changed the way type tags reify. If so, validate -// that your changes are accurate and update the check file. - -object Test extends dotty.runtime.LegacyApp { - val toolbox = cm.mkToolBox() - val rupkg = cm.staticModule("scala.reflect.runtime.package") - val rusym = reificationSupport.selectTerm(rupkg, "universe") - val NullaryMethodType(rutpe) = rusym.info - val ru = reificationSupport.newFreeTerm("ru", scala.reflect.runtime.universe) - reificationSupport.setInfo(ru, rutpe) - - val tree1 = Apply(Select(Ident(ru), TermName("reify")), List(Literal(Constant(2)))) - val ttree1 = toolbox.typecheck(tree1, withMacrosDisabled = false) - println(ttree1) - - val tree2 = Apply(Select(Ident(ru), TermName("reify")), List(Literal(Constant(2)))) - val ttree2 = toolbox.typecheck(tree2, withMacrosDisabled = true) - println(ttree2) -} diff --git a/tests/pending/run/toolbox_typecheck_macrosdisabled2.check b/tests/pending/run/toolbox_typecheck_macrosdisabled2.check deleted file mode 100644 index 86f89504d..000000000 --- a/tests/pending/run/toolbox_typecheck_macrosdisabled2.check +++ /dev/null @@ -1,41 +0,0 @@ -({ - val $u: ru.type = ru; - val $m: $u.Mirror = ru.runtimeMirror({ - final class $anon extends scala.AnyRef { - def (): <$anon: AnyRef> = { - $anon.super.(); - () - }; - () - }; - new $anon() -}.getClass().getClassLoader()); - $u.Expr.apply[Array[Int]]($m, { - final class $treecreator1 extends TreeCreator { - def (): $treecreator1 = { - $treecreator1.super.(); - () - }; - def apply[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Tree = { - val $u: U = $m$untyped.universe; - val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror]; - $u.Apply.apply($u.Select.apply($u.internal.reificationSupport.mkIdent($m.staticModule("scala.Array")), $u.TermName.apply("apply")), scala.collection.immutable.List.apply[$u.Literal]($u.Literal.apply($u.Constant.apply(2)))) - } - }; - new $treecreator1() - })($u.TypeTag.apply[Array[Int]]($m, { - final class $typecreator2 extends TypeCreator { - def (): $typecreator2 = { - $typecreator2.super.(); - () - }; - def apply[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Type = { - val $u: U = $m$untyped.universe; - val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror]; - $u.internal.reificationSupport.TypeRef($u.internal.reificationSupport.ThisType($m.staticPackage("scala").asModule.moduleClass), $m.staticClass("scala.Array"), scala.collection.immutable.List.apply[$u.Type]($m.staticClass("scala.Int").asType.toTypeConstructor)) - } - }; - new $typecreator2() - })) -}: ru.Expr[Array[Int]]) -ru.reify[Array[Int]](scala.Array.apply(2)) diff --git a/tests/pending/run/toolbox_typecheck_macrosdisabled2.scala b/tests/pending/run/toolbox_typecheck_macrosdisabled2.scala deleted file mode 100644 index c554110ed..000000000 --- a/tests/pending/run/toolbox_typecheck_macrosdisabled2.scala +++ /dev/null @@ -1,26 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox -import internal._ - -// Note: If you're looking at this test and you don't know why, you may -// have accidentally changed the way type tags reify. If so, validate -// that your changes are accurate and update the check file. - -object Test extends dotty.runtime.LegacyApp { - val toolbox = cm.mkToolBox() - val rupkg = cm.staticModule("scala.reflect.runtime.package") - val rusym = reificationSupport.selectTerm(rupkg, "universe") - val NullaryMethodType(rutpe) = rusym.info - val ru = reificationSupport.newFreeTerm("ru", scala.reflect.runtime.universe) - reificationSupport.setInfo(ru, rutpe) - - val tree1 = Apply(Select(Ident(ru), TermName("reify")), List(Apply(Select(Ident(TermName("scala")), TermName("Array")), List(Literal(Constant(2)))))) - val ttree1 = toolbox.typecheck(tree1, withMacrosDisabled = false) - println(ttree1) - - val tree2 = Apply(Select(Ident(ru), TermName("reify")), List(Apply(Select(Ident(TermName("scala")), TermName("Array")), List(Literal(Constant(2)))))) - val ttree2 = toolbox.typecheck(tree2, withMacrosDisabled = true) - println(ttree2) -} diff --git a/tests/pending/run/typecheck.check b/tests/pending/run/typecheck.check deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/pending/run/typecheck/Macros_1.scala b/tests/pending/run/typecheck/Macros_1.scala deleted file mode 100644 index ee1c8da76..000000000 --- a/tests/pending/run/typecheck/Macros_1.scala +++ /dev/null @@ -1,12 +0,0 @@ -import scala.reflect.macros.whitebox._ -import scala.language.experimental.macros - -object Macros { - def impl(c: Context) = { - import c.universe._ - c.typecheck(q"class C") - q"()" - } - - def foo: Any = macro impl -} \ No newline at end of file diff --git a/tests/pending/run/typecheck/Test_2.scala b/tests/pending/run/typecheck/Test_2.scala deleted file mode 100644 index b79cc3b31..000000000 --- a/tests/pending/run/typecheck/Test_2.scala +++ /dev/null @@ -1,10 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Test extends dotty.runtime.LegacyApp { - Macros.foo - - val tb = cm.mkToolBox() - tb.typecheck(q"class C") -} \ No newline at end of file diff --git a/tests/pending/run/typed-annotated.check b/tests/pending/run/typed-annotated.check deleted file mode 100644 index d81cc0710..000000000 --- a/tests/pending/run/typed-annotated.check +++ /dev/null @@ -1 +0,0 @@ -42 diff --git a/tests/pending/run/typed-annotated/Macros_1.scala b/tests/pending/run/typed-annotated/Macros_1.scala deleted file mode 100644 index 4f0660dc4..000000000 --- a/tests/pending/run/typed-annotated/Macros_1.scala +++ /dev/null @@ -1,17 +0,0 @@ -import scala.reflect.macros.blackbox.Context -import language.experimental.macros - -class ann extends scala.annotation.StaticAnnotation - -object Macros { - def impl(c: Context) = { - import c.universe._ - // val tpt = Annotated(Apply(Select(New(Ident(newTypeName("ann"))), termNames.CONSTRUCTOR), List()), Ident(newTypeName("Int"))) - val tpt = Annotated(Apply(Select(New(Ident(newTypeName("ann"))), termNames.CONSTRUCTOR), List()), TypeTree(weakTypeOf[Int])) - c.Expr[Unit](Block( - List(ValDef(Modifiers(), newTermName("x"), tpt, Literal(Constant(42)))), - Apply(Ident(newTermName("println")), List(Ident(newTermName("x")))))) - } - - def foo = macro impl -} \ No newline at end of file diff --git a/tests/pending/run/typed-annotated/Test_2.scala b/tests/pending/run/typed-annotated/Test_2.scala deleted file mode 100644 index 0fc472aa6..000000000 --- a/tests/pending/run/typed-annotated/Test_2.scala +++ /dev/null @@ -1,3 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - Macros.foo -} \ No newline at end of file -- cgit v1.2.3