@@ -27,7 +27,7 @@ class RecorderMacro(using qctx0: Quotes) {
27
27
recording : Expr [A ],
28
28
message : Expr [String ],
29
29
listener : Expr [RecorderListener [A , R ]]): Expr [R ] = {
30
- val termArg : Term = recording.asTerm.underlyingArgument
30
+ val termArg : Term = recording.asTerm.underlyingArgument // TODO remove use of underlyingArgument
31
31
32
32
' {
33
33
val recorderRuntime : RecorderRuntime [A , R ] = new RecorderRuntime ($listener)
@@ -46,8 +46,8 @@ class RecorderMacro(using qctx0: Quotes) {
46
46
found : Expr [A ],
47
47
message : Expr [String ],
48
48
listener : Expr [RecorderListener [A , R ]]): Expr [R ] = {
49
- val expectedArg : Term = expected.asTerm.underlyingArgument
50
- val foundArg : Term = found.asTerm.underlyingArgument
49
+ val expectedArg : Term = expected.asTerm
50
+ val foundArg : Term = found.asTerm
51
51
52
52
' {
53
53
val recorderRuntime : RecorderRuntime [A , R ] = new RecorderRuntime ($listener)
@@ -97,13 +97,15 @@ class RecorderMacro(using qctx0: Quotes) {
97
97
}
98
98
99
99
private [this ] def recordAllValues (runtime : Term , expr : Term ): Term =
100
+ // TODO use an TreeMap or an ExprMap
100
101
expr match {
101
102
case New (_) => expr
102
103
case Literal (_) => expr
103
104
case Typed (r @ Repeated (xs, y), tpe) => Typed .copy(r)(recordSubValues(runtime, r), tpe)
104
105
// don't record value of implicit "this" added by compiler; couldn't find a better way to detect implicit "this" than via point
105
106
case Select (x@ This (_), y) if expr.pos.start == x.pos.start => expr
106
107
// case x: Select if x.symbol.isModule => expr // don't try to record the value of packages
108
+ case Inlined (call, Nil , t) => Inlined .copy(expr)(call, Nil , recordAllValues(runtime, t))
107
109
case _ => recordValue(runtime, recordSubValues(runtime, expr), expr)
108
110
}
109
111
0 commit comments