Skip to content

Commit

Permalink
Potential ArgumentOutOfRangeException in InlineDataMustMatchTheoryPar…
Browse files Browse the repository at this point in the history
…ameters (xunit/xunit#2823)
  • Loading branch information
bradwilson committed Nov 28, 2023
1 parent 5c1edb6 commit 08daceb
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public override void AnalyzeCompilation(
context.ReportDiagnostic(
Diagnostic.Create(
Descriptors.X1012_InlineDataMustMatchTheoryParameters_NullShouldNotBeUsedForIncompatibleParameter,
dataParameterExpressions[valueIdx].GetLocation(),
valueIdx < dataParameterExpressions.Count ? dataParameterExpressions[valueIdx].GetLocation() : null,
builder.ToImmutable(),
parameter.Name,
SymbolDisplay.ToDisplayString(paramsElementType ?? parameter.Type)
Expand All @@ -164,7 +164,7 @@ public override void AnalyzeCompilation(
context.ReportDiagnostic(
Diagnostic.Create(
Descriptors.X1010_InlineDataMustMatchTheoryParameters_IncompatibleValueType,
dataParameterExpressions[valueIdx].GetLocation(),
valueIdx < dataParameterExpressions.Count ? dataParameterExpressions[valueIdx].GetLocation() : null,
builder.ToImmutable(),
parameter.Name,
SymbolDisplay.ToDisplayString(paramsElementType ?? parameter.Type)
Expand All @@ -189,7 +189,7 @@ public override void AnalyzeCompilation(
context.ReportDiagnostic(
Diagnostic.Create(
Descriptors.X1011_InlineDataMustMatchTheoryParameters_ExtraValue,
dataParameterExpressions[valueIdx].GetLocation(),
valueIdx < dataParameterExpressions.Count ? dataParameterExpressions[valueIdx].GetLocation() : null,
builder.ToImmutable(),
values[valueIdx].ToCSharpString()
)
Expand Down

0 comments on commit 08daceb

Please sign in to comment.