D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7654 - Direct using of Rebindable!T doesn't work
Summary: Direct using of Rebindable!T doesn't work
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: pull, rejects-valid
Depends on:
Blocks:
 
Reported: 2012-03-06 03:38 UTC by Kenji Hara
Modified: 2014-02-15 11:27 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Kenji Hara 2012-03-06 03:38:12 UTC
void foo(immutable(char[]) s)
{
    auto r1 = rebindable(s);        // works as expected
    Rebindable!(typeof(s)) r2 = s;  // doesn't work!
}
Comment 2 github-bugzilla 2014-02-15 11:06:46 UTC
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.