A range analysis question

bearophile bearophileHUGS at lycos.com
Wed Jul 10 16:10:23 PDT 2013


Ali Çehreli:

> Change the code so that the result does not fit a ubyte you 
> will get the same error as in line 11.

The result is supposed to fit in an ubyte because the input is 
supposed to be made of nibbles. (I have tried to add asserts or 
tests, but they don't change the situation, so I have omitted 
them here).


> That foreach is a runtime foreach because it is applied on 
> 'result' as opposed to the type tuple 's'. Apparently the 
> compiler does not do that kind of code analysis.

Right, but is it right to ask for such analysis to be performed?

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list