@@ -5,11 +5,14 @@ import asm.{Opcodes => Flags}
5
5
import scala .collection .JavaConverters ._
6
6
7
7
object Test extends BytecodeTest {
8
+ // Helpful for debugging the test:
9
+ // println(new java.io.File(classpath.asURLs.head.toURI).list().sorted.mkString("\n"))
10
+
8
11
def assertSame (a : Any , b : Any ) = {
9
12
assert(a == b, s " \n a: $a\n b: $b" )
10
13
}
11
14
12
- val publicStatic = Flags .ACC_PUBLIC | Flags .ACC_STATIC
15
+ val publicStatic = Flags .ACC_PUBLIC | Flags .ACC_STATIC
13
16
val publicAbstractInterface = Flags .ACC_PUBLIC | Flags .ACC_ABSTRACT | Flags .ACC_INTERFACE
14
17
15
18
def innerClassNodes (className : String ): List [InnerClassNode ] = {
@@ -266,10 +269,10 @@ object Test extends BytecodeTest {
266
269
267
270
printInnerClassNodes(" A20" )
268
271
269
- val fun1 = lambdaClass(" A20$$anonfun$6 " , " A20$lambda$1" )
270
- val fun2 = lambdaClass(" A20$$anonfun$6 $$anonfun$apply$1" , " A20$lambda$$$nestedInAnonfun$5$1" )
271
- val fun3 = lambdaClass(" A20$$anonfun$6 $$anonfun$apply$3 " , " A20$lambda$$$nestedInAnonfun$5$2" )
272
- val fun4 = lambdaClass(" A20$$anonfun$6 $$anonfun$apply$3 $$anonfun$apply$2 " , " A20$lambda$$$nestedInAnonfun$7$1" )
272
+ val fun1 = lambdaClass(" A20$$anonfun$4 " , " A20$lambda$1" )
273
+ val fun2 = lambdaClass(" A20$$anonfun$4 $$anonfun$apply$1" , " A20$lambda$$$nestedInAnonfun$5$1" )
274
+ val fun3 = lambdaClass(" A20$$anonfun$4 $$anonfun$apply$2 " , " A20$lambda$$$nestedInAnonfun$5$2" )
275
+ val fun4 = lambdaClass(" A20$$anonfun$4 $$anonfun$apply$2 $$anonfun$apply$3 " , " A20$lambda$$$nestedInAnonfun$7$1" )
273
276
274
277
println(" fun1: attribute for itself and the two child closures `() => ()` and `() => () => 1`" )
275
278
printInnerClassNodes(fun1)
@@ -339,9 +342,9 @@ object Test extends BytecodeTest {
339
342
assertEnclosingMethod (" SI_9105$A$3" , " SI_9105" , null , null )
340
343
assertEnclosingMethod (" SI_9105$B$5" , " SI_9105" , " m$1" , " ()Ljava/lang/Object;" )
341
344
assertEnclosingMethod (" SI_9105$C$1" , " SI_9105" , null , null )
342
- assertEnclosingMethod (" SI_9105$D$1" , " SI_9105" , " met" , " ()Lscala/Function0 ;" )
345
+ assertEnclosingMethod (" SI_9105$D$1" , " SI_9105" , " met" , " ()Lscala/Function1 ;" )
343
346
assertEnclosingMethod (" SI_9105$E$1" , " SI_9105" , " m$3" , " ()Ljava/lang/Object;" )
344
- assertEnclosingMethod (" SI_9105$F$1" , " SI_9105" , " met" , " ()Lscala/Function0 ;" )
347
+ assertEnclosingMethod (" SI_9105$F$1" , " SI_9105" , " met" , " ()Lscala/Function1 ;" )
345
348
assertNoEnclosingMethod(" SI_9105$lambda$$met$1" )
346
349
assertNoEnclosingMethod(" SI_9105$lambda$1" )
347
350
assertNoEnclosingMethod(" SI_9105" )
@@ -366,35 +369,35 @@ object Test extends BytecodeTest {
366
369
assert(innerClassNodes(" SI_9105" ).length == 12 ) // the 12 local classes
367
370
} else {
368
371
// comment in innerClassAttribute/Classes_1.scala explains the difference between A / C and D / F.
369
- assertEnclosingMethod (" SI_9105$$anonfun$4 $A$3" , " SI_9105$$anonfun$4 " , null , null )
370
- assertEnclosingMethod (" SI_9105$$anonfun$4 $B$5" , " SI_9105$$anonfun$4 " , " m$1" , " ()Ljava/lang/Object;" )
371
- assertEnclosingMethod (" SI_9105$$anonfun$4 $C$1" , " SI_9105$$anonfun$4 " , null , null )
372
+ assertEnclosingMethod (" SI_9105$$anonfun$5 $A$3" , " SI_9105$$anonfun$5 " , null , null )
373
+ assertEnclosingMethod (" SI_9105$$anonfun$5 $B$5" , " SI_9105$$anonfun$5 " , " m$1" , " ()Ljava/lang/Object;" )
374
+ assertEnclosingMethod (" SI_9105$$anonfun$5 $C$1" , " SI_9105$$anonfun$5 " , null , null )
372
375
assertEnclosingMethod (" SI_9105$$anonfun$met$1$D$1" , " SI_9105$$anonfun$met$1" , null , null )
373
376
assertEnclosingMethod (" SI_9105$$anonfun$met$1$E$1" , " SI_9105$$anonfun$met$1" , " m$3" , " ()Ljava/lang/Object;" )
374
377
assertEnclosingMethod (" SI_9105$$anonfun$met$1$F$1" , " SI_9105$$anonfun$met$1" , null , null )
375
- assertEnclosingMethod (" SI_9105$$anonfun$4 " , " SI_9105" , null , null )
376
- assertEnclosingMethod (" SI_9105$$anonfun$met$1" , " SI_9105" , " met" , " ()Lscala/Function0 ;" )
378
+ assertEnclosingMethod (" SI_9105$$anonfun$5 " , " SI_9105" , null , null )
379
+ assertEnclosingMethod (" SI_9105$$anonfun$met$1" , " SI_9105" , " met" , " ()Lscala/Function1 ;" )
377
380
assertNoEnclosingMethod(" SI_9105" )
378
381
379
- assertLocal(ownInnerClassNode(" SI_9105$$anonfun$4 $A$3" ), " SI_9105$$anonfun$4 $A$3" , " A$3" )
380
- assertLocal(ownInnerClassNode(" SI_9105$$anonfun$4 $B$5" ), " SI_9105$$anonfun$4 $B$5" , " B$5" )
381
- assertLocal(ownInnerClassNode(" SI_9105$$anonfun$4 $C$1" ), " SI_9105$$anonfun$4 $C$1" , " C$1" )
382
+ assertLocal(ownInnerClassNode(" SI_9105$$anonfun$5 $A$3" ), " SI_9105$$anonfun$5 $A$3" , " A$3" )
383
+ assertLocal(ownInnerClassNode(" SI_9105$$anonfun$5 $B$5" ), " SI_9105$$anonfun$5 $B$5" , " B$5" )
384
+ assertLocal(ownInnerClassNode(" SI_9105$$anonfun$5 $C$1" ), " SI_9105$$anonfun$5 $C$1" , " C$1" )
382
385
assertLocal(ownInnerClassNode(" SI_9105$$anonfun$met$1$D$1" ), " SI_9105$$anonfun$met$1$D$1" , " D$1" )
383
386
assertLocal(ownInnerClassNode(" SI_9105$$anonfun$met$1$E$1" ), " SI_9105$$anonfun$met$1$E$1" , " E$1" )
384
387
assertLocal(ownInnerClassNode(" SI_9105$$anonfun$met$1$F$1" ), " SI_9105$$anonfun$met$1$F$1" , " F$1" )
385
388
386
389
// by-name
387
- assertEnclosingMethod(" SI_9105$$anonfun$5 $G$1" , " SI_9105$$anonfun$5 " , null , null )
388
- assertEnclosingMethod(" SI_9105$$anonfun$5 $H$1" , " SI_9105$$anonfun$5 " , " m$2" , " ()Ljava/lang/Object;" )
389
- assertEnclosingMethod(" SI_9105$$anonfun$5 $I$1" , " SI_9105$$anonfun$5 " , null , null )
390
+ assertEnclosingMethod(" SI_9105$$anonfun$6 $G$1" , " SI_9105$$anonfun$6 " , null , null )
391
+ assertEnclosingMethod(" SI_9105$$anonfun$6 $H$1" , " SI_9105$$anonfun$6 " , " m$2" , " ()Ljava/lang/Object;" )
392
+ assertEnclosingMethod(" SI_9105$$anonfun$6 $I$1" , " SI_9105$$anonfun$6 " , null , null )
390
393
assertEnclosingMethod(" SI_9105$$anonfun$bnM$1$J$1" , " SI_9105$$anonfun$bnM$1" , null , null )
391
394
assertEnclosingMethod(" SI_9105$$anonfun$bnM$1$K$2" , " SI_9105$$anonfun$bnM$1" , " m$4" , " ()Ljava/lang/Object;" )
392
395
assertEnclosingMethod(" SI_9105$$anonfun$bnM$1$L$1" , " SI_9105$$anonfun$bnM$1" , null , null )
393
396
394
- assertAnonymous(ownInnerClassNode(" SI_9105$$anonfun$4 " ), " SI_9105$$anonfun$4 " )
397
+ assertAnonymous(ownInnerClassNode(" SI_9105$$anonfun$5 " ), " SI_9105$$anonfun$5 " )
395
398
assertAnonymous(ownInnerClassNode(" SI_9105$$anonfun$met$1" ), " SI_9105$$anonfun$met$1" )
396
399
397
- assert(innerClassNodes(" SI_9105$$anonfun$4 " ).length == 4 ) // itself and three of the local classes
400
+ assert(innerClassNodes(" SI_9105$$anonfun$5 " ).length == 4 ) // itself and three of the local classes
398
401
assert(innerClassNodes(" SI_9105$$anonfun$met$1" ).length == 4 ) // itself and three of the local classes
399
402
assert(innerClassNodes(" SI_9105" ).length == 4 ) // the four anon funs
400
403
}
@@ -474,7 +477,7 @@ object Test extends BytecodeTest {
474
477
testInner(" ImplClassesAreTopLevel$B2$1$class" , b2)
475
478
testInner(" ImplClassesAreTopLevel$B3$1$class" , b3)
476
479
testInner(" ImplClassesAreTopLevel$B4$class" , b4)
477
-
480
+
478
481
testInner(" ImplClassesAreTopLevel$B1" , b1)
479
482
testInner(" ImplClassesAreTopLevel$B2$1" , b2)
480
483
testInner(" ImplClassesAreTopLevel$B3$1" , b3)
@@ -533,13 +536,13 @@ object Test extends BytecodeTest {
533
536
" NestedInValueClass$A$lambda$$g$2$1" ,
534
537
" NestedInValueClass$A$lambda$$f$extension$1" ,
535
538
" NestedInValueClass$A$lambda$$$nestedInAnonfun$13$1" ,
536
- " NestedInValueClass$A$lambda$$$nestedInAnonfun$15$1" ).foreach(assertNoEnclosingMethod)
539
+ " NestedInValueClass$A$lambda$$NestedInValueClass$A$$ $nestedInAnonfun$15$1" ).foreach(assertNoEnclosingMethod)
537
540
testInner(" NestedInValueClass$A" , a, am)
538
541
testInner(" NestedInValueClass$A$" , a, am, b, c)
539
542
testInner(" NestedInValueClass$A$lambda$$g$2$1" , am)
540
543
testInner(" NestedInValueClass$A$lambda$$f$extension$1" , am)
541
544
testInner(" NestedInValueClass$A$lambda$$$nestedInAnonfun$13$1" , am)
542
- testInner(" NestedInValueClass$A$lambda$$$nestedInAnonfun$15$1" , am)
545
+ testInner(" NestedInValueClass$A$lambda$$NestedInValueClass$A$$ $nestedInAnonfun$15$1" , am)
543
546
} else {
544
547
assertEnclosingMethod(" NestedInValueClass$A$$anonfun$g$2$1" , " NestedInValueClass$A" , null , null )
545
548
assertEnclosingMethod(" NestedInValueClass$A$$anonfun$g$2$1$$anonfun$apply$4" , " NestedInValueClass$A$$anonfun$g$2$1" , null , null )
0 commit comments