PROPOSAL: Fully-qualified names to extend overload sets

Paul D. Anderson paul.d.removethis.anderson at comcast.andthis.net
Mon May 12 13:11:16 PDT 2008


Russell Lewis Wrote:

> 
> EXAMPLE CODE (PROPOSED)
> 
> library.d:
>    class A
>    {
>      int foo();
>    }
>    class B : A
>    {
>      int A.foo(); // overloads A.foo
>    }
> 
> myProgram.d:
>    import library;
>    class C : B
>    {
>      int foo(); // UNRELATED to A.foo!
>    }
> 
> 
>    A myVar = new C;
>    myVar.foo(); // calls B.foo()
>    C myVar_C = cast(C)myVar;
>    myVar.foo(); // calls C.foo()
> 
> 
> THOUGHTS?

Just wanted to bump this because it seemed like it was worth discussing  but got lost in the high traffic of the weekend.

Paul




More information about the Digitalmars-d mailing list