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
When having an abstract class containing private fields that are never assigned to or never read, the native compiler (VS 2012) used to issue related warnings CS0414 / CS0649. The roslyn compiler in VS 2015 however does only trigger these warnings when the class is not being marked as abstract.
For a better overview, I add the minimal example on how to reproduce this issue here as well:
// When the class is being marked as abstract, VS-2015 will not issue any warning.// When the class is not abstract the warnings are issued.publicabstractclassDemonstrator{// This should trigger warning CS0169 Warning Level 2privateint_UnusedField;// This should trigger warning CS0414 Warning Level 4privateint_AssignedButNotReadField;publicDemonstrator(){_AssignedButNotReadField=1;}}
The compiler should still trigger those warnings even though the class is abstract, as, due to the fact that those fields are private, their usage is still restricted to that single class.
The text was updated successfully, but these errors were encountered:
Version Used: VS 2015 Update 3
Steps to Reproduce:
When having an
abstract
class containingprivate
fields that are never assigned to or never read, the native compiler (VS 2012) used to issue related warnings CS0414 / CS0649. The roslyn compiler in VS 2015 however does only trigger these warnings when the class is not being marked asabstract
.For details please see my related StackOverflow question.
For a better overview, I add the minimal example on how to reproduce this issue here as well:
The compiler should still trigger those warnings even though the class is abstract, as, due to the fact that those fields are private, their usage is still restricted to that single class.
The text was updated successfully, but these errors were encountered: