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
}
Comment #1 by rayerd.wiz — 2011-02-27T07:45:37Z
*** Issue 3067 has been marked as a duplicate of this issue. ***
Comment #2 by k.hara.pg — 2011-06-20T01:49:44Z
Mostly agreed to this issue, but I have one question.
Is the common type of 'char' and 'immutable(char)' 'char'?
I guess it is 'const(char)' from implicit const conversion.