Thread overview
[Issue 3686] New: condExp type combining
Jan 07, 2010
Ellery Newcomer
[Issue 3686] common type of imaginary and non-imaginary should be complex
Jul 03, 2011
yebblies
Feb 02, 2012
yebblies
January 07, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3686

           Summary: condExp type combining
           Product: D
           Version: 2.038
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: ellery-newcomer@utulsa.edu


--- Comment #0 from Ellery Newcomer <ellery-newcomer@utulsa.edu> 2010-01-07 12:32:48 PST ---
import std.stdio;
string s(string t1, string t2){
        return "writeln(\"" ~ t1 ~ " " ~ t2 ~ " \"~ typeof(true ? cast(" ~ t1 ~
") 1 : cast(" ~ t2 ~ ") 1).stringof);\n";
}
void main()
{
        mixin(s("ifloat","double"));
}


result of above code doesn't make sense to me. if something like

auto a = true ? 1i : 1;

is allowed, it seems the result type should be complex; not imaginary, and not real.

I'm also curious why combining a char with a wchar or some such results in a uint

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
July 03, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=3686


yebblies <yebblies@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
                 CC|                            |yebblies@gmail.com
           Platform|Other                       |All
            Summary|condExp type combining      |common type of imaginary
                   |                            |and non-imaginary should be
                   |                            |complex
         OS/Version|Linux                       |All


--- Comment #1 from yebblies <yebblies@gmail.com> 2011-07-03 16:16:24 EST ---
char and wchar both implicitly convert to int, so that is expected behavior.

The common type of float and ifloat etc should of course be cfloat.  etc

https://github.com/D-Programming-Language/dmd/pull/198

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 02, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=3686


yebblies <yebblies@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|patch                       |
            Version|2.038                       |D2


--- Comment #2 from yebblies <yebblies@gmail.com> 2012-02-02 12:51:32 EST ---
Imaginary and complex numbers are going away.

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