Mercurial > projects > dang
diff sema/DType.d @ 120:7d0898f77685
Implement the cast expression - works for integers and real/float/double
author | Anders Halager <halager@gmail.com> |
---|---|
date | Sun, 25 May 2008 20:18:55 +0200 |
parents | c0b531362ca6 |
children | ed815b31479b |
line wrap: on
line diff
--- a/sema/DType.d Sun May 25 19:13:07 2008 +0200 +++ b/sema/DType.d Sun May 25 20:18:55 2008 +0200 @@ -252,7 +252,7 @@ override bool hasImplicitConversionTo(DType that) { - if (auto o = cast(DInteger)that) + if (that.isInteger() || that.isReal()) return true; return false; } @@ -270,9 +270,7 @@ override bool hasImplicitConversionTo(DType that) { - if (auto o = cast(DInteger)that) - return true; - if (auto o = cast(DReal)that) + if (that.isInteger() || that.isReal()) return true; return false; }