Skip to content

Commit

Permalink
The sample value must be equal or greater than the required minimum l…
Browse files Browse the repository at this point in the history
…ength by the slice
  • Loading branch information
alrz committed Oct 22, 2021
1 parent 7dc82d4 commit f4331b1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Compilers/CSharp/Portable/Binder/PatternExplainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,11 @@ string tryHandleListPattern(ref bool unnamedEnumValue)
return null;
}

// The sample value must be equal or greater than the required minimum length by the slice.
Debug.Assert(slice.StartIndex - slice.EndIndex <= lengthValue);
if (slice.StartIndex - slice.EndIndex <= lengthValue)
{
// The sample value must be equal or greater than the required minimum length by the slice.
return null;
}
}

var subpatterns = new ArrayBuilder<string>(lengthValue);
Expand Down

0 comments on commit f4331b1

Please sign in to comment.