diff options
Diffstat (limited to 'sources/scalac/transformer/LambdaLift.java')
-rw-r--r-- | sources/scalac/transformer/LambdaLift.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sources/scalac/transformer/LambdaLift.java b/sources/scalac/transformer/LambdaLift.java index 9384055c77..6e14e6ff66 100644 --- a/sources/scalac/transformer/LambdaLift.java +++ b/sources/scalac/transformer/LambdaLift.java @@ -38,6 +38,7 @@ public class LambdaLift extends OwnerTransformer final Definitions definitions; final FreeVars free; final LambdaLiftPhase descr; + private Unit unit; public LambdaLift(Global global, LambdaLiftPhase descr) { super(global); @@ -48,6 +49,7 @@ public class LambdaLift extends OwnerTransformer } public void apply(Unit unit) { + this.unit = unit; global.log(unit.source.toString()); free.initialize(unit); currentOwner = global.definitions.ROOT_CLASS; @@ -412,6 +414,12 @@ public class LambdaLift extends OwnerTransformer //new scalac.ast.printer.TextTreePrinter().print("TUPLE: ").print(tree).print("\n ==> \n").print(tree1).println().end();//DEBUG return tree1; + case Return(Tree expr): + if (tree.symbol() != currentOwner.enclMethod()) { + unit.error(tree.pos, "non-local return not yet implemented"); + } + return super.transform(tree); + case Apply(Tree fn, Tree[] args): Symbol fsym = TreeInfo.methSymbol(fn); Tree fn1 = transform(fn); |