Discussion Thread: DIP 1044--Enum Type Inference--Community Review Round 1

Paul Backus snarwin at gmail.com
Fri Nov 18 19:45:46 UTC 2022


Continuing discussion from the feedback thread:

On Friday, 18 November 2022 at 17:19:11 UTC, IchorDev wrote:
> I presume this means that the list of cases must therefore be 
> exhaustive?

More or less, yes.

That doesn't necessarily mean you have to list every possible 
context where ETI could be used one by one. A better approach 
might be to come up with a set of general, context-independent 
rules that specify how `$identifier` is evaluated, and then add 
special cases only as necessary to cover situations where the 
rules don't apply.

> I might need help from some experienced implementers to work 
> through that, since there are probably many aspects of D's 
> syntax that I am unfamiliar with. For instance, mixing enum 
> types with `int`s in an array literal causes it to be `int[]`. 
> Should ETI work in that case? The easy answer is "no". However, 
> what if D already has a mechanism for figuring out what types 
> have already been used in an array literal? If so, then ETI 
> could work in that example without a special-case, 
> unambiguously.

I'm sure there are many people in the D community who would be 
happy to help you answer questions like these. Ultimately, 
though, it is your responsibility as the DIP author to make sure 
that those questions are addressed before the DIP is submitted to 
Walter and Atila for formal assessment.

If you feel you lack the experience to do this, you might 
consider recruiting someone more experienced as a co-author.


More information about the Digitalmars-d mailing list