controlflow / resharper-heapview

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

Incorrect boxing allocation warning #119

Closed ScrubN closed 10 months ago

ScrubN commented 1 year ago

In cases where an interpolated string containing a value type is provided as an argument to a method expecting an object, the value type is incorrectly flagged as a boxing allocation.

image

This can be verified by checking the lowered code (in this case low-level C#), confirming the value type is indeed not boxed by the object cast. image

controlflow commented 11 months ago

Thanks for reporting! This needs fix in ReSharper, interpolated string gets incorrectly classified when being converted to System.Object type. I'll fix this soon and will add more tests to cover this case in the plugin.