diff options
author | Martin Odersky <odersky@gmail.com> | 2012-04-13 16:57:48 -0700 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2012-04-13 16:57:48 -0700 |
commit | e9280cba72d322973b14f3bc97cd43e423774144 (patch) | |
tree | 6335e3f664f6c3d29aa2bdf36711ddad1932ca57 /test/disabled/neg | |
parent | 2744be417e1f2c461068bb2daef9fa8f11822031 (diff) | |
download | scala-e9280cba72d322973b14f3bc97cd43e423774144.tar.gz scala-e9280cba72d322973b14f3bc97cd43e423774144.tar.bz2 scala-e9280cba72d322973b14f3bc97cd43e423774144.zip |
Disabled macro neg tests that no longer make sense in this form
Diffstat (limited to 'test/disabled/neg')
51 files changed, 279 insertions, 0 deletions
diff --git a/test/disabled/neg/macro-deprecate-dont-touch-backquotedidents.check b/test/disabled/neg/macro-deprecate-dont-touch-backquotedidents.check new file mode 100644 index 0000000000..25df9a6a4a --- /dev/null +++ b/test/disabled/neg/macro-deprecate-dont-touch-backquotedidents.check @@ -0,0 +1,10 @@ +macro-deprecate-dont-touch-backquotedidents.scala:37: error: in future versions of Scala "macro" will be a keyword. consider using a different name.
+package `macro` {
+ ^
+macro-deprecate-dont-touch-backquotedidents.scala:38: error: in future versions of Scala "macro" will be a keyword. consider using a different name.
+ package `macro`.bar {
+ ^
+macro-deprecate-dont-touch-backquotedidents.scala:43: error: in future versions of Scala "macro" will be a keyword. consider using a different name.
+ package `macro`.foo {
+ ^
+three errors found
diff --git a/test/disabled/neg/macro-deprecate-dont-touch-backquotedidents.flags b/test/disabled/neg/macro-deprecate-dont-touch-backquotedidents.flags new file mode 100644 index 0000000000..e8fb65d50c --- /dev/null +++ b/test/disabled/neg/macro-deprecate-dont-touch-backquotedidents.flags @@ -0,0 +1 @@ +-Xfatal-warnings
\ No newline at end of file diff --git a/test/disabled/neg/macro-deprecate-dont-touch-backquotedidents.scala b/test/disabled/neg/macro-deprecate-dont-touch-backquotedidents.scala new file mode 100644 index 0000000000..dee2f1de3b --- /dev/null +++ b/test/disabled/neg/macro-deprecate-dont-touch-backquotedidents.scala @@ -0,0 +1,56 @@ +object Test1 { + val `macro` = ??? +} + +object Test2 { + var `macro` = ??? +} + +object Test3 { + type `macro` = Int +} + +package test4 { + class `macro` +} + +object Test5 { + class `macro` +} + +package test6 { + object `macro` +} + +object Test7 { + object `macro` +} + +package test8 { + trait `macro` +} + +object Test9 { + trait `macro` +} + +package `macro` { + package `macro`.bar { + } +} + +package foo { + package `macro`.foo { + } +} + +object Test12 { + val Some(`macro`) = Some(42) + `macro` match { + case `macro` => println(`macro`) + } +} + +object Test13 { + def `macro` = 2 +}
\ No newline at end of file diff --git a/test/disabled/neg/macro-invalidshape-d.check b/test/disabled/neg/macro-invalidshape-d.check new file mode 100644 index 0000000000..031aa653ab --- /dev/null +++ b/test/disabled/neg/macro-invalidshape-d.check @@ -0,0 +1,4 @@ +Macros_Test_2.scala:2: error: illegal start of statement
+ def foo(x: Any) = {2; macro Impls.foo}
+ ^
+one error found
diff --git a/test/disabled/neg/macro-invalidshape-d.flags b/test/disabled/neg/macro-invalidshape-d.flags new file mode 100644 index 0000000000..cd66464f2f --- /dev/null +++ b/test/disabled/neg/macro-invalidshape-d.flags @@ -0,0 +1 @@ +-language:experimental.macros
\ No newline at end of file diff --git a/test/disabled/neg/macro-invalidshape-d/Impls_1.scala b/test/disabled/neg/macro-invalidshape-d/Impls_1.scala new file mode 100644 index 0000000000..7b1620d117 --- /dev/null +++ b/test/disabled/neg/macro-invalidshape-d/Impls_1.scala @@ -0,0 +1,5 @@ +import scala.reflect.makro.{Context => Ctx} + +object Impls { + def foo(c: Ctx)(x: c.Expr[Any]) = ??? +} diff --git a/test/disabled/neg/macro-invalidshape-d/Macros_Test_2.scala b/test/disabled/neg/macro-invalidshape-d/Macros_Test_2.scala new file mode 100644 index 0000000000..bacd9a6e7c --- /dev/null +++ b/test/disabled/neg/macro-invalidshape-d/Macros_Test_2.scala @@ -0,0 +1,8 @@ +object Macros { + def foo(x: Any) = {2; macro Impls.foo} +} + +object Test extends App { + import Macros._ + foo(42) +}
\ No newline at end of file diff --git a/test/disabled/neg/macro-keyword-bind.check b/test/disabled/neg/macro-keyword-bind.check new file mode 100644 index 0000000000..1f74cfe5cd --- /dev/null +++ b/test/disabled/neg/macro-keyword-bind.check @@ -0,0 +1,7 @@ +macro-keyword-bind.scala:2: error: illegal start of simple pattern
+ val Some(macro) = Some(42)
+ ^
+macro-keyword-bind.scala:6: error: ')' expected but '}' found.
+}
+^
+two errors found
diff --git a/test/disabled/neg/macro-keyword-bind.flags b/test/disabled/neg/macro-keyword-bind.flags new file mode 100644 index 0000000000..7fea2ff901 --- /dev/null +++ b/test/disabled/neg/macro-keyword-bind.flags @@ -0,0 +1 @@ +-Xmacros
\ No newline at end of file diff --git a/test/disabled/neg/macro-keyword-bind.scala b/test/disabled/neg/macro-keyword-bind.scala new file mode 100644 index 0000000000..a3b1553348 --- /dev/null +++ b/test/disabled/neg/macro-keyword-bind.scala @@ -0,0 +1,6 @@ +object Test12 { + val Some(macro) = Some(42) + macro match { + case macro => println(macro) + } +}
\ No newline at end of file diff --git a/test/disabled/neg/macro-keyword-class1.check b/test/disabled/neg/macro-keyword-class1.check new file mode 100644 index 0000000000..d8983180ef --- /dev/null +++ b/test/disabled/neg/macro-keyword-class1.check @@ -0,0 +1,4 @@ +macro-keyword-class1.scala:3: error: identifier expected but 'macro' found.
+class macro
+ ^
+one error found
diff --git a/test/disabled/neg/macro-keyword-class1.flags b/test/disabled/neg/macro-keyword-class1.flags new file mode 100644 index 0000000000..7fea2ff901 --- /dev/null +++ b/test/disabled/neg/macro-keyword-class1.flags @@ -0,0 +1 @@ +-Xmacros
\ No newline at end of file diff --git a/test/disabled/neg/macro-keyword-class1.scala b/test/disabled/neg/macro-keyword-class1.scala new file mode 100644 index 0000000000..8635d1f4f6 --- /dev/null +++ b/test/disabled/neg/macro-keyword-class1.scala @@ -0,0 +1,3 @@ +package test4 + +class macro diff --git a/test/disabled/neg/macro-keyword-class2.check b/test/disabled/neg/macro-keyword-class2.check new file mode 100644 index 0000000000..0e4d11bcc4 --- /dev/null +++ b/test/disabled/neg/macro-keyword-class2.check @@ -0,0 +1,4 @@ +macro-keyword-class2.scala:2: error: identifier expected but 'macro' found.
+ class macro
+ ^
+one error found
diff --git a/test/disabled/neg/macro-keyword-class2.flags b/test/disabled/neg/macro-keyword-class2.flags new file mode 100644 index 0000000000..7fea2ff901 --- /dev/null +++ b/test/disabled/neg/macro-keyword-class2.flags @@ -0,0 +1 @@ +-Xmacros
\ No newline at end of file diff --git a/test/disabled/neg/macro-keyword-class2.scala b/test/disabled/neg/macro-keyword-class2.scala new file mode 100644 index 0000000000..af24a489d0 --- /dev/null +++ b/test/disabled/neg/macro-keyword-class2.scala @@ -0,0 +1,3 @@ +object Test5 { + class macro +} diff --git a/test/disabled/neg/macro-keyword-object1.check b/test/disabled/neg/macro-keyword-object1.check new file mode 100644 index 0000000000..cfbd06ffd6 --- /dev/null +++ b/test/disabled/neg/macro-keyword-object1.check @@ -0,0 +1,4 @@ +macro-keyword-object1.scala:3: error: identifier expected but 'macro' found.
+object macro
+ ^
+one error found
diff --git a/test/disabled/neg/macro-keyword-object1.flags b/test/disabled/neg/macro-keyword-object1.flags new file mode 100644 index 0000000000..7fea2ff901 --- /dev/null +++ b/test/disabled/neg/macro-keyword-object1.flags @@ -0,0 +1 @@ +-Xmacros
\ No newline at end of file diff --git a/test/disabled/neg/macro-keyword-object1.scala b/test/disabled/neg/macro-keyword-object1.scala new file mode 100644 index 0000000000..66eb494e6b --- /dev/null +++ b/test/disabled/neg/macro-keyword-object1.scala @@ -0,0 +1,3 @@ +package test6 + +object macro diff --git a/test/disabled/neg/macro-keyword-object2.check b/test/disabled/neg/macro-keyword-object2.check new file mode 100644 index 0000000000..ede31f13e5 --- /dev/null +++ b/test/disabled/neg/macro-keyword-object2.check @@ -0,0 +1,4 @@ +macro-keyword-object2.scala:2: error: identifier expected but 'macro' found.
+ object macro
+ ^
+one error found
diff --git a/test/disabled/neg/macro-keyword-object2.flags b/test/disabled/neg/macro-keyword-object2.flags new file mode 100644 index 0000000000..7fea2ff901 --- /dev/null +++ b/test/disabled/neg/macro-keyword-object2.flags @@ -0,0 +1 @@ +-Xmacros
\ No newline at end of file diff --git a/test/disabled/neg/macro-keyword-object2.scala b/test/disabled/neg/macro-keyword-object2.scala new file mode 100644 index 0000000000..6f5b9ceacd --- /dev/null +++ b/test/disabled/neg/macro-keyword-object2.scala @@ -0,0 +1,3 @@ +object Test7 { + object macro +} diff --git a/test/disabled/neg/macro-keyword-package1.check b/test/disabled/neg/macro-keyword-package1.check new file mode 100644 index 0000000000..22c1e11ded --- /dev/null +++ b/test/disabled/neg/macro-keyword-package1.check @@ -0,0 +1,4 @@ +macro-keyword-package1.scala:1: error: identifier expected but 'macro' found.
+package macro
+ ^
+one error found
diff --git a/test/disabled/neg/macro-keyword-package1.flags b/test/disabled/neg/macro-keyword-package1.flags new file mode 100644 index 0000000000..7fea2ff901 --- /dev/null +++ b/test/disabled/neg/macro-keyword-package1.flags @@ -0,0 +1 @@ +-Xmacros
\ No newline at end of file diff --git a/test/disabled/neg/macro-keyword-package1.scala b/test/disabled/neg/macro-keyword-package1.scala new file mode 100644 index 0000000000..52d3fbabf6 --- /dev/null +++ b/test/disabled/neg/macro-keyword-package1.scala @@ -0,0 +1,3 @@ +package macro + +package macro.bar
\ No newline at end of file diff --git a/test/disabled/neg/macro-keyword-package2.check b/test/disabled/neg/macro-keyword-package2.check new file mode 100644 index 0000000000..0cb542a85d --- /dev/null +++ b/test/disabled/neg/macro-keyword-package2.check @@ -0,0 +1,4 @@ +macro-keyword-package2.scala:3: error: identifier expected but 'macro' found.
+package macro.foo
+ ^
+one error found
diff --git a/test/disabled/neg/macro-keyword-package2.flags b/test/disabled/neg/macro-keyword-package2.flags new file mode 100644 index 0000000000..7fea2ff901 --- /dev/null +++ b/test/disabled/neg/macro-keyword-package2.flags @@ -0,0 +1 @@ +-Xmacros
\ No newline at end of file diff --git a/test/disabled/neg/macro-keyword-package2.scala b/test/disabled/neg/macro-keyword-package2.scala new file mode 100644 index 0000000000..a68ebd935f --- /dev/null +++ b/test/disabled/neg/macro-keyword-package2.scala @@ -0,0 +1,3 @@ +package foo + +package macro.foo diff --git a/test/disabled/neg/macro-keyword-trait1.check b/test/disabled/neg/macro-keyword-trait1.check new file mode 100644 index 0000000000..9586a62e08 --- /dev/null +++ b/test/disabled/neg/macro-keyword-trait1.check @@ -0,0 +1,4 @@ +macro-keyword-trait1.scala:3: error: identifier expected but 'macro' found.
+trait macro
+ ^
+one error found
diff --git a/test/disabled/neg/macro-keyword-trait1.flags b/test/disabled/neg/macro-keyword-trait1.flags new file mode 100644 index 0000000000..7fea2ff901 --- /dev/null +++ b/test/disabled/neg/macro-keyword-trait1.flags @@ -0,0 +1 @@ +-Xmacros
\ No newline at end of file diff --git a/test/disabled/neg/macro-keyword-trait1.scala b/test/disabled/neg/macro-keyword-trait1.scala new file mode 100644 index 0000000000..e32d4c1385 --- /dev/null +++ b/test/disabled/neg/macro-keyword-trait1.scala @@ -0,0 +1,3 @@ +package test8 + +trait macro diff --git a/test/disabled/neg/macro-keyword-trait2.check b/test/disabled/neg/macro-keyword-trait2.check new file mode 100644 index 0000000000..40aa764378 --- /dev/null +++ b/test/disabled/neg/macro-keyword-trait2.check @@ -0,0 +1,4 @@ +macro-keyword-trait2.scala:2: error: identifier expected but 'macro' found.
+ trait macro
+ ^
+one error found
diff --git a/test/disabled/neg/macro-keyword-trait2.flags b/test/disabled/neg/macro-keyword-trait2.flags new file mode 100644 index 0000000000..7fea2ff901 --- /dev/null +++ b/test/disabled/neg/macro-keyword-trait2.flags @@ -0,0 +1 @@ +-Xmacros
\ No newline at end of file diff --git a/test/disabled/neg/macro-keyword-trait2.scala b/test/disabled/neg/macro-keyword-trait2.scala new file mode 100644 index 0000000000..243a54abe6 --- /dev/null +++ b/test/disabled/neg/macro-keyword-trait2.scala @@ -0,0 +1,3 @@ +object Test9 { + trait macro +} diff --git a/test/disabled/neg/macro-keyword-type.check b/test/disabled/neg/macro-keyword-type.check new file mode 100644 index 0000000000..4a7481114c --- /dev/null +++ b/test/disabled/neg/macro-keyword-type.check @@ -0,0 +1,4 @@ +macro-keyword-type.scala:2: error: identifier expected but 'macro' found.
+ type macro = Int
+ ^
+one error found
diff --git a/test/disabled/neg/macro-keyword-type.flags b/test/disabled/neg/macro-keyword-type.flags new file mode 100644 index 0000000000..7fea2ff901 --- /dev/null +++ b/test/disabled/neg/macro-keyword-type.flags @@ -0,0 +1 @@ +-Xmacros
\ No newline at end of file diff --git a/test/disabled/neg/macro-keyword-type.scala b/test/disabled/neg/macro-keyword-type.scala new file mode 100644 index 0000000000..30e523bcaf --- /dev/null +++ b/test/disabled/neg/macro-keyword-type.scala @@ -0,0 +1,3 @@ +object Test3 { + type macro = Int +}
\ No newline at end of file diff --git a/test/disabled/neg/macro-keyword-val.check b/test/disabled/neg/macro-keyword-val.check new file mode 100644 index 0000000000..0dc4c030a9 --- /dev/null +++ b/test/disabled/neg/macro-keyword-val.check @@ -0,0 +1,7 @@ +macro-keyword-val.scala:2: error: illegal start of simple pattern
+ val macro = ???
+ ^
+macro-keyword-val.scala:3: error: '=' expected but '}' found.
+}
+^
+two errors found
diff --git a/test/disabled/neg/macro-keyword-val.flags b/test/disabled/neg/macro-keyword-val.flags new file mode 100644 index 0000000000..7fea2ff901 --- /dev/null +++ b/test/disabled/neg/macro-keyword-val.flags @@ -0,0 +1 @@ +-Xmacros
\ No newline at end of file diff --git a/test/disabled/neg/macro-keyword-val.scala b/test/disabled/neg/macro-keyword-val.scala new file mode 100644 index 0000000000..96f57acb30 --- /dev/null +++ b/test/disabled/neg/macro-keyword-val.scala @@ -0,0 +1,3 @@ +object Test1 { + val macro = ??? +}
\ No newline at end of file diff --git a/test/disabled/neg/macro-keyword-var.check b/test/disabled/neg/macro-keyword-var.check new file mode 100644 index 0000000000..96d02e0052 --- /dev/null +++ b/test/disabled/neg/macro-keyword-var.check @@ -0,0 +1,7 @@ +macro-keyword-var.scala:2: error: illegal start of simple pattern
+ var macro = ???
+ ^
+macro-keyword-var.scala:3: error: '=' expected but '}' found.
+}
+^
+two errors found
diff --git a/test/disabled/neg/macro-keyword-var.flags b/test/disabled/neg/macro-keyword-var.flags new file mode 100644 index 0000000000..cd66464f2f --- /dev/null +++ b/test/disabled/neg/macro-keyword-var.flags @@ -0,0 +1 @@ +-language:experimental.macros
\ No newline at end of file diff --git a/test/disabled/neg/macro-keyword-var.scala b/test/disabled/neg/macro-keyword-var.scala new file mode 100644 index 0000000000..a79dda6dc2 --- /dev/null +++ b/test/disabled/neg/macro-keyword-var.scala @@ -0,0 +1,3 @@ +object Test2 { + var macro = ??? +}
\ No newline at end of file diff --git a/test/disabled/neg/macro-without-xmacros-a.check b/test/disabled/neg/macro-without-xmacros-a.check new file mode 100644 index 0000000000..a3ca081f04 --- /dev/null +++ b/test/disabled/neg/macro-without-xmacros-a.check @@ -0,0 +1,10 @@ +Macros_2.scala:5: error: not found: value macro
+ def foo(x: Int): Int = macro foo_impl
+ ^
+Macros_2.scala:7: error: not found: value macro
+ def bar(x: Int): Int = macro bar_impl
+ ^
+Macros_2.scala:11: error: not found: value macro
+ def quux(x: Int): Int = macro quux_impl
+ ^
+three errors found
diff --git a/test/disabled/neg/macro-without-xmacros-a/Impls_1.scala b/test/disabled/neg/macro-without-xmacros-a/Impls_1.scala new file mode 100644 index 0000000000..2493c81c95 --- /dev/null +++ b/test/disabled/neg/macro-without-xmacros-a/Impls_1.scala @@ -0,0 +1,18 @@ +import scala.reflect.makro.{Context => Ctx} + +object Impls { + def foo_impl(c: Ctx)(x: c.Expr[Int]): c.mirror.Tree = { + import c.mirror._ + Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(1)))) + } + + def bar_impl(c: Ctx)(x: c.Expr[Int]): c.mirror.Tree = { + import c.mirror._ + Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(2)))) + } + + def quux_impl(c: Ctx)(x: c.Expr[Int]): c.mirror.Tree = { + import c.mirror._ + Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(3)))) + } +} diff --git a/test/disabled/neg/macro-without-xmacros-a/Macros_2.scala b/test/disabled/neg/macro-without-xmacros-a/Macros_2.scala new file mode 100644 index 0000000000..62f9dcf505 --- /dev/null +++ b/test/disabled/neg/macro-without-xmacros-a/Macros_2.scala @@ -0,0 +1,12 @@ +import Impls._ + +object Macros { + object Shmacros { + def foo(x: Int): Int = macro foo_impl + } + def bar(x: Int): Int = macro bar_impl +} + +class Macros { + def quux(x: Int): Int = macro quux_impl +}
\ No newline at end of file diff --git a/test/disabled/neg/macro-without-xmacros-a/Test_3.scala b/test/disabled/neg/macro-without-xmacros-a/Test_3.scala new file mode 100644 index 0000000000..e9a10e20c9 --- /dev/null +++ b/test/disabled/neg/macro-without-xmacros-a/Test_3.scala @@ -0,0 +1,4 @@ +object Test extends App { + import Macros.Shmacros._ + println(foo(2) + Macros.bar(2) * new Macros().quux(4)) +}
\ No newline at end of file diff --git a/test/disabled/neg/macro-without-xmacros-b.check b/test/disabled/neg/macro-without-xmacros-b.check new file mode 100644 index 0000000000..dce4a084c9 --- /dev/null +++ b/test/disabled/neg/macro-without-xmacros-b.check @@ -0,0 +1,10 @@ +Macros_2.scala:3: error: ';' expected but '.' found.
+ def foo(x: Int): Int = macro Impls.foo_impl
+ ^
+Macros_2.scala:5: error: ';' expected but '.' found.
+ def bar(x: Int): Int = macro Impls.bar_impl
+ ^
+Macros_2.scala:9: error: ';' expected but '.' found.
+ def quux(x: Int): Int = macro Impls.quux_impl
+ ^
+three errors found
diff --git a/test/disabled/neg/macro-without-xmacros-b/Impls_1.scala b/test/disabled/neg/macro-without-xmacros-b/Impls_1.scala new file mode 100644 index 0000000000..2493c81c95 --- /dev/null +++ b/test/disabled/neg/macro-without-xmacros-b/Impls_1.scala @@ -0,0 +1,18 @@ +import scala.reflect.makro.{Context => Ctx} + +object Impls { + def foo_impl(c: Ctx)(x: c.Expr[Int]): c.mirror.Tree = { + import c.mirror._ + Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(1)))) + } + + def bar_impl(c: Ctx)(x: c.Expr[Int]): c.mirror.Tree = { + import c.mirror._ + Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(2)))) + } + + def quux_impl(c: Ctx)(x: c.Expr[Int]): c.mirror.Tree = { + import c.mirror._ + Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(3)))) + } +} diff --git a/test/disabled/neg/macro-without-xmacros-b/Macros_2.scala b/test/disabled/neg/macro-without-xmacros-b/Macros_2.scala new file mode 100644 index 0000000000..de7080c7e8 --- /dev/null +++ b/test/disabled/neg/macro-without-xmacros-b/Macros_2.scala @@ -0,0 +1,10 @@ +object Macros { + object Shmacros { + def foo(x: Int): Int = macro Impls.foo_impl + } + def bar(x: Int): Int = macro Impls.bar_impl +} + +class Macros { + def quux(x: Int): Int = macro Impls.quux_impl +}
\ No newline at end of file diff --git a/test/disabled/neg/macro-without-xmacros-b/Test_3.scala b/test/disabled/neg/macro-without-xmacros-b/Test_3.scala new file mode 100644 index 0000000000..e9a10e20c9 --- /dev/null +++ b/test/disabled/neg/macro-without-xmacros-b/Test_3.scala @@ -0,0 +1,4 @@ +object Test extends App { + import Macros.Shmacros._ + println(foo(2) + Macros.bar(2) * new Macros().quux(4)) +}
\ No newline at end of file |