public static class Extension { public static void Test(this DateTime? dt) { } } void Main() { var now = DateTime.Now; Extension.Test(now); //
As Tim said nullable +1
Fix:
public static class Extension { public static void Test(this DateTime? dt) { } } public class Program { private void Main() { DateTime? now = DateTime.Now; Extension.Test(now); now.Test(); } }