Skip to content

Treat init-only properties as cannot write#1730

Merged
manodasanW merged 1 commit into
microsoft:masterfrom
hez2010:initonly
Sep 4, 2024
Merged

Treat init-only properties as cannot write#1730
manodasanW merged 1 commit into
microsoft:masterfrom
hez2010:initonly

Conversation

@hez2010
Copy link
Copy Markdown
Contributor

@hez2010 hez2010 commented Sep 2, 2024

We cannot write to init-only properties after initialized, treat them as cannot write to avoid compilation error.

Alternatives: generate an UnsafeAccessor to mutate the property.

@manodasanW
Copy link
Copy Markdown
Member

Good catch, I think this is the right fix for this given this isn't a write property if it is specified as init only.

@manodasanW manodasanW merged commit 5ad543d into microsoft:master Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants