fix Issue 10144 - Using enum inside final class occurs weird errors

An enum and static variable declaration should not be affected by `synchronized`, `override`, `abstract`, and `final` attributes.
Also allow __gshared and synchronized/override/abstract/final combinations
Merge pull request #2070 from 9rnsr/fix10144

[REG2.063a] Issue 10144 - Using enum inside final class occurs weird errors