[dmd-beta] dmd 1.065 and 2.050 beta
Sönke Ludwig
ludwig at informatik.uni-luebeck.de
Wed Oct 27 12:47:24 PDT 2010
There seems to be a regression in std.algorithm.startsWith. With 2.049
this still worked:
invariant string s = "Hello, World!";
bool res = s.startsWith("Hello");
now the template cannot be matched anymore. Remove the invariant and it
works.
Am 27.10.2010 21:13, schrieb Walter Bright:
> Fix is uploaded.
>
> Don Clugston wrote:
>> On 27 October 2010 16:50, Stephan Dilly <Dilly at funatics.de> wrote:
>>> On 27.10.2010 16:14, Don Clugston wrote:
>>>> On 27 October 2010 15:29, Stephan Dilly<Dilly at funatics.de> wrote:
>>>>> On 27.10.2010 14:51, Stephan Dilly wrote:
>>>>>>> http://ftp.digitalmars.com/dmd1beta.zip
>>>>>>> http://ftp.digitalmars.com/dmd2beta.zip
>>>>>> 1) the client still says it is version 2.049
>>>>>>
>>>>>> 2) there seems to be a regression with pure opCall methods
>>>>>> introduced.
>>>>>> The
>>>>>> following code used to build with dmd2049 but now does not:
>>>>>>
>>>>>>
>>>>>> struct Foo
>>>>>> {
>>>>>> static Foo opCall(in Foo _f) pure
>>>>>> {
>>>>>> return Foo;
>>>>>> }
>>>>>> }
>>>>>>
>>>>>> instead the compiler issues the following error:
>>>>>> "Error: struct bug.Foo no size yet for forward reference"
>>>>>>
>>>>>> the workaround would be to remove the pure but that is no option
>>>>>> for my
>>>>>> codebase full of pure opCalls.
>>>>>>
>>>>>>
>>>>>> regards,
>>>>>> Stephan
>>>>> Ok to be fair, this is the correct code that works in dmd2049 and
>>>>> does
>>>>> not
>>>>> in the beta:
>>>>>
>>>>> struct Foo
>>>>> {
>>>>> static Foo opCall(in Foo _f) pure
>>>>> {
>>>>> return _f;
>>>>> }
>>>>> }
>>>> That is happening because in mtype.c, line 5013, it's trying to work
>>>> out which form of purity the function is. It can't do this for a
>>>> struct, until it knows if the struct has any pointer members. This is
>>>> a problem if it's a member function.
>>>> I don't know if it really needs to determine purity level so early on.
>>>> _______________________________________________
>>>> dmd-beta mailing list
>>>> dmd-beta at puremagic.com
>>>> http://lists.puremagic.com/mailman/listinfo/dmd-beta
>>>>
>>> I don't know either ;)
>>> Does that mean that static pure opCalls wont be possible from now on ?
>>
>> Your code should continue to work. It's a regression.
>>
> _______________________________________________
> dmd-beta mailing list
> dmd-beta at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/dmd-beta
More information about the dmd-beta
mailing list