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 3f1ef717b6 Fix #4017: Look through LdObjIfRef on the operand of await
A constrained GetAwaiter call on a type parameter that is not known to be
a value type wraps its receiver in LdObjIfRef so the reference is read
before any further arguments. ExpressionBuilder has no translation for
LdObjIfRef, so the operand was dropped. GetAwaiter takes no further
arguments, so the operand can be translated from the address, as
CallBuilder already does for call receivers.
2026-10-16 10:07:54 +02:00
upstream 587f5c9583 Upstream icsharpcode/ILSpy state of the touched files before c5f455e56b 2026-10-10 13:01:51 +02:00