[dmd-beta] dmd 1.065 and 2.050 beta

Don Clugston dclugston at googlemail.com
Wed Oct 27 08:07:02 PDT 2010


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.


More information about the dmd-beta mailing list