Reflection: add KVisibility, KClass.visibility, KCallable.visibility
This commit is contained in:
@@ -19,6 +19,7 @@ package kotlin.jvm.internal;
|
||||
import kotlin.jvm.KotlinReflectionNotSupportedError;
|
||||
import kotlin.reflect.*;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.util.List;
|
||||
@@ -99,6 +100,12 @@ public abstract class CallableReference implements KCallable {
|
||||
return getReflected().callBy(args);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public KVisibility getVisibility() {
|
||||
return getReflected().getVisibility();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFinal() {
|
||||
return getReflected().isFinal();
|
||||
|
||||
@@ -48,6 +48,9 @@ class ClassReference(override val jClass: Class<*>) : KClass<Any>, ClassBasedDec
|
||||
override val supertypes: List<KType>
|
||||
get() = error()
|
||||
|
||||
override val visibility: KVisibility?
|
||||
get() = error()
|
||||
|
||||
override val isFinal: Boolean
|
||||
get() = error()
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ package kotlin.jvm.internal;
|
||||
import kotlin.jvm.KotlinReflectionNotSupportedError;
|
||||
import kotlin.reflect.*;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.util.List;
|
||||
@@ -84,6 +85,12 @@ public class FunctionReference extends FunctionImpl implements KFunction {
|
||||
return getReflected().callBy(args);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public KVisibility getVisibility() {
|
||||
return getReflected().getVisibility();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFinal() {
|
||||
return getReflected().isFinal();
|
||||
|
||||
Reference in New Issue
Block a user