[Issue 4731] New: cannot call protected base class method by using base class name

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Aug 26 09:41:22 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4731

           Summary: cannot call protected base class method by using base
                    class name
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: spam at extrawurst.org


--- Comment #0 from Stephan Dilly <spam at extrawurst.org> 2010-08-26 09:41:13 PDT ---
the way how one has to invoke protected base class methods in D seems to be
inconsistent. why do i have to use the super keyword ? using the base class
name works in case of being public, why is protected any different ?


module Foo;

class Base
{
protected void foo() {}
}

module main;

import Foo;

class Super : Base
{
override protected void foo() {super.foo();} // works
//override void foo() {Base.foo();} // does not work:
//Error: class Foo.Base member foo is not accessible
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list