Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

SI-6384 - avoid setting owner of function argument explicitly

  • Loading branch information...
commit 1b4af44689905f3d7d46d9ba1590f9a8c9ff5b1d 1 parent 3281830
Philipp Haller phaller authored
8 src/continuations/plugin/scala/tools/selectivecps/SelectiveCPSTransform.scala
View
@@ -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)))
})
Please sign in to comment.
Something went wrong with that request. Please try again.