[Issue 14765] New: Rangified functions no longer accept types that implicitly cast to string
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Thu Jul 2 10:58:08 PDT 2015
https://issues.dlang.org/show_bug.cgi?id=14765
Issue ID: 14765
Summary: Rangified functions no longer accept types that
implicitly cast to string
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: regression
Priority: P1
Component: phobos
Assignee: nobody at puremagic.com
Reporter: thecybershadow at gmail.com
///////////// test.d /////////////
import std.file;
struct Stringish
{
string s;
alias s this;
}
void main()
{
auto fn = Stringish("test.d");
readText(fn);
}
//////////////////////////////////
This now fails with this error output:
C:\...\std\utf.d(3608,38): Error: cannot implicitly convert expression
(front(this.r.s)) of type dchar to ubyte
C:\...\std\utf.d(3608,38): Error: cannot implicitly convert expression
(front(this.r.s)) of type dchar to ubyte
C:\...\std\utf.d(3608,38): Error: cannot implicitly convert expression
(front(this.r.s)) of type dchar to ubyte
C:\...\std\utf.d(3442,32): Error: template instance std.utf.byDchar!(Stringish)
error instantiating
C:\...\std\internal\cstring.d(188,40): instantiated from here:
byWchar!(Stringish)
C:\...\std\file.d(245,54): instantiated from here: tempCString!(wchar,
Stringish)
C:\...\std\file.d(412,35): instantiated from here: read!(Stringish)
test.d(12,10): instantiated from here: readText!(string, Stringish)
C:\...\std\internal\cstring.d(188,5): Error: forward reference to inferred
return type of function call __r3083.front()
C:\...\std\internal\cstring.d(86,6): Error: function
std.internal.cstring.tempCString!(wchar, Stringish).tempCString no return exp;
or assert(0); at end of function
--
More information about the Digitalmars-d-bugs
mailing list