tuxji commented on code in PR #1241:
URL: https://github.com/apache/daffodil/pull/1241#discussion_r1605431742
##########
daffodil-core/src/main/scala/org/apache/daffodil/core/dsom/Term.scala:
##########
@@ -527,7 +527,7 @@ trait Term
e.complexType.group.canUnparseIfHidden
Review Comment:
Just above this case are two more cases, one case which says a sequence term
can be unparsed if all of its group members can be unparsed while hidden, and
the other case which says a choice can be unparsed if any of its group members
can be unparsed while hidden. I'm sure the function is working as it's
supposed to; I just want to know why the choice case uses the "exists" function?
```scala
case s: SequenceTermBase => {
s.groupMembers.forall { member =>
val res = member.canUnparseIfHidden
res
}
}
case c: ChoiceTermBase => {
c.groupMembers.exists { _.canUnparseIfHidden }
}
```
If there is only one group member which can be unparsed while hidden, I can
see the choice picking that member, but what if there are two group members
which can be unparsed while hidden (ambiguity), or any group member selected by
the choice dispatch key field which cannot be unparsed while hidden (cannot be
defaulted)?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]