[FE] Add getContextReceivers to CallableDescriptor interface
This commit is contained in:
committed by
TeamCityServer
parent
7de8380ddf
commit
a39fbd3822
@@ -21,7 +21,7 @@ class CloneableClassScope(
|
||||
override fun computeDeclaredFunctions(): List<FunctionDescriptor> = listOf(
|
||||
SimpleFunctionDescriptorImpl.create(containingClass, Annotations.EMPTY, CLONE_NAME, DECLARATION, SourceElement.NO_SOURCE).apply {
|
||||
initialize(
|
||||
null, containingClass.thisAsReceiverParameter, emptyList(), emptyList(), containingClass.builtIns.anyType,
|
||||
null, containingClass.thisAsReceiverParameter, emptyList(), emptyList(), emptyList(), containingClass.builtIns.anyType,
|
||||
Modality.OPEN, DescriptorVisibilities.PROTECTED
|
||||
)
|
||||
}
|
||||
|
||||
+2
-2
@@ -17,6 +17,7 @@
|
||||
package org.jetbrains.kotlin.load.java.descriptors;
|
||||
|
||||
import kotlin.Pair;
|
||||
import kotlin.collections.CollectionsKt;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.descriptors.*;
|
||||
@@ -132,8 +133,7 @@ public class JavaClassConstructorDescriptor extends ClassConstructorDescriptorIm
|
||||
);
|
||||
// We do not use doSubstitute here as in JavaMethodDescriptor.enhance because type parameters of constructor belongs to class
|
||||
enhanced.initialize(
|
||||
enhancedReceiver,
|
||||
getDispatchReceiverParameter(),
|
||||
enhancedReceiver, getDispatchReceiverParameter(), CollectionsKt.<ReceiverParameterDescriptor>emptyList(),
|
||||
getTypeParameters(),
|
||||
UtilKt.copyValueParameters(enhancedValueParameterTypes, getValueParameters(), enhanced),
|
||||
enhancedReturnType,
|
||||
|
||||
+2
-1
@@ -93,6 +93,7 @@ public class JavaMethodDescriptor extends SimpleFunctionDescriptorImpl implement
|
||||
public SimpleFunctionDescriptorImpl initialize(
|
||||
@Nullable ReceiverParameterDescriptor extensionReceiverParameter,
|
||||
@Nullable ReceiverParameterDescriptor dispatchReceiverParameter,
|
||||
@NotNull List<ReceiverParameterDescriptor> contextReceiverParameters,
|
||||
@NotNull List<? extends TypeParameterDescriptor> typeParameters,
|
||||
@NotNull List<ValueParameterDescriptor> unsubstitutedValueParameters,
|
||||
@Nullable KotlinType unsubstitutedReturnType,
|
||||
@@ -101,7 +102,7 @@ public class JavaMethodDescriptor extends SimpleFunctionDescriptorImpl implement
|
||||
@Nullable Map<? extends UserDataKey<?>, ?> userData
|
||||
) {
|
||||
SimpleFunctionDescriptorImpl descriptor = super.initialize(
|
||||
extensionReceiverParameter, dispatchReceiverParameter, typeParameters, unsubstitutedValueParameters,
|
||||
extensionReceiverParameter, dispatchReceiverParameter, contextReceiverParameters, typeParameters, unsubstitutedValueParameters,
|
||||
unsubstitutedReturnType, modality, visibility, userData
|
||||
);
|
||||
setOperator(OperatorChecks.INSTANCE.check(descriptor).isSuccess());
|
||||
|
||||
+3
-2
@@ -17,6 +17,7 @@
|
||||
package org.jetbrains.kotlin.load.java.descriptors;
|
||||
|
||||
import kotlin.Pair;
|
||||
import kotlin.collections.CollectionsKt;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.builtins.KotlinBuiltIns;
|
||||
@@ -162,8 +163,8 @@ public class JavaPropertyDescriptor extends PropertyDescriptorImpl implements Ja
|
||||
enhancedReturnType,
|
||||
getTypeParameters(), // TODO
|
||||
getDispatchReceiverParameter(),
|
||||
enhancedReceiver
|
||||
);
|
||||
enhancedReceiver,
|
||||
CollectionsKt.<ReceiverParameterDescriptor>emptyList());
|
||||
return enhanced;
|
||||
}
|
||||
|
||||
|
||||
+3
-2
@@ -515,6 +515,7 @@ class LazyJavaClassMemberScope(
|
||||
getDispatchReceiverParameter(),
|
||||
emptyList(),
|
||||
emptyList(),
|
||||
emptyList(),
|
||||
returnType,
|
||||
// Those functions are generated as open in bytecode
|
||||
// Actually, it should not be important because the class is final anyway, but leaving them open is convenient for consistency
|
||||
@@ -597,7 +598,7 @@ class LazyJavaClassMemberScope(
|
||||
propertyDescriptor.initialize(getter, null)
|
||||
|
||||
val returnType = givenType ?: computeMethodReturnType(method, c.childForMethod(propertyDescriptor, method))
|
||||
propertyDescriptor.setType(returnType, listOf(), getDispatchReceiverParameter(), null)
|
||||
propertyDescriptor.setType(returnType, listOf(), getDispatchReceiverParameter(), null, listOf())
|
||||
getter.initialize(returnType)
|
||||
|
||||
return propertyDescriptor
|
||||
@@ -623,7 +624,7 @@ class LazyJavaClassMemberScope(
|
||||
|
||||
val propertyDescriptor = JavaForKotlinOverridePropertyDescriptor(ownerDescriptor, getterMethod, setterMethod, overriddenProperty)
|
||||
|
||||
propertyDescriptor.setType(getterMethod.returnType!!, listOf(), getDispatchReceiverParameter(), null)
|
||||
propertyDescriptor.setType(getterMethod.returnType!!, listOf(), getDispatchReceiverParameter(), null, listOf())
|
||||
|
||||
val getter = DescriptorFactory.createGetter(
|
||||
propertyDescriptor, getterMethod.annotations, /* isDefault = */false,
|
||||
|
||||
+8
-1
@@ -174,6 +174,7 @@ abstract class LazyJavaScope(
|
||||
DescriptorFactory.createExtensionReceiverParameterForCallable(functionDescriptorImpl, it, Annotations.EMPTY)
|
||||
},
|
||||
getDispatchReceiverParameter(),
|
||||
emptyList(),
|
||||
effectiveSignature.typeParameters,
|
||||
effectiveSignature.valueParameters,
|
||||
effectiveSignature.returnType,
|
||||
@@ -297,7 +298,13 @@ abstract class LazyJavaScope(
|
||||
|
||||
val propertyType = getPropertyType(field)
|
||||
|
||||
propertyDescriptor.setType(propertyType, listOf(), getDispatchReceiverParameter(), null)
|
||||
propertyDescriptor.setType(
|
||||
propertyType,
|
||||
listOf(),
|
||||
getDispatchReceiverParameter(),
|
||||
null,
|
||||
emptyList()
|
||||
)
|
||||
|
||||
if (DescriptorUtils.shouldRecordInitializerForProperty(propertyDescriptor, propertyDescriptor.type)) {
|
||||
propertyDescriptor.setCompileTimeInitializer(
|
||||
|
||||
+1
-1
@@ -115,7 +115,7 @@ class FunctionInvokeDescriptor private constructor(
|
||||
result.initialize(
|
||||
null,
|
||||
functionClass.thisAsReceiverParameter,
|
||||
listOf(),
|
||||
listOf(), listOf(),
|
||||
typeParameters.takeWhile { it.variance == Variance.IN_VARIANCE }
|
||||
.withIndex()
|
||||
.map { createValueParameter(result, it.index, it.value) },
|
||||
|
||||
@@ -26,6 +26,10 @@ import java.util.List;
|
||||
|
||||
public interface CallableDescriptor extends DeclarationDescriptorWithVisibility, DeclarationDescriptorNonRoot,
|
||||
Substitutable<CallableDescriptor> {
|
||||
@NotNull
|
||||
@ReadOnly
|
||||
List<ReceiverParameterDescriptor> getContextReceiverParameters();
|
||||
|
||||
@Nullable
|
||||
ReceiverParameterDescriptor getExtensionReceiverParameter();
|
||||
|
||||
|
||||
+6
@@ -65,6 +65,12 @@ public abstract class AbstractReceiverParameterDescriptor extends DeclarationDes
|
||||
return visitor.visitReceiverParameterDescriptor(this, data);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public List<ReceiverParameterDescriptor> getContextReceiverParameters() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public ReceiverParameterDescriptor getExtensionReceiverParameter() {
|
||||
|
||||
+1
-1
@@ -70,7 +70,7 @@ public class ClassConstructorDescriptorImpl extends FunctionDescriptorImpl imple
|
||||
@NotNull List<TypeParameterDescriptor> typeParameterDescriptors
|
||||
) {
|
||||
super.initialize(
|
||||
null, calculateDispatchReceiverParameter(),
|
||||
null, calculateDispatchReceiverParameter(), Collections.<ReceiverParameterDescriptor>emptyList(),
|
||||
typeParameterDescriptors,
|
||||
unsubstitutedValueParameters, null,
|
||||
Modality.FINAL, visibility);
|
||||
|
||||
+11
-2
@@ -23,6 +23,7 @@ public abstract class FunctionDescriptorImpl extends DeclarationDescriptorNonRoo
|
||||
private List<TypeParameterDescriptor> typeParameters;
|
||||
private List<ValueParameterDescriptor> unsubstitutedValueParameters;
|
||||
private KotlinType unsubstitutedReturnType;
|
||||
private List<ReceiverParameterDescriptor> contextReceiverParameters;
|
||||
private ReceiverParameterDescriptor extensionReceiverParameter;
|
||||
private ReceiverParameterDescriptor dispatchReceiverParameter;
|
||||
private Modality modality;
|
||||
@@ -68,6 +69,7 @@ public abstract class FunctionDescriptorImpl extends DeclarationDescriptorNonRoo
|
||||
public FunctionDescriptorImpl initialize(
|
||||
@Nullable ReceiverParameterDescriptor extensionReceiverParameter,
|
||||
@Nullable ReceiverParameterDescriptor dispatchReceiverParameter,
|
||||
@NotNull List<ReceiverParameterDescriptor> contextReceiverParameters,
|
||||
@NotNull List<? extends TypeParameterDescriptor> typeParameters,
|
||||
@NotNull List<ValueParameterDescriptor> unsubstitutedValueParameters,
|
||||
@Nullable KotlinType unsubstitutedReturnType,
|
||||
@@ -81,6 +83,7 @@ public abstract class FunctionDescriptorImpl extends DeclarationDescriptorNonRoo
|
||||
this.visibility = visibility;
|
||||
this.extensionReceiverParameter = extensionReceiverParameter;
|
||||
this.dispatchReceiverParameter = dispatchReceiverParameter;
|
||||
this.contextReceiverParameters = contextReceiverParameters;
|
||||
|
||||
for (int i = 0; i < typeParameters.size(); ++i) {
|
||||
TypeParameterDescriptor typeParameterDescriptor = typeParameters.get(i);
|
||||
@@ -165,6 +168,12 @@ public abstract class FunctionDescriptorImpl extends DeclarationDescriptorNonRoo
|
||||
this.extensionReceiverParameter = extensionReceiverParameter;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public List<ReceiverParameterDescriptor> getContextReceiverParameters() {
|
||||
return contextReceiverParameters;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public ReceiverParameterDescriptor getExtensionReceiverParameter() {
|
||||
@@ -663,9 +672,9 @@ public abstract class FunctionDescriptorImpl extends DeclarationDescriptorNonRoo
|
||||
return this;
|
||||
}
|
||||
|
||||
// TODO: Substitute context receivers
|
||||
substitutedDescriptor.initialize(
|
||||
substitutedReceiverParameter,
|
||||
substitutedExpectedThis,
|
||||
substitutedReceiverParameter, substitutedExpectedThis, CollectionsKt.<ReceiverParameterDescriptor>emptyList(),
|
||||
substitutedTypeParameters,
|
||||
substitutedValueParameters,
|
||||
substitutedReturnType,
|
||||
|
||||
+6
@@ -166,6 +166,12 @@ public abstract class PropertyAccessorDescriptorImpl extends DeclarationDescript
|
||||
return correspondingProperty;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public List<ReceiverParameterDescriptor> getContextReceiverParameters() {
|
||||
return getCorrespondingProperty().getContextReceiverParameters();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public ReceiverParameterDescriptor getExtensionReceiverParameter() {
|
||||
|
||||
+38
-11
@@ -17,6 +17,7 @@
|
||||
package org.jetbrains.kotlin.descriptors.impl;
|
||||
|
||||
import kotlin.annotations.jvm.ReadOnly;
|
||||
import kotlin.collections.CollectionsKt;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.descriptors.*;
|
||||
@@ -47,6 +48,7 @@ public class PropertyDescriptorImpl extends VariableDescriptorWithInitializerImp
|
||||
private final boolean isExternal;
|
||||
private final boolean isDelegated;
|
||||
|
||||
private List<ReceiverParameterDescriptor> contextReceiverParameters = Collections.emptyList();
|
||||
private ReceiverParameterDescriptor dispatchReceiverParameter;
|
||||
private ReceiverParameterDescriptor extensionReceiverParameter;
|
||||
private List<TypeParameterDescriptor> typeParameters;
|
||||
@@ -121,7 +123,8 @@ public class PropertyDescriptorImpl extends VariableDescriptorWithInitializerImp
|
||||
@NotNull KotlinType outType,
|
||||
@ReadOnly @NotNull List<? extends TypeParameterDescriptor> typeParameters,
|
||||
@Nullable ReceiverParameterDescriptor dispatchReceiverParameter,
|
||||
@Nullable ReceiverParameterDescriptor extensionReceiverParameter
|
||||
@Nullable ReceiverParameterDescriptor extensionReceiverParameter,
|
||||
@NotNull List<ReceiverParameterDescriptor> contextReceiverParameters
|
||||
) {
|
||||
setOutType(outType);
|
||||
|
||||
@@ -129,6 +132,7 @@ public class PropertyDescriptorImpl extends VariableDescriptorWithInitializerImp
|
||||
|
||||
this.extensionReceiverParameter = extensionReceiverParameter;
|
||||
this.dispatchReceiverParameter = dispatchReceiverParameter;
|
||||
this.contextReceiverParameters = contextReceiverParameters;
|
||||
}
|
||||
|
||||
public void initialize(
|
||||
@@ -169,6 +173,12 @@ public class PropertyDescriptorImpl extends VariableDescriptorWithInitializerImp
|
||||
return parameters;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public List<ReceiverParameterDescriptor> getContextReceiverParameters() {
|
||||
return contextReceiverParameters;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public ReceiverParameterDescriptor getExtensionReceiverParameter() {
|
||||
@@ -427,19 +437,22 @@ public class PropertyDescriptorImpl extends VariableDescriptorWithInitializerImp
|
||||
|
||||
ReceiverParameterDescriptor substitutedExtensionReceiver;
|
||||
if (extensionReceiverParameter != null) {
|
||||
KotlinType substitutedReceiverType = substitutor.substitute(extensionReceiverParameter.getType(), Variance.IN_VARIANCE);
|
||||
if (substitutedReceiverType == null) return null;
|
||||
substitutedExtensionReceiver = new ReceiverParameterDescriptorImpl(
|
||||
substitutedDescriptor,
|
||||
new ExtensionReceiver(substitutedDescriptor, substitutedReceiverType, extensionReceiverParameter.getValue()),
|
||||
extensionReceiverParameter.getAnnotations()
|
||||
);
|
||||
}
|
||||
else {
|
||||
substitutedExtensionReceiver = substituteParameterDescriptor(substitutor, substitutedDescriptor, extensionReceiverParameter);
|
||||
} else {
|
||||
substitutedExtensionReceiver = null;
|
||||
}
|
||||
|
||||
substitutedDescriptor.setType(outType, substitutedTypeParameters, substitutedDispatchReceiver, substitutedExtensionReceiver);
|
||||
List<ReceiverParameterDescriptor> substitutedContextReceivers = new ArrayList<ReceiverParameterDescriptor>();
|
||||
for (ReceiverParameterDescriptor contextReceiverParameter: contextReceiverParameters) {
|
||||
ReceiverParameterDescriptor substitutedContextReceiver = substituteParameterDescriptor(substitutor, substitutedDescriptor,
|
||||
contextReceiverParameter);
|
||||
if (substitutedContextReceiver != null) {
|
||||
substitutedContextReceivers.add(substitutedContextReceiver);
|
||||
}
|
||||
}
|
||||
|
||||
substitutedDescriptor.setType(outType, substitutedTypeParameters, substitutedDispatchReceiver, substitutedExtensionReceiver,
|
||||
substitutedContextReceivers);
|
||||
|
||||
PropertyGetterDescriptorImpl newGetter = getter == null ? null : new PropertyGetterDescriptorImpl(
|
||||
substitutedDescriptor, getter.getAnnotations(), copyConfiguration.modality, normalizeVisibility(getter.getVisibility(), copyConfiguration.kind),
|
||||
@@ -514,6 +527,20 @@ public class PropertyDescriptorImpl extends VariableDescriptorWithInitializerImp
|
||||
return prev;
|
||||
}
|
||||
|
||||
private static ReceiverParameterDescriptor substituteParameterDescriptor(
|
||||
TypeSubstitutor substitutor,
|
||||
PropertyDescriptor substitutedPropertyDescriptor,
|
||||
ReceiverParameterDescriptor receiverParameterDescriptor
|
||||
) {
|
||||
KotlinType substitutedType = substitutor.substitute(receiverParameterDescriptor.getType(), Variance.IN_VARIANCE);
|
||||
if (substitutedType == null) return null;
|
||||
return new ReceiverParameterDescriptorImpl(
|
||||
substitutedPropertyDescriptor,
|
||||
new ExtensionReceiver(substitutedPropertyDescriptor, substitutedType, receiverParameterDescriptor.getValue()),
|
||||
receiverParameterDescriptor.getAnnotations()
|
||||
);
|
||||
}
|
||||
|
||||
private static FunctionDescriptor getSubstitutedInitialSignatureDescriptor(
|
||||
@NotNull TypeSubstitutor substitutor,
|
||||
@NotNull PropertyAccessorDescriptor accessorDescriptor
|
||||
|
||||
+4
-2
@@ -55,13 +55,14 @@ public class SimpleFunctionDescriptorImpl extends FunctionDescriptorImpl impleme
|
||||
public SimpleFunctionDescriptorImpl initialize(
|
||||
@Nullable ReceiverParameterDescriptor extensionReceiverParameter,
|
||||
@Nullable ReceiverParameterDescriptor dispatchReceiverParameter,
|
||||
@NotNull List<ReceiverParameterDescriptor> contextReceiverParameters,
|
||||
@NotNull List<? extends TypeParameterDescriptor> typeParameters,
|
||||
@NotNull List<ValueParameterDescriptor> unsubstitutedValueParameters,
|
||||
@Nullable KotlinType unsubstitutedReturnType,
|
||||
@Nullable Modality modality,
|
||||
@NotNull DescriptorVisibility visibility
|
||||
) {
|
||||
return initialize(extensionReceiverParameter, dispatchReceiverParameter, typeParameters, unsubstitutedValueParameters,
|
||||
return initialize(extensionReceiverParameter, dispatchReceiverParameter, contextReceiverParameters, typeParameters, unsubstitutedValueParameters,
|
||||
unsubstitutedReturnType, modality, visibility, null);
|
||||
}
|
||||
|
||||
@@ -69,6 +70,7 @@ public class SimpleFunctionDescriptorImpl extends FunctionDescriptorImpl impleme
|
||||
public SimpleFunctionDescriptorImpl initialize(
|
||||
@Nullable ReceiverParameterDescriptor extensionReceiverParameter,
|
||||
@Nullable ReceiverParameterDescriptor dispatchReceiverParameter,
|
||||
@NotNull List<ReceiverParameterDescriptor> contextReceiverParameters,
|
||||
@NotNull List<? extends TypeParameterDescriptor> typeParameters,
|
||||
@NotNull List<ValueParameterDescriptor> unsubstitutedValueParameters,
|
||||
@Nullable KotlinType unsubstitutedReturnType,
|
||||
@@ -76,7 +78,7 @@ public class SimpleFunctionDescriptorImpl extends FunctionDescriptorImpl impleme
|
||||
@NotNull DescriptorVisibility visibility,
|
||||
@Nullable Map<? extends UserDataKey<?>, ?> userData
|
||||
) {
|
||||
super.initialize(extensionReceiverParameter, dispatchReceiverParameter, typeParameters, unsubstitutedValueParameters,
|
||||
super.initialize(extensionReceiverParameter, dispatchReceiverParameter, contextReceiverParameters, typeParameters, unsubstitutedValueParameters,
|
||||
unsubstitutedReturnType, modality, visibility);
|
||||
|
||||
if (userData != null && !userData.isEmpty()) {
|
||||
|
||||
+2
@@ -83,6 +83,7 @@ class TypeAliasConstructorDescriptorImpl private constructor(
|
||||
typeAliasConstructor.initialize(
|
||||
null,
|
||||
underlyingConstructorDescriptor.dispatchReceiverParameter?.substitute(substitutorForUnderlyingClass),
|
||||
emptyList(),
|
||||
typeAliasDescriptor.declaredTypeParameters,
|
||||
valueParameters,
|
||||
returnType,
|
||||
@@ -205,6 +206,7 @@ class TypeAliasConstructorDescriptorImpl private constructor(
|
||||
typeAliasConstructor.initialize(
|
||||
receiverParameter,
|
||||
null,
|
||||
emptyList(),
|
||||
typeAliasDescriptor.declaredTypeParameters,
|
||||
valueParameters,
|
||||
returnType,
|
||||
|
||||
@@ -88,6 +88,12 @@ public abstract class VariableDescriptorImpl extends DeclarationDescriptorNonRoo
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public List<ReceiverParameterDescriptor> getContextReceiverParameters() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ReceiverParameterDescriptor getExtensionReceiverParameter() {
|
||||
return null;
|
||||
|
||||
@@ -146,7 +146,7 @@ public class DescriptorFactory {
|
||||
SimpleFunctionDescriptorImpl values =
|
||||
SimpleFunctionDescriptorImpl.create(enumClass, Annotations.Companion.getEMPTY(), ENUM_VALUES,
|
||||
CallableMemberDescriptor.Kind.SYNTHESIZED, enumClass.getSource());
|
||||
return values.initialize(null, null, Collections.<TypeParameterDescriptor>emptyList(),
|
||||
return values.initialize(null, null, Collections.<ReceiverParameterDescriptor>emptyList(), Collections.<TypeParameterDescriptor>emptyList(),
|
||||
Collections.<ValueParameterDescriptor>emptyList(),
|
||||
getBuiltIns(enumClass).getArrayType(Variance.INVARIANT, enumClass.getDefaultType()),
|
||||
Modality.FINAL, DescriptorVisibilities.PUBLIC);
|
||||
@@ -165,7 +165,7 @@ public class DescriptorFactory {
|
||||
null,
|
||||
enumClass.getSource()
|
||||
);
|
||||
return valueOf.initialize(null, null, Collections.<TypeParameterDescriptor>emptyList(),
|
||||
return valueOf.initialize(null, null, Collections.<ReceiverParameterDescriptor>emptyList(), Collections.<TypeParameterDescriptor>emptyList(),
|
||||
Collections.singletonList(parameterDescriptor), enumClass.getDefaultType(),
|
||||
Modality.FINAL, DescriptorVisibilities.PUBLIC);
|
||||
}
|
||||
|
||||
@@ -99,6 +99,7 @@ private fun initializeSamConstructorDescriptor(
|
||||
samConstructor.initialize(
|
||||
null,
|
||||
null,
|
||||
emptyList(),
|
||||
typeParameters.descriptors, listOf(parameter),
|
||||
returnType,
|
||||
Modality.FINAL,
|
||||
|
||||
@@ -429,7 +429,8 @@ public class ErrorUtils {
|
||||
SourceElement.NO_SOURCE,
|
||||
false, false, false, false, false, false
|
||||
);
|
||||
descriptor.setType(ERROR_PROPERTY_TYPE, Collections.<TypeParameterDescriptor>emptyList(), null, null);
|
||||
descriptor.setType(ERROR_PROPERTY_TYPE, Collections.<TypeParameterDescriptor>emptyList(), null, null,
|
||||
Collections.<ReceiverParameterDescriptor>emptyList());
|
||||
|
||||
return descriptor;
|
||||
}
|
||||
@@ -438,8 +439,7 @@ public class ErrorUtils {
|
||||
private static SimpleFunctionDescriptor createErrorFunction(@NotNull ErrorScope ownerScope) {
|
||||
ErrorSimpleFunctionDescriptorImpl function = new ErrorSimpleFunctionDescriptorImpl(ERROR_CLASS, ownerScope);
|
||||
function.initialize(
|
||||
null,
|
||||
null,
|
||||
null, null, Collections.<ReceiverParameterDescriptor>emptyList(),
|
||||
Collections.<TypeParameterDescriptorImpl>emptyList(), // TODO
|
||||
Collections.<ValueParameterDescriptor>emptyList(), // TODO
|
||||
createErrorType("<ERROR FUNCTION RETURN TYPE>"),
|
||||
|
||||
+3
-1
@@ -59,7 +59,8 @@ class MemberDeserializer(private val c: DeserializationContext) {
|
||||
getDispatchReceiverParameter(),
|
||||
proto.receiverType(c.typeTable)?.let(local.typeDeserializer::type)?.let { receiverType ->
|
||||
DescriptorFactory.createExtensionReceiverParameterForCallable(property, receiverType, receiverAnnotations)
|
||||
}
|
||||
},
|
||||
emptyList()
|
||||
)
|
||||
|
||||
// Per documentation on Property.getter_flags in metadata.proto, if an accessor flags field is absent, its value should be computed
|
||||
@@ -161,6 +162,7 @@ class MemberDeserializer(private val c: DeserializationContext) {
|
||||
initialize(
|
||||
extensionReceiverParameter,
|
||||
dispatchReceiverParameter,
|
||||
emptyList(), // TODO
|
||||
typeParameters,
|
||||
unsubstitutedValueParameters,
|
||||
unsubstitutedReturnType,
|
||||
|
||||
Reference in New Issue
Block a user