@@ -391,80 +391,80 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
391
391
392
392
def ModuleDef (tree : Tree )(name : TermName , impl : Template ) = tree match {
393
393
case tree : ModuleDef if (name eq tree.name) && (impl eq tree.impl) => tree
394
- case _ => untpd.ModuleDef (name, impl).withPos(tree.pos )
394
+ case _ => finalize(tree, untpd.ModuleDef (name, impl))
395
395
}
396
396
def ParsedTry (tree : Tree )(expr : Tree , handler : Tree , finalizer : Tree ) = tree match {
397
397
case tree : ParsedTry
398
398
if (expr eq tree.expr) && (handler eq tree.handler) && (finalizer eq tree.finalizer) => tree
399
- case _ => untpd.ParsedTry (expr, handler, finalizer).withPos(tree.pos )
399
+ case _ => finalize(tree, untpd.ParsedTry (expr, handler, finalizer))
400
400
}
401
401
def SymbolLit (tree : Tree )(str : String ) = tree match {
402
402
case tree : SymbolLit if str == tree.str => tree
403
- case _ => untpd.SymbolLit (str).withPos(tree.pos )
403
+ case _ => finalize(tree, untpd.SymbolLit (str))
404
404
}
405
405
def InterpolatedString (tree : Tree )(id : TermName , segments : List [Tree ]) = tree match {
406
406
case tree : InterpolatedString if (id eq tree.id) && (segments eq tree.segments) => tree
407
- case _ => untpd.InterpolatedString (id, segments).withPos(tree.pos )
407
+ case _ => finalize(tree, untpd.InterpolatedString (id, segments))
408
408
}
409
409
def Function (tree : Tree )(args : List [Tree ], body : Tree ) = tree match {
410
410
case tree : Function if (args eq tree.args) && (body eq tree.body) => tree
411
- case _ => untpd.Function (args, body).withPos(tree.pos )
411
+ case _ => finalize(tree, untpd.Function (args, body))
412
412
}
413
413
def InfixOp (tree : Tree )(left : Tree , op : Ident , right : Tree ) = tree match {
414
414
case tree : InfixOp if (left eq tree.left) && (op eq tree.op) && (right eq tree.right) => tree
415
- case _ => untpd.InfixOp (left, op, right).withPos(tree.pos )
415
+ case _ => finalize(tree, untpd.InfixOp (left, op, right))
416
416
}
417
417
def PostfixOp (tree : Tree )(od : Tree , op : Ident ) = tree match {
418
418
case tree : PostfixOp if (od eq tree.od) && (op eq tree.op) => tree
419
- case _ => untpd.PostfixOp (od, op).withPos(tree.pos )
419
+ case _ => finalize(tree, untpd.PostfixOp (od, op))
420
420
}
421
421
def PrefixOp (tree : Tree )(op : Ident , od : Tree ) = tree match {
422
422
case tree : PrefixOp if (op eq tree.op) && (od eq tree.od) => tree
423
- case _ => untpd.PrefixOp (op, od).withPos(tree.pos )
423
+ case _ => finalize(tree, untpd.PrefixOp (op, od))
424
424
}
425
425
def Parens (tree : Tree )(t : Tree ) = tree match {
426
426
case tree : Parens if t eq tree.t => tree
427
- case _ => untpd.Parens (t).withPos(tree.pos )
427
+ case _ => finalize(tree, untpd.Parens (t))
428
428
}
429
429
def Tuple (tree : Tree )(trees : List [Tree ]) = tree match {
430
430
case tree : Tuple if trees eq tree.trees => tree
431
- case _ => untpd.Tuple (trees).withPos(tree.pos )
431
+ case _ => finalize(tree, untpd.Tuple (trees))
432
432
}
433
433
def Throw (tree : Tree )(expr : Tree ) = tree match {
434
434
case tree : Throw if expr eq tree.expr => tree
435
- case _ => untpd.Throw (expr).withPos(tree.pos )
435
+ case _ => finalize(tree, untpd.Throw (expr))
436
436
}
437
437
def WhileDo (tree : Tree )(cond : Tree , body : Tree ) = tree match {
438
438
case tree : WhileDo if (cond eq tree.cond) && (body eq tree.body) => tree
439
- case _ => untpd.WhileDo (cond, body).withPos(tree.pos )
439
+ case _ => finalize(tree, untpd.WhileDo (cond, body))
440
440
}
441
441
def DoWhile (tree : Tree )(body : Tree , cond : Tree ) = tree match {
442
442
case tree : DoWhile if (body eq tree.body) && (cond eq tree.cond) => tree
443
- case _ => untpd.DoWhile (body, cond).withPos(tree.pos )
443
+ case _ => finalize(tree, untpd.DoWhile (body, cond))
444
444
}
445
445
def ForYield (tree : Tree )(enums : List [Tree ], expr : Tree ) = tree match {
446
446
case tree : ForYield if (enums eq tree.enums) && (expr eq tree.expr) => tree
447
- case _ => untpd.ForYield (enums, expr).withPos(tree.pos )
447
+ case _ => finalize(tree, untpd.ForYield (enums, expr))
448
448
}
449
449
def ForDo (tree : Tree )(enums : List [Tree ], body : Tree ) = tree match {
450
450
case tree : ForDo if (enums eq tree.enums) && (body eq tree.body) => tree
451
- case _ => untpd.ForDo (enums, body).withPos(tree.pos )
451
+ case _ => finalize(tree, untpd.ForDo (enums, body))
452
452
}
453
453
def GenFrom (tree : Tree )(pat : Tree , expr : Tree ) = tree match {
454
454
case tree : GenFrom if (pat eq tree.pat) && (expr eq tree.expr) => tree
455
- case _ => untpd.GenFrom (pat, expr).withPos(tree.pos )
455
+ case _ => finalize(tree, untpd.GenFrom (pat, expr))
456
456
}
457
457
def GenAlias (tree : Tree )(pat : Tree , expr : Tree ) = tree match {
458
458
case tree : GenAlias if (pat eq tree.pat) && (expr eq tree.expr) => tree
459
- case _ => untpd.GenAlias (pat, expr).withPos(tree.pos )
459
+ case _ => finalize(tree, untpd.GenAlias (pat, expr))
460
460
}
461
461
def ContextBounds (tree : Tree )(bounds : TypeBoundsTree , cxBounds : List [Tree ]) = tree match {
462
462
case tree : ContextBounds if (bounds eq tree.bounds) && (cxBounds eq tree.cxBounds) => tree
463
- case _ => untpd.ContextBounds (bounds, cxBounds).withPos(tree.pos )
463
+ case _ => finalize(tree, untpd.ContextBounds (bounds, cxBounds))
464
464
}
465
465
def PatDef (tree : Tree )(mods : Modifiers , pats : List [Tree ], tpt : Tree , rhs : Tree ) = tree match {
466
466
case tree : PatDef if (mods eq tree.mods) && (pats eq tree.pats) && (tpt eq tree.tpt) && (rhs eq tree.rhs) => tree
467
- case _ => untpd.PatDef (mods, pats, tpt, rhs).withPos(tree.pos )
467
+ case _ => finalize(tree, untpd.PatDef (mods, pats, tpt, rhs))
468
468
}
469
469
}
470
470
0 commit comments