Remove deprecated stuff unused after M13
This commit is contained in:
@@ -248,12 +248,6 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
|||||||
kind = KotlinClass.Kind.LOCAL_CLASS;
|
kind = KotlinClass.Kind.LOCAL_CLASS;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Temporarily write class kind anyway because old compiler may not expect its absence
|
|
||||||
// TODO: remove after M13
|
|
||||||
if (kind == null) {
|
|
||||||
kind = KotlinClass.Kind.CLASS;
|
|
||||||
}
|
|
||||||
|
|
||||||
DescriptorSerializer serializer =
|
DescriptorSerializer serializer =
|
||||||
DescriptorSerializer.create(descriptor, new JvmSerializerExtension(v.getSerializationBindings(), typeMapper));
|
DescriptorSerializer.create(descriptor, new JvmSerializerExtension(v.getSerializationBindings(), typeMapper));
|
||||||
|
|
||||||
@@ -261,7 +255,6 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
|||||||
|
|
||||||
AnnotationVisitor av = v.getVisitor().visitAnnotation(asmDescByFqNameWithoutInnerClasses(JvmAnnotationNames.KOTLIN_CLASS), true);
|
AnnotationVisitor av = v.getVisitor().visitAnnotation(asmDescByFqNameWithoutInnerClasses(JvmAnnotationNames.KOTLIN_CLASS), true);
|
||||||
JvmCodegenUtil.writeAbiVersion(av);
|
JvmCodegenUtil.writeAbiVersion(av);
|
||||||
//noinspection ConstantConditions
|
|
||||||
if (kind != null) {
|
if (kind != null) {
|
||||||
av.visitEnum(
|
av.visitEnum(
|
||||||
JvmAnnotationNames.KIND_FIELD_NAME,
|
JvmAnnotationNames.KIND_FIELD_NAME,
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
package kotlin.reflect.jvm.internal;
|
package kotlin.reflect.jvm.internal;
|
||||||
|
|
||||||
import kotlin.jvm.KotlinReflectionNotSupportedError;
|
|
||||||
import kotlin.jvm.internal.*;
|
import kotlin.jvm.internal.*;
|
||||||
import kotlin.reflect.*;
|
import kotlin.reflect.*;
|
||||||
import org.jetbrains.kotlin.load.java.JvmAbi;
|
import org.jetbrains.kotlin.load.java.JvmAbi;
|
||||||
@@ -50,19 +49,7 @@ public class ReflectionFactoryImpl extends ReflectionFactory {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public KFunction function(FunctionReference f) {
|
public KFunction function(FunctionReference f) {
|
||||||
try {
|
return new KFunctionFromReferenceImpl(f);
|
||||||
return new KFunctionFromReferenceImpl(f);
|
|
||||||
}
|
|
||||||
catch (KotlinReflectionNotSupportedError e) {
|
|
||||||
// If this function reference is compiled with an older compiler, it doesn't have the newer methods
|
|
||||||
// (getName(), getOwner(), getSignature()), so the default implementation from FunctionReference will be invoked
|
|
||||||
// and KotlinReflectionNotSupportedError will be thrown.
|
|
||||||
// Instead it's much better to use the reference as a KFunction. Yes, it will throw "no kotlin-reflect.jar was found"
|
|
||||||
// exceptions even if it exists in the classpath. However, at least it can be used as a function (invoke() will work).
|
|
||||||
// Moreover, old function references were not supposed to be introspected anyway because there was no reflection API back then.
|
|
||||||
// TODO: drop after M13
|
|
||||||
return f;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Properties
|
// Properties
|
||||||
|
|||||||
Reference in New Issue
Block a user