DMD 1.026 and 2.010 releases

Walter Bright newshound1 at digitalmars.com
Sun Jan 20 21:24:05 PST 2008


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;


More information about the Digitalmars-d-announce mailing list