回归错误:取消装箱空引用 - Nullables [英] Regression Bug: Unboxing a null reference - Nullables

查看:100
本文介绍了回归错误:取消装箱空引用 - Nullables的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

代码合同1.4.51019.0为第一个
生成两个警告以下程序中的行,但它只应生成
第一行行的警告。

Code Contracts 1.4.51019.0 generates two warnings for the first and second lines in the following program, though it should only generate a warning for the first line.

相关错误已修复在以前的版本中CC, 如
this thread

A related bug was fixed in a previous version of CC, as discussed in this thread.

namespace CCTest
{
	class Program
	{
		static void Main()
		{
			int first = (int) Foo();  // Warning: Unboxing a null reference
			int second = (int?) Foo() ?? 55;  // Warning: Unboxing a null reference
		}

		static object Foo()
		{
			return null;
		}
	}
}

- Dave

http://davesexton.com/blog

推荐答案

是,我现在修好了。对不起。

Yes, I fixed it now. Sorry.

将在下一个版本中发布。

Will be in the next release.


这篇关于回归错误:取消装箱空引用 - Nullables的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆