We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
偶现的类型转换错误
代码如下: public bool TryGetItem(Hex hex, out T item) { var key = GetHexkey(hex); if(_map.ContainsKey(key)) { item = _map[key]; return true; } item = default; return false; }
_map是dictionary
可能跟范型有关,准备去掉试试
The text was updated successfully, but these errors were encountered:
简化了代码,去掉范型约束之后,线上无报错。猜测跟范型约束有关,其他小伙伴可以参考
Sorry, something went wrong.
ILMethod中设置def.Body = null,结合泛型类型使用就会有小概率造成这个问题。具体原理不明。2.1.0版本,不开启jit #if !DEBUG || DISABLE_ILRUNTIME_DEBUG //Release Method body to save memory if(!noRelease) def.Body = null; #endif
注释掉def.Body = null 可以解决,但是会增加很多堆内存
No branches or pull requests
偶现的类型转换错误
代码如下:
public bool TryGetItem(Hex hex, out T item)
{
var key = GetHexkey(hex);
if(_map.ContainsKey(key))
{
item = _map[key];
return true;
}
item = default;
return false;
}
_map是dictionary
可能跟范型有关,准备去掉试试
The text was updated successfully, but these errors were encountered: