diff --git a/test/org/jetbrains/java/decompiler/SingleClassesTest.java b/test/org/jetbrains/java/decompiler/SingleClassesTest.java index fe54ecb..3a213c4 100644 --- a/test/org/jetbrains/java/decompiler/SingleClassesTest.java +++ b/test/org/jetbrains/java/decompiler/SingleClassesTest.java @@ -112,6 +112,7 @@ public class SingleClassesTest { @Test public void testVarArgCalls() { doTest("pkg/TestVarArgCalls"); } @Test public void testLambdaParams() { doTest("pkg/TestLambdaParams"); } @Test public void testInterfaceMethods() { doTest("pkg/TestInterfaceMethods"); } + //@Test public void testUnionType() { doTest("pkg/TestUnionType"); } //TODO: fix private void doTest(String testFile, String... companionFiles) { ConsoleDecompiler decompiler = fixture.getDecompiler(); diff --git a/testData/classes/pkg/TestUnionType.class b/testData/classes/pkg/TestUnionType.class new file mode 100644 index 0000000..b299158 Binary files /dev/null and b/testData/classes/pkg/TestUnionType.class differ diff --git a/testData/results/TestUnionType.dec b/testData/results/TestUnionType.dec new file mode 100644 index 0000000..1b541d8 --- /dev/null +++ b/testData/results/TestUnionType.dec @@ -0,0 +1,28 @@ +package pkg; + +import java.io.Serializable; +import java.util.Comparator; + +public interface TestUnionType { + static Comparator comparingInt() { + return (Comparator & Serializable)((c1, c2) -> {// 8 + return 1; + })); + } +} + +class 'pkg/TestUnionType' { + method 'lambda$comparingInt$ff46620a$1 (Ljava/lang/Object;Ljava/lang/Object;)I' { + 0 8 + 1 8 + } + + method 'comparingInt ()Ljava/util/Comparator;' { + 5 7 + 8 7 + b 7 + } +} + +Lines mapping: +8 <-> 8 diff --git a/testData/src/pkg/TestUnionType.java b/testData/src/pkg/TestUnionType.java new file mode 100644 index 0000000..13c2bf7 --- /dev/null +++ b/testData/src/pkg/TestUnionType.java @@ -0,0 +1,10 @@ +package pkg; + +import java.io.Serializable; +import java.util.Comparator; + +public interface TestUnionType { + public static Comparator comparingInt() { + return (Comparator & Serializable)(c1, c2) -> 1; + } +}