These pass:
----
static assert(is(typeof(true ? int.init : int.init) == int));
static assert(is(typeof(true ? int.init : const(int).init) == int));
static assert(is(typeof(true ? byte.init : byte.init) == byte));
----
This one fails but should pass:
----
static assert(is(typeof(true ? byte.init : const(byte).init) == byte));
----
This makes CommonType!(byte, const byte) evaluate to int. And that makes this little program surprisingly fail compilation:
----
void main()
{
import std.range: chain;
ubyte[] a = [1, 2];
const(ubyte)[] b = [3, 4];
ubyte f = chain(a, b).front; /* Error: cannot implicitly convert expression (chain(a, b).front()) of type int to ubyte */
}
----
Comment #1 by john.loughran.colvin — 2017-07-05T11:31:13Z
Upping the severity of this because it's such a basic thing.
Especially painful when you've swapped to ubyte[] due to frustrations with autodecoding and are then faced by yet another problem.
Comment #2 by john.loughran.colvin — 2017-07-05T13:50:03Z