Workaround inconsistent descriptor for Any.hashCode in ObjCExport
Recent changes to IR (adopted in https://github.com/JetBrains/kotlin-native/pull/4621) have broken some invariants Native backend relies on, in particular now `hashCodeIrFunction.descriptor.containingDeclaration` is not `builtIns.any`, but is an "IR-based" descriptor which has same fq name. This breaks ObjCExport's predicate detecting `hashCode` (which in turn breaks `interop_objc_smoke` test in two-stage mode). This commit doesn't fix the invariants, but workarounds the problem by making the predicate more flexible.
This commit is contained in:
committed by
Nikolay Krasko
parent
1222b72dcd
commit
37bcd0894f
+2
-1
@@ -265,7 +265,8 @@ private fun ObjCExportMapper.bridgeReturnType(
|
||||
}
|
||||
}
|
||||
|
||||
descriptor.containingDeclaration == descriptor.builtIns.any && descriptor.name.asString() == "hashCode" -> {
|
||||
descriptor.containingDeclaration.let { it is ClassDescriptor && KotlinBuiltIns.isAny(it) } &&
|
||||
descriptor.name.asString() == "hashCode" -> {
|
||||
assert(!convertExceptionsToErrors)
|
||||
MethodBridge.ReturnValue.HashCode
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user