Bug 3686 – common type of imaginary and non-imaginary should be complex
Status
RESOLVED
Resolution
WONTFIX
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2010-01-07T12:32:00Z
Last change time
2017-07-21T07:18:30Z
Assigned to
nobody
Creator
ellery-newcomer
Comments
Comment #0 by ellery-newcomer — 2010-01-07T12:32:48Z
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