Skip to content

Commit 04e4c98

Browse files
committed
Add assert to try and track down a debugging case for #3906
1 parent 5475718 commit 04e4c98

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Rubberduck.CodeAnalysis/Inspections/Concrete/ParameterCanBeByValInspection.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Collections.Generic;
2+
using System.Diagnostics;
23
using System.Linq;
34
using Rubberduck.Common;
45
using Rubberduck.Inspections.Abstract;
@@ -91,6 +92,9 @@ private IEnumerable<IInspectionResult> GetResults(Declaration[] declarations, De
9192

9293
for (var i = 0; i < parameters.Count; i++)
9394
{
95+
//If you hit this assert, congratulations! you've found a test case for https://github.com/rubberduck-vba/Rubberduck/issues/3906
96+
//Please examine the code, and if possible, either fix the indexing on this or upload your failing code to the GitHub issue.
97+
Debug.Assert(parametersAreByRef.Count == parameters.Count);
9498
parametersAreByRef[i] = parametersAreByRef[i] &&
9599
!IsUsedAsByRefParam(declarations, parameters[i]) &&
96100
((VBAParser.ArgContext) parameters[i].Context).BYVAL() == null &&

0 commit comments

Comments
 (0)