diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2012-11-14 02:48:27 -0800 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2012-11-14 02:48:27 -0800 |
commit | 850108886765e99e894f7613f49c1bab3650a0c2 (patch) | |
tree | 8e8408aeae09a8db78f0a70d0ad9c425c23e80d2 /test/files | |
parent | ace401c8084f94a5ca5c38f3a10c5eee18b65645 (diff) | |
parent | 48ee29aa26e4e5358cb1de7890565095420177b4 (diff) | |
download | scala-850108886765e99e894f7613f49c1bab3650a0c2.tar.gz scala-850108886765e99e894f7613f49c1bab3650a0c2.tar.bz2 scala-850108886765e99e894f7613f49c1bab3650a0c2.zip |
Merge pull request #1585 from retronym/ticket/6539-2
SI-6539 Annotation for methods unfit for post-typer ASTs
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/neg/t6539.check | 10 | ||||
-rw-r--r-- | test/files/neg/t6539/Macro_1.scala | 10 | ||||
-rw-r--r-- | test/files/neg/t6539/Test_2.scala | 6 |
3 files changed, 26 insertions, 0 deletions
diff --git a/test/files/neg/t6539.check b/test/files/neg/t6539.check new file mode 100644 index 0000000000..b647636338 --- /dev/null +++ b/test/files/neg/t6539.check @@ -0,0 +1,10 @@ +Test_2.scala:2: error: cto may only be used as an argument to m + M.cto // error + ^ +Test_2.scala:3: error: cto may only be used as an argument to m + M.m(M.cto, ()) // error + ^ +Test_2.scala:5: error: cto may only be used as an argument to m + M.cto // error + ^ +three errors found diff --git a/test/files/neg/t6539/Macro_1.scala b/test/files/neg/t6539/Macro_1.scala new file mode 100644 index 0000000000..ed52776d95 --- /dev/null +++ b/test/files/neg/t6539/Macro_1.scala @@ -0,0 +1,10 @@ +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 + + @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 new file mode 100644 index 0000000000..5a602879ec --- /dev/null +++ b/test/files/neg/t6539/Test_2.scala @@ -0,0 +1,6 @@ +object Test { + M.cto // error + M.m(M.cto, ()) // error + M.m((), M.cto) // okay + M.cto // error +} |