We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
readonly
Dispose(bool)
If an IDisposable field is readonly it cannot be set to null in the Dispose(bool) method. You get a compiler error.
[GenerateDispose(false)] public partial class LogWriter { [DisposeField(false)] private readonly StreamWriter _streamWriter; public LogWriter(string path) { _streamWriter = new StreamWriter(path); } public void WriteLine(string text) => _streamWriter.WriteLine(text.ToUpper()); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Issue Details
If an IDisposable field is

readonly
it cannot be set to null in theDispose(bool)
method. You get a compiler error.Line 18 should not be generated when the field is readonly.
The text was updated successfully, but these errors were encountered: