-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Readonly<T> prevents private members from being accessed #50668
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
Comments
This is working as intended. Mapped types like Duplicate of #16441. |
Well. Is there any alternative way to implement "readonly class object"? |
No. You'd need something like #35416 for this. |
This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
Bug Report
🔎 Search Terms
private, readonly, remove, class, exclude
🕗 Version & Regression Information
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
Can not access private members from
Readonly<T>
version class, even within class body.🙂 Expected behavior
Within
Foo.baz()
, all fields of objects with typeReadonly<Foo>
should be accessible.The text was updated successfully, but these errors were encountered: