Composable ModifyConstant
I learned today that ModifyConstant isn't actually composable and thus causes incompatibilities when multiple mods target the same location.
I'm wondering if the injector can be extended so that they compose cleanly? Two mods would still specify the same original constant to identify the injection site, but Mixin would inject callbacks to both mods' callbacks, one after another in priority order, threading the original value through. The first mod would get the original constant, the second mod gets what the first callback returned, and so on.
Doing that for existing ModifyConstants could break assumptions made by existing mods (at least it would with some of my code) - generally when targeting a constant it seemed like it was correct to assume that the input parameter is going to always be the exact constant specified, so it was sometimes easier to not even use the original constant.
Also there are cases where composing that way just can't work because the constant being targeted is just completely replaced, and not based in any way on the original value - in which case I would find it useful to specify that I want a visible conflict in case the value I would be getting would actually be coming from other mixin's ModifyConstant. Composing them unconditionally would create difficult to debug, unexpected incompatibilities in cases that would previously conflict.
It seems like it could be a useful behaviour though where the injectors are aware of eachother, so while I don't think it's a good retrofit behaviour, it does seem like it could be an opt-in behaviour: if all the injectors targetting a constant declare themselves to be be chainable (or composable, or multi or whatever) then effectively as long as everyone is aware they're part of a chain, the injector can be written with that contract in mind.
It's definitely worth thinking about, especially where the intended changes might have different purposes but actually desire the same outcome, or in situations where both injectors are modifying the constant in mutally-exclusive situations.