Skip to content

Commit 78807dc

Browse files
committed
Remove bindings from Inlined tree
1 parent 4e07b5c commit 78807dc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+187
-225
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ abstract class Positioned(implicit @constructorOnly src: SourceFile) extends Pro
7171
* of all children to the right.
7272
*/
7373
def envelope(src: SourceFile, startSpan: Span = NoSpan): Span = this match {
74-
case Trees.Inlined(call, _, _) =>
74+
case Trees.Inlined(call, _) =>
7575
call.span
7676
case _ =>
7777
def include(span: Span, x: Any): Span = x match {

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,8 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
401401
exprPurity(expr)
402402
case Block(stats, expr) =>
403403
minOf(exprPurity(expr), stats.map(statPurity))
404-
case Inlined(_, bindings, expr) =>
405-
minOf(exprPurity(expr), bindings.map(statPurity))
404+
case Inlined(_, expr) =>
405+
exprPurity(expr)
406406
case NamedArg(_, expr) =>
407407
exprPurity(expr)
408408
case _ =>
@@ -599,7 +599,7 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
599599
Some(meth)
600600
case Block(Nil, expr) =>
601601
unapply(expr)
602-
case Inlined(_, bindings, expr) if bindings.forall(isPureBinding) =>
602+
case Inlined(_, expr) =>
603603
unapply(expr)
604604
case _ =>
605605
None
@@ -728,7 +728,7 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
728728
*/
729729
def tupleArgs(tree: Tree)(implicit ctx: Context): List[Tree] = tree match {
730730
case Block(Nil, expr) => tupleArgs(expr)
731-
case Inlined(_, Nil, expr) => tupleArgs(expr)
731+
case Inlined(_, expr) => tupleArgs(expr)
732732
case Apply(fn, args)
733733
if fn.symbol.name == nme.apply &&
734734
fn.symbol.owner.is(Module) &&

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,9 @@ class TreeTypeMap(
106106
val (tmap1, stats1) = transformDefs(stats)
107107
val expr1 = tmap1.transform(expr)
108108
cpy.Block(blk)(stats1, expr1)
109-
case inlined @ Inlined(call, bindings, expanded) =>
110-
val (tmap1, bindings1) = transformDefs(bindings)
111-
val expanded1 = tmap1.transform(expanded)
112-
cpy.Inlined(inlined)(call, bindings1, expanded1)
109+
case inlined @ Inlined(call, expanded) =>
110+
val expanded1 = transform(expanded)
111+
cpy.Inlined(inlined)(call, expanded1)
113112
case cdef @ CaseDef(pat, guard, rhs) =>
114113
val tmap = withMappedSyms(patVars(pat))
115114
val pat1 = tmap.transform(pat)

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

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -590,20 +590,10 @@ object Trees {
590590
* @param call Info about the original call that was inlined
591591
* Until PostTyper, this is the full call, afterwards only
592592
* a reference to the toplevel class from which the call was inlined.
593-
* @param bindings Bindings for proxies to be used in the inlined code
594-
* @param expansion The inlined tree, minus bindings.
595-
*
596-
* The full inlined code is equivalent to
597-
*
598-
* { bindings; expansion }
599-
*
600-
* The reason to keep `bindings` separate is because they are typed in a
601-
* different context: `bindings` represent the arguments to the inlined
602-
* call, whereas `expansion` represents the body of the inlined function.
593+
* @param expansion The inlined tree, including bindings.
603594
*/
604-
case class Inlined[-T >: Untyped] private[ast] (call: tpd.Tree, bindings: List[MemberDef[T]], expansion: Tree[T])(implicit @constructorOnly src: SourceFile)
595+
case class Inlined[-T >: Untyped] private[ast] (call: tpd.Tree, expansion: Tree[T])(implicit @constructorOnly src: SourceFile)
605596
extends Tree[T] {
606-
assert(bindings.isEmpty)
607597
type ThisTree[-T >: Untyped] = Inlined[T]
608598
}
609599

@@ -1081,9 +1071,9 @@ object Trees {
10811071
case tree: SeqLiteral if (elems eq tree.elems) && (elemtpt eq tree.elemtpt) => tree
10821072
case _ => finalize(tree, untpd.SeqLiteral(elems, elemtpt)(sourceFile(tree)))
10831073
}
1084-
def Inlined(tree: Tree)(call: tpd.Tree, bindings: List[MemberDef], expansion: Tree)(implicit ctx: Context): Inlined = tree match {
1085-
case tree: Inlined if (call eq tree.call) && (bindings eq tree.bindings) && (expansion eq tree.expansion) => tree
1086-
case _ => finalize(tree, untpd.Inlined(call, bindings, expansion)(sourceFile(tree)))
1074+
def Inlined(tree: Tree)(call: tpd.Tree, expansion: Tree)(implicit ctx: Context): Inlined = tree match {
1075+
case tree: Inlined if (call eq tree.call) && (expansion eq tree.expansion) => tree
1076+
case _ => finalize(tree, untpd.Inlined(call, expansion)(sourceFile(tree)))
10871077
}
10881078
def SingletonTypeTree(tree: Tree)(ref: Tree)(implicit ctx: Context): SingletonTypeTree = tree match {
10891079
case tree: SingletonTypeTree if (ref eq tree.ref) => tree
@@ -1244,8 +1234,8 @@ object Trees {
12441234
cpy.Try(tree)(transform(block), transformSub(cases), transform(finalizer))
12451235
case SeqLiteral(elems, elemtpt) =>
12461236
cpy.SeqLiteral(tree)(transform(elems), transform(elemtpt))
1247-
case Inlined(call, bindings, expansion) =>
1248-
cpy.Inlined(tree)(call, transformSub(bindings), transform(expansion)(inlineContext(call)))
1237+
case Inlined(call, expansion) =>
1238+
cpy.Inlined(tree)(call, transform(expansion)(inlineContext(call)))
12491239
case TypeTree() =>
12501240
tree
12511241
case SingletonTypeTree(ref) =>
@@ -1368,8 +1358,8 @@ object Trees {
13681358
this(this(this(x, block), handler), finalizer)
13691359
case SeqLiteral(elems, elemtpt) =>
13701360
this(this(x, elems), elemtpt)
1371-
case Inlined(call, bindings, expansion) =>
1372-
this(this(x, bindings), expansion)(inlineContext(call))
1361+
case Inlined(call, expansion) =>
1362+
this(x, expansion)(inlineContext(call))
13731363
case TypeTree() =>
13741364
x
13751365
case SingletonTypeTree(ref) =>

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
152152
def JavaSeqLiteral(elems: List[Tree], elemtpt: Tree)(implicit ctx: Context): JavaSeqLiteral =
153153
ta.assignType(new untpd.JavaSeqLiteral(elems, elemtpt), elems, elemtpt).asInstanceOf[JavaSeqLiteral]
154154

155-
def Inlined(call: Tree, bindings: List[MemberDef], expansion: Tree)(implicit ctx: Context): Inlined =
156-
ta.assignType(untpd.Inlined(call, bindings, expansion), bindings, expansion)
155+
def Inlined(call: Tree, expansion: Tree)(implicit ctx: Context): Inlined =
156+
ta.assignType(untpd.Inlined(call, expansion), expansion)
157157

158158
def TypeTree(tp: Type)(implicit ctx: Context): TypeTree =
159159
untpd.TypeTree().withType(tp)
@@ -643,12 +643,12 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
643643
}
644644
}
645645

646-
override def Inlined(tree: Tree)(call: Tree, bindings: List[MemberDef], expansion: Tree)(implicit ctx: Context): Inlined = {
647-
val tree1 = untpdCpy.Inlined(tree)(call, bindings, expansion)
646+
override def Inlined(tree: Tree)(call: Tree, expansion: Tree)(implicit ctx: Context): Inlined = {
647+
val tree1 = untpdCpy.Inlined(tree)(call, expansion)
648648
tree match {
649-
case tree: Inlined if sameTypes(bindings, tree.bindings) && (expansion.tpe eq tree.expansion.tpe) =>
649+
case tree: Inlined if expansion.tpe eq tree.expansion.tpe =>
650650
tree1.withTypeUnchecked(tree.tpe)
651-
case _ => ta.assignType(tree1, bindings, expansion)
651+
case _ => ta.assignType(tree1, expansion)
652652
}
653653
}
654654

@@ -1023,7 +1023,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
10231023
case defTree: ValOrDefDef => transform(defTree.rhs)
10241024
case _ => tree
10251025
}
1026-
case Inlined(_, _, arg) => transform(arg)
1026+
case Inlined(_, arg) => transform(arg)
10271027
case Block(Nil, arg) => transform(arg)
10281028
case NamedArg(_, arg) => transform(arg)
10291029
case tree => super.transform(tree)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
305305
def Try(expr: Tree, cases: List[CaseDef], finalizer: Tree)(implicit src: SourceFile): Try = new Try(expr, cases, finalizer)
306306
def SeqLiteral(elems: List[Tree], elemtpt: Tree)(implicit src: SourceFile): SeqLiteral = new SeqLiteral(elems, elemtpt)
307307
def JavaSeqLiteral(elems: List[Tree], elemtpt: Tree)(implicit src: SourceFile): JavaSeqLiteral = new JavaSeqLiteral(elems, elemtpt)
308-
def Inlined(call: tpd.Tree, bindings: List[MemberDef], expansion: Tree)(implicit src: SourceFile): Inlined = new Inlined(call, bindings, expansion)
308+
def Inlined(call: tpd.Tree, expansion: Tree)(implicit src: SourceFile): Inlined = new Inlined(call, expansion)
309309
def TypeTree()(implicit src: SourceFile): TypeTree = new TypeTree()
310310
def SingletonTypeTree(ref: Tree)(implicit src: SourceFile): SingletonTypeTree = new SingletonTypeTree(ref)
311311
def RefinedTypeTree(tpt: Tree, refinements: List[Tree])(implicit src: SourceFile): RefinedTypeTree = new RefinedTypeTree(tpt, refinements)

compiler/src/dotty/tools/dotc/core/quoted/PickledQuotes.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ object PickledQuotes {
131131
val argVals = args.map(arg => SyntheticValDef(NameKinds.UniqueName.fresh("x".toTermName), arg).withSpan(arg.span))
132132
def argRefs() = argVals.map(argVal => ref(argVal.symbol))
133133
def rec(fn: Tree): Tree = fn match {
134-
case Inlined(call, bindings, expansion) =>
134+
case Inlined(call, expansion) =>
135135
// this case must go before closureDef to avoid dropping the inline node
136-
cpy.Inlined(fn)(call, bindings, rec(expansion))
136+
cpy.Inlined(fn)(call, rec(expansion))
137137
case closureDef(ddef) =>
138138
val paramSyms = ddef.vparamss.head.map(param => param.symbol)
139139
val paramToVals = paramSyms.zip(argRefs()).toMap

compiler/src/dotty/tools/dotc/core/tasty/TastyFormat.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Standard-Section: "ASTs" TopLevelStat*
8686
TYPED Length expr_Term ascriptionType_Tern
8787
ASSIGN Length lhs_Term rhs_Term
8888
BLOCK Length expr_Term Stat*
89-
INLINED Length expr_Term call_Term? ValOrDefDef*
89+
INLINED Length expr_Term call_Term?
9090
LAMBDA Length meth_Term target_Type?
9191
IF Length [INLINE] cond_Term then_Term else_Term
9292
MATCH Length (IMPLICIT | [INLINE] sel_Term) CaseDef*
@@ -244,7 +244,7 @@ Standard Section: "Comments" Comment*
244244
object TastyFormat {
245245

246246
final val header: Array[Int] = Array(0x5C, 0xA1, 0xAB, 0x1F)
247-
val MajorVersion: Int = 13
247+
val MajorVersion: Int = 14
248248
val MinorVersion: Int = 0
249249

250250
/** Tags used to serialize names */

compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -458,16 +458,11 @@ class TreePickler(pickler: TastyPickler) {
458458
case SeqLiteral(elems, elemtpt) =>
459459
writeByte(REPEATED)
460460
withLength { pickleTree(elemtpt); elems.foreach(pickleTree) }
461-
case Inlined(call, bindings, expansion) =>
461+
case Inlined(call, expansion) =>
462462
writeByte(INLINED)
463-
bindings.foreach(preRegister)
464463
withLength {
465464
pickleTree(expansion)
466465
if (!call.isEmpty) pickleTree(call)
467-
bindings.foreach { b =>
468-
assert(b.isInstanceOf[DefDef] || b.isInstanceOf[ValDef])
469-
pickleTree(b)
470-
}
471466
}
472467
case Bind(name, body) =>
473468
registerDef(tree.symbol)

compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,9 +1106,8 @@ class TreeUnpickler(reader: TastyReader,
11061106
case _ => readTerm()
11071107
}
11081108
val call = ifBefore(end)(maybeCall, EmptyTree)
1109-
val bindings = readStats(ctx.owner, end).asInstanceOf[List[ValOrDefDef]]
1110-
val expansion = exprReader.readTerm() // need bindings in scope, so needs to be read before
1111-
Inlined(call, bindings, expansion)
1109+
val expansion = exprReader.readTerm()
1110+
Inlined(call, expansion)
11121111
case IF =>
11131112
if (nextByte == INLINE) {
11141113
readByte()

compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,10 +415,10 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
415415
}
416416
case SeqLiteral(elems, elemtpt) =>
417417
"[" ~ toTextGlobal(elems, ",") ~ " : " ~ toText(elemtpt) ~ "]"
418-
case tree @ Inlined(call, bindings, body) =>
418+
case tree @ Inlined(call, body) =>
419419
(("/* inlined from " ~ (if (call.isEmpty) "outside" else toText(call)) ~ " */ ") `provided`
420420
!homogenizedView && !ctx.settings.YshowNoInline.value) ~
421-
blockText(bindings :+ body)
421+
toText(body)
422422
case tpt: untpd.DerivedTypeTree =>
423423
"<derived typetree watching " ~ summarized(toText(tpt.watched)) ~ ">"
424424
case TypeTree() =>

compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ private class ExtractDependenciesCollector extends tpd.TreeTraverser { thisTreeT
370370
}
371371

372372
tree match {
373-
case Inlined(call, _, _) if !call.isEmpty =>
373+
case Inlined(call, _) if !call.isEmpty =>
374374
// The inlined call is normally ignored by TreeTraverser but we need to
375375
// record it as a dependency
376376
traverse(call)

compiler/src/dotty/tools/dotc/tastyreflect/KernelImpl.scala

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -477,14 +477,13 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util.
477477
}
478478

479479
def Inlined_call(self: Inlined)(implicit ctx: Context): Option[Tree /* Term | TypeTree */] = optional(self.call)
480-
def Inlined_bindings(self: Inlined)(implicit ctx: Context): List[Definition] = self.bindings
481480
def Inlined_body(self: Inlined)(implicit ctx: Context): Term = self.expansion
482481

483-
def Inlined_apply(call: Option[Tree /* Term | TypeTree */], bindings: List[Definition], expansion: Term)(implicit ctx: Context): Inlined =
484-
withDefaultPos(ctx => tpd.Inlined(call.getOrElse(tpd.EmptyTree), bindings.map { case b: tpd.MemberDef => b }, expansion)(ctx))
482+
def Inlined_apply(call: Option[Tree /* Term | TypeTree */], expansion: Term)(implicit ctx: Context): Inlined =
483+
withDefaultPos(ctx => tpd.Inlined(call.getOrElse(tpd.EmptyTree), expansion)(ctx))
485484

486-
def Inlined_copy(original: Tree)(call: Option[Tree /* Term | TypeTree */], bindings: List[Definition], expansion: Term)(implicit ctx: Context): Inlined =
487-
tpd.cpy.Inlined(original)(call.getOrElse(tpd.EmptyTree), bindings.asInstanceOf[List[tpd.MemberDef]], expansion)
485+
def Inlined_copy(original: Tree)(call: Option[Tree /* Term | TypeTree */], expansion: Term)(implicit ctx: Context): Inlined =
486+
tpd.cpy.Inlined(original)(call.getOrElse(tpd.EmptyTree), expansion)
488487

489488
type Lambda = tpd.Closure
490489

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,9 +365,8 @@ class MegaPhase(val miniPhases: Array[MiniPhase]) extends Phase {
365365
goTry(cpy.Try(tree)(expr, cases, finalizer), start)
366366
case tree: Inlined =>
367367
implicit val ctx = prepInlined(tree, start)(outerCtx)
368-
val bindings = transformSpecificTrees(tree.bindings, start)
369368
val expansion = transformTree(tree.expansion, start)(inlineContext(tree.call))
370-
goInlined(cpy.Inlined(tree)(tree.call, bindings, expansion), start)
369+
goInlined(cpy.Inlined(tree)(tree.call, expansion), start)
371370
case tree: Return =>
372371
implicit val ctx = prepReturn(tree, start)(outerCtx)
373372
val expr = transformTree(tree.expr, start)

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisPhase
169169

170170
private object dropInlines extends TreeMap {
171171
override def transform(tree: Tree)(implicit ctx: Context): Tree = tree match {
172-
case Inlined(call, _, _) =>
173-
cpy.Inlined(tree)(call, Nil, Typed(ref(defn.Predef_undefined), TypeTree(tree.tpe)))
172+
case Inlined(call, _) =>
173+
cpy.Inlined(tree)(call, Typed(ref(defn.Predef_undefined), TypeTree(tree.tpe)))
174174
case _ => super.transform(tree)
175175
}
176176
}
@@ -223,9 +223,9 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisPhase
223223
case _ =>
224224
super.transform(tree1)
225225
}
226-
case Inlined(call, bindings, expansion) if !call.isEmpty =>
226+
case Inlined(call, expansion) if !call.isEmpty =>
227227
val callTrace = Inliner.inlineCallTrace(call.symbol, call.sourcePos)
228-
cpy.Inlined(tree)(callTrace, transformSub(bindings), transform(expansion)(inlineContext(call)))
228+
cpy.Inlined(tree)(callTrace, transform(expansion)(inlineContext(call)))
229229
case tree: Template =>
230230
withNoCheckNews(tree.parents.flatMap(newPart)) {
231231
val templ1 = paramFwd.forwardParamAccessors(tree)

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ class ReifyQuotes extends MacroTransform {
185185
if (level == 0 && !ctx.inInlineMethod) {
186186
val body2 =
187187
if (body1.isType) body1
188-
else Inlined(Inliner.inlineCallTrace(ctx.owner, quote.sourcePos), Nil, body1)
188+
else Inlined(Inliner.inlineCallTrace(ctx.owner, quote.sourcePos), body1)
189189
pickledQuote(body2, splices, body.tpe, isType).withSpan(quote.span)
190190
}
191191
else {
@@ -240,7 +240,7 @@ class ReifyQuotes extends MacroTransform {
240240
// Note that lifted trees are not necessarily expressions and that Inlined nodes are expected to be expressions.
241241
// For example we can have a lifted tree containing the LHS of an assignment (see tests/run-with-compiler/quote-var.scala).
242242
if (splice.isType || outer.embedded.isLiftedSymbol(body.symbol)) hole
243-
else Inlined(EmptyTree, Nil, hole).withSpan(splice.span)
243+
else Inlined(EmptyTree, hole).withSpan(splice.span)
244244
}
245245
}
246246

@@ -311,7 +311,7 @@ class ReifyQuotes extends MacroTransform {
311311
enclosingInlineds match {
312312
case enclosingInline :: _ =>
313313
// In case a tree was inlined inside of the quote and we this closure corresponds to code within it we need to keep the inlined node.
314-
Inlined(enclosingInline, Nil, closure)(ctx.withSource(lambdaOwner.topLevelClass.source))
314+
Inlined(enclosingInline, closure)(ctx.withSource(lambdaOwner.topLevelClass.source))
315315
case Nil => closure
316316
}
317317
}
@@ -387,14 +387,13 @@ class ReifyQuotes extends MacroTransform {
387387

388388

389389
object ReifyQuotes {
390-
import tpd._
391390

392391
val name: String = "reifyQuotes"
393392

394393
def toValue(tree: tpd.Tree): Option[Any] = tree match {
395394
case Literal(Constant(c)) => Some(c)
396395
case Block(Nil, e) => toValue(e)
397-
case Inlined(_, Nil, e) => toValue(e)
396+
case Inlined(_, e) => toValue(e)
398397
case _ => None
399398
}
400399

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ object Splicer {
9595
}
9696

9797
protected def interpretQuote(tree: Tree)(implicit env: Env): Object =
98-
new scala.quoted.Exprs.TastyTreeExpr(Inlined(EmptyTree, Nil, tree).withSpan(tree.span))
98+
new scala.quoted.Exprs.TastyTreeExpr(Inlined(EmptyTree, tree).withSpan(tree.span))
9999

100100
protected def interpretTypeQuote(tree: Tree)(implicit env: Env): Object =
101101
new scala.quoted.Types.TreeType(tree)
@@ -312,7 +312,7 @@ object Splicer {
312312
case quoted: Ident if quoted.symbol.is(InlineByNameProxy) =>
313313
// inline proxy for by-name parameter
314314
quoted.symbol.defTree.asInstanceOf[DefDef].rhs
315-
case Inlined(EmptyTree, _, quoted) => quoted
315+
case Inlined(EmptyTree, quoted) => quoted
316316
case _ => quoted
317317
}
318318
interpretQuote(quoted1)
@@ -356,7 +356,7 @@ object Splicer {
356356
interpretTree(expr)(newEnv)
357357
case NamedArg(_, arg) => interpretTree(arg)
358358

359-
case Inlined(EmptyTree, Nil, expansion) => interpretTree(expansion)
359+
case Inlined(EmptyTree, expansion) => interpretTree(expansion)
360360

361361
case Typed(expr, _) =>
362362
interpretTree(expr)

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,9 +410,6 @@ class TreeChecker extends Phase with SymTransformer {
410410
override def typedBlock(tree: untpd.Block, pt: Type)(implicit ctx: Context): Tree =
411411
withDefinedSyms(tree.stats) { super.typedBlock(tree, pt) }
412412

413-
override def typedInlined(tree: untpd.Inlined, pt: Type)(implicit ctx: Context): Tree =
414-
withDefinedSyms(tree.bindings) { super.typedInlined(tree, pt) }
415-
416413
/** Check that all defined symbols have legal owners.
417414
* An owner is legal if it is either the same as the context's owner
418415
* or there's an owner chain of valdefs starting at the context's owner and

0 commit comments

Comments
 (0)