diff --git a/dotnet-tools.json b/dotnet-tools.json index d81bfe9ae6d99..c6a27a88ac606 100644 --- a/dotnet-tools.json +++ b/dotnet-tools.json @@ -14,4 +14,4 @@ ] } } -} \ No newline at end of file +} diff --git a/src/Analyzers/CSharp/Tests/MakeFieldReadonly/MakeFieldReadonlyTests.cs b/src/Analyzers/CSharp/Tests/MakeFieldReadonly/MakeFieldReadonlyTests.cs index b6cff758fff1a..214b33631ba97 100644 --- a/src/Analyzers/CSharp/Tests/MakeFieldReadonly/MakeFieldReadonlyTests.cs +++ b/src/Analyzers/CSharp/Tests/MakeFieldReadonly/MakeFieldReadonlyTests.cs @@ -1705,6 +1705,23 @@ await TestInRegularAndScript1Async( { private volatile object first; private readonly object second; +}"); + } + + [WorkItem(46785, "https://github.com/dotnet/roslyn/issues/46785")] + [Fact(Skip = "https://github.com/dotnet/roslyn/issues/46785"), Trait(Traits.Feature, Traits.Features.CodeActionsMakeFieldReadonly)] + public async Task UsedAsRef_NoDiagnostic() + { + await TestMissingInRegularAndScriptAsync( +@"public class C +{ + private string [|_x|] = string.Empty; + + public bool M() + { + ref var myVar = ref x; + return myVar is null; + } }"); } }