icsharpcode/ILSpy — Issue #299: enum operator += cannot be applied
Author: barts2108
Created: 2011-12-08 09:01:45+00:00
State: open

An enum

public enum RequestParserState
{
FirstLine,
HeaderName,
AfterName,
Between,
HeaderValue,
Body
}

and use it in a property

public RequestParserState CurrentState { get; private set; }

then use something like this:

CurrentState = CurrentState + 1;

Will be decompiled by ILSpy into

this.CurrentState += RequestParserState.HeaderName;

resulting in an error

Error	93	Operator '+=' cannot be applied to operands of type 'RequestParserState' and 'RequestParserState'