提交 dd95ba4a 编写于 作者: H Heejae Chang

updated comments

上级 02146ef5
......@@ -176,8 +176,9 @@ public bool TryFetch(OptionKey optionKey, out object value)
}
else if (optionKey.Option.Type == typeof(bool?))
{
// when nullable type is assigned to object, it can lose nullable type.
return (value is bool?) || (value is bool) || (value == null);
// code uses object to hold onto any value which will use boxing on value types.
// see boxing on nullable types - https://msdn.microsoft.com/en-us/library/ms228597.aspx
return (value is bool) || (value == null);
}
else if (value != null && optionKey.Option.Type != value.GetType())
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册