Cleanup (test data format)

master
Roman Shevchenko 6 years ago
parent eaa2830596
commit 866661df29
  1. 2
      test/org/jetbrains/java/decompiler/SingleClassesTest.java
  2. BIN
      testData/classes/pkg/TestSuspendLambdaKt$sl1$1.class
  3. BIN
      testData/classes/pkg/TestSuspendLambdaKt.class
  4. 132
      testData/results/TestSuspendLambdaKt.dec
  5. 1
      testData/src/pkg/TestSuspendLambda.kt

@ -123,7 +123,7 @@ public class SingleClassesTest {
@Test public void testGroovyClass() { doTest("pkg/TestGroovyClass"); } @Test public void testGroovyClass() { doTest("pkg/TestGroovyClass"); }
@Test public void testGroovyTrait() { doTest("pkg/TestGroovyTrait"); } @Test public void testGroovyTrait() { doTest("pkg/TestGroovyTrait"); }
@Test public void testPrivateClasses() { doTest("pkg/PrivateClasses"); } @Test public void testPrivateClasses() { doTest("pkg/PrivateClasses"); }
@Test public void testSuspendLambdaKt() { doTest("pkg/TestSuspendLambdaKt"); } @Test public void testSuspendLambda() { doTest("pkg/TestSuspendLambdaKt"); }
private void doTest(String testFile, String... companionFiles) { private void doTest(String testFile, String... companionFiles) {
ConsoleDecompiler decompiler = fixture.getDecompiler(); ConsoleDecompiler decompiler = fixture.getDecompiler();

@ -1,8 +1,11 @@
package pkg;
import kotlin.Metadata; import kotlin.Metadata;
import kotlin.Unit; import kotlin.Unit;
import kotlin.SuccessOrFailure.Failure; import kotlin.Result.Failure;
import kotlin.coroutines.Continuation; import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.IntrinsicsKt; import kotlin.coroutines.intrinsics.IntrinsicsKt;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda; import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function1; import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics; import kotlin.jvm.internal.Intrinsics;
@ -10,10 +13,9 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
@Metadata( @Metadata(
mv = {1, 1, 11}, mv = {1, 1, 13},
bv = {1, 0, 2}, bv = {1, 0, 3},
k = 2, k = 2,
xi = 2,
d1 = {"\u0000\u0016\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\u0010\u0000\n\u0002\b\u0003\",\u0010\u0000\u001a\u0018\b\u0001\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00030\u0002\u0012\u0006\u0012\u0004\u0018\u00010\u00040\u0001ø\u0001\u0000¢\u0006\n\n\u0002\u0010\u0007\u001a\u0004\b\u0005\u0010\u0006\u0082\u0002\u0004\n\u0002\b\u0019"}, d1 = {"\u0000\u0016\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\u0010\u0000\n\u0002\b\u0003\",\u0010\u0000\u001a\u0018\b\u0001\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00030\u0002\u0012\u0006\u0012\u0004\u0018\u00010\u00040\u0001ø\u0001\u0000¢\u0006\n\n\u0002\u0010\u0007\u001a\u0004\b\u0005\u0010\u0006\u0082\u0002\u0004\n\u0002\b\u0019"},
d2 = {"sl1", "Lkotlin/Function1;", "Lkotlin/coroutines/Continuation;", "", "", "getSl1", "()Lkotlin/jvm/functions/Function1;", "Lkotlin/jvm/functions/Function1;"} d2 = {"sl1", "Lkotlin/Function1;", "Lkotlin/coroutines/Continuation;", "", "", "getSl1", "()Lkotlin/jvm/functions/Function1;", "Lkotlin/jvm/functions/Function1;"}
) )
@ -27,29 +29,37 @@ public final class TestSuspendLambdaKt {
} }
static { static {
@DebugMetadata(
f = "TestSuspendLambda.kt",
l = {3},
i = {},
s = {},
n = {},
m = "invokeSuspend",
c = "pkg/TestSuspendLambdaKt$sl1$1"
)
@Metadata( @Metadata(
mv = {1, 1, 11}, mv = {1, 1, 13},
bv = {1, 0, 2}, bv = {1, 0, 3},
k = 3, k = 3,
xi = 2,
d1 = {"\u0000\n\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0000\u001a\u00020\u0001H\u008a@ø\u0001\u0000¢\u0006\u0004\b\u0002\u0010\u0003"}, d1 = {"\u0000\n\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0000\u001a\u00020\u0001H\u008a@ø\u0001\u0000¢\u0006\u0004\b\u0002\u0010\u0003"},
d2 = {"<anonymous>", "", "invoke", "(Lkotlin/coroutines/Continuation;)Ljava/lang/Object;"} d2 = {"<anonymous>", "", "invoke", "(Ljava/lang/Object;)Ljava/lang/Object;"}
) )
final class NamelessClass_1 extends SuspendLambda implements Function1<Continuation<? super Unit>, Object> { final class NamelessClass_1 extends SuspendLambda implements Function1<Continuation<? super Unit>, Object> {
int label; int label;
@Nullable @Nullable
public final Object invokeSuspend(@NotNull Object var1) { public final Object invokeSuspend(@NotNull Object result) {
Object var3 = IntrinsicsKt.getCOROUTINE_SUSPENDED(); Object var3 = IntrinsicsKt.getCOROUTINE_SUSPENDED();
switch(this.label) { switch(this.label) {
case 0: case 0:
if (var1 instanceof Failure) { if (result instanceof Failure) {
throw ((Failure)var1).exception; throw ((Failure)result).exception;
} }
String var2 = "SL1";// 3 String var2 = "SL1";// 4
System.out.println(var2); System.out.println(var2);
return Unit.INSTANCE;// 4 return Unit.INSTANCE;// 5
default: default:
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine"); throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
} }
@ -60,80 +70,80 @@ public final class TestSuspendLambdaKt {
} }
@NotNull @NotNull
public final Continuation<Unit> create(@NotNull Continuation<? super Unit> continuation) { public final Continuation<Unit> create(@NotNull Continuation<?> completion) {
Intrinsics.checkParameterIsNotNull(continuation, "continuation"); Intrinsics.checkParameterIsNotNull(completion, "completion");
NamelessClass_1 var2 = new NamelessClass_1(continuation); NamelessClass_1 var2 = new NamelessClass_1(completion);
return var2; return var2;
} }
@Nullable public final Object invoke(Object var1) {
public final Object invoke(@NotNull Continuation<? super Unit> continuation) { return ((NamelessClass_1)this.create((Continuation)var1)).invokeSuspend(Unit.INSTANCE);
return ((NamelessClass_1)this.create(continuation)).invokeSuspend(Unit.INSTANCE);
} }
} }
sl1 = (Function1)(new NamelessClass_1((Continuation)null));// 2 sl1 = (Function1)(new NamelessClass_1((Continuation)null));// 3
} }
} }
class 'TestSuspendLambdaKt' { class 'pkg/TestSuspendLambdaKt' {
method 'getSl1 ()Lkotlin/jvm/functions/Function1;' { method 'getSl1 ()Lkotlin/jvm/functions/Function1;' {
0 25 0 27
3 25 3 27
} }
method '<clinit> ()V' { method '<clinit> ()V' {
4 74 4 83
8 74 8 83
b 74 b 83
e 75 e 84
} }
} }
class 'TestSuspendLambdaKt$sl1$1' { class 'pkg/TestSuspendLambdaKt$sl1$1' {
method 'invokeSuspend (Ljava/lang/Object;)Ljava/lang/Object;' { method 'invokeSuspend (Ljava/lang/Object;)Ljava/lang/Object;' {
0 42 0 52
3 42 3 52
5 43 5 53
8 43 8 53
1e 45 1e 55
21 45 21 55
24 46 24 56
27 46 27 56
2a 46 2a 56
2c 49 2c 59
2e 49 2e 59
2f 50 2f 60
33 50 33 60
36 51 36 61
39 51 39 61
3e 53 3e 63
43 53 43 63
} }
method '<init> (Lkotlin/coroutines/Continuation;)V' { method '<init> (Lkotlin/coroutines/Continuation;)V' {
1 58 1 68
3 58 3 68
6 59 6 69
} }
method 'create (Lkotlin/coroutines/Continuation;)Lkotlin/coroutines/Continuation;' { method 'create (Lkotlin/coroutines/Continuation;)Lkotlin/coroutines/Continuation;' {
1 63 1 73
3 63 3 73
e 64 e 74
10 65 10 75
} }
method 'invoke (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;' { method 'invoke (Ljava/lang/Object;)Ljava/lang/Object;' {
2 70 2 79
5 70 5 79
8 70 8 79
b 70 b 79
e 70 e 79
11 79
} }
} }
Lines mapping: Lines mapping:
2 <-> 75 3 <-> 84
3 <-> 50 4 <-> 60
4 <-> 52 5 <-> 62

@ -1,3 +1,4 @@
package pkg
val sl1: suspend () -> Unit = { val sl1: suspend () -> Unit = {
println("SL1") println("SL1")

Loading…
Cancel
Save