我有一个使用此(虚拟)代码的通用方法(是的,我知道IList具有谓词,但是我的代码未使用IList但使用了其他集合,无论如何这与问题无关...) static T FindThing<T>(IList collection, int id) where T : IThing, new() { foreach T thing in collecion { if (thing.Id == id) return thing; } return null; // ERROR: Cannot convert null to type parameter 'T' because it could be a value type. Consider using 'default(T)' instead. } 这给了我一个构建错误 …