Simplify function hierarchy in reflection

Get rid of all classes except kotlin.reflect.KFunction, which will be used to
represent all kinds of simple functions.

Lots of changes to test data are related to the fact that KFunction is not an
extension function (as opposed to KMemberFunction and KExtensionFunction who
were) and so a member or an extension function reference now requires all
arguments be passed to it in the parentheses, including receivers. This is
probably temporary until we support calling any function both as a free
function and as an extension. In JS, functions and extension functions are not
interchangeable, so tests on this behavior are removed until this is supported
This commit is contained in:
Alexander Udalov
2015-06-23 20:34:25 +03:00
parent 3549e1e035
commit c3b97e0668
113 changed files with 350 additions and 534 deletions

View File

@@ -1,9 +1,9 @@
import kotlin.jvm.functions.Function2;
import kotlin.reflect.KMemberFunction;
import kotlin.reflect.KFunction;
public class J {
public static String go() {
KMemberFunction<K, String> fun = K.Companion.getRef();
KFunction<String> fun = K.Companion.getRef();
Object result = ((Function2) fun).invoke(new K(), "KO");
return (String) result;
}