File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change
1
+ package example
2
+
3
+ import scala .language .experimental .macros
4
+
5
+ trait Context {
6
+
7
+ val universe : Universe
8
+
9
+ trait Universe {
10
+ type Tree >: Null <: AnyRef with TreeApi
11
+ type Literal >: Null <: LiteralApi with TermTree
12
+ type TermTree >: Null <: TermTreeApi with Tree
13
+
14
+ trait TermTreeApi extends TreeApi { this : TermTree => }
15
+ trait LiteralApi extends TermTreeApi { this : Literal => }
16
+ trait TreeApi extends Product { this : Tree => }
17
+ }
18
+ }
19
+
20
+ object MacroCompat {
21
+
22
+ object Bundles {
23
+ def mono : Int = macro Macros2 .MacroImpl .mono
24
+ inline def mono : Int = $ { Macros3 .monoImpl }
25
+ }
26
+
27
+ object Macros2 {
28
+ class MacroImpl (val c : Context ) {
29
+ import c .universe ._
30
+
31
+ def mono : Literal = ???
32
+ }
33
+ }
34
+
35
+ object Macros3 {
36
+ import quoted ._
37
+
38
+ def monoImpl (using Quotes ) = ' {1 }
39
+
40
+ }
41
+
42
+ }
You can’t perform that action at this time.
0 commit comments