You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't see all expected warnings after adding the analyzers to a Unity project. For example, in the below sample code, I only get EPS01 A struct 'NonReadOnlyStruct' can be made readonly.
Perhaps I missed a step?
publicstructNonReadOnlyStruct{publicreadonlylongPublicField;publiclongPublicProperty{get;}publicvoidPublicMethod(){}privatestaticreadonlyNonReadOnlyStruct_ros;publicstaticvoidSamples(inNonReadOnlyStructnrs){// Ok. Public field access causes no hidden copiesvarx=nrs.PublicField;// Ok. No hidden copies.x=_ros.PublicField;// Hidden copy: Property access on 'in'-parameterx=nrs.PublicProperty;// Hidden copy: Method call on readonly field_ros.PublicMethod();ref readonly varlocal=refnrs;// Hidden copy: method call on ref readonly locallocal.PublicMethod();// Hidden copy: method call on ref readonly returnLocal().PublicMethod();ref readonly NonReadOnlyStructLocal()=>ref_ros;}}
The text was updated successfully, but these errors were encountered:
I don't see all expected warnings after adding the analyzers to a Unity project. For example, in the below sample code, I only get EPS01
A struct 'NonReadOnlyStruct' can be made readonly
.Perhaps I missed a step?
The text was updated successfully, but these errors were encountered: