http://d.puremagic.com/issues/show_bug.cgi?id=5659
Summary: Conditional operator, array literal, and std.traits.CommonType return a wrong common type Product: D Version: D2 Platform: Other OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: rayerd....@gmail.com Depends on: 3067 --- Comment #0 from Haruki Shigemori <rayerd....@gmail.com> 2011-02-27 07:44:10 PST --- Because summary of issue 3067 was wrong, I report on this problem again. import std.stdio : writeln; import std.traits : CommonType; void main() { auto a = ("a".dup)[0]; auto b = "b"[0]; auto c = true ? a : b; auto d = [a, b][0]; writeln(typeof(a).stringof);//char writeln(typeof(b).stringof);//immutable(char) writeln(typeof(c).stringof);//int, but it should be char. writeln(CommonType!(typeof(a), typeof(b)).stringof);//ditto writeln(typeof(d).stringof);//ditto } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------