Covers user-defined instance compound assignment operators: all eleven
compound forms (+= through >>>=) plus instance ++/-- and their checked
variants on a class, mutable and readonly structs, a generic type, an
interface declaration (alongside a static abstract operator) with a
constrained-generic call site, and call sites through locals, ref
parameters, fields, array elements, and a class declaring both the
classic static operator + and the instance operator += (a variable
target binds to the instance operator; a property target is not a
variable and still binds to the static operator, which already
decompiles correctly today).
The test is Assert.Ignore'd because the decompiler does not understand
the new specially-named instance operator methods yet (#829): it prints
declarations as raw op_*Assignment methods carrying [SpecialName] and
[CompilerFeatureRequired("UserDefinedCompoundAssignmentOperators")],
and call sites as direct method calls. That output does not recompile:
CS8335 because CompilerFeatureRequiredAttribute is reserved for
compiler usage. The fixture is the desired output; both RoslynLatest
debug/opt configs compile it and fail only at the output comparison.
Assisted-by: Claude:claude-fable-5:Claude Code