https://issues.dlang.org/show_bug.cgi?id=19982
--- Comment #4 from shove <[email protected]> --- The final step in the internal implementation of padLeft is chain() , and chain() converts multiple different types into a single type that can be accommodated via CommonType. alias X = CommonType!(int, long, short); assert(is(X == long)); alias Y = CommonType!(int, char[], short); assert(is(Y == void)); -------------------------- static assert(is(ElementType!(typeof("string".padLeft('0', 10))) == uint)); static assert(is(ElementType!(typeof("string".padLeft(dchar('0'), 10))) == dchar)); The corresponding types of these two sentences are transformed as follows: alias Z1 = CommonType!(char, dchar); static assert(is(Z1 == uint)); alias Z2 = CommonType!(dchar, dchar); static assert(is(Z2 == dchar)); So there is no problem with the design here, we can use it flexibly after mastering this feature. --
