diff options
author | Mark Harrah <dmharrah@gmail.com> | 2013-10-18 16:39:26 -0400 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-10-23 14:23:08 +0200 |
commit | 50c8b39ec4e795b6de7b8ebeb6e20bf5c4b7f9e0 (patch) | |
tree | 3e92795a55be5082799dc8d670a6dc7d7e1026af /test/files/neg | |
parent | ce74bb00603f23087fbd3b0fe2870f09d73bb676 (diff) | |
download | scala-50c8b39ec4e795b6de7b8ebeb6e20bf5c4b7f9e0.tar.gz scala-50c8b39ec4e795b6de7b8ebeb6e20bf5c4b7f9e0.tar.bz2 scala-50c8b39ec4e795b6de7b8ebeb6e20bf5c4b7f9e0.zip |
SI-7519: Additional test case covering sbt/sbt#914
(cherry picked from commit e72c32db03b44d6eaf1c1872765a578c5445e15f)
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/t7519-b.check | 4 | ||||
-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, 26 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..ad554b8633 --- /dev/null +++ b/test/files/neg/t7519-b.check @@ -0,0 +1,4 @@ +Use_2.scala:6: error: No implicit view available from String => K. + 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") +} + |