Description
This was first mentioned in DFDL-1302. The associated test is impOptArrayThenScalar02parse in the following files:
daffodil-test/src/test/resources/edu/illinois/ncsa/daffodil/section16/array_optional_elem/UnparseArrayImplicitOptionalElem.tdml
daffodil-test/src/test/scala-debug/edu/illinois/ncsa/daffodil/section16/array_optional_elem/TestUnparseArrayOptionalElemDebug.scala
daffodil-test/src/test/scala/edu/illinois/ncsa/daffodil/section16/array_optional_elem/TestUnparseArrayOptionalElem.scala
Note from the ticket:
I think the issue with the parse case is just a diagnostic issue. What is happening is it's successfully parsing "3" as the first <opt> element. It then tries to parse another <opt> element, but there is no data left over. So it completes the <opt> array, having successfully parsed a single occurrence. It then goes on to attempt to parse the required "sca" element. As before, there is no data, so it fails to parse <sca> and then prints the "insufficient bits" error. So this is just an example of correct behavior, but poor diagnostics.
The test was changed to behave as expected, but this ticket reflects the poor diagnostic message.