Open stuartmorgan opened 3 weeks ago
They are deduped at the generation level, but it's probably a similar issue to what I mentioned here. A method is being deleted or having it's type altered, and the old msgSend isn't cleaned up.
Another possibility in this case is that the deduping logic could be made more aggressive. Maybe there are cases where the msgSend deduping logic thinks two argument types are different, but they're actually the same. For example, nullability doesn't affect the msgSend function signature.
As I mentioned on the other bug, as a work around for now, just add some ignore_for_file
rules to the preamble:
option in your ffigen config.
I always have a scattering of unused
_objc_msgSend_###
warnings from my generated bindings. It also looks like there's some de-duping at the usage level but not the generation level for_objc_msgSend_*
. For example, I have this in theNSScriptClassDescription
generation section:_objc_msgSend_686
is unused. When I looked for_sel_classDescriptionForClass_
to see why, I found these in two different classes:They both use the identical:
from the
NSClassDescription
generation section.If over-generating and letting tree shaking handle it is intentional (to make the generator logic simpler), the file should be generated with a file-level
ignore
for that warning. But in this case since there's clearly already some kind of global de-duping happening somewhere anyway, maybe it would be easy to make that include not generating the duplicate in the first place?