Skip to content

Add test showing optional elements cannot have predicates in expressions#1179

Merged
stevedlawrence merged 1 commit intoapache:mainfrom
stevedlawrence:daffodil-2013-no-predicate-for-optionals
Mar 13, 2024
Merged

Add test showing optional elements cannot have predicates in expressions#1179
stevedlawrence merged 1 commit intoapache:mainfrom
stevedlawrence:daffodil-2013-no-predicate-for-optionals

Conversation

@stevedlawrence
Copy link
Member

Optional elements used to be implemented as arrays with a max size of one. A side effect of this was that accessing these elements in an expression required a predicate (e.g. /path/to/optional[1]).

However, at some point we changed the implementation so optional elements were no longer arrays and were added to the infoset just like scalars. This change also meant they no longer needed, or were allowed to have, predicates in expressions. This adds a test to confirm that behavior.

This also adds a colon to "subset" error messages to make the actual error message more clear.

DAFFODIL-2013

Optional elements used to be implemented as arrays with a max size of
one. A side effect of this was that accessing these elements in an
expression required a predicate (e.g. /path/to/optional[1]).

However, at some point we changed the implementation so optional
elements were no longer arrays and were added to the infoset just like
scalars. This change also meant they no longer needed, or were allowed
to have, predicates in expressions. This adds a test to confirm that
behavior.

This also adds a colon to "subset" error messages to make the actual
error message more clear.

DAFFODIL-2013
Copy link
Contributor

@tuxji tuxji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Contributor

@mbeckerle mbeckerle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@stevedlawrence stevedlawrence merged commit 36b98fc into apache:main Mar 13, 2024
@stevedlawrence stevedlawrence deleted the daffodil-2013-no-predicate-for-optionals branch March 13, 2024 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants