To add one more tip @alfaromartino — I would recommend using Cthulhu.jl for this as it lets you descend into the function body.
I guess another option is for me to leave the function body in both functions? Then inspection tools like @code_warntype
would work. And I suppose it could improve source tracking for errors, and simplify the propagation of other macros (@matthias314 - relevant to your question too).
You would still generate the second function and call promote_op
on it; but then just not actually use it. It would exclusively be for testing the type inference of itself.