此代码工作正常不能键入“无效”隐式转换为“System.Collections.Generic.Dictionary <string,bool>
Dictionary<string, bool> test = new Dictionary<string, bool>();
test.Add("test string", true);
下面的代码引发此错误:无法隐式转换类型‘无效’到” System.Collections中.Generic.Dictionary
Dictionary<string, bool> test = new Dictionary<string, bool>().Add("test string", true);
为什么?有什么不同?
agh ..忘了检查返回类型。谢谢。 – PSR 2014-10-16 10:32:27