Skip to content

Commit 1612275

Browse files
committed
Add spliced-captured path dependent type tests
1 parent 2731ec5 commit 1612275

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import scala.quoted.*
2+
3+
object Macro:
4+
inline def generateCode: Unit = ${ testThisPaths }
5+
6+
def testThisPaths(using Quotes): Expr[Unit] =
7+
'{
8+
trait E extends G:
9+
type V
10+
val f: F
11+
${
12+
val expr = '{
13+
// println(this) // FIXME: this should work
14+
// println(f) // FIXME: this should work
15+
// println(this.f) // FIXME: this should work
16+
// println(??? : this.type) // FIXME: this should work
17+
println(??? : V)
18+
println(??? : this.V)
19+
println(??? : this.f.V)
20+
println(??? : this.f.type)
21+
}
22+
expr
23+
}
24+
trait F:
25+
type V
26+
}
27+
28+
trait G:
29+
val f: Any
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@main def test = Macro.generateCode

0 commit comments

Comments
 (0)