diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2014-02-17 12:08:28 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2014-02-17 12:13:20 +0100 |
commit | 3ca9038d08dd4a528ae15ee93d44fc7f1392de4e (patch) | |
tree | efc189a76947191215cb0f48ca1b6b7895bc5667 /test/files/run | |
parent | 6ef6c96eff2f0d2f505d45a1436d73a960193076 (diff) | |
download | scala-3ca9038d08dd4a528ae15ee93d44fc7f1392de4e.tar.gz scala-3ca9038d08dd4a528ae15ee93d44fc7f1392de4e.tar.bz2 scala-3ca9038d08dd4a528ae15ee93d44fc7f1392de4e.zip |
Revert "SI-5920 enables default and named args in macros"
This reverts commit a02e053a5dec134f7c7dc53a2c1091039218237d.
That commit lead to an error compiling Specs2:
[info] [warn] /localhome/jenkinsdbuild/workspace/Community-2.11.x-retronym/dbuild-0.7.1-M1/target-0.7.1-M1/project-builds/specs2-aaa8091b47a34817ca90134ace8b09a9e0f854e9/core/src/test/scala/org/specs2/text/EditDistanceSpec.scala:6: Unused import
[info] [warn] import DiffShortener._
[info] [warn] ^
[info] [error] /localhome/jenkinsdbuild/workspace/Community-2.11.x-retronym/dbuild-0.7.1-M1/target-0.7.1-M1/project-builds/specs2-aaa8091b47a34817ca90134ace8b09a9e0f854e9/core/src/test/scala/org/specs2/text/LinesContentDifferenceSpec.scala:7: exception during macro expansion:
[info] [error] java.lang.UnsupportedOperationException: Position.point on NoPosition
[info] [error] at scala.reflect.internal.util.Position.fail(Position.scala:53)
[info] [error] at scala.reflect.internal.util.UndefinedPosition.point(Position.scala:131)
[info] [error] at scala.reflect.internal.util.UndefinedPosition.point(Position.scala:126)
[info] [error] at org.specs2.reflect.Macros$.sourceOf(Macros.scala:25)
[info] [error] at org.specs2.reflect.Macros$.stringExpr(Macros.scala:19)
Diffstat (limited to 'test/files/run')
9 files changed, 3 insertions, 184 deletions
diff --git a/test/files/run/macro-expand-default-named.check b/test/files/run/macro-expand-default-named.check deleted file mode 100644 index 2d75772572..0000000000 --- a/test/files/run/macro-expand-default-named.check +++ /dev/null @@ -1,56 +0,0 @@ -Test.this.one(2, -40) = 42 -Test.this.one(y = -40, x = 2) = 42 -Test.this.one(2, -40) = 42 -Test.this.one(100) = 140 -Test.this.one(y = 100) = -98 -Test.this.one(100) = 140 -Test.this.one() = 42 -Test.this.qualone.one(2, -40) = 42 -Test.this.qualone.one(y = -40, x = 2) = 42 -Test.this.qualone.one(2, -40) = 42 -Test.this.qualone.one(x = 100) = 140 -Test.this.qualone.one(y = 100) = -98 -Test.this.qualone.one(x = 100) = 140 -Test.this.qualone.one() = 42 -Test.this.onezero(2, -40)(1, 2) = 41 -Test.this.onezero(y = -40, x = 2)(z = 3, w = 4) = 41 -Test.this.onezero(2, -40)(5, 6) = 41 -Test.this.onezero(100)(7, 8) = 139 -Test.this.onezero(y = 100)(z = 9, w = 10) = -99 -Test.this.onezero(100)(11, 12) = 139 -Test.this.onezero()(13, 14) = 41 -Test.this.qualonezero.onezero(2, -40)(15, 16) = 41 -Test.this.qualonezero.onezero(y = -40, x = 2)(z = 17, w = 18) = 41 -Test.this.qualonezero.onezero(2, -40)(19, 20) = 41 -Test.this.qualonezero.onezero(x = 100)(z = 21, w = 22) = 139 -Test.this.qualonezero.onezero(y = 100)(z = 23, w = 24) = -99 -Test.this.qualonezero.onezero(x = 100)(z = 25, w = 26) = 139 -Test.this.qualonezero.onezero()(z = 27, w = 28) = 41 -Test.this.zeroone(1, 2)(2, -40) = 41 -Test.this.zeroone(x = 3, y = 4)(w = -40, z = 2) = 41 -Test.this.zeroone(5, 6)(2, -40) = 41 -Test.this.zeroone(x = 7, y = 8)(z = 100) = 139 -Test.this.zeroone(x = 9, y = 10)(w = 100) = -99 -Test.this.zeroone(x = 11, y = 12)(z = 100) = 139 -Test.this.zeroone(x = 13, y = 14)() = 41 -Test.this.qualzeroone.zeroone(15, 16)(2, -40) = 41 -Test.this.qualzeroone.zeroone(x = 17, y = 18)(w = -40, z = 2) = 41 -Test.this.qualzeroone.zeroone(19, 20)(2, -40) = 41 -Test.this.qualzeroone.zeroone(x = 21, y = 22)(z = 100) = 139 -Test.this.qualzeroone.zeroone(x = 23, y = 24)(w = 100) = -99 -Test.this.qualzeroone.zeroone(x = 25, y = 26)(z = 100) = 139 -Test.this.qualzeroone.zeroone(x = 27, y = 28)() = 41 -Test.this.oneone(2, -40)(2, -40) = 84 -Test.this.oneone(y = -40, x = 2)(w = -40, z = 2) = 84 -Test.this.oneone(2, -40)(2, -40) = 84 -Test.this.oneone(x = 100)(z = 100) = 280 -Test.this.oneone(y = 100)(w = 100) = -196 -Test.this.oneone(x = 100)(z = 100) = 280 -Test.this.oneone()() = 84 -Test.this.qualoneone.oneone(2, -40)(2, -40) = 84 -Test.this.qualoneone.oneone(y = -40, x = 2)(w = -40, z = 2) = 84 -Test.this.qualoneone.oneone(2, -40)(2, -40) = 84 -Test.this.qualoneone.oneone(x = 100)(z = 100) = 280 -Test.this.qualoneone.oneone(y = 100)(w = 100) = -196 -Test.this.qualoneone.oneone(x = 100)(z = 100) = 280 -Test.this.qualoneone.oneone()() = 84 diff --git a/test/files/run/macro-expand-default-named/Impls_1.scala b/test/files/run/macro-expand-default-named/Impls_1.scala deleted file mode 100644 index 73774cd56a..0000000000 --- a/test/files/run/macro-expand-default-named/Impls_1.scala +++ /dev/null @@ -1,37 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def one(c: Context)(x: c.Tree, y: c.Tree) = { - import c.universe._ - val x1 = x orElse q"2" - val y1 = y orElse q"-40" - q"println(${c.macroApplication.toString + " = "} + ($x1 - $y1))" - } - - def onezero(c: Context)(x: c.Tree, y: c.Tree)(z: c.Tree, w: c.Tree) = { - import c.universe._ - val x1 = x orElse q"2" - val y1 = y orElse q"-40" - val z1 = z - val w1 = w - q"println(${c.macroApplication.toString + " = "} + ($x1 - $y1 + $z1 - $w1))" - } - - def zeroone(c: Context)(x: c.Tree, y: c.Tree)(z: c.Tree, w: c.Tree) = { - import c.universe._ - val x1 = x - val y1 = y - val z1 = z orElse q"2" - val w1 = w orElse q"-40" - q"println(${c.macroApplication.toString + " = "} + ($x1 - $y1 + $z1 - $w1))" - } - - def oneone(c: Context)(x: c.Tree, y: c.Tree)(z: c.Tree, w: c.Tree) = { - import c.universe._ - val x1 = x orElse q"2" - val y1 = y orElse q"-40" - val z1 = z orElse q"2" - val w1 = w orElse q"-40" - q"println(${c.macroApplication.toString + " = "} + ($x1 - $y1 + $z1 - $w1))" - } -}
\ No newline at end of file diff --git a/test/files/run/macro-expand-default-named/Macros_Test_2.scala b/test/files/run/macro-expand-default-named/Macros_Test_2.scala deleted file mode 100644 index e58eddd9a3..0000000000 --- a/test/files/run/macro-expand-default-named/Macros_Test_2.scala +++ /dev/null @@ -1,71 +0,0 @@ -import scala.language.experimental.macros - -object Test extends App { - def one(x: Int = 2, y: Int = -40): Unit = macro Impls.one - one(2, -40) - one(y = -40, x = 2) - one(x = 2, y = -40) - one(x = 100) - one(y = 100) - one(100) - one() - var qualone = this - qualone.one(2, -40) - qualone.one(y = -40, x = 2) - qualone.one(x = 2, y = -40) - qualone.one(x = 100) - qualone.one(y = 100) - qualone.one(100) - qualone.one() - - def onezero(x: Int = 2, y: Int = -40)(z: Int, w: Int): Unit = macro Impls.onezero - onezero(2, -40)(1, 2) - onezero(y = -40, x = 2)(3, 4) - onezero(x = 2, y = -40)(5, 6) - onezero(x = 100)(7, 8) - onezero(y = 100)(9, 10) - onezero(100)(11, 12) - onezero()(13, 14) - var qualonezero = this - qualonezero.onezero(2, -40)(15, 16) - qualonezero.onezero(y = -40, x = 2)(17, 18) - qualonezero.onezero(x = 2, y = -40)(19, 20) - qualonezero.onezero(x = 100)(21, 22) - qualonezero.onezero(y = 100)(23, 24) - qualonezero.onezero(100)(25, 26) - qualonezero.onezero()(27, 28) - - def zeroone(x: Int, y: Int)(z: Int = 2, w: Int = -40): Unit = macro Impls.zeroone - zeroone(1, 2)(2, -40) - zeroone(3, 4)(w = -40, z = 2) - zeroone(5, 6)(z = 2, w = -40) - zeroone(7, 8)(z = 100) - zeroone(9, 10)(w = 100) - zeroone(11, 12)(100) - zeroone(13, 14)() - var qualzeroone = this - qualzeroone.zeroone(15, 16)(2, -40) - qualzeroone.zeroone(17, 18)(w = -40, z = 2) - qualzeroone.zeroone(19, 20)(z = 2, w = -40) - qualzeroone.zeroone(21, 22)(z = 100) - qualzeroone.zeroone(23, 24)(w = 100) - qualzeroone.zeroone(25, 26)(100) - qualzeroone.zeroone(27, 28)() - - def oneone(x: Int = 2, y: Int = -40)(z: Int = 2, w: Int = -40): Unit = macro Impls.oneone - oneone(2, -40)(2, -40) - oneone(y = -40, x = 2)(w = -40, z = 2) - oneone(x = 2, y = -40)(z = 2, w = -40) - oneone(x = 100)(z = 100) - oneone(y = 100)(w = 100) - oneone(100)(100) - oneone()() - var qualoneone = this - qualoneone.oneone(2, -40)(2, -40) - qualoneone.oneone(y = -40, x = 2)(w = -40, z = 2) - qualoneone.oneone(x = 2, y = -40)(z = 2, w = -40) - qualoneone.oneone(x = 100)(z = 100) - qualoneone.oneone(y = 100)(w = 100) - qualoneone.oneone(100)(100) - qualoneone.oneone()() -}
\ No newline at end of file diff --git a/test/files/run/macro-expand-ownerchain-a.check b/test/files/run/macro-expand-ownerchain-a.check deleted file mode 100644 index 51993f072d..0000000000 --- a/test/files/run/macro-expand-ownerchain-a.check +++ /dev/null @@ -1,2 +0,0 @@ -2 -2 diff --git a/test/files/run/macro-expand-ownerchain-a/Macros_1.scala b/test/files/run/macro-expand-ownerchain-a/Macros_1.scala deleted file mode 100644 index 0d11c24ad1..0000000000 --- a/test/files/run/macro-expand-ownerchain-a/Macros_1.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.reflect.macros.whitebox._ -import scala.language.experimental.macros - -object Macros { - def impl(c: Context)(x: c.Tree, y: c.Tree) = { - import c.universe._ - q"println($x)" - } - - def foo(x: Int, y: Int): Unit = macro impl -}
\ No newline at end of file diff --git a/test/files/run/macro-expand-ownerchain-a/Test_2.scala b/test/files/run/macro-expand-ownerchain-a/Test_2.scala deleted file mode 100644 index 738afc75df..0000000000 --- a/test/files/run/macro-expand-ownerchain-a/Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends App { - Macros.foo(y = 1, x = ((x: Int) => x)(2)) - Macros.foo(y = 1, x = {val x = 2; x}) -}
\ No newline at end of file diff --git a/test/files/run/macro-invalidusage-partialapplication-with-tparams.check b/test/files/run/macro-invalidusage-partialapplication-with-tparams.check index f1061e00f7..6cbcb9e5af 100644 --- a/test/files/run/macro-invalidusage-partialapplication-with-tparams.check +++ b/test/files/run/macro-invalidusage-partialapplication-with-tparams.check @@ -1,3 +1,3 @@ reflective compilation has failed: -missing arguments for macro method foo in object Macros +too few argument lists for macro invocation diff --git a/test/files/run/macro-invalidusage-partialapplication.check b/test/files/run/macro-invalidusage-partialapplication.check index f1061e00f7..6cbcb9e5af 100644 --- a/test/files/run/macro-invalidusage-partialapplication.check +++ b/test/files/run/macro-invalidusage-partialapplication.check @@ -1,3 +1,3 @@ reflective compilation has failed: -missing arguments for macro method foo in object Macros +too few argument lists for macro invocation diff --git a/test/files/run/reify-repl-fail-gracefully.check b/test/files/run/reify-repl-fail-gracefully.check index c78d95dbed..29ccee3cc6 100644 --- a/test/files/run/reify-repl-fail-gracefully.check +++ b/test/files/run/reify-repl-fail-gracefully.check @@ -10,7 +10,7 @@ import scala.reflect.runtime.universe._ scala> scala> reify -<console>:12: error: missing arguments for macro method reify in class Universe +<console>:12: error: too few argument lists for macro invocation reify ^ |