[IR] Generify lowerings
#KT-1179
This commit is contained in:
committed by
teamcity
parent
22b2554368
commit
282ab398c6
+1
@@ -88,6 +88,7 @@ class FunctionClassDescriptor(
|
||||
override fun getSource(): SourceElement = SourceElement.NO_SOURCE
|
||||
override fun getSealedSubclasses() = emptyList<ClassDescriptor>()
|
||||
override fun getInlineClassRepresentation(): InlineClassRepresentation<SimpleType>? = null
|
||||
override fun getMultiFieldValueClassRepresentation(): MultiFieldValueClassRepresentation<SimpleType>? = null
|
||||
|
||||
override fun getDeclaredTypeParameters() = parameters
|
||||
|
||||
|
||||
@@ -104,6 +104,9 @@ public interface ClassDescriptor extends ClassifierDescriptorWithTypeParameters,
|
||||
@Nullable
|
||||
InlineClassRepresentation<SimpleType> getInlineClassRepresentation();
|
||||
|
||||
@Nullable
|
||||
MultiFieldValueClassRepresentation<SimpleType> getMultiFieldValueClassRepresentation();
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
ClassDescriptor getOriginal();
|
||||
|
||||
@@ -85,6 +85,7 @@ class NotFoundClasses(private val storageManager: StorageManager, private val mo
|
||||
override fun getCompanionObjectDescriptor(): ClassDescriptor? = null
|
||||
override fun getSealedSubclasses(): Collection<ClassDescriptor> = emptyList()
|
||||
override fun getInlineClassRepresentation(): InlineClassRepresentation<SimpleType>? = null
|
||||
override fun getMultiFieldValueClassRepresentation(): MultiFieldValueClassRepresentation<SimpleType>? = null
|
||||
|
||||
override fun toString() = "class $name (not found)"
|
||||
}
|
||||
|
||||
@@ -181,4 +181,10 @@ public class ClassDescriptorImpl extends ClassDescriptorBase {
|
||||
public InlineClassRepresentation<SimpleType> getInlineClassRepresentation() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public MultiFieldValueClassRepresentation<SimpleType> getMultiFieldValueClassRepresentation() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
+6
@@ -199,6 +199,12 @@ public class EnumEntrySyntheticClassDescriptor extends ClassDescriptorBase {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public MultiFieldValueClassRepresentation<SimpleType> getMultiFieldValueClassRepresentation() {
|
||||
return null;
|
||||
}
|
||||
|
||||
private class EnumEntryScope extends MemberScopeImpl {
|
||||
private final MemoizedFunctionToNotNull<Name, Collection<? extends SimpleFunctionDescriptor>> functions;
|
||||
private final MemoizedFunctionToNotNull<Name, Collection<? extends PropertyDescriptor>> properties;
|
||||
|
||||
+19
-1
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.descriptors.impl;
|
||||
|
||||
import kotlin.Pair;
|
||||
import kotlin.collections.CollectionsKt;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -328,10 +329,27 @@ public class LazySubstitutingClassDescriptor extends ModuleAwareClassDescriptor
|
||||
//noinspection ConstantConditions
|
||||
return representation == null ? null : new InlineClassRepresentation<SimpleType>(
|
||||
representation.getUnderlyingPropertyName(),
|
||||
substituteSimpleType(getInlineClassRepresentation().getUnderlyingType())
|
||||
substituteSimpleType(representation.getUnderlyingType())
|
||||
);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public MultiFieldValueClassRepresentation<SimpleType> getMultiFieldValueClassRepresentation() {
|
||||
MultiFieldValueClassRepresentation<SimpleType> representation = original.getMultiFieldValueClassRepresentation();
|
||||
if (representation == null) {
|
||||
return null;
|
||||
}
|
||||
List<Pair<Name, SimpleType>> underlyingList = new ArrayList<Pair<Name, SimpleType>>(representation.getUnderlyingPropertyNamesToTypes());
|
||||
for (int i = 0; i < underlyingList.size(); i++) {
|
||||
Pair<Name, SimpleType> pair = underlyingList.get(i);
|
||||
Name name = pair.getFirst();
|
||||
SimpleType simpleType = pair.getSecond();
|
||||
underlyingList.set(i, new Pair<Name, SimpleType>(name, substituteSimpleType(simpleType)));
|
||||
}
|
||||
return new MultiFieldValueClassRepresentation<SimpleType>(underlyingList);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public SimpleType getDefaultFunctionTypeForSamInterface() {
|
||||
|
||||
@@ -195,6 +195,12 @@ public class MutableClassDescriptor extends ClassDescriptorBase {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public MultiFieldValueClassRepresentation<SimpleType> getMultiFieldValueClassRepresentation() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return DeclarationDescriptorImpl.toString(this);
|
||||
|
||||
Reference in New Issue
Block a user