fix Issue 3903 - Traits compiles as true for an array sum with wrong syntax

Check invalid binary operations of arrays in front-end.