diff options
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/neg/t7519-b.check | 6 | ||||
-rw-r--r-- | test/files/neg/t7519-b/Mac_1.scala | 14 | ||||
-rw-r--r-- | test/files/neg/t7519-b/Use_2.scala | 8 |
3 files changed, 28 insertions, 0 deletions
diff --git a/test/files/neg/t7519-b.check b/test/files/neg/t7519-b.check new file mode 100644 index 0000000000..08d819eeec --- /dev/null +++ b/test/files/neg/t7519-b.check @@ -0,0 +1,6 @@ +Use_2.scala:6: error: type mismatch; + found : String + required: Q + val x: Q = ex.Mac.mac("asdf") + ^ +one error found diff --git a/test/files/neg/t7519-b/Mac_1.scala b/test/files/neg/t7519-b/Mac_1.scala new file mode 100644 index 0000000000..55b583d24b --- /dev/null +++ b/test/files/neg/t7519-b/Mac_1.scala @@ -0,0 +1,14 @@ +// get expected error message without package declaration +package ex + +import scala.language.experimental.macros +import scala.reflect.macros._ + +object IW { + def foo(a: String): String = ??? +} +object Mac { + def mac(s: String): String = macro macImpl + def macImpl(c: Context)(s: c.Expr[String]): c.Expr[String] = + c.universe.reify(IW.foo(s.splice)) +} diff --git a/test/files/neg/t7519-b/Use_2.scala b/test/files/neg/t7519-b/Use_2.scala new file mode 100644 index 0000000000..413e40e25e --- /dev/null +++ b/test/files/neg/t7519-b/Use_2.scala @@ -0,0 +1,8 @@ +trait Q +trait K + +object Use { + implicit def cd[T](p: T)(implicit ev: T => K): Q = ??? + val x: Q = ex.Mac.mac("asdf") +} + |