Skip to content

Commit 1be0244

Browse files
author
martende
committed
neg test added
1 parent 597a949 commit 1be0244

File tree

6 files changed

+22
-0
lines changed

6 files changed

+22
-0
lines changed

test/files/neg/t5753.check

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
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)
2+
println(foo(42))
3+
^
4+
one error found

test/files/neg/t5753.flags

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-language:experimental.macros
626 Bytes
Binary file not shown.

test/files/neg/t5753/Impls.class

866 Bytes
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import scala.reflect.macros.{Context => Ctx}
2+
3+
trait Impls {
4+
def impl(c: Ctx)(x: c.Expr[Any]) = x
5+
}
6+

test/files/neg/t5753/Test_2.scala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import scala.reflect.macros.{Context => Ctx}
2+
3+
object Macros extends Impls {
4+
def foo(x: Any) = macro impl
5+
}
6+
7+
object Test extends App {
8+
import Macros._
9+
println(foo(42))
10+
}
11+

0 commit comments

Comments
 (0)