Verbose checking of range category

Jesse Phillips jessekphillips+D at gmail.com
Sat Dec 11 11:06:45 PST 2010


Andrei Alexandrescu Wrote:

> This program will generate a valid executable, but will also print 
> during compilation:
> 
> Type int is not a random access range because:
>    no empty property
>    no front property
>    no popFront method
>    no indexing
>    no slicing
> 
> When a programmer has an odd issue with a range check, turning 
> verboseness of checks could help.
> 
> What do you think?
> 
> 
> Andrei

I think it would be best if DMD would emit which constraint failed. Better support for automatically say why would be good too. Basically I like bearophile's suggestion to give them more structure. But until then, yes do this. It should be everywhere, but ranges a big, and need them now!


More information about the Digitalmars-d mailing list