Replies: 2 comments 5 replies
-
|
Is your problem that you can make mutable classes, even with the |
Beta Was this translation helpful? Give feedback.
5 replies
-
|
You could write an analyzer that forbids writable properties on record classes. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
structs provide a way to have
readonly structorreadonly record structwhich tells me that all members need to be readonly only or init only members/fields.classes do not allow to attach the
readonlymodifier. However there are situations where I havea
classor arecord class.For example:
does not help me in finding out that for SubPixFusingLowThreshZ I forgot to make an init out of the set.
I thought it might make sense to make the behavior of struct and class symmetric and also allow a readonly on classes, but I do not now what implications this brings.
Beta Was this translation helpful? Give feedback.
All reactions