In reply to bmorris:
It would help if you stated what output value you were expecting.
If you want a count of then number of elements greater than 5, then you need to write
y=numbers.sum with (int'(item>5));
That’s because the type of item>5 is a 1-bit expression, and sum of 1-bit expressions is a 1-bit result.
If you want the sum of elements whose values are greater than 5, then you need to write
y=numbers.sum with (item>5?item:0);