-
-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inheritance of remap
is inadequately documented
#551
Comments
This is intended behaviour, although I agree that it's poorly documented in the Javadocs |
As EarthComputer says this is the intended behaviour, I think the confusion actually arises from the fact that Java has a weird contract for "default" values of annotations which is used by the Mixin AP to tristate the value, in that there's a difference between a value being specified as the "default" and not being specified at all. The tristate is:
While the tristate characteristic could be documented better, I chose this behaviour as the most intuitive since in general if a thing is being decorated with
I disagree that there should be a "warning" in this case. You told it the element was remappable so the AP complaining that you told it something wouldn't be very helpful as then you'd need a
I feel like calling this a "quirk" is kind of rude, this is designed behaviour which is intended to make
Which in my mind clearly articulates that the |
remap
isn't always set to true
by default, it depends on the contextremap
is inadequately documented
I agree, it would have been completely intuitive if I didn't know anything about the JVM. As it is, I know just enough to be wrong: when I looked at the code I just assumed that there was no way to determine a "default"/
I agree, I only went to the code because in this particular instance (in the
I agree, if I had seen these docs from the |
Annotation values as they are actually stored in the class are actually all just converted to
This is why I agreed the documentation needs expanding upon, but the behaviour itself is intended.
This is likely the approach I will take as I wouldn't use the term tristate in the docs, just describe the behaviour of omitting the setting vs. specifying it in the same way I do in the root annotation javadoc. |
Okay, so this is a little confusing since it was completely unexpected to me, but in short: the behavior changes if you supply
remap=true
to a certain mixin even though the default value for the annotation istrue
anyway. I find this extremely counterintuitive.My situation was that I was trying to target a remapped method inside of a non-remapped method. The outer method was marked
remap=false
. What I assumed was thatremap=true
is the default always so the inner annotation would not need to haveremap=true
explicitly stated. What actually happens though is the remap value is set for the "context" and so the default for the inner annotation becomesremap=false
with no warning.Either this (potentially useful, but also potentially confusing) quirk should be clearly documented in each
remap
Javadoc or the value should always default toremap=true
regardless of "parent" annotations.The text was updated successfully, but these errors were encountered: