Skip to content

Commit 9e02a81

Browse files
Add tests with macros (unstable)
The macros are compiled correctly when done in two stages, but when the two files are compiled at the same time, $anonfun is considered to be a dependency
1 parent 36d9c9e commit 9e02a81

File tree

4 files changed

+23
-0
lines changed

4 files changed

+23
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import scala.quoted.*
2+
3+
inline def foo(): Int =
4+
${fooImpl}
5+
6+
def fooImpl(using Quotes): Expr[Int] =
7+
'{3}
8+
9+
inline trait A:
10+
val i: Int = foo()
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class B extends A:
2+
def test = foo()
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import scala.quoted.*
2+
3+
inline def foo(): Int =
4+
${fooImpl}
5+
6+
def fooImpl(using Quotes): Expr[Int] =
7+
'{3}
8+
9+
inline trait A:
10+
val i: Int = foo()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
class B extends A

0 commit comments

Comments
 (0)