你的位置: 码友网首页 / 资讯源列表 / C# 8.0 nullable references: NotNull

关于[C# 8.0 nullable references: NotNull]的摘要:

So far in this sub-series on attributes for getting better results from C# 8's nullable references feature I've described the AllowNull and DisallowNull attributes. Now it's NotNull's turn. As with all of these attributes, this enables us to describe our intent in more detail so that the compiler can find more null-related programming errors without producing spurious warnings. This particular post is concerned with a scenario where the successful execution of a method implies that we can now be certain that something isn't null, and we'd like the compiler to know that.

原文地址: https://endjin.com/blog/2020/06/dotnet-csharp-8-nullable-references-notnull

收录时间: 2020-06-30 浏览量: 1960 分类: C#开发

| 0 收藏 | 0