mirror of https://github.com/icsharpcode/ILSpy.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1007 B
49 lines
1007 B
using System.Runtime.CompilerServices; |
|
|
|
namespace ICSharpCode.Decompiler.Tests.TestCases.Ugly; |
|
|
|
internal class NoUserDefinedCompoundAssignmentOperators |
|
{ |
|
public class Compound |
|
{ |
|
public int Value; |
|
|
|
[SpecialName] |
|
[CompilerFeatureRequired("UserDefinedCompoundAssignmentOperators")] |
|
public void op_AdditionAssignment(int rhs) |
|
{ |
|
Value += rhs; |
|
} |
|
|
|
[SpecialName] |
|
[CompilerFeatureRequired("UserDefinedCompoundAssignmentOperators")] |
|
public void op_SubtractionAssignment(int rhs) |
|
{ |
|
Value -= rhs; |
|
} |
|
|
|
[SpecialName] |
|
[CompilerFeatureRequired("UserDefinedCompoundAssignmentOperators")] |
|
public void op_CheckedSubtractionAssignment(int rhs) |
|
{ |
|
checked |
|
{ |
|
Value -= rhs; |
|
} |
|
} |
|
|
|
[SpecialName] |
|
[CompilerFeatureRequired("UserDefinedCompoundAssignmentOperators")] |
|
public void op_IncrementAssignment() |
|
{ |
|
Value++; |
|
} |
|
} |
|
|
|
public static void Use(Compound c, int n) |
|
{ |
|
c.op_AdditionAssignment(n); |
|
c.op_CheckedSubtractionAssignment(n); |
|
c.op_IncrementAssignment(); |
|
} |
|
}
|
|
|