DMD 1.026 and 2.010 releases

Extrawurst spam at extrawurst.org
Sun Jan 20 22:14:31 PST 2008


Walter Bright schrieb:
> Extrawurst wrote:
>> ohh what a great day for const, #1319 was in top ten for me ;). 
>> thanks for this release!
>>
>> but what happened to scoped interfaces:
>> [CODE]
>>
>> interface IFoo {
>> }
>>
>> class Foo : IFoo {}
>>
>> IFoo getaFoo(){
>>    return new Foo();
>> }
>>
>> void main() {
>>    scope auto a = getaFoo();
>> }
>>
>> [/CODE]
>>
>> this is illegal since 2.010. how can i do such a thing from now on ?
>
> It never worked anyway. The problem is an interface cannot be deleted. 
> The solution is two steps:
>
>   scope f = new Foo();
>   IFoo i = f;

The point is that an unchanged code that used to work with dmd2.009 did 
exactly that and worked. By changing to dmd2.010 it is now broken.


More information about the Digitalmars-d-announce mailing list