Collection initializers can leak refs #75802
Labels
Area-Compilers
New Language Feature - Ref Fields
untriaged
Issues and PRs which have not yet been triaged by a lead
Version Used: 4.13.0-2.24555.1 (9dcb2a3)
Steps to Reproduce:
Expected Behavior: Error on
return new R() { local };
like there would be if explicitly written asvar r = new R(); r.Add(local); return r;
.Actual Behavior: No errors. The code accesses a dead reference when executing.
The text was updated successfully, but these errors were encountered: