From e5d34d70499504e085ddf957c1c818ffb63f4e8d Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Thu, 13 Dec 2012 00:46:06 +0100 Subject: the scanner is now less eager about deprecations When healing braces it isn't very useful to report deprecation warnings, especially since this process is just simple context-free skimming, which can't know about what positions can accept what identifiers. --- test/files/neg/macro-false-deprecation-warning.check | 4 ++++ test/files/neg/macro-false-deprecation-warning.flags | 1 + .../macro-false-deprecation-warning/Impls_Macros_1.scala | 15 +++++++++++++++ 3 files changed, 20 insertions(+) create mode 100644 test/files/neg/macro-false-deprecation-warning.check create mode 100644 test/files/neg/macro-false-deprecation-warning.flags create mode 100644 test/files/neg/macro-false-deprecation-warning/Impls_Macros_1.scala (limited to 'test') diff --git a/test/files/neg/macro-false-deprecation-warning.check b/test/files/neg/macro-false-deprecation-warning.check new file mode 100644 index 0000000000..7d56505ec4 --- /dev/null +++ b/test/files/neg/macro-false-deprecation-warning.check @@ -0,0 +1,4 @@ +Impls_Macros_1.scala:5: error: illegal start of simple expression +} +^ +one error found diff --git a/test/files/neg/macro-false-deprecation-warning.flags b/test/files/neg/macro-false-deprecation-warning.flags new file mode 100644 index 0000000000..cd66464f2f --- /dev/null +++ b/test/files/neg/macro-false-deprecation-warning.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/test/files/neg/macro-false-deprecation-warning/Impls_Macros_1.scala b/test/files/neg/macro-false-deprecation-warning/Impls_Macros_1.scala new file mode 100644 index 0000000000..6dc2ea114b --- /dev/null +++ b/test/files/neg/macro-false-deprecation-warning/Impls_Macros_1.scala @@ -0,0 +1,15 @@ +import scala.reflect.macros.Context + +object Helper { + def unapplySeq[T](x: List[T]): Option[Seq[T]] = +} + +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] + } +} -- cgit v1.2.3