MinecraftDev icon indicating copy to clipboard operation
MinecraftDev copied to clipboard

Warn about unconditional inject-at-head-cancel mixins

Open i509VCB opened this issue 3 years ago • 1 comments
trafficstars

This can be made with an Injector mixin that always cancels the rest of the function (at head) and possibly returns a different value.

This is effectively an overwrite with undefined behavior.

  1. The ordering is undefined unless you change mixin priority. Two of these could conflict
  2. Any transformations afterwards are entirely ignored. An overwrite would be more explicit about this behavior.

If an inject-at-head injector has a conditional that can change (unfamiliar with control flow in PSI, may not be feasible), then said warning should not be risen.

i509VCB avatar May 23 '22 04:05 i509VCB

This should be fairly easy to implement.

Earthcomputer avatar May 23 '22 13:05 Earthcomputer