From 1d70cacca1864ae536e2e1d31d117d43dbc92c24 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Fri, 31 Aug 2012 16:18:42 -0700 Subject: Hardening specialization and others. Cleaned up some logic which has become unreasonably circuitous over time. Gave "mkSuperSelect" an accurate name (it's now "mkSuperInitCall".) Put in better logging for spotting OverloadedTypes which should not be. --- src/compiler/scala/tools/nsc/ast/TreeGen.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/compiler/scala/tools/nsc/ast/TreeGen.scala') diff --git a/src/compiler/scala/tools/nsc/ast/TreeGen.scala b/src/compiler/scala/tools/nsc/ast/TreeGen.scala index 0e65bfca6d..3177ceefcd 100644 --- a/src/compiler/scala/tools/nsc/ast/TreeGen.scala +++ b/src/compiler/scala/tools/nsc/ast/TreeGen.scala @@ -54,7 +54,7 @@ abstract class TreeGen extends reflect.internal.TreeGen with TreeDSL { // wrap the given expression in a SoftReference so it can be gc-ed def mkSoftRef(expr: Tree): Tree = atPos(expr.pos) { val constructor = SoftReferenceClass.info.nonPrivateMember(nme.CONSTRUCTOR).suchThat(_.paramss.flatten.size == 1) - NewFromConstructor(constructor, List(expr)) + NewFromConstructor(constructor, expr) } // annotate the expression with @unchecked @@ -209,7 +209,7 @@ abstract class TreeGen extends reflect.internal.TreeGen with TreeDSL { else AppliedTypeTree(Ident(clazz), targs map TypeTree) )) } - def mkSuperSelect = Select(Super(This(tpnme.EMPTY), tpnme.EMPTY), nme.CONSTRUCTOR) + def mkSuperInitCall: Select = Select(Super(This(tpnme.EMPTY), tpnme.EMPTY), nme.CONSTRUCTOR) def wildcardStar(tree: Tree) = atPos(tree.pos) { Typed(tree, Ident(tpnme.WILDCARD_STAR)) } @@ -360,8 +360,8 @@ abstract class TreeGen extends reflect.internal.TreeGen with TreeDSL { */ def mkSynchronizedCheck(clazz: Symbol, cond: Tree, syncBody: List[Tree], stats: List[Tree]): Tree = mkSynchronizedCheck(mkAttributedThis(clazz), cond, syncBody, stats) - - def mkSynchronizedCheck(attrThis: Tree, cond: Tree, syncBody: List[Tree], stats: List[Tree]): Tree = + + def mkSynchronizedCheck(attrThis: Tree, cond: Tree, syncBody: List[Tree], stats: List[Tree]): Tree = Block(mkSynchronized( attrThis, If(cond, Block(syncBody: _*), EmptyTree)) :: -- cgit v1.2.3