Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Better error message for private constructors of extensible types #8579
Which is surprising given that the
From what I understand, there is a difference between a regular sum type begin private, which means that all its constructors are private and therefore, no value of this type can be constructed (which corresponds to the current error message), and an extensible variant type, where each constructor can be private or not, and where the type being private means that no constructors can be added to the type (but not that all constructors are private, contrary to the regular variant case).
This PR adapts the error message in cases of private constructors of extensible variant types to be:
gasche left a comment
Good to go if CI passes. Thanks!
(For the record, I'm not fond of "many fine eyes" as a cop-out to writing actual reviewer's names, except in the case where the list would get unreasonably long as it was used in stdlib PRs. If you start contributing more to the compiler, which would be very nice, don't pull that one too often.)