Type Inference Bug?
Daniel Murphy via Digitalmars-d
digitalmars-d at puremagic.com
Fri Nov 21 07:29:08 PST 2014
"Meta" wrote in message news:tyfdmprlmreagrrnbuon at forum.dlang.org...
> Hmm, do you know why is(typeof(i) == shared(U), U)) might fail? I wonder
> why : is required over ==... Doesn't the former check if T is a subtype of
> U, rather than check that they're the same type?
I have no idea, I tried == first, expecting it to work. And yes, it checks
it's a subtype, but you could enforce exact type with something like
if (typeof(i) == shared(U), U) && is(shared(U) == typeof(i))
More information about the Digitalmars-d
mailing list