Skip to content

Commit 88630ae

Browse files
committed
Return Apply from appliedTo
1 parent dd26907 commit 88630ae

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

compiler/src/dotty/tools/dotc/ast/tpd.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -891,19 +891,19 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
891891
selectWithSig(sym.name, sym.signature)
892892

893893
/** A unary apply node with given argument: `tree(arg)` */
894-
def appliedTo(arg: Tree)(using Context): Tree =
894+
def appliedTo(arg: Tree)(using Context): Apply =
895895
appliedToArgs(arg :: Nil)
896896

897897
/** An apply node with given arguments: `tree(arg, args0, ..., argsN)` */
898-
def appliedTo(arg: Tree, args: Tree*)(using Context): Tree =
898+
def appliedTo(arg: Tree, args: Tree*)(using Context): Apply =
899899
appliedToArgs(arg :: args.toList)
900900

901901
/** An apply node with given argument list `tree(args(0), ..., args(args.length - 1))` */
902902
def appliedToArgs(args: List[Tree])(using Context): Apply =
903903
Apply(tree, args)
904904

905905
/** An applied node that accepts only varargs as arguments */
906-
def appliedToVarargs(args: List[Tree], tpt: Tree)(using Context): Tree =
906+
def appliedToVarargs(args: List[Tree], tpt: Tree)(using Context): Apply =
907907
appliedTo(repeated(args, tpt))
908908

909909
/** The current tree applied to given argument lists:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ class ReifyQuotes extends MacroTransform {
372372
if (tree.isType)
373373
transformSpliceType(body, body.select(tpnme.spliceType))
374374
else
375-
val splice = ref(defn.InternalQuoted_exprSplice).appliedToType(tree.tpe).appliedTo(body).asInstanceOf[Apply]
375+
val splice = ref(defn.InternalQuoted_exprSplice).appliedToType(tree.tpe).appliedTo(body)
376376
transformSplice(body, splice)
377377

378378
case tree: DefDef if tree.symbol.is(Macro) && level == 0 =>

0 commit comments

Comments
 (0)