未验证 提交 bbfbb0da 编写于 作者: M msftbot[bot] 提交者: GitHub

Merge pull request #44384 from CyrusNajmabadi/addTests10

Add tests demonstrating 'remove unneccessary cast' issue is closed.
......@@ -8035,5 +8035,27 @@ void Main()
await VerifyCS.VerifyCodeFixAsync(source, source);
}
[WorkItem(44382, "https://github.com/dotnet/roslyn/issues/44382")]
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsRemoveUnnecessaryCast)]
public async Task DoNotRemoveCastOnParameterInitializer1()
{
var source =
@"enum E : byte { }
class C { void F() { void f(E e = (E)byte.MaxValue) { } } }";
await VerifyCS.VerifyCodeFixAsync(source, source);
}
[WorkItem(44382, "https://github.com/dotnet/roslyn/issues/44382")]
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsRemoveUnnecessaryCast)]
public async Task DoNotRemoveCastOnParameterInitializer2()
{
var source =
@"enum E : byte { }
class C { void f(E e = (E)byte.MaxValue) { } }";
await VerifyCS.VerifyCodeFixAsync(source, source);
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册