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

In a nullable-reference-types-enabled file, why does the compiler still warn on the second line?

#nullable enable string? name = GetName(); if (name != null) { Action log = () => Console.WriteLine(name.Length); name = null; log(); }