Bug 4731 – cannot call protected base class method by using base class name

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2010-08-26T09:41:13Z
Last change time
2024-12-13T17:53:13Z
Keywords
rejects-valid
Assigned to
No Owner
Creator
Stephan Dilly
Moved to GitHub: dmd#18296 →

Comments

Comment #0 by spam — 2010-08-26T09:41:13Z
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 by robert.schadek — 2024-12-13T17:53:13Z
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