resharper-heapview icon indicating copy to clipboard operation
resharper-heapview copied to clipboard

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

Open controlflow opened this issue 2 years ago • 0 comments

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();
  }
}

controlflow avatar Aug 01 '22 20:08 controlflow