<br><br><div class="gmail_quote">On Mon, Aug 2, 2010 at 00:37, Andrej Mitrovic <span dir="ltr"><<a href="mailto:andrej.mitrovich@gmail.com">andrej.mitrovich@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex"><div class="gmail_quote"><div>That's because the first part of the constraint is tested, to allow for short-circuiting the second part. So the bad array comparison triggers the problem in object._EqArray.</div>
<div>
<br></div><div>You should always test for the most general constraint first, I guess. In this particular case, use areComparable!(A,B) as the first argument to && in both templates.</div><br></div></blockquote><div>
</div></div></div>Let me see if I'm getting this right. <br><br>false && true will short circuit to false (this is normal).<br><br>true && false will short circuit to true? How can that be? It's not a logical OR, its an AND, and as far as I know both expressions need to be True to evaluate to True. Or is it different for template constraints?<br>
</blockquote><div><br></div><div>I was answering you about the "incompatible types" error. The first part of the template, 'is(typeof(longer[0 .. 1] == shorter) : bool', triggers the error and that stops the compilation process. I agree that, if longer[0..1] == shorter is an error, then we could have is(typeof()) result in 'true'. But here what happens is that everything stops. I'll post about this on the main list, see if it's normal behavior or not and add a bug report.</div>
<div><br></div><div><br></div><div>Philippe</div><div><br></div></div>