CRV - item.index not working

In reply to CRVAddict:

When you are calling it after randomize in the $display or wherever, you are executing an array reduction operation on the array. It uses a value of 6 for index 5. So 'h4 will be replaced by 6 and that adds up to 20.

The exact same thing happens when you put it in a constraint. You are not asking the solver to constrain index 5 to be 6 at all. Refer to dave’s response above for the expansion of the array reduction operation.