Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add error about factory constructor generating an enum value (#3461)
This PR introduces a compile-time error for the situation where the constructor which is implicitly invoked by an `<enumEntry>` is not generative. The reason why this error is added at this time is that an extension type that implements an `enum` type `E` is capable of declaring a constant constructor that allows the declaration `E` to have a constant factory constructor. That constructor will necessarily return one of the objects created by an `<enumEntry>` in the declaration of `E`, and this means that we could have multiple `<enumEntry>` constructs denoting the same object. That should never occur in an `enum` declaration, so we need this new error. See #3460 for further information and examples.
- Loading branch information