Skip to content

Commit b83db70

Browse files
committed
Update SA1117 for static anonymous functions
1 parent 3951927 commit b83db70

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp9/ReadabilityRules/SA1117CSharp9UnitTests.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,26 @@ public void Method()
5656
DiagnosticResult expected = Diagnostic().WithLocation(11, 16);
5757
await VerifyCSharpDiagnosticAsync(testCode, expected, CancellationToken.None).ConfigureAwait(false);
5858
}
59+
60+
[Fact]
61+
[WorkItem(3973, "https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/3973")]
62+
public async Task TestStaticAnonymousFunctionWithMixedParameterPlacementAsync()
63+
{
64+
var testCode = @"
65+
using System;
66+
67+
class TestClass
68+
{
69+
void TestMethod()
70+
{
71+
Func<int, int, int, int> func = static (
72+
int first, int second,
73+
{|#0:int third|}) => first + second + third;
74+
}
75+
}
76+
";
77+
78+
await VerifyCSharpDiagnosticAsync(testCode, Diagnostic().WithLocation(0), CancellationToken.None).ConfigureAwait(false);
79+
}
5980
}
6081
}

0 commit comments

Comments
 (0)