Bug 16663 – [REG 2.072] std.unit.toUpper rejects an alias this to a string

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-11-06T14:40:00Z
Last change time
2017-01-16T23:24:44Z
Assigned to
nobody
Creator
b2.temp

Comments

Comment #0 by b2.temp — 2016-11-06T14:40:21Z
struct String { string data; alias data this; } void main() { import std.uni : toUpper; auto u = toUpper(String("a")); } works with DMD 2.071.2 with DMD 2.072 we get an error.
Comment #1 by public — 2016-11-10T16:52:14Z
Checked, doesn't work with DMD 2.071.2 either. Looking at std.uni history, `toUpper` seems to have never accepted `alias this` string because of `isSomeString!T` constraint. Are you sure you haven't missed some context?
Comment #2 by public — 2016-11-10T16:58:55Z
Nevermind, I have found my mistake. Can reproduce indeed.
Comment #3 by public — 2016-11-10T17:09:00Z
Comment #4 by dfj1esp02 — 2016-11-11T09:50:05Z
This probably falls under the same argument: this String is not supposed to be a range. Maybe extension of range functions to collections (autorangification) is in order.
Comment #5 by github-bugzilla — 2016-11-20T22:47:22Z
Commits pushed to stable at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/8f8979ebe15adf6ef82c3f43b81388a61be99700 Revert "Merge pull request #4790 from JackStouffer/uni-private" This reverts commit 1a7914a48cd7929373bb628f4938a8224de2167c, reversing changes made to d38727771b559828d50f01c70815f913e653b706. Fixes issue 16663 https://github.com/dlang/phobos/commit/2f27e58b0e498aeecfdbce5178ad0bb700ab779c Add regression test for issue 16663 https://github.com/dlang/phobos/commit/de688d978d3319e87adbe549538c7f0b0aa7743d Merge pull request #4901 from Dicebot/revert-regressions2 Fix issue 16663: std.unit.toUpper rejects an alias this to a string
Comment #6 by github-bugzilla — 2016-12-07T16:09:05Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/8f8979ebe15adf6ef82c3f43b81388a61be99700 Revert "Merge pull request #4790 from JackStouffer/uni-private" https://github.com/dlang/phobos/commit/2f27e58b0e498aeecfdbce5178ad0bb700ab779c Add regression test for issue 16663 https://github.com/dlang/phobos/commit/de688d978d3319e87adbe549538c7f0b0aa7743d Merge pull request #4901 from Dicebot/revert-regressions2
Comment #7 by github-bugzilla — 2016-12-27T13:11:19Z
Commits pushed to scope at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/8f8979ebe15adf6ef82c3f43b81388a61be99700 Revert "Merge pull request #4790 from JackStouffer/uni-private" https://github.com/dlang/phobos/commit/2f27e58b0e498aeecfdbce5178ad0bb700ab779c Add regression test for issue 16663 https://github.com/dlang/phobos/commit/de688d978d3319e87adbe549538c7f0b0aa7743d Merge pull request #4901 from Dicebot/revert-regressions2
Comment #8 by github-bugzilla — 2017-01-16T23:24:44Z
Commits pushed to newCTFE at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/8f8979ebe15adf6ef82c3f43b81388a61be99700 Revert "Merge pull request #4790 from JackStouffer/uni-private" https://github.com/dlang/phobos/commit/2f27e58b0e498aeecfdbce5178ad0bb700ab779c Add regression test for issue 16663 https://github.com/dlang/phobos/commit/de688d978d3319e87adbe549538c7f0b0aa7743d Merge pull request #4901 from Dicebot/revert-regressions2