You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The @MergeMethod annotation allows a user to augment an existing method on a class. However, no checks are done to verify that such a method actually exists. In most cases, this isn't a major issue since the user can use the @Override annotation to ensure such a method exists on the parent class.
However, there are cases where using @Override isn't actually possible. In particular, static methods can't use @Override since you can't use virtual dispatch with a static method. In such a case, it's possible to specify an incorrect signature for a @MergeMethod, and would look like a silent failure from a user perspective: the method wouldn't be overridden, and the default behavior for the overridden method would remain. In most cases this would just be a silent failure, but in some cases if there are multiple merged methods this could lead to crashes or other weird behavior.
All this would be mitigated by issuing an error or warning when a @MergeMethod does not replace something.
The text was updated successfully, but these errors were encountered:
The
@MergeMethod
annotation allows a user to augment an existing method on a class. However, no checks are done to verify that such a method actually exists. In most cases, this isn't a major issue since the user can use the@Override
annotation to ensure such a method exists on the parent class.However, there are cases where using
@Override
isn't actually possible. In particular,static
methods can't use@Override
since you can't use virtual dispatch with a static method. In such a case, it's possible to specify an incorrect signature for a@MergeMethod
, and would look like a silent failure from a user perspective: the method wouldn't be overridden, and the default behavior for the overridden method would remain. In most cases this would just be a silent failure, but in some cases if there are multiple merged methods this could lead to crashes or other weird behavior.All this would be mitigated by issuing an error or warning when a
@MergeMethod
does not replace something.The text was updated successfully, but these errors were encountered: