Fix array indexing in consts (broken by earlier const enum fixes)

Fixes #3169 and uses that to fix const array indexing, which I broke (in a way that doesn't break tests but will greatly confuse users) while trying to fix const enum vectors.