首页 > 解决方案 > Rider“表达式总是错误的”按位警告和

问题描述

为什么 Rider 会"Expression is always false"在以下代码中发出警告?

bool b = (await Method1()) &
                  (await Method2()) &
                  (await Method3());

Method1 和 Method2 和 Method3 是一样的。

private async Task<bool> Method1()
{
    return true;
}

标签: c#resharperrider

解决方案


推荐阅读