Thread overview
[Bug 59] New: implicit conversion from integer to cfloat not caught by the compiler
Mar 20, 2006
d-bugmail
May 18, 2006
d-bugmail
May 19, 2006
Thomas Kuehne
March 20, 2006
http://d.puremagic.com/bugzilla/show_bug.cgi?id=59

           Summary: implicit conversion from integer to cfloat not caught by
                    the compiler
           Product: D
           Version: 0.150
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: thomas-dloop@kuehne.cn


cfloat c;
c = 0.0; // should fail to compile

test cases: http://dstress.kuehne.cn/nocompile/c/cfloat_10_A.d http://dstress.kuehne.cn/nocompile/c/cfloat_10_B.d http://dstress.kuehne.cn/nocompile/c/cdouble_10_A.d http://dstress.kuehne.cn/nocompile/c/cdouble_10_B.d http://dstress.kuehne.cn/nocompile/c/creal_35_A.d http://dstress.kuehne.cn/nocompile/c/creal_35_B.d


-- 

May 18, 2006
http://d.puremagic.com/bugzilla/show_bug.cgi?id=59


smjg@iname.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |smjg@iname.com




------- Comment #1 from smjg@iname.com  2006-05-18 08:54 -------
Make up your mind - are we talking about integers or floating points here?


-- 

May 19, 2006
d-bugmail@puremagic.com schrieb am 2006-05-18:
> ------- Comment #1 from smjg@iname.com  2006-05-18 08:54 -------
> Make up your mind - are we talking about integers or floating points here?

Thanks for catching this.

In contrast to the documentation the compiler allows implicity promoting integers to complex floats.

creal c = 1; // should fail to compile

Thomas