On Thu, Dec 04, 2014 at 01:49:06PM +0000, Tobias Pankrath via Digitalmars-d 
wrote:
> >
> >How would this be handled in the current proposal?
> >
> >class C
> >{
> >  int bar(ref T); // <-- inferred to be scope
> >}
> >
> >class D : C
> >{
> >  override int bar(ref T); // <-- inferred to be NOT scope (but cannot
> >remove scope when overriding)
> >}
> 
> Attribute inference only works for function literals and template
> functions.  So no inference is done for both methods. Template methods
> can not be overwritten.

However, AFAIK, template *classes* trigger attribute inference on its
(non-template) member functions, so this would be problematic:

        class Base(T) {
                T data;
                void method(ref T); // inferred to be scope
        }

        class Derived : Base!int {
                override void method(ref T); // oops, cannot override
        }


T

-- 
I think Debian's doing something wrong, `apt-get install pesticide', doesn't 
seem to remove the bugs on my system! -- Mike Dresser

Reply via email to