Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions compiler/src/dotty/tools/dotc/transform/ReifyQuotes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,18 @@ class ReifyQuotes extends MacroTransformWithImplicits {

override def phaseName: String = "reifyQuotes"

override def checkPostCondition(tree: Tree)(implicit ctx: Context): Unit = {
tree match {
case tree: RefTree if !ctx.inTransparentMethod =>
assert(!tree.symbol.isQuote)
// assert(!tree.symbol.isSplice) // TODO widen ~ type references at stage 0?
assert(tree.symbol != defn.QuotedExpr_~)
case tree: Select if tree.symbol == defn.QuotedExpr_~ =>
assert(Splicer.canBeSpliced(tree.qualifier))
case _ =>
}
}

override def run(implicit ctx: Context): Unit =
if (ctx.compilationUnit.containsQuotesOrSplices) super.run

Expand Down