diff options
author | Josh Suereth <Joshua.Suereth@gmail.com> | 2012-08-03 21:14:20 -0700 |
---|---|---|
committer | Josh Suereth <Joshua.Suereth@gmail.com> | 2012-08-03 21:14:20 -0700 |
commit | 233b0ebe05beb32382e49bc9f3ffc76c8785b626 (patch) | |
tree | c500e384dc4811c60c1c857bdc31de1f36ca4f27 /test/files/neg | |
parent | 8a2df611d2390caa4c2e1b56433408654dfc9d9a (diff) | |
parent | 4b0f6d9ccc9023635ce6297839138fa68a5ebc33 (diff) | |
download | scala-233b0ebe05beb32382e49bc9f3ffc76c8785b626.tar.gz scala-233b0ebe05beb32382e49bc9f3ffc76c8785b626.tar.bz2 scala-233b0ebe05beb32382e49bc9f3ffc76c8785b626.zip |
Merge pull request #1042 from paulp/merge-2.10.x
Merge 2.10.x
Diffstat (limited to 'test/files/neg')
71 files changed, 195 insertions, 111 deletions
diff --git a/test/files/neg/macro-basic-mamdmi.check b/test/files/neg/macro-basic-mamdmi.check index eef444f7b3..67b00c0ec5 100644 --- a/test/files/neg/macro-basic-mamdmi.check +++ b/test/files/neg/macro-basic-mamdmi.check @@ -1,5 +1,4 @@ Impls_Macros_Test_1.scala:36: 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)
-if you do need to define macro implementations along with the rest of your program, consider two-phase compilation with -Xmacro-fallback-classpath in the second phase pointing to the output of the first phase
println(foo(2) + Macros.bar(2) * new Macros().quux(4))
^
one error found
diff --git a/test/files/neg/macro-basic-mamdmi/Impls_Macros_Test_1.scala b/test/files/neg/macro-basic-mamdmi/Impls_Macros_Test_1.scala index 8abde907bb..908438cf65 100644 --- a/test/files/neg/macro-basic-mamdmi/Impls_Macros_Test_1.scala +++ b/test/files/neg/macro-basic-mamdmi/Impls_Macros_Test_1.scala @@ -1,4 +1,4 @@ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} object Impls { def foo(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = { diff --git a/test/files/neg/macro-cyclic/Impls_Macros_1.scala b/test/files/neg/macro-cyclic/Impls_Macros_1.scala index 2ecdc3416e..ac9b7938db 100644 --- a/test/files/neg/macro-cyclic/Impls_Macros_1.scala +++ b/test/files/neg/macro-cyclic/Impls_Macros_1.scala @@ -1,4 +1,4 @@ -import scala.reflect.makro.Context +import scala.reflect.macros.Context object Macros { def impl(c: Context) = { diff --git a/test/files/neg/macro-invalidimpl-a/Impls_1.scala b/test/files/neg/macro-invalidimpl-a/Impls_1.scala index c2f1843b8b..cfa1218038 100644 --- a/test/files/neg/macro-invalidimpl-a/Impls_1.scala +++ b/test/files/neg/macro-invalidimpl-a/Impls_1.scala @@ -1,4 +1,4 @@ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} class Impls { def foo(c: Ctx)(x: c.Expr[Any]) = ??? diff --git a/test/files/neg/macro-invalidimpl-b/Impls_1.scala b/test/files/neg/macro-invalidimpl-b/Impls_1.scala index 7b1620d117..4467021545 100644 --- a/test/files/neg/macro-invalidimpl-b/Impls_1.scala +++ b/test/files/neg/macro-invalidimpl-b/Impls_1.scala @@ -1,4 +1,4 @@ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} object Impls { def foo(c: Ctx)(x: c.Expr[Any]) = ??? diff --git a/test/files/neg/macro-invalidimpl-c/Impls_Macros_1.scala b/test/files/neg/macro-invalidimpl-c/Impls_Macros_1.scala index 657e2d4260..67a0eb348b 100644 --- a/test/files/neg/macro-invalidimpl-c/Impls_Macros_1.scala +++ b/test/files/neg/macro-invalidimpl-c/Impls_Macros_1.scala @@ -1,4 +1,4 @@ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} class Macros { object Impls { diff --git a/test/files/neg/macro-invalidimpl-d/Impls_1.scala b/test/files/neg/macro-invalidimpl-d/Impls_1.scala index f18e699a1e..e0819c938c 100644 --- a/test/files/neg/macro-invalidimpl-d/Impls_1.scala +++ b/test/files/neg/macro-invalidimpl-d/Impls_1.scala @@ -1,4 +1,4 @@ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} trait MacroHelpers { object Impls { diff --git a/test/files/neg/macro-invalidimpl-e.check b/test/files/neg/macro-invalidimpl-e.check index 61d1e05b87..5cfcf85625 100644 --- a/test/files/neg/macro-invalidimpl-e.check +++ b/test/files/neg/macro-invalidimpl-e.check @@ -1,12 +1,12 @@ Macros_Test_2.scala:2: error: ambiguous reference to overloaded definition,
-both method foo in object Impls of type (c: scala.reflect.makro.Context)(x: c.Expr[Any], y: c.Expr[Any])Nothing
-and method foo in object Impls of type (c: scala.reflect.makro.Context)(x: c.Expr[Any])Nothing
+both method foo in object Impls of type (c: scala.reflect.macros.Context)(x: c.Expr[Any], y: c.Expr[Any])Nothing
+and method foo in object Impls of type (c: scala.reflect.macros.Context)(x: c.Expr[Any])Nothing
match expected type ?
def foo(x: Any) = macro Impls.foo
^
Macros_Test_2.scala:3: error: ambiguous reference to overloaded definition,
-both method foo in object Impls of type (c: scala.reflect.makro.Context)(x: c.Expr[Any], y: c.Expr[Any])Nothing
-and method foo in object Impls of type (c: scala.reflect.makro.Context)(x: c.Expr[Any])Nothing
+both method foo in object Impls of type (c: scala.reflect.macros.Context)(x: c.Expr[Any], y: c.Expr[Any])Nothing
+and method foo in object Impls of type (c: scala.reflect.macros.Context)(x: c.Expr[Any])Nothing
match expected type ?
def foo(x: Any, y: Any) = macro Impls.foo
^
diff --git a/test/files/neg/macro-invalidimpl-e/Impls_1.scala b/test/files/neg/macro-invalidimpl-e/Impls_1.scala index ad3eed5cd5..fd40119c31 100644 --- a/test/files/neg/macro-invalidimpl-e/Impls_1.scala +++ b/test/files/neg/macro-invalidimpl-e/Impls_1.scala @@ -1,4 +1,4 @@ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} object Impls { def foo(c: Ctx)(x: c.Expr[Any]) = ??? diff --git a/test/files/neg/macro-invalidimpl-f.check b/test/files/neg/macro-invalidimpl-f.check index ec82faa58c..14f1e25287 100644 --- a/test/files/neg/macro-invalidimpl-f.check +++ b/test/files/neg/macro-invalidimpl-f.check @@ -1,7 +1,7 @@ -Macros_Test_2.scala:2: error: macro implementation has wrong shape: - required: (c: scala.reflect.makro.Context)(): c.Expr[Unit] - found : (c: scala.reflect.makro.Context): c.Expr[Unit] -number of parameter sections differ - def bar1() = macro Impls.fooNullary - ^ -one error found +Macros_Test_2.scala:2: error: macro implementation has wrong shape:
+ required: (c: scala.reflect.macros.Context)(): c.Expr[Unit]
+ found : (c: scala.reflect.macros.Context): c.Expr[Unit]
+number of parameter sections differ
+ def bar1() = macro Impls.fooNullary
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidimpl-f/Impls_1.scala b/test/files/neg/macro-invalidimpl-f/Impls_1.scala index 3b8f15b90c..334ee714be 100644 --- a/test/files/neg/macro-invalidimpl-f/Impls_1.scala +++ b/test/files/neg/macro-invalidimpl-f/Impls_1.scala @@ -1,4 +1,4 @@ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} object Impls { def fooNullary(c: Ctx) = { diff --git a/test/files/neg/macro-invalidimpl-g.check b/test/files/neg/macro-invalidimpl-g.check index 9c01f01dc8..a886436d35 100644 --- a/test/files/neg/macro-invalidimpl-g.check +++ b/test/files/neg/macro-invalidimpl-g.check @@ -1,6 +1,6 @@ Macros_Test_2.scala:2: error: macro implementation has wrong shape:
- required: (c: scala.reflect.makro.Context): c.Expr[Unit]
- found : (c: scala.reflect.makro.Context)(): c.Expr[Unit]
+ required: (c: scala.reflect.macros.Context): c.Expr[Unit]
+ found : (c: scala.reflect.macros.Context)(): c.Expr[Unit]
number of parameter sections differ
def foo1 = macro Impls.fooEmpty
^
diff --git a/test/files/neg/macro-invalidimpl-g/Impls_1.scala b/test/files/neg/macro-invalidimpl-g/Impls_1.scala index 3b8f15b90c..334ee714be 100644 --- a/test/files/neg/macro-invalidimpl-g/Impls_1.scala +++ b/test/files/neg/macro-invalidimpl-g/Impls_1.scala @@ -1,4 +1,4 @@ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} object Impls { def fooNullary(c: Ctx) = { diff --git a/test/files/neg/macro-invalidimpl-h/Impls_1.scala b/test/files/neg/macro-invalidimpl-h/Impls_1.scala index 7db8bcd324..427fd3d5c0 100644 --- a/test/files/neg/macro-invalidimpl-h/Impls_1.scala +++ b/test/files/neg/macro-invalidimpl-h/Impls_1.scala @@ -1,4 +1,4 @@ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} object Impls { def foo[U <: Int](c: Ctx) = ??? diff --git a/test/files/neg/macro-invalidret-nontree.check b/test/files/neg/macro-invalidret-nontree.check index 0b793cf421..78ab08df3e 100644 --- a/test/files/neg/macro-invalidret-nontree.check +++ b/test/files/neg/macro-invalidret-nontree.check @@ -1,6 +1,6 @@ Macros_Test_2.scala:2: error: macro implementation has wrong shape:
- required: (c: scala.reflect.makro.Context): c.Expr[Any]
- found : (c: scala.reflect.makro.Context): Int
+ required: (c: scala.reflect.macros.Context): c.Expr[Any]
+ found : (c: scala.reflect.macros.Context): Int
type mismatch for return type: Int does not conform to c.Expr[Any]
def foo = macro Impls.foo
^
diff --git a/test/files/neg/macro-invalidret-nontree/Impls_1.scala b/test/files/neg/macro-invalidret-nontree/Impls_1.scala index efc8d4bfec..ef19b1b405 100644 --- a/test/files/neg/macro-invalidret-nontree/Impls_1.scala +++ b/test/files/neg/macro-invalidret-nontree/Impls_1.scala @@ -1,4 +1,4 @@ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} object Impls { def foo(c: Ctx) = 2 diff --git a/test/files/neg/macro-invalidret-nonuniversetree.check b/test/files/neg/macro-invalidret-nonuniversetree.check index 1b9487982f..09df2c0a92 100644 --- a/test/files/neg/macro-invalidret-nonuniversetree.check +++ b/test/files/neg/macro-invalidret-nonuniversetree.check @@ -1,6 +1,6 @@ Macros_Test_2.scala:2: error: macro implementation has wrong shape:
- required: (c: scala.reflect.makro.Context): c.Expr[Any]
- found : (c: scala.reflect.makro.Context): reflect.basis.Literal
+ required: (c: scala.reflect.macros.Context): c.Expr[Any]
+ found : (c: scala.reflect.macros.Context): reflect.basis.Literal
type mismatch for return type: reflect.basis.Literal does not conform to c.Expr[Any]
def foo = macro Impls.foo
^
diff --git a/test/files/neg/macro-invalidret-nonuniversetree/Impls_1.scala b/test/files/neg/macro-invalidret-nonuniversetree/Impls_1.scala index da0eb0ac83..8311d474c2 100644 --- a/test/files/neg/macro-invalidret-nonuniversetree/Impls_1.scala +++ b/test/files/neg/macro-invalidret-nonuniversetree/Impls_1.scala @@ -1,4 +1,4 @@ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} object Impls { def foo(c: Ctx) = scala.reflect.basis.Literal(scala.reflect.basis.Constant(42)) diff --git a/test/files/neg/macro-invalidshape-a/Impls_1.scala b/test/files/neg/macro-invalidshape-a/Impls_1.scala index 7b1620d117..4467021545 100644 --- a/test/files/neg/macro-invalidshape-a/Impls_1.scala +++ b/test/files/neg/macro-invalidshape-a/Impls_1.scala @@ -1,4 +1,4 @@ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} object Impls { def foo(c: Ctx)(x: c.Expr[Any]) = ??? diff --git a/test/files/neg/macro-invalidshape-b/Impls_1.scala b/test/files/neg/macro-invalidshape-b/Impls_1.scala index 7b1620d117..4467021545 100644 --- a/test/files/neg/macro-invalidshape-b/Impls_1.scala +++ b/test/files/neg/macro-invalidshape-b/Impls_1.scala @@ -1,4 +1,4 @@ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} object Impls { def foo(c: Ctx)(x: c.Expr[Any]) = ??? diff --git a/test/files/neg/macro-invalidshape-c/Impls_1.scala b/test/files/neg/macro-invalidshape-c/Impls_1.scala index 7b1620d117..4467021545 100644 --- a/test/files/neg/macro-invalidshape-c/Impls_1.scala +++ b/test/files/neg/macro-invalidshape-c/Impls_1.scala @@ -1,4 +1,4 @@ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} object Impls { def foo(c: Ctx)(x: c.Expr[Any]) = ??? diff --git a/test/files/neg/macro-invalidshape-d/Impls_1.scala b/test/files/neg/macro-invalidshape-d/Impls_1.scala index 7b1620d117..4467021545 100644 --- a/test/files/neg/macro-invalidshape-d/Impls_1.scala +++ b/test/files/neg/macro-invalidshape-d/Impls_1.scala @@ -1,4 +1,4 @@ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} object Impls { def foo(c: Ctx)(x: c.Expr[Any]) = ??? diff --git a/test/files/neg/macro-invalidsig-context-bounds/Impls_1.scala b/test/files/neg/macro-invalidsig-context-bounds/Impls_1.scala index 2eef7aac8b..633981ce19 100644 --- a/test/files/neg/macro-invalidsig-context-bounds/Impls_1.scala +++ b/test/files/neg/macro-invalidsig-context-bounds/Impls_1.scala @@ -1,5 +1,5 @@ import scala.reflect.runtime.universe._ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} object Impls { def foo[U: c.TypeTag: Numeric](c: Ctx) = { diff --git a/test/files/neg/macro-invalidsig-ctx-badargc.check b/test/files/neg/macro-invalidsig-ctx-badargc.check index 1e1621ab61..8a1ca6a8b1 100644 --- a/test/files/neg/macro-invalidsig-ctx-badargc.check +++ b/test/files/neg/macro-invalidsig-ctx-badargc.check @@ -1,7 +1,7 @@ -Macros_Test_2.scala:2: error: macro implementation has wrong shape: - required: (c: scala.reflect.makro.Context): c.Expr[Any] - found : : Nothing -number of parameter sections differ - def foo = macro Impls.foo - ^ -one error found +Macros_Test_2.scala:2: error: macro implementation has wrong shape:
+ required: (c: scala.reflect.macros.Context): c.Expr[Any]
+ found : : Nothing
+number of parameter sections differ
+ def foo = macro Impls.foo
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidsig-ctx-badtype.check b/test/files/neg/macro-invalidsig-ctx-badtype.check index b1702bbca6..9e57ab8631 100644 --- a/test/files/neg/macro-invalidsig-ctx-badtype.check +++ b/test/files/neg/macro-invalidsig-ctx-badtype.check @@ -1,7 +1,7 @@ Macros_Test_2.scala:2: error: macro implementation has wrong shape:
- required: (c: scala.reflect.makro.Context): c.Expr[Any]
+ required: (c: scala.reflect.macros.Context): c.Expr[Any]
found : (c: scala.reflect.api.Universe): Nothing
-type mismatch for parameter c: scala.reflect.makro.Context does not conform to scala.reflect.api.Universe
+type mismatch for parameter c: scala.reflect.macros.Context does not conform to scala.reflect.api.Universe
def foo = macro Impls.foo
^
one error found
diff --git a/test/files/neg/macro-invalidsig-ctx-badvarargs.check b/test/files/neg/macro-invalidsig-ctx-badvarargs.check index 18e3d6201f..37941a7dc9 100644 --- a/test/files/neg/macro-invalidsig-ctx-badvarargs.check +++ b/test/files/neg/macro-invalidsig-ctx-badvarargs.check @@ -1,7 +1,7 @@ -Macros_Test_2.scala:2: error: macro implementation has wrong shape: - required: (c: scala.reflect.makro.Context): c.Expr[Any] - found : (cs: scala.reflect.makro.Context*): Nothing -types incompatible for parameter cs: corresponding is not a vararg parameter - def foo = macro Impls.foo - ^ -one error found +Macros_Test_2.scala:2: error: macro implementation has wrong shape:
+ required: (c: scala.reflect.macros.Context): c.Expr[Any]
+ found : (cs: scala.reflect.macros.Context*): Nothing
+types incompatible for parameter cs: corresponding is not a vararg parameter
+ def foo = macro Impls.foo
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidsig-ctx-badvarargs/Impls_1.scala b/test/files/neg/macro-invalidsig-ctx-badvarargs/Impls_1.scala index b2fb2539ec..c4ed8be91e 100644 --- a/test/files/neg/macro-invalidsig-ctx-badvarargs/Impls_1.scala +++ b/test/files/neg/macro-invalidsig-ctx-badvarargs/Impls_1.scala @@ -1,4 +1,4 @@ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} object Impls { def foo(cs: Ctx*) = ??? diff --git a/test/files/neg/macro-invalidsig-ctx-noctx.check b/test/files/neg/macro-invalidsig-ctx-noctx.check index 66fa7c3514..722fe9dfb6 100644 --- a/test/files/neg/macro-invalidsig-ctx-noctx.check +++ b/test/files/neg/macro-invalidsig-ctx-noctx.check @@ -1,7 +1,7 @@ -Macros_Test_2.scala:2: error: macro implementation has wrong shape: - required: (c: scala.reflect.makro.Context)(x: c.Expr[Any]): c.Expr[Any] - found : (c: scala.reflect.makro.Context): Nothing -number of parameter sections differ - def foo(x: Any) = macro Impls.foo - ^ -one error found +Macros_Test_2.scala:2: error: macro implementation has wrong shape:
+ required: (c: scala.reflect.macros.Context)(x: c.Expr[Any]): c.Expr[Any]
+ found : (c: scala.reflect.macros.Context): Nothing
+number of parameter sections differ
+ def foo(x: Any) = macro Impls.foo
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidsig-ctx-noctx/Impls_1.scala b/test/files/neg/macro-invalidsig-ctx-noctx/Impls_1.scala index 1e0ed755af..6904cfb1dc 100644 --- a/test/files/neg/macro-invalidsig-ctx-noctx/Impls_1.scala +++ b/test/files/neg/macro-invalidsig-ctx-noctx/Impls_1.scala @@ -1,4 +1,4 @@ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} object Impls { def foo(c: Ctx) = ??? diff --git a/test/files/neg/macro-invalidsig-implicit-params/Impls_Macros_1.scala b/test/files/neg/macro-invalidsig-implicit-params/Impls_Macros_1.scala index 5bfe73ec59..b32a20ba06 100644 --- a/test/files/neg/macro-invalidsig-implicit-params/Impls_Macros_1.scala +++ b/test/files/neg/macro-invalidsig-implicit-params/Impls_Macros_1.scala @@ -1,5 +1,5 @@ import scala.reflect.runtime.universe._ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} object Impls { def foo_targs[T, U: c.TypeTag](c: Ctx)(implicit x: c.Expr[Int]) = { diff --git a/test/files/neg/macro-invalidsig-params-badargc.check b/test/files/neg/macro-invalidsig-params-badargc.check index 6de8c5e95a..ab4fb535c5 100644 --- a/test/files/neg/macro-invalidsig-params-badargc.check +++ b/test/files/neg/macro-invalidsig-params-badargc.check @@ -1,7 +1,7 @@ -Impls_Macros_1.scala:8: error: macro implementation has wrong shape: - required: (c: scala.reflect.makro.Context)(x: c.Expr[Int]): c.Expr[Any] - found : (c: scala.reflect.makro.Context)(x: c.Expr[Int], y: c.Expr[Int]): Nothing -parameter lists have different length, found extra parameter y: c.Expr[Int] - def foo(x: Int) = macro Impls.foo - ^ -one error found +Impls_Macros_1.scala:8: error: macro implementation has wrong shape:
+ required: (c: scala.reflect.macros.Context)(x: c.Expr[Int]): c.Expr[Any]
+ found : (c: scala.reflect.macros.Context)(x: c.Expr[Int], y: c.Expr[Int]): Nothing
+parameter lists have different length, found extra parameter y: c.Expr[Int]
+ def foo(x: Int) = macro Impls.foo
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidsig-params-badargc/Impls_Macros_1.scala b/test/files/neg/macro-invalidsig-params-badargc/Impls_Macros_1.scala index 4b449f35ed..ae16612b93 100644 --- a/test/files/neg/macro-invalidsig-params-badargc/Impls_Macros_1.scala +++ b/test/files/neg/macro-invalidsig-params-badargc/Impls_Macros_1.scala @@ -1,4 +1,4 @@ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} object Impls { def foo(c: Ctx)(x: c.Expr[Int], y: c.Expr[Int]) = ??? diff --git a/test/files/neg/macro-invalidsig-params-badtype.check b/test/files/neg/macro-invalidsig-params-badtype.check index e4f67e650a..007620a366 100644 --- a/test/files/neg/macro-invalidsig-params-badtype.check +++ b/test/files/neg/macro-invalidsig-params-badtype.check @@ -1,6 +1,6 @@ Impls_Macros_1.scala:8: error: macro implementation has wrong shape:
- required: (c: scala.reflect.makro.Context)(x: c.Expr[Int]): c.Expr[Any]
- found : (c: scala.reflect.makro.Context)(x: c.universe.Tree): Nothing
+ required: (c: scala.reflect.macros.Context)(x: c.Expr[Int]): c.Expr[Any]
+ found : (c: scala.reflect.macros.Context)(x: c.universe.Tree): Nothing
type mismatch for parameter x: c.Expr[Int] does not conform to c.universe.Tree
def foo(x: Int) = macro Impls.foo
^
diff --git a/test/files/neg/macro-invalidsig-params-badtype/Impls_Macros_1.scala b/test/files/neg/macro-invalidsig-params-badtype/Impls_Macros_1.scala index 6393e6d395..ab90b85881 100644 --- a/test/files/neg/macro-invalidsig-params-badtype/Impls_Macros_1.scala +++ b/test/files/neg/macro-invalidsig-params-badtype/Impls_Macros_1.scala @@ -1,4 +1,4 @@ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} object Impls { def foo(c: Ctx)(x: c.universe.Tree) = ??? diff --git a/test/files/neg/macro-invalidsig-params-badvarargs.check b/test/files/neg/macro-invalidsig-params-badvarargs.check index 0827680299..f0dcc24d03 100644 --- a/test/files/neg/macro-invalidsig-params-badvarargs.check +++ b/test/files/neg/macro-invalidsig-params-badvarargs.check @@ -1,7 +1,7 @@ -Impls_Macros_1.scala:8: error: macro implementation has wrong shape: - required: (c: scala.reflect.makro.Context)(x: c.Expr[Int], y: c.Expr[Int]): c.Expr[Any] - found : (c: scala.reflect.makro.Context)(xs: c.Expr[Int]*): Nothing -parameter lists have different length, required extra parameter y: c.Expr[Int] - def foo(x: Int, y: Int) = macro Impls.foo - ^ -one error found +Impls_Macros_1.scala:8: error: macro implementation has wrong shape:
+ required: (c: scala.reflect.macros.Context)(x: c.Expr[Int], y: c.Expr[Int]): c.Expr[Any]
+ found : (c: scala.reflect.macros.Context)(xs: c.Expr[Int]*): Nothing
+parameter lists have different length, required extra parameter y: c.Expr[Int]
+ def foo(x: Int, y: Int) = macro Impls.foo
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidsig-params-badvarargs/Impls_Macros_1.scala b/test/files/neg/macro-invalidsig-params-badvarargs/Impls_Macros_1.scala index 2ee1c2767c..b4c75ad0ba 100644 --- a/test/files/neg/macro-invalidsig-params-badvarargs/Impls_Macros_1.scala +++ b/test/files/neg/macro-invalidsig-params-badvarargs/Impls_Macros_1.scala @@ -1,4 +1,4 @@ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} object Impls { def foo(c: Ctx)(xs: c.Expr[Int]*) = ??? diff --git a/test/files/neg/macro-invalidsig-params-namemismatch.check b/test/files/neg/macro-invalidsig-params-namemismatch.check index ca7270cca8..00d781a2ac 100644 --- a/test/files/neg/macro-invalidsig-params-namemismatch.check +++ b/test/files/neg/macro-invalidsig-params-namemismatch.check @@ -1,7 +1,7 @@ -Impls_Macros_1.scala:8: error: macro implementation has wrong shape: - required: (c: scala.reflect.makro.Context)(x: c.Expr[Int], y: c.Expr[Int]): c.Expr[Any] - found : (c: scala.reflect.makro.Context)(y: c.Expr[Int], x: c.Expr[Int]): Nothing -parameter names differ: x != y - def foo(x: Int, y: Int) = macro Impls.foo - ^ -one error found +Impls_Macros_1.scala:8: error: macro implementation has wrong shape:
+ required: (c: scala.reflect.macros.Context)(x: c.Expr[Int], y: c.Expr[Int]): c.Expr[Any]
+ found : (c: scala.reflect.macros.Context)(y: c.Expr[Int], x: c.Expr[Int]): Nothing
+parameter names differ: x != y
+ def foo(x: Int, y: Int) = macro Impls.foo
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidsig-params-namemismatch/Impls_Macros_1.scala b/test/files/neg/macro-invalidsig-params-namemismatch/Impls_Macros_1.scala index 89c5347647..c7cf0b06c4 100644 --- a/test/files/neg/macro-invalidsig-params-namemismatch/Impls_Macros_1.scala +++ b/test/files/neg/macro-invalidsig-params-namemismatch/Impls_Macros_1.scala @@ -1,4 +1,4 @@ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} object Impls { def foo(c: Ctx)(y: c.Expr[Int], x: c.Expr[Int]) = ??? diff --git a/test/files/neg/macro-invalidsig-tparams-badtype.check b/test/files/neg/macro-invalidsig-tparams-badtype.check index 9166db3574..e5e8366ba4 100644 --- a/test/files/neg/macro-invalidsig-tparams-badtype.check +++ b/test/files/neg/macro-invalidsig-tparams-badtype.check @@ -1,6 +1,6 @@ Macros_Test_2.scala:2: error: macro implementation has wrong shape:
- required: (c: scala.reflect.makro.Context): c.Expr[Any]
- found : (c: scala.reflect.makro.Context)(U: c.universe.Type): Nothing
+ required: (c: scala.reflect.macros.Context): c.Expr[Any]
+ found : (c: scala.reflect.macros.Context)(U: c.universe.Type): Nothing
number of parameter sections differ
def foo[U] = macro Impls.foo[U]
^
diff --git a/test/files/neg/macro-invalidsig-tparams-badtype/Impls_1.scala b/test/files/neg/macro-invalidsig-tparams-badtype/Impls_1.scala index 9886331502..dbeca178a7 100644 --- a/test/files/neg/macro-invalidsig-tparams-badtype/Impls_1.scala +++ b/test/files/neg/macro-invalidsig-tparams-badtype/Impls_1.scala @@ -1,4 +1,4 @@ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} object Impls { def foo[U](c: Ctx)(U: c.universe.Type) = ??? diff --git a/test/files/neg/macro-invalidsig-tparams-bounds-a/Impls_1.scala b/test/files/neg/macro-invalidsig-tparams-bounds-a/Impls_1.scala index 88b85d48f4..89020de7dd 100644 --- a/test/files/neg/macro-invalidsig-tparams-bounds-a/Impls_1.scala +++ b/test/files/neg/macro-invalidsig-tparams-bounds-a/Impls_1.scala @@ -1,4 +1,4 @@ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} object Impls { def foo[U <: String](c: Ctx) = ??? diff --git a/test/files/neg/macro-invalidsig-tparams-bounds-b/Impls_1.scala b/test/files/neg/macro-invalidsig-tparams-bounds-b/Impls_1.scala index 88b85d48f4..89020de7dd 100644 --- a/test/files/neg/macro-invalidsig-tparams-bounds-b/Impls_1.scala +++ b/test/files/neg/macro-invalidsig-tparams-bounds-b/Impls_1.scala @@ -1,4 +1,4 @@ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} object Impls { def foo[U <: String](c: Ctx) = ??? diff --git a/test/files/neg/macro-invalidsig-tparams-notparams-a/Impls_1.scala b/test/files/neg/macro-invalidsig-tparams-notparams-a/Impls_1.scala index ea472e6f91..98a3a6db7c 100644 --- a/test/files/neg/macro-invalidsig-tparams-notparams-a/Impls_1.scala +++ b/test/files/neg/macro-invalidsig-tparams-notparams-a/Impls_1.scala @@ -1,5 +1,5 @@ import scala.reflect.runtime.universe._ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} object Impls { def foo[U: c.TypeTag](c: Ctx) = ??? diff --git a/test/files/neg/macro-invalidsig-tparams-notparams-b/Impls_1.scala b/test/files/neg/macro-invalidsig-tparams-notparams-b/Impls_1.scala index c4eb3d9b4a..dbc7000485 100644 --- a/test/files/neg/macro-invalidsig-tparams-notparams-b/Impls_1.scala +++ b/test/files/neg/macro-invalidsig-tparams-notparams-b/Impls_1.scala @@ -1,5 +1,5 @@ import scala.reflect.runtime.universe._ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} object Impls { def foo[T: c.TypeTag, U: c.TypeTag, V](c: Ctx)(implicit V: c.TypeTag[V]): c.Expr[Unit] = { diff --git a/test/files/neg/macro-invalidsig-tparams-notparams-c.check b/test/files/neg/macro-invalidsig-tparams-notparams-c.check index b64a469cc3..e3e17c7506 100644 --- a/test/files/neg/macro-invalidsig-tparams-notparams-c.check +++ b/test/files/neg/macro-invalidsig-tparams-notparams-c.check @@ -1,4 +1,4 @@ -Macros_Test_2.scala:3: error: wrong number of type parameters for method foo: [T, U, V](c: scala.reflect.makro.Context)(implicit evidence$1: c.TypeTag[T], implicit evidence$2: c.TypeTag[U], implicit V: c.TypeTag[V])c.Expr[Unit]
+Macros_Test_2.scala:3: error: wrong number of type parameters for method foo: [T, U, V](c: scala.reflect.macros.Context)(implicit evidence$1: c.TypeTag[T], implicit evidence$2: c.TypeTag[U], implicit V: c.TypeTag[V])c.Expr[Unit]
def foo[V] = macro Impls.foo[V]
^
one error found
diff --git a/test/files/neg/macro-invalidsig-tparams-notparams-c/Impls_1.scala b/test/files/neg/macro-invalidsig-tparams-notparams-c/Impls_1.scala index 41facc881e..3edadb115d 100644 --- a/test/files/neg/macro-invalidsig-tparams-notparams-c/Impls_1.scala +++ b/test/files/neg/macro-invalidsig-tparams-notparams-c/Impls_1.scala @@ -1,5 +1,5 @@ import scala.reflect.runtime.universe._ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} object Impls { def foo[T: c.TypeTag, U: c.TypeTag, V](c: Ctx)(implicit V: c.TypeTag[V]): c.Expr[Unit] = { diff --git a/test/files/neg/macro-invalidusage-badargs/Impls_1.scala b/test/files/neg/macro-invalidusage-badargs/Impls_1.scala index 2346a6106d..52c9f9c3e9 100644 --- a/test/files/neg/macro-invalidusage-badargs/Impls_1.scala +++ b/test/files/neg/macro-invalidusage-badargs/Impls_1.scala @@ -1,4 +1,4 @@ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} object Impls { def foo(c: Ctx)(x: c.Expr[Int]) = x diff --git a/test/files/neg/macro-invalidusage-badbounds/Impls_1.scala b/test/files/neg/macro-invalidusage-badbounds/Impls_1.scala index 88b85d48f4..89020de7dd 100644 --- a/test/files/neg/macro-invalidusage-badbounds/Impls_1.scala +++ b/test/files/neg/macro-invalidusage-badbounds/Impls_1.scala @@ -1,4 +1,4 @@ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} object Impls { def foo[U <: String](c: Ctx) = ??? diff --git a/test/files/neg/macro-invalidusage-badtargs/Impls_1.scala b/test/files/neg/macro-invalidusage-badtargs/Impls_1.scala index 2346a6106d..52c9f9c3e9 100644 --- a/test/files/neg/macro-invalidusage-badtargs/Impls_1.scala +++ b/test/files/neg/macro-invalidusage-badtargs/Impls_1.scala @@ -1,4 +1,4 @@ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} object Impls { def foo(c: Ctx)(x: c.Expr[Int]) = x diff --git a/test/files/neg/macro-invalidusage-methodvaluesyntax/Impls_1.scala b/test/files/neg/macro-invalidusage-methodvaluesyntax/Impls_1.scala index 31e758e9a0..8d7fdf3e8a 100644 --- a/test/files/neg/macro-invalidusage-methodvaluesyntax/Impls_1.scala +++ b/test/files/neg/macro-invalidusage-methodvaluesyntax/Impls_1.scala @@ -1,4 +1,4 @@ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} object Impls { def foo(c: Ctx) = { diff --git a/test/files/neg/macro-noexpand/Impls_1.scala b/test/files/neg/macro-noexpand/Impls_1.scala index 7b1620d117..4467021545 100644 --- a/test/files/neg/macro-noexpand/Impls_1.scala +++ b/test/files/neg/macro-noexpand/Impls_1.scala @@ -1,4 +1,4 @@ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} object Impls { def foo(c: Ctx)(x: c.Expr[Any]) = ??? diff --git a/test/files/neg/macro-nontypeablebody/Impls_1.scala b/test/files/neg/macro-nontypeablebody/Impls_1.scala index 7b1620d117..4467021545 100644 --- a/test/files/neg/macro-nontypeablebody/Impls_1.scala +++ b/test/files/neg/macro-nontypeablebody/Impls_1.scala @@ -1,4 +1,4 @@ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} object Impls { def foo(c: Ctx)(x: c.Expr[Any]) = ??? diff --git a/test/files/neg/macro-override-macro-overrides-abstract-method-a/Impls_Macros_1.scala b/test/files/neg/macro-override-macro-overrides-abstract-method-a/Impls_Macros_1.scala index cb0b152852..e43264f52f 100644 --- a/test/files/neg/macro-override-macro-overrides-abstract-method-a/Impls_Macros_1.scala +++ b/test/files/neg/macro-override-macro-overrides-abstract-method-a/Impls_Macros_1.scala @@ -1,4 +1,4 @@ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} object Impls { def impl(c: Ctx)(x: c.Expr[Int]) = x diff --git a/test/files/neg/macro-override-macro-overrides-abstract-method-b/Impls_Macros_1.scala b/test/files/neg/macro-override-macro-overrides-abstract-method-b/Impls_Macros_1.scala index cb0b152852..e43264f52f 100644 --- a/test/files/neg/macro-override-macro-overrides-abstract-method-b/Impls_Macros_1.scala +++ b/test/files/neg/macro-override-macro-overrides-abstract-method-b/Impls_Macros_1.scala @@ -1,4 +1,4 @@ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} object Impls { def impl(c: Ctx)(x: c.Expr[Int]) = x diff --git a/test/files/neg/macro-override-method-overrides-macro/Impls_1.scala b/test/files/neg/macro-override-method-overrides-macro/Impls_1.scala index d6493caad9..ec93dd4111 100644 --- a/test/files/neg/macro-override-method-overrides-macro/Impls_1.scala +++ b/test/files/neg/macro-override-method-overrides-macro/Impls_1.scala @@ -1,4 +1,4 @@ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} object Impls { def impl(c: Ctx)(tag: String, x: c.Expr[_]) = { diff --git a/test/files/neg/macro-without-xmacros-a/Impls_1.scala b/test/files/neg/macro-without-xmacros-a/Impls_1.scala index 0b6fbe240e..8976f8e28d 100644 --- a/test/files/neg/macro-without-xmacros-a/Impls_1.scala +++ b/test/files/neg/macro-without-xmacros-a/Impls_1.scala @@ -1,4 +1,4 @@ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} object Impls { def foo_impl(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = { diff --git a/test/files/neg/macro-without-xmacros-b/Impls_1.scala b/test/files/neg/macro-without-xmacros-b/Impls_1.scala index 0b6fbe240e..8976f8e28d 100644 --- a/test/files/neg/macro-without-xmacros-b/Impls_1.scala +++ b/test/files/neg/macro-without-xmacros-b/Impls_1.scala @@ -1,4 +1,4 @@ -import scala.reflect.makro.{Context => Ctx} +import scala.reflect.macros.{Context => Ctx} object Impls { def foo_impl(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = { diff --git a/test/files/neg/t3234.check b/test/files/neg/t3234.check new file mode 100644 index 0000000000..477b021e5e --- /dev/null +++ b/test/files/neg/t3234.check @@ -0,0 +1,2 @@ +error: there were 1 inliner warnings; re-run with -Yinline-warnings for details +one error found diff --git a/test/files/neg/t3234.flags b/test/files/neg/t3234.flags new file mode 100644 index 0000000000..c9cefdc4b9 --- /dev/null +++ b/test/files/neg/t3234.flags @@ -0,0 +1 @@ +-Yinline -Xfatal-warnings
\ No newline at end of file diff --git a/test/files/neg/t3234.scala b/test/files/neg/t3234.scala new file mode 100644 index 0000000000..443d0467f0 --- /dev/null +++ b/test/files/neg/t3234.scala @@ -0,0 +1,19 @@ +trait Trait1 { + // need more work before this one works + // @inline + def foo2(n: Int) = n*n +} + +trait Trait2 { + @inline def foo3(n: Int) = 1 +} + +class Base extends Trait1 { + @inline def foo(n: Int) = n +} + +object Test extends Base with Trait2 { + def main(args: Array[String]) = { + println(foo(42) + foo2(11) + foo3(2)) + } +}
\ No newline at end of file diff --git a/test/files/neg/t5031.check b/test/files/neg/t5031.check new file mode 100644 index 0000000000..8983d8daf9 --- /dev/null +++ b/test/files/neg/t5031.check @@ -0,0 +1,5 @@ +Id.scala:3: error: Companions 'class Test' and 'object Test' must be defined in same file: + Found in t5031/package.scala and t5031/Id.scala +object Test + ^ +one error found diff --git a/test/files/neg/t5031/Id.scala b/test/files/neg/t5031/Id.scala new file mode 100644 index 0000000000..2f0db002d2 --- /dev/null +++ b/test/files/neg/t5031/Id.scala @@ -0,0 +1,4 @@ +package t5031 + +object Test + diff --git a/test/files/neg/t5031/package.scala b/test/files/neg/t5031/package.scala new file mode 100644 index 0000000000..17b63220be --- /dev/null +++ b/test/files/neg/t5031/package.scala @@ -0,0 +1,3 @@ +package object t5031 { + class Test +} diff --git a/test/files/neg/t5689.check b/test/files/neg/t5689.check index 6abc4c13f6..3b25dd612e 100644 --- a/test/files/neg/t5689.check +++ b/test/files/neg/t5689.check @@ -1,6 +1,6 @@ t5689.scala:4: error: macro implementation has wrong shape:
- required: (c: scala.reflect.makro.Context)(i: c.Expr[Double]): c.Expr[String]
- found : (c: scala.reflect.makro.Context)(i: c.Expr[Double]): c.Expr[Int]
+ required: (c: scala.reflect.macros.Context)(i: c.Expr[Double]): c.Expr[String]
+ found : (c: scala.reflect.macros.Context)(i: c.Expr[Double]): c.Expr[Int]
type mismatch for return type: c.Expr[Int] does not conform to c.Expr[String]
def returnsString(i: Double): String = macro returnsIntImpl
^
diff --git a/test/files/neg/t5689.scala b/test/files/neg/t5689.scala index ef7a45b364..3266039c35 100644 --- a/test/files/neg/t5689.scala +++ b/test/files/neg/t5689.scala @@ -1,4 +1,4 @@ -import scala.reflect.makro.Context +import scala.reflect.macros.Context object Macros { def returnsString(i: Double): String = macro returnsIntImpl diff --git a/test/files/neg/t5799.check b/test/files/neg/t5799.check new file mode 100644 index 0000000000..10e2658d56 --- /dev/null +++ b/test/files/neg/t5799.check @@ -0,0 +1,4 @@ +t5799.scala:2: error: value class may not have secondary constructors + def this(s: String) = this(s.toDouble) + ^ +one error found diff --git a/test/files/neg/t5799.scala b/test/files/neg/t5799.scala new file mode 100644 index 0000000000..9bd6ab7dd1 --- /dev/null +++ b/test/files/neg/t5799.scala @@ -0,0 +1,8 @@ +class Foo(val bar: Double) extends AnyVal { + def this(s: String) = this(s.toDouble) +} +object Test { + def main(args: Array[String]): Unit = + new Foo("") + } + diff --git a/test/files/neg/t5878.check b/test/files/neg/t5878.check new file mode 100644 index 0000000000..50dba0d272 --- /dev/null +++ b/test/files/neg/t5878.check @@ -0,0 +1,13 @@ +t5878.scala:1: error: value class may not unbox to itself +case class Foo(x: Bar) extends AnyVal + ^ +t5878.scala:2: error: value class may not unbox to itself +case class Bar(x: Foo) extends AnyVal + ^ +t5878.scala:4: error: value class may not unbox to itself +class Foo1(val x: Bar1) extends AnyVal + ^ +t5878.scala:5: error: value class may not unbox to itself +class Bar1(val x: Foo1) extends AnyVal + ^ +four errors found diff --git a/test/files/neg/t5878.scala b/test/files/neg/t5878.scala new file mode 100644 index 0000000000..b4e33627ef --- /dev/null +++ b/test/files/neg/t5878.scala @@ -0,0 +1,6 @@ +case class Foo(x: Bar) extends AnyVal +case class Bar(x: Foo) extends AnyVal + +class Foo1(val x: Bar1) extends AnyVal +class Bar1(val x: Foo1) extends AnyVal + diff --git a/test/files/neg/t5882.check b/test/files/neg/t5882.check new file mode 100644 index 0000000000..df01c7bc0a --- /dev/null +++ b/test/files/neg/t5882.check @@ -0,0 +1,15 @@ +t5882.scala:2: warning: case classes without a parameter list have been deprecated; +use either case objects or case classes with `()' as parameter list. + case class Scope + ^ +t5882.scala:2: error: value class may not have nested class definitions + case class Scope + ^ +t5882.scala:3: error: value class may not have nested class definitions + class Foo + ^ +t5882.scala:4: error: value class may not have nested module definitions + object Bar + ^ +one warning found +three errors found diff --git a/test/files/neg/t5882.scala b/test/files/neg/t5882.scala new file mode 100644 index 0000000000..1233eb636f --- /dev/null +++ b/test/files/neg/t5882.scala @@ -0,0 +1,5 @@ +class NodeOps(val n: Any) extends AnyVal { + case class Scope + class Foo + object Bar +} |