Skip to content

[Serializer] Fix readonly property initialization from incorrect scope #61028

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

Open
wants to merge 1 commit into
base: 6.4
Choose a base branch
from

Conversation

santysisi
Copy link
Contributor

@santysisi santysisi commented Jul 2, 2025

Q A
Branch? 6.4
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #60846
License MIT

Readonly properties couldn't be initialized during denormalization due to scope restrictions. This change checks if a property is readonly and uninitialized, if so, it sets the value using the declaring class's scope.

Also added a safety check to throw a LogicException if a readonly property is already initialized, to avoid accidental mutation.

@santysisi santysisi requested a review from dunglas as a code owner July 2, 2025 23:30
@carsonbot carsonbot added this to the 6.4 milestone Jul 2, 2025
@santysisi santysisi force-pushed the fix/readonly-property-initialization branch 4 times, most recently from fa410b1 to 2f87dc4 Compare July 3, 2025 00:02
@santysisi santysisi force-pushed the fix/readonly-property-initialization branch from 2f87dc4 to 5c28257 Compare July 3, 2025 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment