Skip to content

Commit b829b49

Browse files
committed
Issue #172 Fixed
1 parent 693b009 commit b829b49

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/CommandLine/Core/ValueMapper.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,17 @@ private static IEnumerable<Tuple<SpecificationProperty, Maybe<Error>>> MapValues
4141
yield break;
4242
}
4343

44+
var next = specProps.Skip(1).FirstOrDefault(s => s.Specification.IsValue()).ToMaybe();
45+
if (!pt.Specification.IsMaxNotSpecified()
46+
&& next.IsNothing()
47+
&& values.Skip(taken.Count()).Any())
48+
{
49+
yield return
50+
Tuple.Create<SpecificationProperty, Maybe<Error>>(
51+
pt, Maybe.Just<Error>(new SequenceOutOfRangeError(NameInfo.EmptyName)));
52+
yield break;
53+
}
54+
4455
yield return
4556
converter(taken, pt.Property.PropertyType, pt.Specification.ConversionType.IsScalar())
4657
.Return(

0 commit comments

Comments
 (0)