Bug 14396 – [REG2.066] compile error std.conv.parse!int with input range

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-04-02T15:04:00Z
Last change time
2017-07-19T17:43:04Z
Keywords
pull
Assigned to
nobody
Creator
coz.d.lang

Comments

Comment #0 by coz.d.lang — 2015-04-02T15:04:08Z
import std.stdio; import std.conv; void main() { struct StrInputRange { this (string s) { str = s; } char front() const @property { return str[front_index]; } char popFront() @property { return str[front_index++]; } bool empty() const @property { return str.length <= front_index; } size_t front_index = 0; string str; } auto input = StrInputRange("777"); auto a = std.conv.parse!int(input); writefln("a = %s", a); } /* -- compile error (dmd2.067) C:\D\dmd2\windows\bin\..\..\src\phobos\std\conv.d(1992): Error: cannot implicitly convert expression (cast(int)s.front() - 48) of type int to char source\app.d(17): Error: template instance std.conv.parse!(int, StrInputRange) error instantiating -- output (dmd2.065) a = 777 */
Comment #1 by ag0aep6g — 2015-04-02T22:54:54Z
Comment #2 by github-bugzilla — 2015-04-17T14:11:05Z
Commits pushed to stable at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/99da04d9af3a4e44d8576445c06d701fe6fdada4 fix Issue 14396 - compile error std.conv.parse!int with input range (dmd2.067) https://github.com/D-Programming-Language/phobos/commit/99956f90609d1d23c5612ba6d4f58b8f951e914d Merge pull request #3183 from aG0aep6G/14396-stable fix Issue 14396 - compile error std.conv.parse!int with input range (dmd...
Comment #3 by github-bugzilla — 2015-04-20T16:11:15Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/99da04d9af3a4e44d8576445c06d701fe6fdada4 fix Issue 14396 - compile error std.conv.parse!int with input range (dmd2.067) https://github.com/D-Programming-Language/phobos/commit/99956f90609d1d23c5612ba6d4f58b8f951e914d Merge pull request #3183 from aG0aep6G/14396-stable
Comment #4 by github-bugzilla — 2017-07-19T17:43:04Z
Commits pushed to dmd-cxx at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/99da04d9af3a4e44d8576445c06d701fe6fdada4 fix Issue 14396 - compile error std.conv.parse!int with input range (dmd2.067) https://github.com/dlang/phobos/commit/99956f90609d1d23c5612ba6d4f58b8f951e914d Merge pull request #3183 from aG0aep6G/14396-stable