D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4731 - cannot call protected base class method by using base class name
Summary: cannot call protected base class method by using base class name
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Windows
: P3 normal
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2010-08-26 09:41 UTC by Stephan Dilly
Modified: 2024-12-13 17:53 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Stephan Dilly 2010-08-26 09:41:13 UTC
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
}
Comment 1 dlangBugzillaToGithub 2024-12-13 17:53:13 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/18296

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB