Randomizing item in array with specific value

Hi,
i have a dynamic array of enum and int limit
typedef enum int {GOOD_TYPE, BAD_TYPE, AVERAGE_TYPE …} some_type_e;
rand some_type_e type_array;
int limit;

i want to add a constraint, that at least one element in type_array, between index 0 and limit will get GOOD_TYPE
i was thinking in these lines:
GOOD_TYPE inside {type_array[0:limit-1]};

but it doesn’t compile

In reply to guyleve:

You must use iterative constraints on random array variables (See 18.5.8 Iterative constraints in the 1800-2017 LRM)

constraint C {
    type_array.or(element) with (element == GOOD_TYPE && element.index < limit); }