There doesn't seem to be a precise limit. I've tested an enum with 10000 cases and it works. However, I wouldn't recommend doing this because compilation becomes extremely slow and the code becomes difficult to maintain. I think it's better to limit the number of cases to a maximum of a hundred to avoid this kind of problem.