Skip to content

Commit 86a2aa6

Browse files
committed
Revert "Add error reporter for inlined quotes"
This reverts commit 0628792.
1 parent 6e0f59a commit 86a2aa6

File tree

5 files changed

+2
-38
lines changed

5 files changed

+2
-38
lines changed

compiler/src/dotty/tools/dotc/transform/ReifyQuotes.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ class ReifyQuotes extends MacroTransformWithImplicits {
336336
}
337337

338338
val tree1 =
339-
if (level == 0) cpy.Inlined(tree)(call, stagedBindings, Splicer.splice(seq(splicedBindings, body).withPos(tree.pos)))
339+
if (level == 0) cpy.Inlined(tree)(call, stagedBindings, Splicer.splice(seq(splicedBindings, body)))
340340
else seq(stagedBindings, cpy.Select(expansion)(cpy.Inlined(tree)(call, splicedBindings, body), name))
341341
val tree2 = transform(tree1)
342342

compiler/src/dotty/tools/dotc/transform/Splicer.scala

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ import dotty.tools.dotc.ast.tpd
55
import dotty.tools.dotc.core.Contexts._
66
import dotty.tools.dotc.core.quoted._
77
import dotty.tools.dotc.interpreter._
8-
import dotty.tools.dotc.core.Decorators._
9-
10-
import java.lang.reflect.InvocationTargetException
118

129
/** Utility class to splice quoted expressions */
1310
object Splicer {
@@ -25,18 +22,7 @@ object Splicer {
2522
/** Splice the Tree for a Quoted expression which is constructed via a reflective call to the given method */
2623
private def reflectiveSplice(tree: Tree)(implicit ctx: Context): Tree = {
2724
val interpreter = new Interpreter
28-
try {
29-
interpreter.interpretTree[scala.quoted.Expr[_]](tree).map(PickledQuotes.quotedExprToTree).getOrElse(tree)
30-
} catch {
31-
case ex: InvocationTargetException => tryRecoverFromTargetException(tree, ex)
32-
}
33-
}
34-
35-
private def tryRecoverFromTargetException(tree: Tree, ex: InvocationTargetException)(implicit ctx: Context): Tree = ex.getCause match {
36-
case ex: scala.quoted.InlineQuote.QuoteError =>
37-
ctx.error(ex.getMessage, tree.pos)
38-
EmptyTree
39-
case _ => throw ex
25+
interpreter.interpretTree[scala.quoted.Expr[_]](tree).map(PickledQuotes.quotedExprToTree).getOrElse(tree)
4026
}
4127

4228
}

library/src/scala/quoted/InlineQuote.scala

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/neg/quote-error/Macro_1.scala

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/neg/quote-error/Test_2.scala

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)