Files
ILSpy/ICSharpCode.Decompiler.Tests
Selim Selimi 40b1691a91 Fix #4153: keep foreach when a named argument inlines the loop variable
Inlining may extend a named-argument block: CanExtendNamedArgument moves an
expression into the first named-argument store (or the second one for an
instance call) and checks reordering against the stored values. The reverse
move was refused: Block.CanInlineIntoSlot rejected every slot of a
CallWithNamedArgs block, and CanMoveInto checked reordering against the whole
store instruction, which counts as a write to a local. The foreach pattern
relies on CanUninline to pull the Current getter back out of the loop body's
first statement, so once the getter had been inlined into a named-argument
block the loop was emitted as using + while (MoveNext()). Both checks now
mirror what inlining allows, so an expression inlined into a named-argument
block can always be un-inlined again.

Assisted-by: Claude:claude-fable-5-1:Claude Code
2026-10-09 16:38:08 +02:00
..
2026-10-06 07:35:36 +02:00
2026-09-21 18:40:40 +02:00