summaryrefslogtreecommitdiff
path: root/test/files/neg/t6539
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2012-11-06 23:43:44 +0100
committerJason Zaugg <jzaugg@gmail.com>2012-11-08 23:14:11 +0100
commit48ee29aa26e4e5358cb1de7890565095420177b4 (patch)
tree9b8dce70434cafafe7fc1c4afbcad7231e071ce8 /test/files/neg/t6539
parent6902da3168c02448387edc000dedfe97ef5f7cd9 (diff)
downloadscala-48ee29aa26e4e5358cb1de7890565095420177b4.tar.gz
scala-48ee29aa26e4e5358cb1de7890565095420177b4.tar.bz2
scala-48ee29aa26e4e5358cb1de7890565095420177b4.zip
Refine @compileTimeOnly
- Don't default the message, and show it exclusively. - Fix cut-and-pasto in the @since tag - Be tolerant if the annotaion class is missing, as seems to have been the case compiling the continuations plugin. - s/\t/ / in the test file to show the errors are positioned correctly. - Use defensive getOrElse
Diffstat (limited to 'test/files/neg/t6539')
-rw-r--r--test/files/neg/t6539/Macro_1.scala8
-rw-r--r--test/files/neg/t6539/Test_2.scala10
2 files changed, 9 insertions, 9 deletions
diff --git a/test/files/neg/t6539/Macro_1.scala b/test/files/neg/t6539/Macro_1.scala
index 69bd53fe07..ed52776d95 100644
--- a/test/files/neg/t6539/Macro_1.scala
+++ b/test/files/neg/t6539/Macro_1.scala
@@ -2,9 +2,9 @@ import language.experimental.macros
import reflect.macros.Context
object M {
- def m(a: Any, b: Any): Any = macro mImpl
- def mImpl(c: Context)(a: c.Expr[Any], b: c.Expr[Any]) = a
+ def m(a: Any, b: Any): Any = macro mImpl
+ def mImpl(c: Context)(a: c.Expr[Any], b: c.Expr[Any]) = a
- @reflect.macros.compileTimeOnly("cto may only be used as an argument to m")
- def cto = 0
+ @reflect.macros.compileTimeOnly("cto may only be used as an argument to " + "m")
+ def cto = 0
}
diff --git a/test/files/neg/t6539/Test_2.scala b/test/files/neg/t6539/Test_2.scala
index 1569c79788..5a602879ec 100644
--- a/test/files/neg/t6539/Test_2.scala
+++ b/test/files/neg/t6539/Test_2.scala
@@ -1,6 +1,6 @@
object Test {
- M.cto // error
- M.m(M.cto, ()) // error
- M.m((), M.cto) // okay
- M.cto // error
-} \ No newline at end of file
+ M.cto // error
+ M.m(M.cto, ()) // error
+ M.m((), M.cto) // okay
+ M.cto // error
+}