当前位置:网站首页>c# 解决CS8602告警 解引用可能出现空引用
c# 解决CS8602告警 解引用可能出现空引用
2022-08-10 01:18:00 【ou.cs】
!
null 容忍操作符(null-forgiving operator)
官方文档:! (null-forgiving) operator (C# reference) The compiler warns
that you may be dereferencing null when you write the property
message.Length because its static analysis determines that message may
be null. You may know that IsNotNull provides a null check, and when
it returns true, the null-state of message should be not-null. You
must tell the compiler those facts. One way is to use the null
forgiving operator, !. You can change the WriteLine statement to match
the following code:
它的主要作用就是告诉编译器,变量不可能为 null。
边栏推荐
猜你喜欢
sql实战积累
什么是一网统管?终于有人讲明白了
Maya制作赛博朋克机器人模型
In the 2022 gold, nine, silver and ten work tide, how can I successfully change jobs and get a high salary?
【LeetCode】求根节点到叶节点数字之和
墨西哥大众VW Mexico常见的几种label
Button countdown reminder
手把手教你编写性能测试用例
Shader Graph learns various special effects cases
Solidity最强对手:MOVE语言及新公链崛起
随机推荐
20220809-PotPlayer如何设置默认字体色-设置默认字体色的方法
防勒索病毒现状分析
Unity碰撞和触发
Initial attempt at UI traversal
DP 优化方法合集
volatile 关键字(修饰符 volatile 告诉编译器,变量的值可能以程序未明确指定的方式被改变)
罗彻斯特大学 | 现在是什么序列?蛋白质序列的贝叶斯优化的预训练集成
Sikuli 基于图形识别的自动化测试技术
中文NER的SOTA:RICON
【机器学习】随机森林、AdaBoost、GBDT、XGBoost从零开始理解
In the 2022 gold, nine, silver and ten work tide, how can I successfully change jobs and get a high salary?
Aptos 深度解读:机遇、挑战与风险
[Turn] Typora_Markdown_ picture title (caption)
[转] Typora_Markdown_图片标题(题注)
[LeetCode] Find the sum of the numbers from the root node to the leaf node
使用IDEA的PUSH常见问题
万字总结:分布式系统的38个知识点
.Net interview experience summary
Pyscript,创建一个能执行crud操作的网页应用
[网鼎杯 2020 青龙组]AreUSerialz