Version Used:
Not sure - I found the error while using sharplab.
Steps to Reproduce:
- Create a private unused field in a class or struct.
- Pass the private field as
ref readonly or in into a method.
Repro (edited)
Diagnostic Id:
CS0649: Field 'field' is never assigned to, and will always have its default value 'value'.
Expected Behavior:
The warning still persists, even when the field is passed by a readonly reference into a method.
Actual Behavior:
Warning is removed.