The decompiler's stake in the C# 10 "improved definite assignment"
rules (dotnet/csharplang#4465) is the mirror image of the compiler
feature: decompiled output must stay provably assigned when recompiled,
and ideally should not need dummy initializers where the C# 10 rules
prove assignment.
OutVariableFlows (green) pins that out variables flowing through
short-circuit operators, conditional access, ternaries, while/for
conditions, exception filters, closures and generic/struct out
parameters decompile to recompilable code in all four Roslyn 4
debug/opt configs. Probing these flow shapes found no CS0165-broken
output: the decompiler either rewrites conditional access into
explicit null-check chains or falls back to a dummy initializer.
The lifted-negation shape '(!(x)) ?? true' documents a trap: the
C# 10 rules do not cover it, so its dummy initializer is required.
ImprovedDefiniteAssignment (Assert.Ignore'd, #829) is the desired
output spec for the shapes where the decompiler keeps the conditional
access and currently hoists the out variable with a 'default(T)'
initializer that the C# 10 rules make redundant: '?? false' on int,
generic and struct out parameters, and '== true' on chained
conditional access in if and while conditions. All four configs
compile the fixture and fail only at the output comparison; the
EXPECTED_OUTPUT branches carry IL-equivalent inputs where the desired
form lowers to different IL.
Assisted-by: Claude:claude-fable-5:Claude Code