False positive: S3220 (Method calls should not resolve ambiguously to overloads with "params") - checks private constructors

Version: SonarLint - 5.3.0.41207
Issue: S3220 triggered on private constructors

Sample code:

 public class SomeException : Exception
  {
      public Guid? ErrorReference { get; private set; }

      private SomeException (Guid errorReference, string message)
          : base(message)
      {
          ErrorReference = errorReference;
      }

      public SomeException (Guid errorRef, string message, params object[] args)
          : this(errorRef, string.Format(message, args))
      {

      }
  }


public class Test
{
    public Test()
    {
        var x = new SomeException(Guid.NewGuid(), "msgWithoutParams");
    }
} 

Hello @Rashair

Thanks for reporting this false positive. I can confirm the issue.
I opened an issue in our repository, you can track progress there.

All the best,
Čaba

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.