C# 11 added a small piece of syntax with a surprising amount of machinery behind it. A type can now declare what + does when the surrounding code is overflow-checked, separately from what it does by default:
public static Amount operator + ( Amount a , Amount b ) => /* wraps */ ; public static Amount operator checked + ( Amount a , Amount b ) => /* throws */ ;
Enter fullscreen mode
Exit fullscreen mode
Open an assembly that uses this in a decompiler that predates the feature and you get a type with a + operator and, sitting beside it, a stray public method called op_CheckedAddition that no C# syntax seems to produce. The decompiler is not wrong about the bytes — that method really exists. It is wrong about what the bytes mean . This post walks the lowering and shows what Glass.NET has to recognise to give the keyword back.
The real question
There is one keyword, checked , and there are two methods.…