From 1be02447823f309c7450299ba7128da4b86573ad Mon Sep 17 00:00:00 2001 From: martende Date: Tue, 27 Nov 2012 17:30:20 +0100 Subject: neg test added --- test/files/neg/t5753.check | 4 ++++ test/files/neg/t5753.flags | 1 + test/files/neg/t5753/Impls$class.class | Bin 0 -> 626 bytes test/files/neg/t5753/Impls.class | Bin 0 -> 866 bytes test/files/neg/t5753/Impls_Macros_1.scala | 6 ++++++ test/files/neg/t5753/Test_2.scala | 11 +++++++++++ 6 files changed, 22 insertions(+) create mode 100644 test/files/neg/t5753.check create mode 100644 test/files/neg/t5753.flags create mode 100644 test/files/neg/t5753/Impls$class.class create mode 100644 test/files/neg/t5753/Impls.class create mode 100644 test/files/neg/t5753/Impls_Macros_1.scala create mode 100644 test/files/neg/t5753/Test_2.scala (limited to 'test') diff --git a/test/files/neg/t5753.check b/test/files/neg/t5753.check new file mode 100644 index 0000000000..76602de17d --- /dev/null +++ b/test/files/neg/t5753.check @@ -0,0 +1,4 @@ +Test_2.scala:9: error: macro implementation not found: foo (the most common reason for that is that you cannot use macro implementations in the same compilation run that defines them) + println(foo(42)) + ^ +one error found diff --git a/test/files/neg/t5753.flags b/test/files/neg/t5753.flags new file mode 100644 index 0000000000..cd66464f2f --- /dev/null +++ b/test/files/neg/t5753.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/test/files/neg/t5753/Impls$class.class b/test/files/neg/t5753/Impls$class.class new file mode 100644 index 0000000000..476329174e Binary files /dev/null and b/test/files/neg/t5753/Impls$class.class differ diff --git a/test/files/neg/t5753/Impls.class b/test/files/neg/t5753/Impls.class new file mode 100644 index 0000000000..dfcf89ed44 Binary files /dev/null and b/test/files/neg/t5753/Impls.class differ diff --git a/test/files/neg/t5753/Impls_Macros_1.scala b/test/files/neg/t5753/Impls_Macros_1.scala new file mode 100644 index 0000000000..1d9c26458c --- /dev/null +++ b/test/files/neg/t5753/Impls_Macros_1.scala @@ -0,0 +1,6 @@ +import scala.reflect.macros.{Context => Ctx} + +trait Impls { +def impl(c: Ctx)(x: c.Expr[Any]) = x +} + diff --git a/test/files/neg/t5753/Test_2.scala b/test/files/neg/t5753/Test_2.scala new file mode 100644 index 0000000000..2369b18e76 --- /dev/null +++ b/test/files/neg/t5753/Test_2.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.{Context => Ctx} + +object Macros extends Impls { + def foo(x: Any) = macro impl +} + +object Test extends App { + import Macros._ + println(foo(42)) +} + -- cgit v1.2.3