summaryrefslogtreecommitdiff
path: root/src/continuations/plugin
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-10-31 07:15:01 -0700
committerPaul Phillips <paulp@improving.org>2012-10-31 07:54:24 -0700
commit202a949afeb4877318432ffff8e3ffdc14df9615 (patch)
tree4021376fcbcfe5d8bc5066ec6d9039fdd2097f88 /src/continuations/plugin
parentb480d991072e6e68ed46574d87e4483da778ff0e (diff)
parent8aec78470637f42f50981f8034215a709602dbad (diff)
downloadscala-202a949afeb4877318432ffff8e3ffdc14df9615.tar.gz
scala-202a949afeb4877318432ffff8e3ffdc14df9615.tar.bz2
scala-202a949afeb4877318432ffff8e3ffdc14df9615.zip
Merge branch 'merge-2.10.0-wip' into merge-2.10.x
* merge-2.10.0-wip: Use Typed rather than .setType Wider use and a new variant of typedPos. SI-6575 Plug inference leak of AbstractPartialFun Remove compiler phases that don't influence scaladoc generation. Disabled generation of _1, _2, etc. methods. SI-6526 Additional test case. Fix SI-6552, regression with self types. avoid single-art assert where harmful in duration-tck Fix for SI-6537, inaccurate unchecked warning. Crash on missing accessor (internal bug in the lazy vals implementation) instead of trying to recover from the bug Incorporated changes suggested in code review Added one more test for SI-6358 Closes SI-6358. Move accessor generation for lazy vals to typers. SI-6526 Tail call elimination should descend deeper. Remove unneeded calls to substring() Changes Tree and Type members from vals to defs. Scaladoc knows the package structure of the libraries, so don't include them in external documentation setting. Fixes SI-6170: issue with dragging scaladoc splitter over central iframe Added a Swing ColorChooser wrapper Added a Swing PopupMenu wrapper Conflicts: src/compiler/scala/reflect/reify/phases/Reshape.scala src/compiler/scala/tools/nsc/typechecker/Duplicators.scala src/continuations/plugin/scala/tools/selectivecps/SelectiveCPSTransform.scala src/reflect/scala/reflect/internal/Types.scala test/files/neg/unchecked-knowable.check
Diffstat (limited to 'src/continuations/plugin')
-rw-r--r--src/continuations/plugin/scala/tools/selectivecps/SelectiveCPSTransform.scala22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/continuations/plugin/scala/tools/selectivecps/SelectiveCPSTransform.scala b/src/continuations/plugin/scala/tools/selectivecps/SelectiveCPSTransform.scala
index eb23e1276c..f4b0fb0419 100644
--- a/src/continuations/plugin/scala/tools/selectivecps/SelectiveCPSTransform.scala
+++ b/src/continuations/plugin/scala/tools/selectivecps/SelectiveCPSTransform.scala
@@ -193,12 +193,12 @@ abstract class SelectiveCPSTransform extends PluginComponent with
val pos = catches.head.pos
val funSym = currentOwner.newValueParameter(cpsNames.catches, pos).setInfo(appliedType(PartialFunctionClass, ThrowableClass.tpe, targettp))
- val funDef = localTyper.typed(atPos(pos) {
+ val funDef = localTyper.typedPos(pos) {
ValDef(funSym, Match(EmptyTree, catches1))
- })
- val expr2 = localTyper.typed(atPos(pos) {
+ }
+ val expr2 = localTyper.typedPos(pos) {
Apply(Select(expr1, expr1.tpe.member(cpsNames.flatMapCatch)), List(Ident(funSym)))
- })
+ }
val exSym = currentOwner.newValueParameter(cpsNames.ex, pos).setInfo(ThrowableClass.tpe)
@@ -223,7 +223,7 @@ abstract class SelectiveCPSTransform extends PluginComponent with
val pos = finalizer.pos
val finalizer2 = duplicateTree(finalizer1)
val fun = Function(List(), finalizer2)
- val expr3 = localTyper.typed(atPos(pos) { Apply(Select(expr2, expr2.tpe.member("mapFinally")), List(fun)) })
+ val expr3 = localTyper.typedPos(pos) { Apply(Select(expr2, expr2.tpe.member("mapFinally")), List(fun)) }
val chown = new ChangeOwnerTraverser(currentOwner, fun.symbol)
chown.traverse(finalizer2)
@@ -290,7 +290,7 @@ abstract class SelectiveCPSTransform extends PluginComponent with
val body1 = (new TreeSymSubstituter(List(vd.symbol), List(ctxValSym)))(body)
- val body2 = localTyper.typed(atPos(vd.symbol.pos) { body1 })
+ val body2 = localTyper.typedPos(vd.symbol.pos) { body1 }
// in theory it would be nicer to look for an @cps annotation instead
// of testing for Context
@@ -304,7 +304,7 @@ abstract class SelectiveCPSTransform extends PluginComponent with
def applyCombinatorFun(ctxR: Tree, body: Tree) = {
val arg = currentOwner.newValueParameter(name, ctxR.pos).setInfo(tpe)
val body1 = (new TreeSymSubstituter(List(vd.symbol), List(arg)))(body)
- val fun = localTyper.typed(atPos(vd.symbol.pos) { Function(List(ValDef(arg)), body1) }) // types body as well
+ val fun = localTyper.typedPos(vd.symbol.pos) { Function(List(ValDef(arg)), body1) } // types body as well
arg.owner = fun.symbol
body1.changeOwner(currentOwner -> fun.symbol)
@@ -328,9 +328,9 @@ abstract class SelectiveCPSTransform extends PluginComponent with
debuglog("will use method:"+methodName)
- localTyper.typed(atPos(vd.symbol.pos) {
+ localTyper.typedPos(vd.symbol.pos) {
Apply(Select(ctxR, ctxR.tpe.member(methodName)), List(fun))
- })
+ }
}
def mkBlock(stms: List[Tree], expr: Tree) = if (stms.nonEmpty) Block(stms, expr) else expr
@@ -352,12 +352,12 @@ abstract class SelectiveCPSTransform extends PluginComponent with
def ctxRef = localTyper.typed(Ident(ctxSym))
val argSym = currentOwner.newValue(vd.symbol.name).setInfo(tpe)
val argDef = localTyper.typed(ValDef(argSym, Select(ctxRef, ctxRef.tpe.member(cpsNames.getTrivialValue))))
- val switchExpr = localTyper.typed(atPos(vd.symbol.pos) {
+ val switchExpr = localTyper.typedPos(vd.symbol.pos) {
val body2 = mkBlock(bodyStms, bodyExpr).duplicate // dup before typing!
If(Select(ctxRef, ctxSym.tpe.member(cpsNames.isTrivial)),
applyTrivial(argSym, mkBlock(argDef::bodyStms, bodyExpr)),
applyCombinatorFun(ctxRef, body2))
- })
+ }
(List(ctxDef), switchExpr)
} else {
// ctx.flatMap { <lhs> => ... }