You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Operands of arithmetic operators are type checked twice #9500
The malformed payload (warning 47) is reported twice for b and eight times for c. A @ppwarning on an operand is reported twice too.
The cause is translate_unified_ops in compiler/typing/typecore.ml (around line 4418). It types an operand with type_exp to find out its type, and then types it again with type_expect. When the operand is itself an operator application, the same happens inside it, so the work doubles with each level of nesting. Besides the repeated diagnostics, this costs type checking time on long chains of operators.
Found by a review of #9491, which makes every other warning attribute report once.
Activity
Fix operands of arithmetic operators being type checked twice (rescri…