typeof(null) a;
const typeof(null) b = a;
a = b;
assert(a == b);
Only the first line of the above actually compiles. The others complain:
cannot implicitly convert expression (a) of type typeof(null) to typeof(null)
cannot implicitly convert expression (b) of type typeof(null) to typeof(null)
incompatible types for ((a) == (b)): 'typeof(null)' and 'typeof(null)'
In addition to typeof(null) not being implicitly castable to const(typeof(null)), and vice versa, the error message is misleading - no indication of constness is given in the error messages.
Comment #1 by simen.kjaras — 2013-10-30T14:51:44Z
Another thing that fails with typeof(null):
assert(is(typeof(null) : const(typeof(null))));