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
{{ message }}
Repository navigation
Consistency of __PROPERTY__ magic constant meaning in hook signature #17222
Huh. I didn't know that __METHOD__ worked in most of those places... I've never used it except in the body. That's probably why it is how it is: We never thought about it. 😄
I'm fine with making it meaningful in the hook attribute, as it's functionally the same as a method. That... could probably be treated as a non-breaking bug fix if we wanted, but that's not my call.
Adding it to property attributes I'd also be in favor of, though I'm not sure if that would also be legal as a bug fix or if it would have to wait for 8.5.
I don't think the property default value is distinct enough from the property itself for it to have its own attributes to begin with, so there's nothing to do there.
I don't think BC is a concern yet. This can be treated as a bug IMO. Given the behavior of the other pseudo constants, I think all of these cases should work.
Activity
Crell commentedon Dec 20, 2024
Huh. I didn't know that
__METHOD__worked in most of those places... I've never used it except in the body. That's probably why it is how it is: We never thought about it. 😄I'm fine with making it meaningful in the hook attribute, as it's functionally the same as a method. That... could probably be treated as a non-breaking bug fix if we wanted, but that's not my call.
Adding it to property attributes I'd also be in favor of, though I'm not sure if that would also be legal as a bug fix or if it would have to wait for 8.5.
I don't think the property default value is distinct enough from the property itself for it to have its own attributes to begin with, so there's nothing to do there.
Ilija?
iluuu1994 commentedon Dec 20, 2024
I don't think BC is a concern yet. This can be treated as a bug IMO. Given the behavior of the other pseudo constants, I think all of these cases should work.
__PROPERTY__ does not work in all constant expression contexts
__PROPERTY__ does not work in all constant expression contexts