This is not a regression. The example code you posted was never supposed to work, but relied on bugs in DMD to work nonetheless. An immutable(char[]) is not an input range since you can't call popFront() on it. You used to be able to because of Bug 3534 (<a href="http://d.puremagic.com/issues/show_bug.cgi?id=3534">http://d.puremagic.com/issues/show_bug.cgi?id=3534</a>). I added code to Phobos to explicitly disable this, so that until 3534 gets fixed people avoid writing code that relies on it.<br>
<br><div class="gmail_quote">On Wed, Oct 27, 2010 at 3:47 PM, Sönke Ludwig <span dir="ltr"><<a href="mailto:ludwig@informatik.uni-luebeck.de">ludwig@informatik.uni-luebeck.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
There seems to be a regression in std.algorithm.startsWith. With 2.049 this still worked:<br>
<br>
invariant string s = "Hello, World!";<br>
bool res = s.startsWith("Hello");<br>
<br>
now the template cannot be matched anymore. Remove the invariant and it works.<br>
<br>
Am 27.10.2010 21:13, schrieb Walter Bright:<div><div></div><div class="h5"><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Fix is uploaded.<br>
<br>
Don Clugston wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
On 27 October 2010 16:50, Stephan Dilly <<a href="mailto:Dilly@funatics.de" target="_blank">Dilly@funatics.de</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
On 27.10.2010 16:14, Don Clugston wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
On 27 October 2010 15:29, Stephan Dilly<<a href="mailto:Dilly@funatics.de" target="_blank">Dilly@funatics.de</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
On 27.10.2010 14:51, Stephan Dilly wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<a href="http://ftp.digitalmars.com/dmd1beta.zip" target="_blank">http://ftp.digitalmars.com/dmd1beta.zip</a><br>
<a href="http://ftp.digitalmars.com/dmd2beta.zip" target="_blank">http://ftp.digitalmars.com/dmd2beta.zip</a><br>
</blockquote>
1) the client still says it is version 2.049<br>
<br>
2) there seems to be a regression with pure opCall methods introduced.<br>
The<br>
following code used to build with dmd2049 but now does not:<br>
<br>
<br>
struct Foo<br>
{<br>
static Foo opCall(in Foo _f) pure<br>
{<br>
return Foo;<br>
}<br>
}<br>
<br>
instead the compiler issues the following error:<br>
"Error: struct bug.Foo no size yet for forward reference"<br>
<br>
the workaround would be to remove the pure but that is no option for my<br>
codebase full of pure opCalls.<br>
<br>
<br>
regards,<br>
Stephan<br>
</blockquote>
Ok to be fair, this is the correct code that works in dmd2049 and does<br>
not<br>
in the beta:<br>
<br>
struct Foo<br>
{<br>
static Foo opCall(in Foo _f) pure<br>
{<br>
return _f;<br>
}<br>
}<br>
</blockquote>
That is happening because in mtype.c, line 5013, it's trying to work<br>
out which form of purity the function is. It can't do this for a<br>
struct, until it knows if the struct has any pointer members. This is<br>
a problem if it's a member function.<br>
I don't know if it really needs to determine purity level so early on.<br>
_______________________________________________<br>
dmd-beta mailing list<br>
<a href="mailto:dmd-beta@puremagic.com" target="_blank">dmd-beta@puremagic.com</a><br>
<a href="http://lists.puremagic.com/mailman/listinfo/dmd-beta" target="_blank">http://lists.puremagic.com/mailman/listinfo/dmd-beta</a><br>
<br>
</blockquote>
I don't know either ;)<br>
Does that mean that static pure opCalls wont be possible from now on ?<br>
</blockquote>
<br>
Your code should continue to work. It's a regression.<br>
<br>
</blockquote>
_______________________________________________<br>
dmd-beta mailing list<br>
<a href="mailto:dmd-beta@puremagic.com" target="_blank">dmd-beta@puremagic.com</a><br>
<a href="http://lists.puremagic.com/mailman/listinfo/dmd-beta" target="_blank">http://lists.puremagic.com/mailman/listinfo/dmd-beta</a><br>
</blockquote>
<br>
_______________________________________________<br>
dmd-beta mailing list<br>
<a href="mailto:dmd-beta@puremagic.com" target="_blank">dmd-beta@puremagic.com</a><br>
<a href="http://lists.puremagic.com/mailman/listinfo/dmd-beta" target="_blank">http://lists.puremagic.com/mailman/listinfo/dmd-beta</a><br>
</div></div></blockquote></div><br>