Skip to content

<function> throws "Operator tuple not implemented" when a math child sits beside a multi-valued child #1876

Description

@dqnykamp

Summary

A <function> that has a <math> child alongside a child expanding to more than one
value fails to build outright:

Operator tuple not implemented for conversion to mathjs

Nothing renders — the whole document dies, not just the function.

Reproductions

All of these throw:

<function><math>1</math><numberList>3 1 2</numberList></function>
<function><math>1</math><mathList>3 1 2</mathList></function>
<function><math>1</math><sequence to="3" /></function>
<function><math>1</math><sort>3 1 2</sort></function>
<function><math>1</math><shuffle>1 2 3</shuffle></function>
<function><math>1</math><repeat for="1 2" valueName="v">$v</repeat></function>
<function><math>1</math><conditionalContent><sort>3 1 2</sort></conditionalContent></function>
<function><math>1</math><group><numberList>3 1 2</numberList></group></function>

These are fine, which is what makes the failure surprising:

<function><math>1</math><number>3</number></function>
<function><math>1</math><number>3</number><number>1</number><number>2</number></function>
<function><math>1</math><math>1</math><math>2</math></function>
<function><math>1</math><group><number>3</number><number>1</number></group></function>
<function><math>1</math><repeat for="1" valueName="v">$v</repeat></function>
<function><numberList>3 1 2</numberList></function>

So it is not the number of children, and it is not composites as such. Writing the same
values out one component at a time works; routing them through anything that delivers
them as a single multi-valued child does not — and adding a second, single-valued <math>
child is what turns it from working into throwing.

Why it matters

The editor accepts every one of the throwing documents. <numberList>, <mathList>,
<sequence> and <conditionalContent> have always been legal children of <function>,
so this is not new, but nothing warns the author before the activity goes blank.

Notes

Found while sweeping every newly legal (container, composite) pair for
#1872. That PR makes <sort>, <shuffle>,
<repeat> and <repeatForSequence> legal children of <function> as well, which adds
four more spellings of the same crash but does not cause it — the <numberList> and
<conditionalContent> spellings above reproduce it on main.

Related: #1873, #1874, #1875 — other containers that mishandle a child they cannot
inspect before it expands.

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Effort

    None yet

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions