Skip to content

Commit

Permalink
Remove tpt from Quote
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasstucki committed Apr 28, 2023
1 parent 1f62049 commit 5ae7861
Show file tree
Hide file tree
Showing 22 changed files with 69 additions and 67 deletions.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/CompilationUnit.scala
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ object CompilationUnit {
if tree.symbol.is(Flags.Inline) then
containsInline = true
tree match
case tpd.Quote(_, _) =>
case tpd.Quote(_) =>
containsQuote = true
case tree: tpd.Apply if tree.symbol == defn.QuotedTypeModule_of =>
containsQuote = true
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/ast/Desugar.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1986,7 +1986,7 @@ object desugar {
trees foreach collect
case Block(Nil, expr) =>
collect(expr)
case Quote(expr, _) =>
case Quote(expr) =>
new UntypedTreeTraverser {
def traverse(tree: untpd.Tree)(using Context): Unit = tree match {
case Splice(expr, _) => collect(expr)
Expand Down
40 changes: 25 additions & 15 deletions compiler/src/dotty/tools/dotc/ast/Trees.scala
Original file line number Diff line number Diff line change
Expand Up @@ -678,23 +678,33 @@ object Trees {
}

/** A tree representing a quote `'{ expr }`
* `Quote`s are created by the `Parser` with an empty `tpt`. In typer
* they can be typed as a `Quote` with a known `tpt` or desugared and
* typed as a quote pattern.
* `Quote`s are created by the `Parser`. In typer they can be typed as a
* `Quote` with a known `tpt` or desugared and typed as a quote pattern.
*
* `Quotes` are checked and transformed in the `staging`, `splicing` and `pickleQuotes`
* phases. After `pickleQuotes` phase, the only quotes that exist are in `inline`
* methods. These are dropped when we remove the inline method implementations.
*
* The `tpt` will be transformed in `staging` and used in `pickleQuotes` to create the
* pickled representation of the quote.
*
* @param expr The tree that was quoted
* @param tpt The type of the tree that was quoted
*/
case class Quote[+T <: Untyped] private[ast] (expr: Tree[T], tpt: Tree[T])(implicit @constructorOnly src: SourceFile)
case class Quote[+T <: Untyped] private[ast] (expr: Tree[T])(implicit @constructorOnly src: SourceFile)
extends TermTree[T] {
type ThisTree[+T <: Untyped] = Quote[T]

/** Type of the quoted expression as seen from outside the quote */
def exprType(using Context): Type =
val quoteType = typeOpt // Quotes ?=> Expr[T]
val exprType = quoteType.argInfos.last // Expr[T]
exprType.argInfos.head // T

/** Set the type of the quoted expression as seen from outside the quote */
def withExprType(tpe: Type)(using Context): Quote[Type] =
val exprType = // Expr[T]
defn.QuotedExprClass.typeRef.appliedTo(tpe)
val quoteType = // Quotes ?=> Expr[T]
defn.FunctionType(1, isContextual = true)
.appliedTo(defn.QuotesClass.typeRef, exprType)
withType(quoteType)
}

/** A tree representing a splice `${ expr }`
Expand Down Expand Up @@ -1299,9 +1309,9 @@ object Trees {
case tree: Inlined if (call eq tree.call) && (bindings eq tree.bindings) && (expansion eq tree.expansion) => tree
case _ => finalize(tree, untpd.Inlined(call, bindings, expansion)(sourceFile(tree)))
}
def Quote(tree: Tree)(expr: Tree, tpt: Tree)(using Context): Quote = tree match {
case tree: Quote if (expr eq tree.expr) && (tpt eq tree.tpt) => tree
case _ => finalize(tree, untpd.Quote(expr, tpt)(sourceFile(tree)))
def Quote(tree: Tree)(expr: Tree)(using Context): Quote = tree match {
case tree: Quote if (expr eq tree.expr) => tree
case _ => finalize(tree, untpd.Quote(expr)(sourceFile(tree)))
}
def Splice(tree: Tree)(expr: Tree, tpt: Tree)(using Context): Splice = tree match {
case tree: Splice if (expr eq tree.expr) && (tpt eq tree.tpt) => tree
Expand Down Expand Up @@ -1546,8 +1556,8 @@ object Trees {
case Thicket(trees) =>
val trees1 = transform(trees)
if (trees1 eq trees) tree else Thicket(trees1)
case tree @ Quote(expr, tpt) =>
cpy.Quote(tree)(transform(expr), transform(tpt))
case tree @ Quote(expr) =>
cpy.Quote(tree)(transform(expr))
case tree @ Splice(expr, tpt) =>
cpy.Splice(tree)(transform(expr), transform(tpt))
case tree @ Hole(_, _, args, content, tpt) =>
Expand Down Expand Up @@ -1691,8 +1701,8 @@ object Trees {
this(this(x, arg), annot)
case Thicket(ts) =>
this(x, ts)
case Quote(expr, tpt) =>
this(this(x, expr), tpt)
case Quote(expr) =>
this(x, expr)
case Splice(expr, tpt) =>
this(this(x, expr), tpt)
case Hole(_, _, args, content, tpt) =>
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/ast/tpd.scala
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
def Inlined(call: Tree, bindings: List[MemberDef], expansion: Tree)(using Context): Inlined =
ta.assignType(untpd.Inlined(call, bindings, expansion), bindings, expansion)

def Quote(expr: Tree, tpt: Tree)(using Context): Quote =
ta.assignType(untpd.Quote(expr, tpt), tpt)
def Quote(expr: Tree, tpe: Type)(using Context): Quote =
untpd.Quote(expr).withExprType(tpe)

def Splice(expr: Tree, tpt: Tree)(using Context): Splice =
ta.assignType(untpd.Splice(expr, tpt), tpt)
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/ast/untpd.scala
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
def SeqLiteral(elems: List[Tree], elemtpt: Tree)(implicit src: SourceFile): SeqLiteral = new SeqLiteral(elems, elemtpt)
def JavaSeqLiteral(elems: List[Tree], elemtpt: Tree)(implicit src: SourceFile): JavaSeqLiteral = new JavaSeqLiteral(elems, elemtpt)
def Inlined(call: tpd.Tree, bindings: List[MemberDef], expansion: Tree)(implicit src: SourceFile): Inlined = new Inlined(call, bindings, expansion)
def Quote(expr: Tree, tpt: Tree)(implicit src: SourceFile): Quote = new Quote(expr, tpt)
def Quote(expr: Tree)(implicit src: SourceFile): Quote = new Quote(expr)
def Splice(expr: Tree, tpt: Tree)(implicit src: SourceFile): Splice = new Splice(expr, tpt)
def TypeTree()(implicit src: SourceFile): TypeTree = new TypeTree()
def InferredTypeTree()(implicit src: SourceFile): TypeTree = new InferredTypeTree()
Expand Down
6 changes: 3 additions & 3 deletions compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -665,11 +665,11 @@ class TreePickler(pickler: TastyPickler) {
pickleTree(hi)
pickleTree(alias)
}
case Quote(expr, tpt) =>
case tree @ Quote(expr) =>
pickleTree(
// scala.quoted.runtime.Expr.quoted[<tpt>](<expr>)
// scala.quoted.runtime.Expr.quoted[<exprType>](<expr>)
ref(defn.QuotedRuntime_exprQuote)
.appliedToTypeTree(tpt)
.appliedToType(tree.exprType)
.appliedTo(expr)
.withSpan(tree.span)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1269,7 +1269,7 @@ class TreeUnpickler(reader: TastyReader,

def quotedExpr(fn: Tree, args: List[Tree]): Tree =
val TypeApply(_, targs) = fn: @unchecked
Quote(args.head, targs.head)
Quote(args.head, targs.head.tpe)

def splicedExpr(fn: Tree, args: List[Tree]): Tree =
val TypeApply(_, targs) = fn: @unchecked
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/inlines/Inliner.scala
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ class Inliner(val call: tpd.Tree)(using Context):

override def typedQuote(tree: untpd.Quote, pt: Type)(using Context): Tree =
super.typedQuote(tree, pt) match
case Quote(Splice(inner, _), _) => inner
case Quote(Splice(inner, _)) => inner
case tree1 =>
ctx.compilationUnit.needsStaging = true
tree1
Expand Down Expand Up @@ -1070,7 +1070,7 @@ class Inliner(val call: tpd.Tree)(using Context):
else tree match {
case tree: RefTree if tree.isTerm && tree.symbol.isDefinedInCurrentRun && !tree.symbol.isLocal =>
foldOver(tree.symbol :: syms, tree)
case Quote(body, _) =>
case Quote(body) =>
level += 1
try apply(syms, body)
finally level -= 1
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/parsing/Parsers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1262,7 +1262,7 @@ object Parsers {
}
}
in.nextToken()
Quote(t, EmptyTree)
Quote(t)
}
else
if !in.featureEnabled(Feature.symbolLiterals) then
Expand Down Expand Up @@ -2497,7 +2497,7 @@ object Parsers {
val expr =
if (in.token == LBRACKET) inBrackets(typ())
else stagedBlock()
Quote(expr, EmptyTree)
Quote(expr)
}
}
case NEW =>
Expand Down
6 changes: 3 additions & 3 deletions compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -716,9 +716,9 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
"Thicket {" ~~ toTextGlobal(trees, "\n") ~~ "}"
case MacroTree(call) =>
keywordStr("macro ") ~ toTextGlobal(call)
case Quote(expr, tpt) =>
val tptText = (keywordStr("[") ~ toTextGlobal(tpt) ~ keywordStr("]")).provided(!tpt.isEmpty && printDebug)
keywordStr("'") ~ tptText ~ keywordStr("{") ~ toTextGlobal(expr) ~ keywordStr("}")
case tree @ Quote(expr) =>
val exprTypeText = (keywordStr("[") ~ toTextGlobal(tree.exprType) ~ keywordStr("]")).provided(printDebug)
keywordStr("'") ~ exprTypeText ~ keywordStr("{") ~ toTextGlobal(expr) ~ keywordStr("}")
case Splice(expr, tpt) =>
val tptText = (keywordStr("[") ~ toTextGlobal(tpt) ~ keywordStr("]")).provided(!tpt.isEmpty && printDebug)
keywordStr("$") ~ tptText ~ keywordStr("{") ~ toTextGlobal(expr) ~ keywordStr("}")
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/staging/CrossStageSafety.scala
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ class CrossStageSafety extends TreeMapWithStages {
val transformedBody = transformQuoteBody(body, quote.span)
val stripAnnotsDeep: TypeMap = new TypeMap:
def apply(tp: Type): Type = mapOver(tp.stripAnnots)
val tpt1 = TypeTree(healType(quote.tpt.srcPos)(stripAnnotsDeep(quote.tpt.tpe)))
cpy.Quote(quote)(transformedBody, tpt1)
val exprType1 = healType(quote.srcPos)(stripAnnotsDeep(quote.exprType))
cpy.Quote(quote)(transformedBody).withExprType(exprType1)
}

override protected def transformQuotedType(body: Tree, quote: Apply)(using Context): Tree = {
Expand Down
6 changes: 3 additions & 3 deletions compiler/src/dotty/tools/dotc/staging/TreeMapWithStages.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ abstract class TreeMapWithStages extends TreeMapWithImplicits {
* - `quoted.runtime.Expr.quote[T](<body0>)` --> `quoted.runtime.Expr.quote[T](<body>)`
*/
protected def transformQuote(body: Tree, quote: Quote)(using Context): Tree =
cpy.Quote(quote)(body, quote.tpt)
cpy.Quote(quote)(body)

/** Transform the quote `quote` which contains the quoted `body`.
*
Expand Down Expand Up @@ -62,7 +62,7 @@ abstract class TreeMapWithStages extends TreeMapWithImplicits {
try transformQuotedType(quotedTree, tree)
finally inQuoteOrSplice = old

case tree @ Quote(quotedTree, _) =>
case tree @ Quote(quotedTree) =>
val old = inQuoteOrSplice
inQuoteOrSplice = true
try dropEmptyBlocks(quotedTree) match {
Expand All @@ -79,7 +79,7 @@ abstract class TreeMapWithStages extends TreeMapWithImplicits {
val old = inQuoteOrSplice
inQuoteOrSplice = true
try dropEmptyBlocks(splicedTree) match {
case Quote(t, _) =>
case Quote(t) =>
// Optimization: `${ 'x }` --> `x`
transform(t)
case _ =>
Expand Down
3 changes: 1 addition & 2 deletions compiler/src/dotty/tools/dotc/transform/MegaPhase.scala
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,7 @@ class MegaPhase(val miniPhases: Array[MiniPhase]) extends Phase {
case tree: Quote =>
inContext(prepQuote(tree, start)(using outerCtx)) {
val expr = transformTree(tree.expr, start)(using quoteContext)
val tpt = transformTree(tree.tpt, start)
goQuote(cpy.Quote(tree)(expr, tpt), start)
goQuote(cpy.Quote(tree)(expr), start)
}
case tree: Splice =>
inContext(prepSplice(tree, start)(using outerCtx)) {
Expand Down
6 changes: 3 additions & 3 deletions compiler/src/dotty/tools/dotc/transform/PickleQuotes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ class PickleQuotes extends MacroTransform {
protected def newTransformer(using Context): Transformer = new Transformer {
override def transform(tree: tpd.Tree)(using Context): tpd.Tree =
tree match
case Apply(Select(Quote(expr, tpt), nme.apply), List(quotes)) =>
val (contents, codeWithHoles) = makeHoles(expr)
case Apply(Select(quote: Quote, nme.apply), List(quotes)) =>
val (contents, codeWithHoles) = makeHoles(quote.expr)
val sourceRef = Inlines.inlineCallTrace(ctx.owner, tree.sourcePos)
val codeWithHoles2 = Inlined(sourceRef, Nil, codeWithHoles)
val pickled = PickleQuotes(quotes, codeWithHoles2, contents, tpt.tpe, false)
val pickled = PickleQuotes(quotes, codeWithHoles2, contents, quote.exprType, false)
transform(pickled) // pickle quotes that are in the contents
case Apply(TypeApply(_, List(tpt)), List(quotes)) if tree.symbol == defn.QuotedTypeModule_of =>
tpt match
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/transform/PostTyper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisPhase
)
case Block(_, Closure(_, _, tpt)) if ExpandSAMs.needsWrapperClass(tpt.tpe) =>
superAcc.withInvalidCurrentClass(super.transform(tree))
case Quote(expr, _) =>
case Quote(expr) =>
ctx.compilationUnit.needsStaging = true
super.transform(tree)
case tree =>
Expand Down
10 changes: 5 additions & 5 deletions compiler/src/dotty/tools/dotc/transform/Splicer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ object Splicer {
* See: `Staging`
*/
def splice(tree: Tree, splicePos: SrcPos, spliceExpansionPos: SrcPos, classLoader: ClassLoader)(using Context): Tree = tree match {
case Quote(quotedTree, _) => quotedTree
case Quote(quotedTree) => quotedTree
case _ =>
val macroOwner = newSymbol(ctx.owner, nme.MACROkw, Macro | Synthetic, defn.AnyType, coord = tree.span)
try
Expand Down Expand Up @@ -136,7 +136,7 @@ object Splicer {
* See: `Staging`
*/
def checkValidMacroBody(tree: Tree)(using Context): Unit = tree match {
case Quote(_, _) => // ok
case Quote(_) => // ok
case _ =>
type Env = Set[Symbol]

Expand All @@ -155,7 +155,7 @@ object Splicer {
case Block(Nil, expr) => checkIfValidArgument(expr)
case Typed(expr, _) => checkIfValidArgument(expr)

case Apply(Select(Quote(expr, tpt), nme.apply), _) =>
case Apply(Select(Quote(expr), nme.apply), _) =>
val noSpliceChecker = new TreeTraverser {
def traverse(tree: Tree)(using Context): Unit = tree match
case Splice(_, _) =>
Expand Down Expand Up @@ -203,7 +203,7 @@ object Splicer {
case Typed(expr, _) =>
checkIfValidStaticCall(expr)

case Apply(Select(Quote(quoted, tpt), nme.apply), _) =>
case Apply(Select(Quote(quoted), nme.apply), _) =>
// OK, canceled and warning emitted

case Call(fn, args)
Expand Down Expand Up @@ -240,7 +240,7 @@ object Splicer {

override protected def interpretTree(tree: Tree)(implicit env: Env): Object = tree match {
// Interpret level -1 quoted code `'{...}` (assumed without level 0 splices)
case Apply(Select(Quote(expr, _), nme.apply), _) =>
case Apply(Select(Quote(expr), nme.apply), _) =>
val expr1 = expr match {
case expr: Ident if expr.symbol.isAllOf(InlineByNameProxy) =>
// inline proxy for by-name parameter
Expand Down
10 changes: 5 additions & 5 deletions compiler/src/dotty/tools/dotc/transform/Splicing.scala
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class Splicing extends MacroTransform:
override def transform(tree: tpd.Tree)(using Context): tpd.Tree =
assert(level == 0)
tree match
case Apply(Select(Quote(expr, _), nme.apply),List(quotes)) =>
case Apply(Select(Quote(expr), nme.apply),List(quotes)) =>
QuoteTransformer().transform(tree)
case TypeApply(_, _) if tree.symbol == defn.QuotedTypeModule_of =>
QuoteTransformer().transform(tree)
Expand Down Expand Up @@ -134,7 +134,7 @@ class Splicing extends MacroTransform:
typeHoles.put(qual, hole)
hole
cpy.TypeDef(tree)(rhs = hole)
case Apply(Select(Quote(expr, tpt), nme.apply),List(quotes)) =>
case Apply(Select(Quote(expr), nme.apply),List(quotes)) =>
super.transform(tree)(using quoteContext)
case _: Template =>
for sym <- tree.symbol.owner.info.decls do
Expand Down Expand Up @@ -237,7 +237,7 @@ class Splicing extends MacroTransform:
case Splice(expr, tpt) =>
val expr1 = transform(expr)(using spliceContext)
cpy.Splice(tree)(expr1, tpt)
case Apply(sel @ Select(app @ Quote(expr, tpt), nme.apply), quotesArgs) =>
case Apply(sel @ Select(app @ Quote(expr), nme.apply), quotesArgs) =>
expr match
case expr: RefTree if isCaptured(expr.symbol) =>
capturedTerm(expr)
Expand All @@ -246,7 +246,7 @@ class Splicing extends MacroTransform:
if level > 1 then transform(expr)(using quoteContext)
else transformLevel0QuoteContent(expr)(using quoteContext)
}
cpy.Apply(tree)(cpy.Select(sel)(cpy.Quote(app)(newExpr, tpt), nme.apply), quotesArgs)
cpy.Apply(tree)(cpy.Select(sel)(cpy.Quote(app)(newExpr), nme.apply), quotesArgs)
case Apply(TypeApply(typeof, List(tpt)), List(quotes))
if tree.symbol == defn.QuotedTypeModule_of && containsCapturedType(tpt.tpe) =>
val newContent = capturedPartTypes(tpt)
Expand Down Expand Up @@ -412,7 +412,7 @@ class Splicing extends MacroTransform:
Splice(closure, TypeTree(tpe))

private def quoted(expr: Tree)(using Context): Tree =
Quote(expr, TypeTree(expr.tpe.widenTermRefExpr))
Quote(expr, expr.tpe.widenTermRefExpr)
.select(nme.apply)
.appliedTo(quotes.nn)

Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/transform/patmat/Space.scala
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ object SpaceEngine {
def isIrrefutableQuotedPattern(unapp: tpd.Tree, implicits: List[tpd.Tree], pt: Type)(using Context): Boolean = {
implicits.headOption match
// pattern '{ $x: T }
case Some(tpd.Apply(tpd.Select(tpd.Quote(tpd.TypeApply(fn, List(tpt)), _), nme.apply), _))
case Some(tpd.Apply(tpd.Select(tpd.Quote(tpd.TypeApply(fn, List(tpt))), nme.apply), _))
if unapp.symbol.owner.eq(defn.QuoteMatching_ExprMatchModule)
&& fn.symbol.eq(defn.QuotedRuntimePatterns_patternHole) =>
pt <:< defn.QuotedExprClass.typeRef.appliedTo(tpt.tpe)
Expand Down
7 changes: 3 additions & 4 deletions compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ trait QuotesAndSplices {
*/
def typedQuote(tree: untpd.Quote, pt: Type)(using Context): Tree = {
record("typedQuote")
assert(tree.tpt.isEmpty)
tree.expr match {
case untpd.Splice(innerExpr, _) if tree.isTerm && !ctx.mode.is(Mode.Pattern) =>
report.warning("Canceled splice directly inside a quote. '{ ${ XYZ } } is equivalent to XYZ.", tree.srcPos)
Expand All @@ -62,7 +61,7 @@ trait QuotesAndSplices {
// TODO typecheck directly (without `exprQuote`)
val exprQuoteTree = untpd.Apply(untpd.ref(defn.QuotedRuntime_exprQuote.termRef), tree.expr)
val quotedExpr = typedApply(exprQuoteTree, pt)(using quoteContext) match
case Apply(TypeApply(fn, tpt :: Nil), quotedExpr :: Nil) => Quote(quotedExpr, tpt)
case Apply(TypeApply(fn, tpt :: Nil), quotedExpr :: Nil) => Quote(quotedExpr, tpt.tpe)
makeInlineable(quotedExpr.select(nme.apply).appliedTo(quotes).withSpan(tree.span))
}

Expand All @@ -77,7 +76,7 @@ trait QuotesAndSplices {
assert(tree.tpt.isEmpty)
checkSpliceOutsideQuote(tree)
tree.expr match {
case untpd.Quote(innerExpr, _) if innerExpr.isTerm =>
case untpd.Quote(innerExpr) if innerExpr.isTerm =>
report.warning("Canceled quote directly inside a splice. ${ '{ XYZ } } is equivalent to XYZ.", tree.srcPos)
return typed(innerExpr, pt)
case _ =>
Expand Down Expand Up @@ -446,7 +445,7 @@ trait QuotesAndSplices {

val quoteClass = if (quoted.isTerm) defn.QuotedExprClass else defn.QuotedTypeClass
val quotedPattern =
if (quoted.isTerm) tpd.Quote(shape, TypeTree(defn.AnyType)).select(nme.apply).appliedTo(qctx)
if (quoted.isTerm) tpd.Quote(shape, defn.AnyType).select(nme.apply).appliedTo(qctx)
else ref(defn.QuotedTypeModule_of.termRef).appliedToTypeTree(shape).appliedTo(qctx)

val matchModule = if quoted.isTerm then defn.QuoteMatching_ExprMatch else defn.QuoteMatching_TypeMatch
Expand Down
Loading

0 comments on commit 5ae7861

Please sign in to comment.