New Issue: segfault when compiling a program trying to access an enum like an array

18674, "bmcdonald3", "segfault when compiling a program trying to access an enum like an array", "2021-11-02T18:15:49Z"

Summary of Problem

The code below causes a segfault when compiling. I was hoping that indexing the enum like below would yield a, but I don't think that is a common enum feature. An error message like what you get when you try to do int[0] could be valuable such as:

error: illegal type index expression 'int(64)[0]'
note: primitive type 'int(64)' cannot be used in an index expression

Steps to Reproduce

enum testEnum {a, b, c};
testEnum[0];