Minor, make ownTypeParameters a property in TypeDeserializer

This commit is contained in:
Alexander Udalov
2014-11-25 18:18:41 +03:00
parent 3a066dfd07
commit c35ddc3616
3 changed files with 5 additions and 4 deletions
@@ -55,7 +55,7 @@ public class MemberDeserializer(private val c: DeserializationContext) {
val local = c.childContext(property, proto.getTypeParameterList())
property.setType(
local.typeDeserializer.type(proto.getReturnType()),
local.typeDeserializer.getOwnTypeParameters(),
local.typeDeserializer.ownTypeParameters,
getDispatchReceiverParameter(),
if (proto.hasReceiverType()) local.typeDeserializer.type(proto.getReceiverType()) else null
)
@@ -131,7 +131,7 @@ public class MemberDeserializer(private val c: DeserializationContext) {
function.initialize(
if (proto.hasReceiverType()) local.typeDeserializer.type(proto.getReceiverType()) else null,
getDispatchReceiverParameter(),
local.typeDeserializer.getOwnTypeParameters(),
local.typeDeserializer.ownTypeParameters,
local.memberDeserializer.valueParameters(proto, AnnotatedCallableKind.FUNCTION),
local.typeDeserializer.type(proto.getReturnType()),
modality(Flags.MODALITY.get(proto.getFlags())),
@@ -48,7 +48,8 @@ public class TypeDeserializer(
}
}
fun getOwnTypeParameters(): List<TypeParameterDescriptor> = typeParameterDescriptors().values().toReadOnlyList()
val ownTypeParameters: List<TypeParameterDescriptor>
get() = typeParameterDescriptors().values().toReadOnlyList()
fun type(proto: ProtoBuf.Type): JetType {
if (proto.hasFlexibleTypeCapabilitiesId()) {
@@ -144,7 +144,7 @@ public class DeserializedClassDescriptor(
private inner class DeserializedClassTypeConstructor : AbstractClassTypeConstructor() {
private val supertypes = computeSuperTypes()
override fun getParameters() = c.typeDeserializer.getOwnTypeParameters()
override fun getParameters() = c.typeDeserializer.ownTypeParameters
override fun getSupertypes(): Collection<JetType> {
// We cannot have error supertypes because subclasses inherit error functions from them