Load new proto messages for functions and properties
This commit is contained in:
+1
-1
@@ -65,7 +65,7 @@ public interface AnnotationAndConstantLoader<A, C, T> {
|
||||
@Nullable
|
||||
C loadPropertyConstant(
|
||||
@NotNull ProtoContainer container,
|
||||
@NotNull ProtoBuf.Callable proto,
|
||||
@NotNull ProtoBuf.Property proto,
|
||||
@NotNull JetType expectedType
|
||||
);
|
||||
}
|
||||
|
||||
+27
-33
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.serialization.deserialization
|
||||
|
||||
import com.google.protobuf.MessageLite
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
import org.jetbrains.kotlin.descriptors.annotations.AnnotationUseSiteTarget
|
||||
import org.jetbrains.kotlin.descriptors.annotations.AnnotationWithTarget
|
||||
@@ -27,23 +28,11 @@ import org.jetbrains.kotlin.resolve.DescriptorFactory
|
||||
import org.jetbrains.kotlin.serialization.Flags
|
||||
import org.jetbrains.kotlin.serialization.ProtoBuf
|
||||
import org.jetbrains.kotlin.serialization.ProtoBuf.Callable
|
||||
import org.jetbrains.kotlin.serialization.ProtoBuf.CallableKind.FUN
|
||||
import org.jetbrains.kotlin.serialization.ProtoBuf.CallableKind.VAL
|
||||
import org.jetbrains.kotlin.serialization.ProtoBuf.CallableKind.VAR
|
||||
import org.jetbrains.kotlin.serialization.deserialization.descriptors.*
|
||||
import org.jetbrains.kotlin.utils.toReadOnlyList
|
||||
|
||||
public class MemberDeserializer(private val c: DeserializationContext) {
|
||||
public fun loadCallable(proto: Callable): CallableMemberDescriptor {
|
||||
val callableKind = Flags.CALLABLE_KIND.get(proto.getFlags())
|
||||
return when (callableKind) {
|
||||
FUN -> loadFunction(proto)
|
||||
VAL, VAR -> loadProperty(proto)
|
||||
else -> throw IllegalArgumentException("Unsupported callable kind: $callableKind")
|
||||
}
|
||||
}
|
||||
|
||||
private fun loadProperty(proto: Callable): PropertyDescriptor {
|
||||
public fun loadProperty(proto: ProtoBuf.Property): PropertyDescriptor {
|
||||
val flags = proto.getFlags()
|
||||
|
||||
val property = DeserializedPropertyDescriptor(
|
||||
@@ -63,7 +52,7 @@ public class MemberDeserializer(private val c: DeserializationContext) {
|
||||
val local = c.childContext(property, proto.getTypeParameterList())
|
||||
|
||||
val hasGetter = Flags.OLD_HAS_GETTER.get(flags)
|
||||
val receiverAnnotations = if (hasGetter)
|
||||
val receiverAnnotations = if (hasGetter && proto.hasReceiverType())
|
||||
getReceiverParameterAnnotations(proto, AnnotatedCallableKind.PROPERTY_GETTER)
|
||||
else
|
||||
Annotations.EMPTY
|
||||
@@ -113,7 +102,9 @@ public class MemberDeserializer(private val c: DeserializationContext) {
|
||||
property.getKind(), null, SourceElement.NO_SOURCE
|
||||
)
|
||||
val setterLocal = local.childContext(setter, listOf())
|
||||
val valueParameters = setterLocal.memberDeserializer.valueParameters(proto, AnnotatedCallableKind.PROPERTY_SETTER)
|
||||
val valueParameters = setterLocal.memberDeserializer.valueParameters(
|
||||
listOf(proto.setterValueParameter), proto, AnnotatedCallableKind.PROPERTY_SETTER
|
||||
)
|
||||
setter.initialize(valueParameters.single())
|
||||
setter
|
||||
}
|
||||
@@ -139,16 +130,18 @@ public class MemberDeserializer(private val c: DeserializationContext) {
|
||||
return property
|
||||
}
|
||||
|
||||
private fun loadFunction(proto: Callable): CallableMemberDescriptor {
|
||||
public fun loadFunction(proto: ProtoBuf.Function): FunctionDescriptor {
|
||||
val annotations = getAnnotations(proto, proto.getFlags(), AnnotatedCallableKind.FUNCTION)
|
||||
val receiverAnnotations = getReceiverParameterAnnotations(proto, AnnotatedCallableKind.FUNCTION)
|
||||
val receiverAnnotations = if (proto.hasReceiverType())
|
||||
getReceiverParameterAnnotations(proto, AnnotatedCallableKind.FUNCTION)
|
||||
else Annotations.EMPTY
|
||||
val function = DeserializedSimpleFunctionDescriptor.create(c.containingDeclaration, proto, c.nameResolver, annotations)
|
||||
val local = c.childContext(function, proto.getTypeParameterList())
|
||||
function.initialize(
|
||||
if (proto.hasReceiverType()) local.typeDeserializer.type(proto.getReceiverType(), receiverAnnotations) else null,
|
||||
getDispatchReceiverParameter(),
|
||||
local.typeDeserializer.ownTypeParameters,
|
||||
local.memberDeserializer.valueParameters(proto, AnnotatedCallableKind.FUNCTION),
|
||||
local.memberDeserializer.valueParameters(proto.valueParameterList, proto, AnnotatedCallableKind.FUNCTION),
|
||||
local.typeDeserializer.type(proto.returnType),
|
||||
Deserialization.modality(Flags.MODALITY.get(proto.flags)),
|
||||
Deserialization.visibility(Flags.VISIBILITY.get(proto.flags))
|
||||
@@ -166,19 +159,19 @@ public class MemberDeserializer(private val c: DeserializationContext) {
|
||||
val classDescriptor = c.containingDeclaration as ClassDescriptor
|
||||
val descriptor = DeserializedConstructorDescriptor(
|
||||
classDescriptor, null, getAnnotations(proto, proto.getFlags(), AnnotatedCallableKind.FUNCTION),
|
||||
isPrimary, CallableMemberDescriptor.Kind.DECLARATION, proto, c.nameResolver
|
||||
isPrimary, CallableMemberDescriptor.Kind.DECLARATION, TODO("proto"), c.nameResolver
|
||||
)
|
||||
val local = c.childContext(descriptor, listOf())
|
||||
descriptor.initialize(
|
||||
classDescriptor.getTypeConstructor().getParameters(),
|
||||
local.memberDeserializer.valueParameters(proto, AnnotatedCallableKind.FUNCTION),
|
||||
local.memberDeserializer.valueParameters(proto.valueParameterList, proto, AnnotatedCallableKind.FUNCTION),
|
||||
Deserialization.visibility(Flags.VISIBILITY.get(proto.getFlags()))
|
||||
)
|
||||
descriptor.setReturnType(local.typeDeserializer.type(proto.getReturnType()))
|
||||
return descriptor
|
||||
}
|
||||
|
||||
private fun getAnnotations(proto: Callable, flags: Int, kind: AnnotatedCallableKind): Annotations {
|
||||
private fun getAnnotations(proto: MessageLite, flags: Int, kind: AnnotatedCallableKind): Annotations {
|
||||
if (!Flags.HAS_ANNOTATIONS.get(flags)) {
|
||||
return Annotations.EMPTY
|
||||
}
|
||||
@@ -190,27 +183,28 @@ public class MemberDeserializer(private val c: DeserializationContext) {
|
||||
}
|
||||
|
||||
private fun getReceiverParameterAnnotations(
|
||||
proto: Callable,
|
||||
proto: MessageLite,
|
||||
kind: AnnotatedCallableKind,
|
||||
receiverTargetedKind: AnnotatedCallableKind = kind
|
||||
): Annotations {
|
||||
return DeserializedAnnotationsWithPossibleTargets(c.storageManager) {
|
||||
if (proto.hasReceiverType()) {
|
||||
c.containingDeclaration.asProtoContainer()?.let {
|
||||
c.components.annotationAndConstantLoader
|
||||
.loadExtensionReceiverParameterAnnotations(it, proto, receiverTargetedKind)
|
||||
.map { AnnotationWithTarget(it, AnnotationUseSiteTarget.RECEIVER) }
|
||||
}.orEmpty()
|
||||
}
|
||||
else emptyList()
|
||||
c.containingDeclaration.asProtoContainer()?.let {
|
||||
c.components.annotationAndConstantLoader
|
||||
.loadExtensionReceiverParameterAnnotations(it, proto, receiverTargetedKind)
|
||||
.map { AnnotationWithTarget(it, AnnotationUseSiteTarget.RECEIVER) }
|
||||
}.orEmpty()
|
||||
}
|
||||
}
|
||||
|
||||
private fun valueParameters(callable: Callable, kind: AnnotatedCallableKind): List<ValueParameterDescriptor> {
|
||||
private fun valueParameters(
|
||||
valueParameters: List<ProtoBuf.ValueParameter>,
|
||||
callable: MessageLite,
|
||||
kind: AnnotatedCallableKind
|
||||
): List<ValueParameterDescriptor> {
|
||||
val callableDescriptor = c.containingDeclaration as CallableDescriptor
|
||||
val containerOfCallable = callableDescriptor.containingDeclaration.asProtoContainer()
|
||||
|
||||
return callable.valueParameterList.mapIndexed { i, proto ->
|
||||
return valueParameters.mapIndexed { i, proto ->
|
||||
val flags = if (proto.hasFlags()) proto.flags else 0
|
||||
ValueParameterDescriptorImpl(
|
||||
callableDescriptor, null, i,
|
||||
@@ -226,7 +220,7 @@ public class MemberDeserializer(private val c: DeserializationContext) {
|
||||
|
||||
private fun getParameterAnnotations(
|
||||
container: ProtoContainer,
|
||||
callable: Callable,
|
||||
callable: MessageLite,
|
||||
kind: AnnotatedCallableKind,
|
||||
index: Int,
|
||||
valueParameter: ProtoBuf.ValueParameter
|
||||
|
||||
+6
-5
@@ -16,11 +16,12 @@
|
||||
|
||||
package org.jetbrains.kotlin.serialization.deserialization.descriptors
|
||||
|
||||
import org.jetbrains.kotlin.serialization.ProtoBuf
|
||||
import org.jetbrains.kotlin.serialization.deserialization.NameResolver
|
||||
import com.google.protobuf.MessageLite
|
||||
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor
|
||||
import org.jetbrains.kotlin.serialization.deserialization.NameResolver
|
||||
|
||||
public interface DeserializedCallableMemberDescriptor: CallableMemberDescriptor {
|
||||
public val proto: ProtoBuf.Callable
|
||||
public val nameResolver: NameResolver
|
||||
interface DeserializedCallableMemberDescriptor : CallableMemberDescriptor {
|
||||
val proto: MessageLite
|
||||
|
||||
val nameResolver: NameResolver
|
||||
}
|
||||
|
||||
+1
-1
@@ -186,7 +186,7 @@ public class DeserializedClassDescriptor(
|
||||
override fun toString() = getName().toString()
|
||||
}
|
||||
|
||||
private inner class DeserializedClassMemberScope : DeserializedMemberScope(c, classProto.getMemberList()) {
|
||||
private inner class DeserializedClassMemberScope : DeserializedMemberScope(c, classProto.functionList, classProto.propertyList) {
|
||||
private val classDescriptor: DeserializedClassDescriptor get() = this@DeserializedClassDescriptor
|
||||
private val allDescriptors = c.storageManager.createLazyValue {
|
||||
computeDescriptors(DescriptorKindFilter.ALL, JetScope.ALL_NAME_FILTER, NoLookupLocation.WHEN_GET_ALL_DESCRIPTORS)
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ public class DeserializedConstructorDescriptor(
|
||||
annotations: Annotations,
|
||||
isPrimary: Boolean,
|
||||
kind: CallableMemberDescriptor.Kind,
|
||||
override val proto: ProtoBuf.Callable,
|
||||
override val proto: ProtoBuf.Constructor,
|
||||
override val nameResolver: NameResolver
|
||||
) : ConstructorDescriptorImpl(containingDeclaration, original, annotations, isPrimary, kind, SourceElement.NO_SOURCE),
|
||||
DeserializedCallableMemberDescriptor {
|
||||
|
||||
+45
-56
@@ -16,14 +16,13 @@
|
||||
|
||||
package org.jetbrains.kotlin.serialization.deserialization.descriptors
|
||||
|
||||
import com.google.protobuf.MessageLite
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
import org.jetbrains.kotlin.incremental.components.LookupLocation
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.resolve.scopes.DescriptorKindFilter
|
||||
import org.jetbrains.kotlin.resolve.scopes.JetScopeImpl
|
||||
import org.jetbrains.kotlin.serialization.Flags
|
||||
import org.jetbrains.kotlin.serialization.ProtoBuf
|
||||
import org.jetbrains.kotlin.serialization.ProtoBuf.CallableKind
|
||||
import org.jetbrains.kotlin.serialization.deserialization.DeserializationContext
|
||||
import org.jetbrains.kotlin.utils.Printer
|
||||
import org.jetbrains.kotlin.utils.toReadOnlyList
|
||||
@@ -31,59 +30,49 @@ import java.util.*
|
||||
|
||||
public abstract class DeserializedMemberScope protected constructor(
|
||||
protected val c: DeserializationContext,
|
||||
membersList: Collection<ProtoBuf.Callable>
|
||||
functionList: Collection<ProtoBuf.Function>,
|
||||
propertyList: Collection<ProtoBuf.Property>
|
||||
) : JetScopeImpl() {
|
||||
|
||||
private data class ProtoKey(val name: Name, val kind: Kind, val isExtension: Boolean)
|
||||
private enum class Kind { FUNCTION, PROPERTY }
|
||||
private data class ProtoKey(val name: Name, val isExtension: Boolean)
|
||||
|
||||
private fun CallableKind.toKind(): Kind {
|
||||
return when (this) {
|
||||
CallableKind.FUN -> Kind.FUNCTION
|
||||
CallableKind.VAL, CallableKind.VAR -> Kind.PROPERTY
|
||||
else -> throw IllegalStateException("Unexpected CallableKind $this")
|
||||
}
|
||||
}
|
||||
private val functionProtos =
|
||||
c.storageManager.createLazyValue {
|
||||
groupByKey(filteredFunctionProtos(functionList), { it.name }) { it.hasReceiverType() }
|
||||
}
|
||||
private val propertyProtos =
|
||||
c.storageManager.createLazyValue {
|
||||
groupByKey(filteredPropertyProtos(propertyList), { it.name }) { it.hasReceiverType() }
|
||||
}
|
||||
|
||||
private val membersProtos =
|
||||
c.storageManager.createLazyValue { groupByKey(filteredMemberProtos(membersList)) }
|
||||
private val functions =
|
||||
c.storageManager.createMemoizedFunction<Name, Collection<FunctionDescriptor>> { computeFunctions(it) }
|
||||
private val properties =
|
||||
c.storageManager.createMemoizedFunction<Name, Collection<VariableDescriptor>> { computeProperties(it) }
|
||||
|
||||
protected open fun filteredMemberProtos(allMemberProtos: Collection<ProtoBuf.Callable>): Collection<ProtoBuf.Callable> = allMemberProtos
|
||||
protected open fun filteredFunctionProtos(protos: Collection<ProtoBuf.Function>): Collection<ProtoBuf.Function> = protos
|
||||
|
||||
private fun groupByKey(membersList: Collection<ProtoBuf.Callable>): Map<ProtoKey, List<ProtoBuf.Callable>> {
|
||||
val map = LinkedHashMap<ProtoKey, MutableList<ProtoBuf.Callable>>()
|
||||
for (memberProto in membersList) {
|
||||
val key = ProtoKey(
|
||||
c.nameResolver.getName(memberProto.getName()),
|
||||
Flags.CALLABLE_KIND[memberProto.getFlags()].toKind(),
|
||||
memberProto.hasReceiverType()
|
||||
)
|
||||
var protos = map[key]
|
||||
if (protos == null) {
|
||||
protos = ArrayList(1)
|
||||
map.put(key, protos)
|
||||
}
|
||||
protos.add(memberProto)
|
||||
protected open fun filteredPropertyProtos(protos: Collection<ProtoBuf.Property>): Collection<ProtoBuf.Property> = protos
|
||||
|
||||
private fun <M : MessageLite> groupByKey(
|
||||
protos: Collection<M>, getNameIndex: (M) -> Int, isExtension: (M) -> Boolean
|
||||
): Map<ProtoKey, List<M>> {
|
||||
val map = LinkedHashMap<ProtoKey, MutableList<M>>()
|
||||
for (proto in protos) {
|
||||
val key = ProtoKey(c.nameResolver.getName(getNameIndex(proto)), isExtension(proto))
|
||||
map.getOrPut(key) { ArrayList(1) }.add(proto)
|
||||
}
|
||||
return map
|
||||
}
|
||||
|
||||
private fun <D : CallableMemberDescriptor> computeMembers(name: Name, kind: Kind): LinkedHashSet<D> {
|
||||
val memberProtos = membersProtos()[ProtoKey(name, kind, isExtension = false)].orEmpty() +
|
||||
membersProtos()[ProtoKey(name, kind, isExtension = true)].orEmpty()
|
||||
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
return memberProtos.mapTo(LinkedHashSet<D>()) { memberProto ->
|
||||
c.memberDeserializer.loadCallable(memberProto) as D
|
||||
}
|
||||
}
|
||||
|
||||
private fun computeFunctions(name: Name): Collection<FunctionDescriptor> {
|
||||
val descriptors = computeMembers<FunctionDescriptor>(name, Kind.FUNCTION)
|
||||
val protos = functionProtos()[ProtoKey(name, isExtension = false)].orEmpty() +
|
||||
functionProtos()[ProtoKey(name, isExtension = true)].orEmpty()
|
||||
|
||||
val descriptors = protos.mapTo(linkedSetOf()) {
|
||||
c.memberDeserializer.loadFunction(it)
|
||||
}
|
||||
|
||||
computeNonDeclaredFunctions(name, descriptors)
|
||||
return descriptors.toReadOnlyList()
|
||||
}
|
||||
@@ -94,7 +83,13 @@ public abstract class DeserializedMemberScope protected constructor(
|
||||
override fun getFunctions(name: Name, location: LookupLocation): Collection<FunctionDescriptor> = functions(name)
|
||||
|
||||
private fun computeProperties(name: Name): Collection<VariableDescriptor> {
|
||||
val descriptors = computeMembers<PropertyDescriptor>(name, Kind.PROPERTY)
|
||||
val protos = propertyProtos()[ProtoKey(name, isExtension = false)].orEmpty() +
|
||||
propertyProtos()[ProtoKey(name, isExtension = true)].orEmpty()
|
||||
|
||||
val descriptors = protos.mapTo(linkedSetOf()) {
|
||||
c.memberDeserializer.loadProperty(it)
|
||||
}
|
||||
|
||||
computeNonDeclaredProperties(name, descriptors)
|
||||
return descriptors.toReadOnlyList()
|
||||
}
|
||||
@@ -142,32 +137,26 @@ public abstract class DeserializedMemberScope protected constructor(
|
||||
nameFilter: (Name) -> Boolean,
|
||||
location: LookupLocation
|
||||
) {
|
||||
val acceptsProperties = kindFilter.acceptsKinds(DescriptorKindFilter.VARIABLES_MASK)
|
||||
val acceptsFunctions = kindFilter.acceptsKinds(DescriptorKindFilter.FUNCTIONS_MASK)
|
||||
if (!(acceptsFunctions || acceptsProperties)) {
|
||||
return
|
||||
if (kindFilter.acceptsKinds(DescriptorKindFilter.VARIABLES_MASK)) {
|
||||
val keys = propertyProtos().keySet().filter { nameFilter(it.name) }
|
||||
addMembers(result, keys) { getProperties(it, location) }
|
||||
}
|
||||
|
||||
val keys = membersProtos().keySet().filter { nameFilter(it.name) }
|
||||
if (acceptsProperties) {
|
||||
addMembers(result, keys, Kind.PROPERTY) { getProperties(it, location) }
|
||||
}
|
||||
if (acceptsFunctions) {
|
||||
addMembers(result, keys, Kind.FUNCTION) { getFunctions(it, location) }
|
||||
if (kindFilter.acceptsKinds(DescriptorKindFilter.FUNCTIONS_MASK)) {
|
||||
val keys = functionProtos().keySet().filter { nameFilter(it.name) }
|
||||
addMembers(result, keys) { getFunctions(it, location) }
|
||||
}
|
||||
}
|
||||
|
||||
private fun addMembers(
|
||||
result: MutableCollection<DeclarationDescriptor>,
|
||||
keys: Collection<ProtoKey>,
|
||||
kind: Kind,
|
||||
getMembers: (Name) -> Collection<CallableDescriptor>
|
||||
) {
|
||||
val filteredByKind = keys.filter { it.kind == kind }
|
||||
listOf(false, true).forEach { isExtension ->
|
||||
filteredByKind.filter { it.isExtension == isExtension }
|
||||
keys.filter { it.isExtension == isExtension }
|
||||
.flatMap { getMembers(it.name) }
|
||||
.filterTo(result) { (it.getExtensionReceiverParameter() != null) == isExtension }
|
||||
.filterTo(result) { (it.extensionReceiverParameter != null) == isExtension }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,7 +174,7 @@ public abstract class DeserializedMemberScope protected constructor(
|
||||
override fun getOwnDeclaredDescriptors() = getAllDescriptors()
|
||||
|
||||
override fun printScopeStructure(p: Printer) {
|
||||
p.println(javaClass.getSimpleName(), " {")
|
||||
p.println(javaClass.simpleName, " {")
|
||||
p.pushIndent()
|
||||
|
||||
p.println("containingDeclaration = " + getContainingDeclaration())
|
||||
|
||||
+1
-2
@@ -39,8 +39,7 @@ public open class DeserializedPackageMemberScope(
|
||||
nameResolver: NameResolver,
|
||||
components: DeserializationComponents,
|
||||
classNames: () -> Collection<Name>
|
||||
) : DeserializedMemberScope(components.createContext(packageDescriptor, nameResolver), proto.getMemberList()) {
|
||||
|
||||
) : DeserializedMemberScope(components.createContext(packageDescriptor, nameResolver), proto.functionList, proto.propertyList) {
|
||||
private val packageFqName = packageDescriptor.fqName
|
||||
|
||||
internal val classNames by c.storageManager.createLazyValue { classNames().toSet() }
|
||||
|
||||
+9
-13
@@ -16,19 +16,15 @@
|
||||
|
||||
package org.jetbrains.kotlin.serialization.deserialization.descriptors
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.Modality
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.descriptors.annotations.Annotations
|
||||
import org.jetbrains.kotlin.descriptors.Visibility
|
||||
import org.jetbrains.kotlin.serialization.deserialization.NameResolver
|
||||
import org.jetbrains.kotlin.descriptors.impl.PropertyDescriptorImpl
|
||||
import org.jetbrains.kotlin.serialization.ProtoBuf
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor.Kind
|
||||
import org.jetbrains.kotlin.descriptors.SourceElement
|
||||
import org.jetbrains.kotlin.descriptors.annotations.Annotations
|
||||
import org.jetbrains.kotlin.descriptors.impl.PropertyDescriptorImpl
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.serialization.ProtoBuf
|
||||
import org.jetbrains.kotlin.serialization.deserialization.NameResolver
|
||||
|
||||
public class DeserializedPropertyDescriptor(
|
||||
class DeserializedPropertyDescriptor(
|
||||
containingDeclaration: DeclarationDescriptor,
|
||||
original: PropertyDescriptor?,
|
||||
annotations: Annotations,
|
||||
@@ -37,8 +33,8 @@ public class DeserializedPropertyDescriptor(
|
||||
isVar: Boolean,
|
||||
name: Name,
|
||||
kind: Kind,
|
||||
override public val proto: ProtoBuf.Callable,
|
||||
override public val nameResolver: NameResolver,
|
||||
override val proto: ProtoBuf.Property,
|
||||
override val nameResolver: NameResolver,
|
||||
lateInit: Boolean,
|
||||
isConst: Boolean
|
||||
) : DeserializedCallableMemberDescriptor,
|
||||
|
||||
+4
-5
@@ -29,12 +29,11 @@ import org.jetbrains.kotlin.name.Name;
|
||||
import org.jetbrains.kotlin.serialization.Flags;
|
||||
import org.jetbrains.kotlin.serialization.ProtoBuf;
|
||||
import org.jetbrains.kotlin.serialization.deserialization.Deserialization;
|
||||
import org.jetbrains.kotlin.serialization.deserialization.DeserializationPackage;
|
||||
import org.jetbrains.kotlin.serialization.deserialization.NameResolver;
|
||||
|
||||
public class DeserializedSimpleFunctionDescriptor extends SimpleFunctionDescriptorImpl implements DeserializedCallableMemberDescriptor {
|
||||
|
||||
private final ProtoBuf.Callable proto;
|
||||
private final ProtoBuf.Function proto;
|
||||
private final NameResolver nameResolver;
|
||||
|
||||
private DeserializedSimpleFunctionDescriptor(
|
||||
@@ -43,7 +42,7 @@ public class DeserializedSimpleFunctionDescriptor extends SimpleFunctionDescript
|
||||
@NotNull Annotations annotations,
|
||||
@NotNull Name name,
|
||||
@NotNull Kind kind,
|
||||
@NotNull ProtoBuf.Callable proto,
|
||||
@NotNull ProtoBuf.Function proto,
|
||||
@NotNull NameResolver nameResolver
|
||||
) {
|
||||
super(containingDeclaration, original, annotations, name, kind, SourceElement.NO_SOURCE);
|
||||
@@ -77,7 +76,7 @@ public class DeserializedSimpleFunctionDescriptor extends SimpleFunctionDescript
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public ProtoBuf.Callable getProto() {
|
||||
public ProtoBuf.Function getProto() {
|
||||
return proto;
|
||||
}
|
||||
|
||||
@@ -90,7 +89,7 @@ public class DeserializedSimpleFunctionDescriptor extends SimpleFunctionDescript
|
||||
@NotNull
|
||||
public static DeserializedSimpleFunctionDescriptor create(
|
||||
@NotNull DeclarationDescriptor containingDeclaration,
|
||||
@NotNull ProtoBuf.Callable proto,
|
||||
@NotNull ProtoBuf.Function proto,
|
||||
@NotNull NameResolver nameResolver,
|
||||
@NotNull Annotations annotations
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user