Value range propagation for if-else

Daniel Murphy via Digitalmars-d digitalmars-d at puremagic.com
Mon Jun 23 05:52:08 PDT 2014


""Nordlöw""  wrote in message news:jctlkqtiztnbnctldtdg at forum.dlang.org...

> I'm currently merely talking about possibilities in this case, so I cannot 
> currently prove you wronge ;) To me it seem like an unneccessary 
> limitation that valueRanges aren't propagated to function call arguments 
> provided that the function source is known at compile time. And it doesn't 
> sound to me like enabling this in DMD would be such a great task either.

What happens when a function is called from different places with values 
with different ranges?  What about when it's called from another compilation 
unit?  Generally the argument ranges can only be known when the function is 
inlined, and by then it's much too late to expose them via __traits. 



More information about the Digitalmars-d mailing list