Skip to content

Refuse a call with a surplus tuple operand whole, and type it without the broadcast lift - #468

Open
enumeratio wants to merge 1 commit into
cortex-js:mainfrom
enumeratio:surplus-operands-tuples
Open

enumeratio wants to merge 1 commit into
cortex-js:mainfrom
enumeratio:surplus-operands-tuples

Conversation

@enumeratio

Copy link
Copy Markdown
Contributor

Fix #467.

hasSurplusOperands (the 'surplus-operands' broadcast exemption) now applies to the component-wise tuple broadcast (tupleBroadcastCells) and to the result-type lift of a broadcastable operator, as it already did to the list broadcast arms. Heads that do not opt in, such as a chained Equal, are unchanged.

  • Numerator(3/2, (1, 2)): before, Tuple(Error, Error); after, one unexpected-argument error, as for a surplus list.
  • Type of Numerator(3/2, (1, 2)): before, tuple<nothing | number, nothing | number>; after, nothing | number.
  • Type of Numerator(3/2, [1, 2]): before, list<nothing | number^2>; after, nothing | number, as for Numerator(3/2, Rule(Over, R)).

Found while following up on #443.

…and its type is no longer lifted over a surplus list or tuple. Fix cortex-js#467
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

A surplus tuple operand of Numerator, Denominator or NumeratorDenominator fans out into a tuple of errors

1 participant