From 0bcc871e3f4c4331fb53ec0e7087669589a607d6 Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Wed, 21 Jan 2015 19:57:45 +0100 Subject: SI-9105 Fix EnclosingMethod for classes defined in lambdas This change fixes both GenASM and GenBCode, except for the change to renaming in LamdaLift mentioned below. The reason for an inconsistent EnclosingMethod attribute was the symbol owner chain. Initially, closure class symbols don't exist, they are only created in UnCurry (delambdafy:inline). So walking the originalOwner of a definition does not yield closure classes. The commit also fixes uses of isAnonymousClass, isAnonymousFunction and isDelambdafyFunction in two ways: 1. by phase-travelling to an early phase. after flatten, the name includes the name of outer classes, so the properties may become accidentally true (they check for a substring in the name) 2. by ensuring that the (destructive) renames during LambdaLift don't make the above properties accidentally true. This was in fact the cause for SI-8900. --- test/files/jvm/t9105.check | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/files/jvm/t9105.check (limited to 'test/files/jvm/t9105.check') diff --git a/test/files/jvm/t9105.check b/test/files/jvm/t9105.check new file mode 100644 index 0000000000..34750833f1 --- /dev/null +++ b/test/files/jvm/t9105.check @@ -0,0 +1,18 @@ +#partest !-Ydelambdafy:method +(class C$$anonfun$1$A$1,class C$$anonfun$1,null) +(class C$$anonfun$1$B$1,class C$$anonfun$1,private final java.lang.Object C$$anonfun$1.m$1()) +(class C$$anonfun$1$C$1,class C$$anonfun$1,null) +(class C$$anonfun$1$$anonfun$2$D$1,class C$$anonfun$1$$anonfun$2,null) +(class C$$anonfun$met$1$E$1,class C$$anonfun$met$1,null) +(class C$$anonfun$met$1$F$1,class C$$anonfun$met$1,private final java.lang.Object C$$anonfun$met$1.m$2()) +(class C$$anonfun$met$1$G$1,class C$$anonfun$met$1,null) +(class C$$anonfun$met$1$$anonfun$3$H$1,class C$$anonfun$met$1$$anonfun$3,null) +#partest -Ydelambdafy:method +(class C$A$1,class C,null) +(class C$B$1,class C,private final java.lang.Object C.m$1()) +(class C$C$1,class C,null) +(class C$D$1,class C,null) +(class C$E$1,class C,public scala.Function0 C.met()) +(class C$F$1,class C,private final java.lang.Object C.m$2()) +(class C$G$1,class C,public scala.Function0 C.met()) +(class C$H$1,class C,public scala.Function0 C.met()) -- cgit v1.2.3