@@ -112,6 +112,9 @@ function _parse_expression(stack, data, expr, x, parent_index)
112112 if length (x. args) == 2 && ! isexpr (x. args[2 ], :... )
113113 _parse_univariate_expression (stack, data, expr, x, parent_index)
114114 else
115+ # The call is either n-ary, or it is a splat, in which case we
116+ # cannot tell just yet whether the expression is unary or nary.
117+ # Punt to multivariate and try to recover later.
115118 _parse_multivariate_expression (stack, data, expr, x, parent_index)
116119 end
117120 elseif isexpr (x, :comparison )
@@ -177,8 +180,15 @@ function _parse_multivariate_expression(
177180 @assert isexpr (x, :call )
178181 id = get (data. operators. multivariate_operator_to_id, x. args[1 ], nothing )
179182 if id === nothing
180- @assert x. args[1 ] in data. operators. comparison_operators
181- _parse_inequality_expression (stack, data, expr, x, parent_index)
183+ if haskey (data. operators. univariate_operator_to_id, x. args[1 ])
184+ # It may also be a unary variate operator with splatting.
185+ _parse_univariate_expression (stack, data, expr, x, parent_index)
186+ elseif x. args[1 ] in data. operators. comparison_operators
187+ # Or it may be a binary (in)equality operator.
188+ _parse_inequality_expression (stack, data, expr, x, parent_index)
189+ else
190+ throw (MOI. UnsupportedNonlinearOperator (x. args[1 ]))
191+ end
182192 return
183193 end
184194 push! (expr. nodes, Node (NODE_CALL_MULTIVARIATE, id, parent_index))
0 commit comments