From 77f835f48eb8fae957f994504233ef164868ddd3 Mon Sep 17 00:00:00 2001 From: Antonio Aversa Date: Wed, 27 Sep 2023 17:36:38 +0200 Subject: [PATCH] Code review 2 --- ...cMethodWithMultidimensionalArray.CSharp12.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/analyzers/tests/SonarAnalyzer.UnitTest/TestCases/PublicMethodWithMultidimensionalArray.CSharp12.cs b/analyzers/tests/SonarAnalyzer.UnitTest/TestCases/PublicMethodWithMultidimensionalArray.CSharp12.cs index d34160d38f2..dca15cbd879 100644 --- a/analyzers/tests/SonarAnalyzer.UnitTest/TestCases/PublicMethodWithMultidimensionalArray.CSharp12.cs +++ b/analyzers/tests/SonarAnalyzer.UnitTest/TestCases/PublicMethodWithMultidimensionalArray.CSharp12.cs @@ -21,3 +21,20 @@ public void AMethod2(params IntMatrix a) { } // Compliant } } +// https://github.com/SonarSource/sonar-dotnet/issues/8100 +namespace Repro_8100 +{ + public class InlineArrays + { + public void AMethod1(Buffer[] a) { } // FN, Buffer[] is 2-dimensional + public void AMethod1(Buffer[,] a) { } // Noncompliant, Buffer[,] is 3-dimensional + public void AMethod2(params Buffer[] a) { } // Compliant, params of Buffer + public void AMethod3(params Buffer[][] a) { } // FN, params of Buffer[] + } + + [System.Runtime.CompilerServices.InlineArray(10)] + public struct Buffer + { + int arrayItem; + } +}