当前位置:网站首页>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。
边栏推荐
- 【kali-密码攻击】(5.1.2)密码在线破解:Medusa
- egg.js中Class constructor BaseContextClass cannot be invoked without ‘new‘解决方法
- 商业模式及其 SubDAO 深入研究
- Sikuli 基于图形识别的自动化测试技术
- 跨部门沟通的技巧
- 破产企业的职工退休怎么办?
- Chip Information|Semiconductor revenue growth expected to slow to 7%, Bluetooth chip demand still growing steadily
- Solidity最强对手:MOVE语言及新公链崛起
- RESOURCE_EXHAUSTED: etcdserver: mvcc: database space exceeded
- 无js实现弹出层效果
猜你喜欢
随机推荐
OpenSSF的开源软件风险评估工具:Scorecards
【Swoole系列3.5】进程池与进程管理器
对修饰器的实验支持功能在将来的版本中可能更改。在 “tsconfig“ 或 “jsconfig“ 中设置 “experimentalDecorators“ 选项以删除此警告
22.括号生成
.Net interview experience summary
hopscotch game
你有对象类,我有结构体,Go lang1.18入门精炼教程,由白丁入鸿儒,go lang结构体(struct)的使用EP06
eyb:Redis学习(4)
你有对象类,我有结构体,Go lang1.18入门精炼教程,由白丁入鸿儒,go lang结构体(struct)的使用EP06
Shader Graph learns various special effects cases
[Swoole Series 3.5] Process Pool and Process Manager
跳房子游戏
JDBC数据库连接池练习题
The shell specifies the parameter name to pass the parameter
web开发概述
unity编辑器扩展界面使用 List
解决sed替换文本,里面含有“/“、“#”等特殊字符的问题
高压之下,必有懦夫
2022金九银十工作潮,怎么样才能成功跳槽面试拿到高薪呢?
【UNR #6 B】机器人表演(DP)