Skip to content

Commit

Permalink
neg test added
Browse files Browse the repository at this point in the history
  • Loading branch information
martende committed Nov 27, 2012
1 parent 597a949 commit 1be0244
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/files/neg/t5753.check
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,4 @@
Test_2.scala:9: 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)
println(foo(42))
^
one error found
1 change: 1 addition & 0 deletions test/files/neg/t5753.flags
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1 @@
-language:experimental.macros
Binary file added test/files/neg/t5753/Impls$class.class
Binary file not shown.
Binary file added test/files/neg/t5753/Impls.class
Binary file not shown.
6 changes: 6 additions & 0 deletions test/files/neg/t5753/Impls_Macros_1.scala
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,6 @@
import scala.reflect.macros.{Context => Ctx}

trait Impls {
def impl(c: Ctx)(x: c.Expr[Any]) = x
}

11 changes: 11 additions & 0 deletions test/files/neg/t5753/Test_2.scala
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,11 @@
import scala.reflect.macros.{Context => Ctx}

object Macros extends Impls {
def foo(x: Any) = macro impl
}

object Test extends App {
import Macros._
println(foo(42))
}

0 comments on commit 1be0244

Please sign in to comment.