diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2012-11-16 14:56:55 -0800 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2012-11-16 14:56:55 -0800 |
commit | 6645fec23ab3ee7d12f5cfc7c474a42f0eb7ec15 (patch) | |
tree | a4f4cd998a558990315530e67fb06068b836d8ad /test/files/neg | |
parent | b091cbda7e3a22f0d4554159b27b1bb30cf4a3a9 (diff) | |
parent | ed44df6c85e82bc6d4731ed232de53bdbeadb2e1 (diff) | |
download | scala-6645fec23ab3ee7d12f5cfc7c474a42f0eb7ec15.tar.gz scala-6645fec23ab3ee7d12f5cfc7c474a42f0eb7ec15.tar.bz2 scala-6645fec23ab3ee7d12f5cfc7c474a42f0eb7ec15.zip |
Merge pull request #1623 from paulp/merge-2.10.x
Merge 2.10.0-wip/.x into master
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/t6323a.check | 2 | ||||
-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 |
4 files changed, 27 insertions, 1 deletions
diff --git a/test/files/neg/t6323a.check b/test/files/neg/t6323a.check index 670247887c..a80c9a0a81 100644 --- a/test/files/neg/t6323a.check +++ b/test/files/neg/t6323a.check @@ -1,6 +1,6 @@ t6323a.scala:11: `package`.this.materializeTypeTag[Test](scala.reflect.runtime.`package`.universe) is not a valid implicit value for reflect.runtime.universe.TypeTag[Test] because: failed to typecheck the materialized tag: -cannot create a TypeTag referring to local class Test.Test +cannot create a TypeTag referring to local class Test.Test: use WeakTypeTag instead val value = u.typeOf[Test] ^ t6323a.scala:11: error: No TypeTag available for Test 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 +} |