https://issues.dlang.org/show_bug.cgi?id=24838
--- Comment #5 from anonymous4 <[email protected]> --- Lowering could be something like --- struct Context { T* ref_capture; //normal capture } void Closure(Context* ctx) { bool oneref=false; //change this T* local_ref; if(oneref)local_ref=cast(T*)ctx; else local_ref=ctx.ref_capture; //call local_ref.method(); } --- If one reference is captured, `oneref` variable could be changed(?) accordingly, and argument would be different, then backend will optimize it. --
