On Fri, Apr 26, 2013 at 08:05:45PM -0400, Jonathan M Davis wrote:
> On Friday, April 26, 2013 14:34:45 Walter Bright wrote:
> > D has an interesting feature called VRP (value range propagation), where
> > implicit conversion very much depends on the value.
> 
> VRP is a fantastic feature, but I think that it's coming back to bite us 
> somewhat if foo(1) calls an overload which takes bool.
[...]

Does VRP work only with literals, or does it work with general variables
(by inferring from, say, if-conditions)?

        void func(int i) {
                ubyte b;
                if (i >= 0 && i < 256) {
                        b = i;          // OK without cast?
                }
                ...
        }


T

-- 
That's not a bug; that's a feature!

Reply via email to