stevedlawrence commented on a change in pull request #55: Fixes the issue of 
separated empty optional elements, (ie. 1:2::4:5).
URL: https://github.com/apache/incubator-daffodil/pull/55#discussion_r175548093
 
 

 ##########
 File path: 
daffodil-runtime1-unparser/src/main/scala/org/apache/daffodil/processors/unparsers/ElementKindUnparsers.scala
 ##########
 @@ -54,25 +54,22 @@ class SequenceCombinatorUnparser(ctxt: 
ModelGroupRuntimeData, childUnparsers: Ve
 
   override def nom = "Sequence"
 
-  // Sequences of nothing (no initiator, no terminator, nothing at all) should
-  // have been optimized away
-  Assert.invariant(childUnparsers.length > 0)
-
   // Since some of the grammar terms might have folded away to EmptyGram,
   // the number of unparsers here may be different from the number of
   // children of the sequence group.
-  Assert.invariant(ctxt.groupMembers.length >= childUnparsers.length)
+  Assert.invariant(ctxt.groupMembers.length == childUnparsers.length)
 
 Review comment:
   If using == works, I would stick with that. The more restrictive an assert 
is, the better. I'm a little surprised it works, I would think something from 
groupMembers would get filtered out, but it's not completely unreasonable.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to