File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
tests/pos-macros/this-type-capture Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
1
+ @ main def test = Macro .generateCode
You can’t perform that action at this time.
0 commit comments