void foo(immutable(char[]) s) { auto r1 = rebindable(s); // works as expected Rebindable!(typeof(s)) r2 = s; // doesn't work! }
https://github.com/D-Programming-Language/phobos/pull/480
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/c9fe9679d43de8b960bb0bfcb208637dc28e0452 Fix Issue 7654 - Fix Rebindable of narrow strings. `Rebindable!(const(T)[])` should be `T[]`, but `Rebindable` was using `ElementType` instead of `ElementEncodingType`, which would result in `dchar[]` for narrow strings. This pull fixes this simple mistake. https://d.puremagic.com/issues/show_bug.cgi?id=7654 https://github.com/D-Programming-Language/phobos/commit/a35a00efb9171297e3119849bb77d2b9a46717df Merge pull request #1941 from Poita/bug7654 Fix Issue 7654 - Fix Rebindable of narrow strings.