summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@gmail.com>2014-08-14 16:23:59 +0200
committerLukas Rytz <lukas.rytz@gmail.com>2014-08-19 17:56:20 +0200
commit3bcad9abc0010931b230b182f6f5de7e0860ae45 (patch)
treed16927518d50fd407e9f169452e3f8026b9dcd15 /src
parent22295833c33298064b40469a1ff0e491be5f80a1 (diff)
downloadscala-3bcad9abc0010931b230b182f6f5de7e0860ae45.tar.gz
scala-3bcad9abc0010931b230b182f6f5de7e0860ae45.tar.bz2
scala-3bcad9abc0010931b230b182f6f5de7e0860ae45.zip
Fix indentation in delambdafy
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/transform/Delambdafy.scala50
1 files changed, 25 insertions, 25 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/Delambdafy.scala b/src/compiler/scala/tools/nsc/transform/Delambdafy.scala
index 1f8ab7e887..371061662e 100644
--- a/src/compiler/scala/tools/nsc/transform/Delambdafy.scala
+++ b/src/compiler/scala/tools/nsc/transform/Delambdafy.scala
@@ -252,39 +252,39 @@ abstract class Delambdafy extends Transform with TypingTransformers with ast.Tre
captureProxies2 += ((capture, sym))
}
- // the Optional proxy that will hold a reference to the 'this'
- // object used by the lambda, if any. NoSymbol if there is no this proxy
- val thisProxy = {
- val target = targetMethod(originalFunction)
- if (thisReferringMethods contains target) {
- val sym = anonClass.newVariable(nme.FAKE_LOCAL_THIS, originalFunction.pos, SYNTHETIC)
- sym.info = oldClass.tpe
- sym
- } else NoSymbol
- }
+ // the Optional proxy that will hold a reference to the 'this'
+ // object used by the lambda, if any. NoSymbol if there is no this proxy
+ val thisProxy = {
+ val target = targetMethod(originalFunction)
+ if (thisReferringMethods contains target) {
+ val sym = anonClass.newVariable(nme.FAKE_LOCAL_THIS, originalFunction.pos, SYNTHETIC)
+ sym.info = oldClass.tpe
+ sym
+ } else NoSymbol
+ }
- val decapturify = new DeCapturifyTransformer(captureProxies2, unit, oldClass, anonClass, originalFunction.symbol.pos, thisProxy)
+ val decapturify = new DeCapturifyTransformer(captureProxies2, unit, oldClass, anonClass, originalFunction.symbol.pos, thisProxy)
- val accessorMethod = createAccessorMethod(thisProxy, originalFunction)
+ val accessorMethod = createAccessorMethod(thisProxy, originalFunction)
- val decapturedFunction = decapturify.transform(originalFunction).asInstanceOf[Function]
+ val decapturedFunction = decapturify.transform(originalFunction).asInstanceOf[Function]
- val members = (optionSymbol(thisProxy).toList ++ (captureProxies2 map (_._2))) map {member =>
- anonClass.info.decls enter member
- ValDef(member, gen.mkZero(member.tpe)) setPos decapturedFunction.pos
- }
+ val members = (optionSymbol(thisProxy).toList ++ (captureProxies2 map (_._2))) map {member =>
+ anonClass.info.decls enter member
+ ValDef(member, gen.mkZero(member.tpe)) setPos decapturedFunction.pos
+ }
- // constructor
- val constr = createConstructor(anonClass, members)
+ // constructor
+ val constr = createConstructor(anonClass, members)
- // apply method with same arguments and return type as original lambda.
- val applyMethodDef = createApplyMethod(anonClass, decapturedFunction, accessorMethod, thisProxy)
+ // apply method with same arguments and return type as original lambda.
+ val applyMethodDef = createApplyMethod(anonClass, decapturedFunction, accessorMethod, thisProxy)
- val bridgeMethod = createBridgeMethod(anonClass, originalFunction, applyMethodDef)
+ val bridgeMethod = createBridgeMethod(anonClass, originalFunction, applyMethodDef)
- def fulldef(sym: Symbol) =
- if (sym == NoSymbol) sym.toString
- else s"$sym: ${sym.tpe} in ${sym.owner}"
+ def fulldef(sym: Symbol) =
+ if (sym == NoSymbol) sym.toString
+ else s"$sym: ${sym.tpe} in ${sym.owner}"
bridgeMethod foreach (bm =>
// TODO SI-6260 maybe just create the apply method with the signature (Object => Object) in all cases