代码检查:空扩展块
此检查会报告空的 扩展块 ,它们可能是在重构或清理后遗留的。 例如:
public static class StringExtensions
{
extension(string str)
{
public bool IsNullOrEmpty() => string.IsNullOrEmpty(str);
public bool IsNullOrWhiteSpace() => string.IsNullOrWhiteSpace(str);
}
extension (char[] chars)
{
}
}
public static class StringExtensions
{
extension(string str)
{
public bool IsNullOrEmpty() => string.IsNullOrEmpty(str);
public bool IsNullOrWhiteSpace() => string.IsNullOrWhiteSpace(str);
}
}
2026年 3月 25日