当前位置:网站首页>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。
边栏推荐
猜你喜欢

分析 20 个 veToken 生态系统协议 这种代币模型为何受欢迎?
![[Turn] Typora_Markdown_ picture title (caption)](/img/67/589eed8de86bff9fc017ae7c409410.png)
[Turn] Typora_Markdown_ picture title (caption)

对修饰器的实验支持功能在将来的版本中可能更改。在 “tsconfig“ 或 “jsconfig“ 中设置 “experimentalDecorators“ 选项以删除此警告

阿里云OSS文件上传

【机器学习】随机森林、AdaBoost、GBDT、XGBoost从零开始理解

ABAP 里文件操作涉及到中文字符集的问题和解决方案

中文NER的SOTA:RICON

web开发概述

RedHat红帽RHEL7安装与使用,VMware Workstation16 Pro虚拟机的安装与使用

Pyscript,创建一个能执行crud操作的网页应用
随机推荐
牛客刷题——剑指offer(第四期)
Sikuli 基于图形识别的自动化测试技术
罗彻斯特大学 | 现在是什么序列?蛋白质序列的贝叶斯优化的预训练集成
多线程之享元模式和final原理
【LeetCode】求根节点到叶节点数字之和
什么是一网统管?终于有人讲明白了
【Swoole系列3.5】进程池与进程管理器
Unity顶点动画
C# 四舍五入 MidpointRounding.AwayFromZero
C# rounding MidpointRounding.AwayFromZero
Solve the problem of sed replacement text containing special characters such as "/" and "#"
[LeetCode] Find the sum of the numbers from the root node to the leaf node
以太网PHY芯片LAN8720A芯片研究
Solidity最强对手:MOVE语言及新公链崛起
Unity image使用长图后 图片很糊
防勒索病毒现状分析
web开发概述
DHCP——动态主机配置协议
惊掉你下巴,程序员编码竟然可以被 996 指数化
hint: Updates were rejected because the tip of your current branch is behind hint: its remote counte