[PSI2IR] Fix parameter initialization for constructors with CR
This commit is contained in:
committed by
TeamCityServer
parent
4caf42804a
commit
2fbfee3e11
@@ -474,7 +474,7 @@ class ClassGenerator(
|
||||
}
|
||||
|
||||
ktPrimaryConstructor.valueParameters.forEachIndexed { i, ktParameter ->
|
||||
val irValueParameter = irPrimaryConstructor.valueParameters[i]
|
||||
val irValueParameter = irPrimaryConstructor.valueParameters[i + ktClassOrObject.contextReceivers.size]
|
||||
if (ktParameter.hasValOrVar()) {
|
||||
val irProperty = PropertyGenerator(declarationGenerator)
|
||||
.generatePropertyForPrimaryConstructorParameter(ktParameter, irValueParameter)
|
||||
|
||||
+3
-2
@@ -156,7 +156,8 @@ internal class InsertImplicitCasts(
|
||||
return expression.transformPostfix {
|
||||
transformReceiverArguments(substitutedDescriptor)
|
||||
for (index in substitutedDescriptor.valueParameters.indices) {
|
||||
val argument = getValueArgument(index) ?: continue
|
||||
val irIndex = index + substitutedDescriptor.contextReceiverParameters.size
|
||||
val argument = getValueArgument(irIndex) ?: continue
|
||||
val parameterType = substitutedDescriptor.valueParameters[index].type
|
||||
val originalParameterType = substitutedDescriptor.original.valueParameters[index].type
|
||||
|
||||
@@ -168,7 +169,7 @@ internal class InsertImplicitCasts(
|
||||
else
|
||||
parameterType
|
||||
|
||||
putValueArgument(index, argument.cast(expectedType, originalExpectedType = originalParameterType))
|
||||
putValueArgument(irIndex, argument.cast(expectedType, originalExpectedType = originalParameterType))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user