test for union types

master
Egor.Ushakov 8 years ago
parent 478e6896e9
commit 195dabf6e6
  1. 1
      test/org/jetbrains/java/decompiler/SingleClassesTest.java
  2. BIN
      testData/classes/pkg/TestUnionType.class
  3. 28
      testData/results/TestUnionType.dec
  4. 10
      testData/src/pkg/TestUnionType.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();

@ -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

@ -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;
}
}
Loading…
Cancel
Save