Nullable reference types unexpected CS8629 Nullable value type may be null with temporary variables
问题 In a C# 8 project, I am using nullable reference types and am getting an unexpected (or at least, unexpected to me) CS8629 warning, bool singleContent = x.DataInt != null; bool multiContent = x.DataNvarchar != null; if (singleContent && multiContent) { throw new ArgumentException("Expected data to either associate a single content node or " + "multiple content nodes, but both are associated."); } if (singleContent) { var copy = x.DataInt.Value; // CS8629 here newPropertyData.DataNvarchar = $