Skip to content
Browse files

SI-7519: Additional test case covering sbt/sbt#914

(cherry picked from commit e72c32d)
  • Loading branch information...
1 parent ce74bb0 commit 50c8b39ec4e795b6de7b8ebeb6e20bf5c4b7f9e0 @harrah harrah committed with retronym Oct 18, 2013
Showing with 26 additions and 0 deletions.
  1. +4 −0 test/files/neg/t7519-b.check
  2. +14 −0 test/files/neg/t7519-b/Mac_1.scala
  3. +8 −0 test/files/neg/t7519-b/Use_2.scala
View
4 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
View
14 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))
+}
View
8 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")
+}
+

0 comments on commit 50c8b39

Please sign in to comment.
Something went wrong with that request. Please try again.