controlflow / resharper-heapview

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

Do not optimize "display classes" into struct inside interfaces with variance annotations #103

Closed controlflow closed 1 year ago

controlflow commented 2 years ago
interface I1<T> {
  void M(int parameter) {
    // display class is optimized into struct
    void Local() => parameter++;
    Local();
  }
}

interface I2<out T> {
  void M(int parameter) {
    // display class is a reference type
    void Local() => parameter++;
    Local();
  }
}