What was broken A VB exception filter caught object, not Exception
The VB compiler writes the filter for On Error Resume Next and On Error GoTo as a single and expression, not as the branch chain the C# compiler emits. ILSpy did not know that shape and printed catch (object obj) when (obj is Exception && ...).
How we fixed it The type test moves into the catch declaration
The decompiler now recognises this pattern, takes the type test out of the condition and prints catch (Exception ex) when (...) with the condition alone. Tests for On Error and Visual Basic try, catch and finally blocks were added.
#4134
What was broken Decompiled code kept the delegate cache field
With _ = (Action<int>)M; the delegate is created and discarded at once, so the cache field is never read. The transform required exactly one read, so the output kept a field named <>O.<0>__M and the code did not compile.
How we fixed it The delegate construction instead of the cache check
When the cache field has no reads, the check is replaced by the delegate construction it guarded. The output is new Action<int>(M);, which compiles and does the same.
#4133
What was broken Conditionals lost nint and their local
After an earlier change in the decompiler, two patterns came out worse than the source. A ?: with nint branches of different types got (IntPtr) casts, and int n = b ? 1 : 0; from code built with -o+ was pasted into every use of n.
How we fixed it nint and the local stay in place
VisitIfInstruction maps IntPtr to nint when native integers are on, with the same logic VisitBox uses. CopyPropagation no longer copies between a bool and a non-bool variable, so the conditional stays in its local.
#4231 #4232
What was broken await on a type parameter dropped its operand
With await value, where T is constrained to an interface with GetAwaiter, the constrained call becomes an LdObjIfRef instruction. ExpressionBuilder had no case for it, so the output had an unsupported opcode comment instead of value and did not compile.
How we fixed it The await operand is translated from its address
The await operand is now translated from its address, the way CallBuilder already does for call receivers. The output is await value; again, with a test in AsyncAwaitPatterns.
#4251
What was broken A ?. chain over bool? failed to compile
The decompiler turned GetValueOrDefault() on a bool? into == true even inside a ?. chain. The chain ended too early, the result was bool instead of bool?, and the ?? false after it did not compile.
How we fixed it GetValueOrDefault() stays inside the ?. chain
The call is kept as it is when its target is part of a ?. chain, so the output is c?.Flag.GetValueOrDefault() ?? false. We added a test for the printed output and one that runs both forms on null, false and true.
#4253
What was broken with plus await left a raw <Clone>$ call
When a with expression's initializer contained an await, Roslyn copies the receiver into a hoisted temporary before the await. The initializer transform rejected that copy, so the output kept a _003CClone_003E_0024() call and separate assignments that did not compile.
How we fixed it The with expression is rebuilt with its await
ILInlining now inlines copies between two hoisted compiler temporaries and leaves copies of user locals alone. The output is value with { X = await Get() } again, and the same works for object initializers.
#4292