I'm working on adding multiplatform support to a plugin that previously only supported the JVM. It replaces the fake overrides for
equals
,
hashCode
, and
toString
with real implementations. This works on JVM and as-is on the newly-added JS target. On native targets, however, only
hashCode
and
toString
work. Replacing the body of the fake
equals
function and marking it as non-fake somehow isn't enough. Debugging at runtime, I always end up in
kotlin_Any_equals
. Dumping the LLVM IR after the
VerifyBitcode
phase shows that the
equals
function is completely absent. Dumping the IR after the plugin matches on the
equals
method shows that it successfully replaced the function body with the new IR, but somewhere it's getting removed still. Any ideas?