https://issues.dlang.org/show_bug.cgi?id=17229
--- Comment #6 from Steven Schveighoffer <[email protected]> --- (In reply to anonymous4 from comment #5) > static assert(is(ubyte:dchar)); > This assert succeeds. Is it intended? It's why LockingTextWriter accepts > bytes event though it's a text writer. Yes, in the compiler, ubyte and dchar are fundamentally unsigned integer types. You can implicitly convert via integer promotion. Technically, char can integer promote to dchar as well. However, foreach(dchar d; someCharArray) is specialized in the compiler to go through auto decoding. The forums contain volumes of battles on auto-decoding and how the choice has affected D, I don't think we need to rehash it here. What we need to do is make it so obviously wrong code is not accepted for this function. I'll try and get a PR together. --
