Fix GH-10377: Unable to have an anonymous readonly class#10381
Closed
ndossche wants to merge 1 commit intophp:masterfrom
Closed
Fix GH-10377: Unable to have an anonymous readonly class#10381ndossche wants to merge 1 commit intophp:masterfrom
ndossche wants to merge 1 commit intophp:masterfrom
Conversation
Member
|
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. |
Member
Author
|
Thank you for your review. |
Member
Author
|
Since no more replies came in, and I agree with your decision: I changed the target to master and rebased on top of master. |
kocsismate
reviewed
Feb 13, 2023
kocsismate
reviewed
Feb 13, 2023
kocsismate
approved these changes
Feb 15, 2023
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.