Skip to content

Commit

Permalink
Fix wrong annotated compiler error
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-strecker-sonarsource committed Feb 20, 2023
1 parent 286b13b commit d7be4d9
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -10,8 +10,9 @@ public class Program
public void StringAssertions()
{
var s = "Test";
s.Should(); // Noncompliant (no "ambiguous calls" compiler error as in C# 7)
s.Should(); // Noncompliant
s?.Should(); // Noncompliant
s[0].Should(); // Noncompliant (no "ambiguous calls" compiler error as in C# 7)
s?[0].Should(); // Noncompliant
s.Should().Be("Test"); // Compliant
s.Should()?.Be("Test"); // Compliant
Expand Down

0 comments on commit d7be4d9

Please sign in to comment.