Support introspection of parameter names and indices in reflection
This commit is contained in:
@@ -19,6 +19,9 @@ package kotlin.jvm.internal;
|
||||
import kotlin.jvm.KotlinReflectionNotSupportedError;
|
||||
import kotlin.reflect.KCallable;
|
||||
import kotlin.reflect.KDeclarationContainer;
|
||||
import kotlin.reflect.KParameter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* A superclass for all classes generated by Kotlin compiler for callable references.
|
||||
@@ -60,7 +63,10 @@ public abstract class CallableReference implements KCallable {
|
||||
// The following methods are the stub implementations of reflection functions.
|
||||
// They are called when you're using reflection on a property reference without the reflection implementation in the classpath.
|
||||
|
||||
// (nothing here yet)
|
||||
@Override
|
||||
public List<KParameter> getParameters() {
|
||||
throw error();
|
||||
}
|
||||
|
||||
protected static Error error() {
|
||||
throw new KotlinReflectionNotSupportedError();
|
||||
|
||||
@@ -19,6 +19,8 @@ package kotlin.jvm.internal;
|
||||
import kotlin.jvm.KotlinReflectionNotSupportedError;
|
||||
import kotlin.reflect.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class FunctionReference
|
||||
extends FunctionImpl
|
||||
@@ -58,6 +60,11 @@ public class FunctionReference
|
||||
throw error();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<KParameter> getParameters() {
|
||||
throw error();
|
||||
}
|
||||
|
||||
protected static Error error() {
|
||||
throw new KotlinReflectionNotSupportedError();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user