Added tests for tuple and function types in alternative signatures.
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
package test;
|
||||
|
||||
import java.lang.String;
|
||||
import java.lang.UnsupportedOperationException;
|
||||
import java.util.*;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
import jet.*;
|
||||
|
||||
public class MethodWithFunctionTypes {
|
||||
@KotlinSignature("fun foo(f : (String?) -> String) : (String.() -> String?)?")
|
||||
public ExtensionFunction0<String, String> foo(Function1<String, String> f) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package test
|
||||
|
||||
import java.util.*
|
||||
|
||||
public open class MethodWithFunctionTypes : Object() {
|
||||
open fun foo(p0 : (String?) -> String) : (String.() -> String?)? {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace test
|
||||
|
||||
open class test.MethodWithFunctionTypes : java.lang.Object {
|
||||
final /*constructor*/ fun <init>(): test.MethodWithFunctionTypes
|
||||
open fun foo(/*0*/ p0: jet.Function1<jet.String?, jet.String>): jet.ExtensionFunction0<jet.String, jet.String?>?
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package test;
|
||||
|
||||
import java.util.*;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
import jet.*;
|
||||
|
||||
public class MethodWithTupleType {
|
||||
@KotlinSignature("fun foo(pair : #(String, String?))")
|
||||
public void foo(Tuple2<String, String> pair) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package test
|
||||
|
||||
import java.util.*
|
||||
|
||||
public open class MethodWithTupleType : Object() {
|
||||
open fun foo(p0 : Tuple2<String, String?>) { // writing Tuple2<..> instead of #(..), because the latter
|
||||
// adds unnecessary "out" keywords
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace test
|
||||
|
||||
open class test.MethodWithTupleType : java.lang.Object {
|
||||
final /*constructor*/ fun <init>(): test.MethodWithTupleType
|
||||
open fun foo(/*0*/ p0: jet.Tuple2<jet.String, jet.String?>): jet.Tuple0
|
||||
}
|
||||
Reference in New Issue
Block a user