controlflow / resharper-heapview

ReSharper Heap Allocations Viewer plugin
MIT License
303 stars 28 forks source link

C# 10 'with' expressions #101

Closed controlflow closed 1 year ago

controlflow commented 2 years ago

They do allocate (invoke copy constructor) for record classes and anonymous objects.

record R;
_ = new R() with { }; // alloc

Copy constructor can be custom, but it always creates the new instance. Clone<> method can be custom in the future.

controlflow commented 1 year ago

Implemented