-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Fix GH-10377: Unable to have an anonymous readonly class #10381
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
Conversation
Nice, the PR looks good to me! However, IMO we should fix this in master only as this is not a bug per se, but a missing feature caused by an oversight when I implemented the RFC. Feel free to ask the RMs what they think if you disagree :) If we arrive to a consensus, I'll merge your work. |
Thank you for your review. |
Since no more replies came in, and I agree with your decision: I changed the target to master and rebased on top of master. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you!
This fixes the oversight that an anonymous class should be able to be readonly. Other identifiers such as final and abstract do not make sense. As we still want nice errors for when users try to use these modifiers, or use multiple modifiers, we introduce a new function zend_add_anonymous_class_modifier that will perform verification for anonymous class modifiers, just like zend_add_class_modifier does for non-anonymous classes.
Fixes GH-10377
This fixes the oversight that an anonymous class should be able to be readonly. Other identifiers such as final and abstract do not make sense. As we still want nice errors for when users try to use these modifiers, or use multiple modifiers, we introduce a new function zend_add_anonymous_class_modifier that will perform verification for anonymous class modifiers, just like zend_add_class_modifier does for non-anonymous classes.