Closed marek-safar closed 1 year ago
The reason is code like:
(b ? ref _field1 : ref _field2) = 2;
The if/then/else ends with a merge of two state where one captures _field1 and the other _field2, so we need to merge two non-empty captured references. That has not been implemented yet.
I'm afraid that the only correct solution is to support something like MultiValue<CapturedReferenceValue>
or for CapturedReferenceValue
to store potentially multiple references. That also means that all consumption sides have to iterave over all possible values.
DynamicallyAccessedMembersAnalyzer fails with
detailed exception like
when encountering ref fields access for example this one https://github.com/dotnet/runtime/blob/4cf2e3bb18162d750e7a128bb805c49c9fd52612/src/libraries/System.Private.CoreLib/src/System/Threading/Overlapped.cs#L46