Support KCallable.call

#KT-2187 Fixed
This commit is contained in:
Alexander Udalov
2015-07-16 21:45:28 +03:00
parent ffe32e0b6d
commit e079b8f425
22 changed files with 462 additions and 3 deletions
@@ -34,6 +34,15 @@ public interface KCallable<out R> {
/**
* Parameters required to make a call to this callable.
* If this callable requires a `this` instance or an extension receiver parameter,
* they come first in the list in that order.
*/
public val parameters: List<KParameter>
/**
* Calls this callable with the specified arguments and returns the result.
* Throws an exception if the number of specified arguments is not equal to the size of [parameters],
* or if their types do not match the types of the parameters.
*/
public fun call(vararg args: Any?): R
}
@@ -36,7 +36,8 @@ public interface KParameter {
public val name: String?
/**
* Type of this parameter.
* Type of this parameter. For a `vararg` parameter, this is the type of the corresponding array,
* not the individual element.
*/
public val type: KType
}