diff options
Diffstat (limited to 'test/files/neg')
5 files changed, 29 insertions, 0 deletions
diff --git a/test/files/neg/t6123-explaintypes-macros.check b/test/files/neg/t6123-explaintypes-macros.check new file mode 100644 index 0000000000..ebcb8069d5 --- /dev/null +++ b/test/files/neg/t6123-explaintypes-macros.check @@ -0,0 +1,9 @@ +c.universe.Expr[Any]* <: c.universe.Expr[String]*? +false +BadMac_2.scala:6: error: macro implementation has wrong shape: + required: (c: scala.reflect.macros.Context)(format: c.Expr[String], params: c.Expr[Any]*): c.Expr[Unit] + found : (c: scala.reflect.macros.Context)(format: c.Expr[String], params: c.Expr[String]*): c.Expr[Unit] +type mismatch for parameter params: c.Expr[Any]* does not conform to c.Expr[String]* + def printf(format: String, params: Any*): Unit = macro printf_impl + ^ +one error found diff --git a/test/files/neg/t6123-explaintypes-macros/BadMac_2.flags b/test/files/neg/t6123-explaintypes-macros/BadMac_2.flags new file mode 100644 index 0000000000..b36707c7cf --- /dev/null +++ b/test/files/neg/t6123-explaintypes-macros/BadMac_2.flags @@ -0,0 +1 @@ +-explaintypes diff --git a/test/files/neg/t6123-explaintypes-macros/BadMac_2.scala b/test/files/neg/t6123-explaintypes-macros/BadMac_2.scala new file mode 100644 index 0000000000..38b8e24444 --- /dev/null +++ b/test/files/neg/t6123-explaintypes-macros/BadMac_2.scala @@ -0,0 +1,8 @@ +import scala.language.experimental.macros +import scala.reflect.macros.Context + +// explain some macro types to me +object BadMac { + def printf(format: String, params: Any*): Unit = macro printf_impl + def printf_impl(c: Context)(format: c.Expr[String], params: c.Expr[String]*): c.Expr[Unit] = ??? +} diff --git a/test/files/neg/t6123-explaintypes-macros/Macros.flags b/test/files/neg/t6123-explaintypes-macros/Macros.flags new file mode 100644 index 0000000000..b36707c7cf --- /dev/null +++ b/test/files/neg/t6123-explaintypes-macros/Macros.flags @@ -0,0 +1 @@ +-explaintypes diff --git a/test/files/neg/t6123-explaintypes-macros/Macros.scala b/test/files/neg/t6123-explaintypes-macros/Macros.scala new file mode 100644 index 0000000000..a12c277c86 --- /dev/null +++ b/test/files/neg/t6123-explaintypes-macros/Macros.scala @@ -0,0 +1,10 @@ +import scala.language.experimental.macros +import scala.reflect.macros.Context + +object Macros { + def printf(format: String, params: Any*): Unit = macro printf_impl + def printf_impl(c: Context)(format: c.Expr[String], params: c.Expr[Any]*): c.Expr[Unit] = ??? +} + +// something trivial to run +object Test extends App |