Version Used: VS 17.0.1
Steps to Reproduce:
- Paste the following code:
using System.Runtime.CompilerServices;
public class Test
{
private ulong nextD3D12ComputeFenceValue;
internal void Repro()
{
ref ulong d3D12FenceValue = ref Unsafe.NullRef<ulong>();
d3D12FenceValue = ref nextD3D12ComputeFenceValue;
d3D12FenceValue++;
}
}
- Observe the "make field readonly" code fix on the
nextD3D12ComputeFenceValue field. Applying that will result in a compiler error, as we're getting a ref to that field within Repro(), which will not build if the field was readonly.
Expected Behavior:
No diagnostics, this code is fine.
Actual Behavior:
IDE0044 is produced on that field.
Version Used: VS 17.0.1
Steps to Reproduce:
nextD3D12ComputeFenceValuefield. Applying that will result in a compiler error, as we're getting arefto that field withinRepro(), which will not build if the field was readonly.Expected Behavior:
No diagnostics, this code is fine.
Actual Behavior:
IDE0044 is produced on that field.