http://d.puremagic.com/issues/show_bug.cgi?id=259


�ric Esti�venart <eric.estieven...@free.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |eric.estieven...@free.fr


--- Comment #19 from �ric Esti�venart <eric.estieven...@free.fr> 2011-01-14 
11:55:24 PST ---
Indeed this is rather critical; I hit it in a simple precondition like:
void insert( Object o, int ndx = -1 ) // -1 means last
  in { assert( ndx >= -1 && ndx <= somearray.length ); }

forcing to add a cast everywhere would be very painful...

The following code should compile without error and pass:
void main()
{
  uint ulen = 0;
  int ndx = -1;
  assert( -1 <= ulen );
  assert( ndx <= ulen );
}

If it generates warnings is another issue...

// This one should compile too
void func2()
{
  uint u;
  // should not compile (or at least warn): always yields to true
  static assert( !is( typeof( u >= 0 ) ) );
  static assert( !is( typeof( u >= -1 ) ) );
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to