Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumC#nullable reference typesSingle-choice MCQ

In a nullable-reference-types-enabled file, why does this code compile with no warning even though the field is never assigned to a non-null value in the constructor?

#nullable enable class Config { public string Name = null!; }