I have a feature request: "Named enum scope inference"

Alex Rønne Petersen alex at lycus.org
Fri Sep 28 21:26:31 PDT 2012


On 29-09-2012 06:06, Tommi wrote:
> So, these would be the new rules we'd give to the compiler:
>
> 1) See if you can compile the code exactly the way you've been doing it
> thus far. If it compiles, great, we're done.
>
> 2) Else, if there are undefined identifiers that are passed to places
> where named enum variables are expected, try to see if prefixing those
> identifier names with the expected enum type name (plus a dot) would
> make the code compile.
>
> This wouldn't break any existing code, and to me the rule seems
> intuitive enough.

It's an awful lot of magic (it's not as easy in the implementation as it 
sounds like) for questionable gain when we have the with statement IMO.

-- 
Alex Rønne Petersen
alex at lycus.org
http://lycus.org


More information about the Digitalmars-d mailing list