CS8618 is incorrectly reported for a constructor with SetsRequiredMembersAttribute and a required non-auto property #77013
Labels
Area-Compilers
Feature - Required Members
Required properties and fields
Resolution-By Design
The behavior reported in the issue matches the current design
Version Used:
Dotnet SDK 9.0.101
csc.dll 4.1200.24.57006
C# 13
Steps to Reproduce:
Also provided as a gist: https://sharplab.io/#gist:c97d05bc1df387299a3a36043bfcd68f
Diagnostic Id:
CS8618: Non-nullable property 'Test' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.
Expected Behavior:
The code should compile without warning
Actual Behavior:
The code gets a warning suggesting to add the required modifier, when it is already there
The text was updated successfully, but these errors were encountered: