diff --git a/core/builtins/src/kotlin/reflect/_Deprecated.kt b/core/builtins/src/kotlin/reflect/_Deprecated.kt new file mode 100644 index 00000000000..04a023bbf52 --- /dev/null +++ b/core/builtins/src/kotlin/reflect/_Deprecated.kt @@ -0,0 +1,29 @@ +/* + * Copyright 2010-2015 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package kotlin.reflect + +@deprecated("This class will be dropped in M13 because it was a part of an overly complex API. Use KFunction instead") +public interface KTopLevelFunction : KFunction + +@deprecated("This class will be dropped in M13 because it was a part of an overly complex API. Use KFunction instead") +public interface KTopLevelExtensionFunction + +@deprecated("This class will be dropped in M13 because it was a part of an overly complex API. Use KFunction instead") +public interface KMemberFunction : KFunction + +@deprecated("This class will be dropped in M13 because it was a part of an overly complex API. Use KFunction instead") +public interface KLocalFunction : KFunction diff --git a/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KFunctionImpl.kt b/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KFunctionImpl.kt index 69d3ad41ad9..875804fcd52 100644 --- a/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KFunctionImpl.kt +++ b/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KFunctionImpl.kt @@ -18,17 +18,18 @@ package kotlin.reflect.jvm.internal import org.jetbrains.kotlin.descriptors.FunctionDescriptor import kotlin.jvm.internal.FunctionImpl -import kotlin.reflect.KFunction +import kotlin.reflect.* open class KFunctionImpl protected constructor( container: KCallableContainerImpl, name: String, signature: String, descriptorInitialValue: FunctionDescriptor? -) : KFunction, FunctionImpl() { - constructor(container: KCallableContainerImpl, name: String, signature: String): this(container, name, signature, null) +) : KFunction, FunctionImpl(), + KLocalFunction, KMemberFunction, KTopLevelExtensionFunction, KTopLevelFunction { + constructor(container: KCallableContainerImpl, name: String, signature: String) : this(container, name, signature, null) - constructor(container: KCallableContainerImpl, descriptor: FunctionDescriptor): this( + constructor(container: KCallableContainerImpl, descriptor: FunctionDescriptor) : this( container, descriptor.getName().asString(), RuntimeTypeMapper.mapSignature(descriptor), descriptor ) diff --git a/core/runtime.jvm/src/kotlin/jvm/internal/FunctionReference.java b/core/runtime.jvm/src/kotlin/jvm/internal/FunctionReference.java index 6aff6021d97..bdf895a0a43 100644 --- a/core/runtime.jvm/src/kotlin/jvm/internal/FunctionReference.java +++ b/core/runtime.jvm/src/kotlin/jvm/internal/FunctionReference.java @@ -17,10 +17,16 @@ package kotlin.jvm.internal; import kotlin.jvm.KotlinReflectionNotSupportedError; -import kotlin.reflect.KDeclarationContainer; -import kotlin.reflect.KFunction; +import kotlin.reflect.*; -public class FunctionReference extends FunctionImpl implements KFunction { +@SuppressWarnings("deprecation") +public class FunctionReference + extends FunctionImpl + implements KFunction, + KTopLevelFunction, + KMemberFunction, + KTopLevelExtensionFunction, + KLocalFunction { private final int arity; public FunctionReference(int arity) {