Skip to content
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

[Suggestion] use base type whenever possible #7

Closed
tugberkugurlu opened this issue Nov 16, 2014 · 1 comment
Closed

[Suggestion] use base type whenever possible #7

tugberkugurlu opened this issue Nov 16, 2014 · 1 comment

Comments

@tugberkugurlu
Copy link
Contributor

For the below case for example, it would be possible to use Stream instead of FileStream:

using (FileStream stream = File.Open(@"c:\dev\foo.txt", FileMode.Open))

Cases to cover:

  • This should be a hidden code analyzer.
  • We need to make sure that any members that are specific to FileStream is not used inside the code block.
@tugberkugurlu
Copy link
Contributor Author

ported to DotNetAnalyzers/Proposals#11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant