Fix failing IR tests because of CCE in WrappedValueParameterDescriptor
In previous commits, renderValueParameter began to calculate its containing declaration. However, WrappedValueParameterDescriptor assumes that parent of IrParameter is IrFunction, which is not true for dispatch receiver parameters. The correct fix would be not to create WrappedValueParameterDescriptor for dispatch receivers at all and use WrappedReceiverParameterDescriptor instead. In this fix, I just moved parameter' containing declaration calculation inside specific option which is usually false, thus hiding the found problem.
This commit is contained in:
+2
@@ -88,6 +88,8 @@ abstract class WrappedCallableDescriptor<T : IrDeclaration>(
|
||||
override fun <V : Any?> getUserData(key: CallableDescriptor.UserDataKey<V>?): V? = null
|
||||
}
|
||||
|
||||
// TODO: (Roman Artemev) do not create this kind of descriptor for dispatch receiver parameters
|
||||
// WrappedReceiverParameterDescriptor should be used instead
|
||||
open class WrappedValueParameterDescriptor(
|
||||
annotations: Annotations = Annotations.EMPTY,
|
||||
sourceElement: SourceElement = SourceElement.NO_SOURCE
|
||||
|
||||
@@ -815,8 +815,7 @@ internal class DescriptorRendererImpl(
|
||||
renderModifier(builder, valueParameter.isCrossinline, "crossinline")
|
||||
renderModifier(builder, valueParameter.isNoinline, "noinline")
|
||||
|
||||
val containingDeclaration = valueParameter.containingDeclaration
|
||||
if (renderAnnotationPropertiesInPrimaryConstructor && containingDeclaration.isAnnotationConstructor()) {
|
||||
if (renderAnnotationPropertiesInPrimaryConstructor && valueParameter.containingDeclaration.isAnnotationConstructor()) {
|
||||
renderModifier(builder, actualPropertiesInPrimaryConstructor, "actual")
|
||||
renderModifier(builder, true, "val")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user