Test function types in decompiler

This commit is contained in:
Pavel V. Talanov
2014-10-27 16:42:37 +03:00
parent c0416255c4
commit b728ba2b1e
3 changed files with 37 additions and 0 deletions
@@ -0,0 +1,14 @@
// IntelliJ API Decompiler stub source generated from a class file
// Implementation of methods is not available
package test
internal final class FunctionTypes() {
public final fun <A> (A.(A) -> A)?.bar(): kotlin.Unit { /* compiled code */ }
public final fun <IP, R, P1> ((IP) -> R).compose(f: (P1) -> IP): (P1) -> R { /* compiled code */ }
public final fun <IP, R, P1> ((IP) -> R).compose2(f: (P1) -> IP): (P1) -> R { /* compiled code */ }
public final fun <A> (A.(A) -> A).foo(): kotlin.Unit { /* compiled code */ }
}
@@ -0,0 +1,17 @@
package test
class FunctionTypes {
public fun<IP, R, P1> Function1<IP, R>.compose(f: (P1) -> IP): (P1) -> R {
return {(p1: P1) -> this(f(p1)) }
}
public fun<IP, R, P1> ((IP) -> R).compose2(f: (P1) -> IP) : (P1) -> R {
return {(p1: P1) -> this(f(p1)) }
}
public fun <A> (A.(A) -> A).foo() {
}
public fun <A> (A.(A) -> A)?.bar() {
}
}
@@ -61,6 +61,12 @@ public class DecompiledTextTestGenerated extends AbstractDecompiledTextTest {
doTest(fileName);
}
@TestMetadata("FunctionTypes")
public void testFunctionTypes() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/libraries/decompiledText/FunctionTypes/");
doTest(fileName);
}
@TestMetadata("NestedClasses")
public void testNestedClasses() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/libraries/decompiledText/NestedClasses/");