File tree 4 files changed +14
-10
lines changed
compiler/src/dotty/tools/dotc
4 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -63,11 +63,7 @@ class Interpreter(implicit ctx: Context) {
63
63
* If some error is encountered while interpreting a ctx.error is emitted and a StopInterpretation is thrown.
64
64
*/
65
65
private def interpretTreeImpl (tree : Tree , env : Env ): Object = {
66
- ctx.debuglog(
67
- s """ Interpreting:
68
- | ${tree.show}
69
- | $env
70
- """ .stripMargin)
66
+ // println(s"Interpreting:\n${tree.show}\n$env\n")
71
67
72
68
implicit val pos : Position = tree.pos
73
69
@@ -114,6 +110,9 @@ class Interpreter(implicit ctx: Context) {
114
110
val env2 = bindings.foldLeft(env)((acc, x) => interpretStat(x, acc))
115
111
interpretTreeImpl(expansion, env2)
116
112
113
+ case TypeApply (fn, _) =>
114
+ interpretTreeImpl(fn, env)
115
+
117
116
case Typed (expr, _) =>
118
117
interpretTreeImpl(expr, env)
119
118
@@ -129,7 +128,7 @@ class Interpreter(implicit ctx: Context) {
129
128
case _ =>
130
129
// TODO Add more precise descriptions of why it could not be interpreted.
131
130
// This should be done after the full interpreter is implemented.
132
- throw new StopInterpretation (s " Could not interpret ${tree.show}. Consider extracting logic into a helper def. " , tree.pos)
131
+ throw new StopInterpretation (s " Could not interpret ${tree.show}. Consider extracting logic into a helper def. \n $tree \n " , tree.pos)
133
132
}
134
133
}
135
134
Original file line number Diff line number Diff line change @@ -16,10 +16,7 @@ object Splicer {
16
16
*/
17
17
def splice (tree : Tree )(implicit ctx : Context ): Tree = tree match {
18
18
case Quoted (quotedTree) => quotedTree
19
- case tree : RefTree => reflectiveSplice(tree)
20
- case tree : Apply => reflectiveSplice(tree)
21
- case tree : Inlined => reflectiveSplice(tree)
22
- case tree : Block => reflectiveSplice(tree)
19
+ case _ => reflectiveSplice(tree)
23
20
}
24
21
25
22
/** Splice the Tree for a Quoted expression which is constructed via a reflective call to the given method */
Original file line number Diff line number Diff line change
1
+ import scala .quoted ._
2
+ object Macro {
3
+ inline def ff [T ](implicit t : Type [T ]): Int = ~ impl[T ]
4
+ def impl [T ]: Expr [Int ] = 4
5
+ }
Original file line number Diff line number Diff line change
1
+ object Test {
2
+ Macro .ff[Int ]
3
+ }
You can’t perform that action at this time.
0 commit comments