-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Labels
Area-CompilersArea-IDEFeature - Nullable Reference TypesNullable Reference TypesNullable Reference Types
Milestone
Description
Version Used:
Locally: SDK 10.0.101
lab.razor.fyi: 5.0.0 and 5.3.0-2.25619.2
Steps to Reproduce:
class C
{
public C() { }
public string S { get; set; } = null!; //IDE0370: Suppression is unnecessary
}20260103-1611-05.8100910.mp4
IDE0370 on ! sign.
Diagnostic Id:
IDE0370: Suppression is unnecessary
Expected Behavior:
No diagnostic should be produced, as null assigned to not nullable property.
Actual Behavior:
False positive IDE0370. When proposed fix applied, it result in "CS8625: Cannot convert null literal to non-nullable reference type." warning.
No diagnostic, if constructor removed/commented.
Metadata
Metadata
Assignees
Labels
Area-CompilersArea-IDEFeature - Nullable Reference TypesNullable Reference TypesNullable Reference Types