Check if there is bridge by signatures instead of IR

#KT-50649 Fixed
This commit is contained in:
Ilmir Usmanov
2022-01-15 06:49:05 +01:00
committed by TeamCityServer
parent 8fe4e9030f
commit b794b0f1be
11 changed files with 134 additions and 4 deletions
@@ -694,13 +694,11 @@ class ExpressionCodegen(
// Otherwise, we need to treat `Result` as boxed if it overrides a non-`Result` or boxed `Result` type.
// TODO: if results of `needsResultArgumentUnboxing` for `overriddenSymbols` are inconsistent, the boxedness
// of the `Result` depends on which overridden function is called. This is probably unfixable.
val signature = methodSignatureMapper.mapAsmMethod(this)
val parent = this.parent
return parent is IrClass &&
parent.functions.none {
it != this && it.origin == IrDeclarationOrigin.BRIDGE && it.attributeOwnerId == attributeOwnerId
} &&
overriddenSymbols.any {
it.owner.resultIsActuallyAny(index) != false
methodSignatureMapper.mapAsmMethod(it.owner) == signature && it.owner.resultIsActuallyAny(index) != false
}
}