klyn.reflection.TypeLoader.methodTypeAt
method
public static methodTypeAt(typeName as String, methodIndex as Long, parameterIndex as Long) as Type
Description

Resolves a registered method signature in its declaration scope. Receiver-dependent returns and declared generic parameters are metadata, not independent classes to load by name.

Parameters
ParameterDescription
typeNameRegistered declaring type.
methodIndexIndex of the declared method.
parameterIndexParameter index, or -1 for its return type.
Returns

Signature type metadata, including scoped generic type variables.

Throws
  • TypeError if either index is invalid.
  • ClassNotFoundException if a concrete signature type cannot load.
Example
import klyn.reflection
resultType = TypeLoader.methodTypeAt("klyn.Object", 0l, -1l)
print(resultType.fullName)