Closed haykpetros closed 8 years ago
Thanks for this, could you make this a Pull Request by chance?
It seems that this might be a bug in Visual Studio 2015, so we are going to wait until it is verified.
Considering that there's a wdc in MSDN about this I doubt this is a bug.
It's never a bug in the compiler... except this time. Even worse, a commit has been made to SharpCompress that tried to fix this but instead broke the build on VS2013 with a legitimate case of the warning it tried to prevent.
The deflate code is from DotNetZip from 2009 and has been working without any compiler saying peep until VS2015 showed up and threw CS0675. This change in compiler behavior is a bug: https://github.com/dotnet/roslyn/issues/4027
About a month ago, pull request https://github.com/adamhathcock/sharpcompress/pull/101 containing 18bd8102281c04c7eb09ecfdd984d7382b629f2c changed the deflate code in what looks like an attempt to satisfy VS2015. Unfortunately it creates a real case of CS0675 that VS2013 does catch so right now the build is broken on VS2013.
I've created pull request https://github.com/adamhathcock/sharpcompress/pull/104 that reverts 18bd8102281c04c7eb09ecfdd984d7382b629f2c and disables CS0675 warnings on Defalte.send_bits().
When building SharpCompress project with Warning level above 2 (usually 4 is default) it will fail on lines 683 and 695 of DeflateManager.cs:
I believe following line:
can be replaced using following code instead: