-
Notifications
You must be signed in to change notification settings - Fork 231
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
Fix S1104 FP: Should be ignored on classes and structs marked as [Serializable] #8504
Comments
Hello @dukobpa3, thanks for the report. |
Actually not because many serializers can't work with properties. |
Good point. Then, this must be frustrating to deal with; I apologize. We will fix it in a future hardening sprint. |
For transparency: I updated the code sample to use a public class, since the rule doesn't raise for private ones. |
S1144 I think relevant also Sometimes I should add the fields just to copy serializing source structure, but not all of them will be used after that Especially when working with some 3-d parties. |
@dukobpa3 You are making some great points. I have created another issue. Thanks! |
Description
S1104 FP: Should be ignored on classes and structs marked as [Serializable]
Repro steps
This kind of classes/structs always have an issue on each field.
Expected behavior
If object have
[Serializable]
attribute then 99.9% it will have a lot of public fields, so this rule is not relevant in this caseActual behavior
This kind of classes/structs always have an issue on each field.
Known workarounds
Something like this. But in this case we really don't need it since all compilers already understand
[Serializable]
objects and will not strip it, an even Rider/Resharper will not highlite this issue etc...Related information
The text was updated successfully, but these errors were encountered: