[JVM_IR] Don't add synthetic accessor when processing function reference

The issue appeared after code refactoring. Originally we didn't
save generated accessor for symbols in `IrFunctionReference`. These
symbols will be processed in their own turn.

#KT-59079 Fixed
This commit is contained in:
Ivan Kylchik
2023-06-06 16:32:09 +02:00
committed by Space Team
parent 456783436c
commit f74fd947b3
6 changed files with 56 additions and 8 deletions
@@ -276,14 +276,12 @@ private class SyntheticAccessorTransformer(
accessorGenerator.isOrShouldBeHiddenAsSealedClassConstructor(function) -> accessorGenerator.getSyntheticConstructorOfSealedClass(function)
else -> return super.visitFunctionReference(expression)
}
generatedAccessor.symbol.save().owner.let { accessor ->
expression.transformChildrenVoid()
return IrFunctionReferenceImpl(
expression.startOffset, expression.endOffset, expression.type,
accessor.symbol, accessor.typeParameters.size,
accessor.valueParameters.size, accessor.symbol, expression.origin
)
}
expression.transformChildrenVoid()
return IrFunctionReferenceImpl(
expression.startOffset, expression.endOffset, expression.type,
generatedAccessor.symbol, generatedAccessor.typeParameters.size,
generatedAccessor.valueParameters.size, generatedAccessor.symbol, expression.origin
)
}
return super.visitFunctionReference(expression)