Permalink
Browse files

SI-6384 - avoid setting owner of function argument explicitly

  • Loading branch information...
1 parent 3281830 commit 1b4af44689905f3d7d46d9ba1590f9a8c9ff5b1d @phaller phaller committed Nov 2, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/continuations/plugin/scala/tools/selectivecps/SelectiveCPSTransform.scala
@@ -21,6 +21,7 @@ abstract class SelectiveCPSTransform extends PluginComponent with
import global._ // the global environment
import definitions._ // standard classes and methods
import typer.atOwner // methods to type trees
+ import symtab.Flags
/** the following two members override abstract members in Transform */
val phaseName: String = "selectivecps"
@@ -191,13 +192,12 @@ abstract class SelectiveCPSTransform extends PluginComponent with
val pos = catches.head.pos
val funSym = currentOwner.newValueParameter(pos, cpsNames.catches).setInfo(appliedType(PartialFunctionClass.tpe, List(ThrowableClass.tpe, targettp)))
- val argSym = currentOwner.newValueParameter(pos, cpsNames.ex).setInfo(ThrowableClass.tpe)
- val rhs = Match(Ident(argSym), catches1)
- val fun = Function(List(ValDef(argSym)), rhs)
+ val rhs = Match(Ident(cpsNames.ex), catches1)
+ val param = ValDef(Modifiers(Flags.PARAM), cpsNames.ex, TypeTree(ThrowableClass.tpe), EmptyTree)
+ val fun = Function(List(param), rhs)
val funDef = localTyper.typed(atPos(pos) {
ValDef(funSym, fun)
})
- argSym.owner = fun.symbol
val expr2 = localTyper.typed(atPos(pos) {
Apply(Select(expr1, expr1.tpe.member(cpsNames.flatMapCatch)), List(Ident(funSym)))
})

0 comments on commit 1b4af44

Please sign in to comment.