Commit Graph
4 Commits
Author SHA1 Message Date
dualfroz 85285c1cea Fix #4019: Recognize with expressions whose initializer awaits
Roslyn spills the receiver of an initializer assignment that precedes an
await into a hoisted temporary, so the clone of a with expression (and the
object of an object initializer) reaches the initializer transform through
a copy it rejects. Only copies between two hoisted compiler temporaries are
inlined: folding copies of hoisted user locals as well would turn a user's
local into an initializer.
2026-10-10 17:52:06 +02:00
upstream ef47a24511 Upstream icsharpcode/ILSpy state of the touched files before b3c37fd8d4 2026-10-10 13:18:39 +02:00
dualfroz 3b5201cabc Fix #4153: Keep foreach when a named argument reads the loop variable
Once a named argument is hoisted, the call becomes a CallWithNamedArgs
block, and inlining moves the Current getter into the block's first
argument store. The foreach detection could not move it back out:
CanInlineIntoSlot refused the block, and for an instance call the store
of the 'this' argument in front counted as a write the getter cannot be
moved past. That store only writes the block's own variable, so the
getter is checked against the stored value instead, the same way
CanExtendNamedArgument allows inlining into that position.
2026-10-03 03:33:10 +02:00
upstream 3e462ad472 Upstream icsharpcode/ILSpy state of the touched files before 3c35e4cef6 2026-10-03 03:33:10 +02:00