www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - is it a bug? protection attributes on interfaces/abstracts have no

reply dennis luehring <dl.soluz gmx.net> writes:
repost from d.learn

is it a bug? protection attributes on interfaces/abstracts have no 
effect outside modules?

module types;

private interface itest
{
    public void blub2();
    private void blub3();
}

private class test
{
    protected abstract void blub4();
    public abstract void blub5();
}

---

module classes;

import types;

class A: itest
{
    public void blub2(){}
    public void blub3(){}
}

class B: test
{
    protected override void blub4(){}
    public override void blub5(){}
}

class C: test
{
    public override void blub4(){}
    public override void blub5(){}
}

should the attributes do anything or is it a bug to allow the usage?
Feb 03 2012
next sibling parent reply "Daniel Murphy" <yebblies nospamgmail.com> writes:
C.blub4 - yes, it looks like a bug

A.blub3 - I've seen a bug about this somewhere in bugzilla, and it's 
debatable whether it's a bug or not.  Private functions are not virtual, so 
it doesn't override anything, it just uses the same name as an interface 
method.  Allowing override here is probably a bug. 
Feb 03 2012
parent reply dennis luehring <dl.soluz gmx.net> writes:
Am 03.02.2012 14:53, schrieb Daniel Murphy:
 C.blub4 - yes, it looks like a bug

 A.blub3 - I've seen a bug about this somewhere in bugzilla, and it's
 debatable whether it's a bug or not.  Private functions are not virtual, so
 it doesn't override anything, it just uses the same name as an interface
 method.  Allowing override here is probably a bug.
and why can i see a private interface in different module?
Feb 03 2012
next sibling parent reply "Daniel Murphy" <yebblies nospamgmail.com> writes:
Another bug.  Although there have been some bugfixes in that area since the 
last release, it might be fixed in the github version.

"dennis luehring" <dl.soluz gmx.net> wrote in message 
news:jggp8k$c1n$1 digitalmars.com...
 Am 03.02.2012 14:53, schrieb Daniel Murphy:
 C.blub4 - yes, it looks like a bug

 A.blub3 - I've seen a bug about this somewhere in bugzilla, and it's
 debatable whether it's a bug or not.  Private functions are not virtual, 
 so
 it doesn't override anything, it just uses the same name as an interface
 method.  Allowing override here is probably a bug.
and why can i see a private interface in different module?
Feb 03 2012
parent reply dennis luehring <dl.soluz gmx.net> writes:
Am 03.02.2012 15:56, schrieb Daniel Murphy:
 Another bug.  Although there have been some bugfixes in that area since the
 last release, it might be fixed in the github version.

 "dennis luehring"<dl.soluz gmx.net>  wrote in message
 news:jggp8k$c1n$1 digitalmars.com...
  Am 03.02.2012 14:53, schrieb Daniel Murphy:
  C.blub4 - yes, it looks like a bug

  A.blub3 - I've seen a bug about this somewhere in bugzilla, and it's
  debatable whether it's a bug or not.  Private functions are not virtual,
  so
  it doesn't override anything, it just uses the same name as an interface
  method.  Allowing override here is probably a bug.
and why can i see a private interface in different module?
is there something like an github build or do i need to build from source?
Feb 03 2012
parent reply "Daniel Murphy" <yebblies nospamgmail.com> writes:
"dennis luehring" <dl.soluz gmx.net> wrote in message 
news:jggue2$ksn$1 digitalmars.com...
 Am 03.02.2012 15:56, schrieb Daniel Murphy:

 is there something like an github build or do i need to build from source?
From source I'm afraid. And because they all get changed in tandem you'll need to build druntime and phobos as well to get it to work. On the plus side, it's not incredibly difficult to get working.
Feb 03 2012
parent reply dennis luehring <dl.soluz gmx.net> writes:
Am 03.02.2012 16:54, schrieb Daniel Murphy:
 "dennis luehring"<dl.soluz gmx.net>  wrote in message
 news:jggue2$ksn$1 digitalmars.com...
  Am 03.02.2012 15:56, schrieb Daniel Murphy:

  is there something like an github build or do i need to build from source?
From source I'm afraid. And because they all get changed in tandem you'll need to build druntime and phobos as well to get it to work. On the plus side, it's not incredibly difficult to get working.
is there a good "i've never done it before and im on windows tutorial" for it
Feb 03 2012
parent David Nadlinger <see klickverbot.at> writes:
Assuming that DMD and DigitalMars make are on your PATH, just »cd src; 
make -f win32.mak dmd«, resp. »make -f win32.mak« in the root directory 
for druntime/Phobos.

David


On 2/3/12 5:33 PM, dennis luehring wrote:
 Am 03.02.2012 16:54, schrieb Daniel Murphy:
 "dennis luehring"<dl.soluz gmx.net> wrote in message
 news:jggue2$ksn$1 digitalmars.com...
 Am 03.02.2012 15:56, schrieb Daniel Murphy:

 is there something like an github build or do i need to build from
 source?
From source I'm afraid. And because they all get changed in tandem you'll need to build druntime and phobos as well to get it to work. On the plus side, it's not incredibly difficult to get working.
is there a good "i've never done it before and im on windows tutorial" for it
Feb 03 2012
prev sibling parent reply dennis luehring <dl.soluz gmx.net> writes:
Am 03.02.2012 18:44, schrieb Manfred Nowak:
 dennis luehring wrote:

  why can i see a private interface in different module?
The docs online define protections for member sof the module. -manfred
that means i can't hide an interface inside a module?
Feb 03 2012
parent Manfred Nowak <svv1999 hotmail.com> writes:
dennis luehring wrote:

 that means i can't hide an interface inside a module?
I cannot find the definition of members of modules. Therefore this conclusion might or might not be true. The docs say something about "Member Templates" thow: http://www.d-programming-language.org/template-comparison.html -manfred
Feb 03 2012
prev sibling parent "Martin Nowak" <dawg dawgfoto.de> writes:
On Fri, 03 Feb 2012 13:27:34 +0100, dennis luehring <dl.soluz gmx.net>  
wrote:

 repost from d.learn

 is it a bug? protection attributes on interfaces/abstracts have no  
 effect outside modules?

 module types;

 private interface itest
 {
     public void blub2();
     private void blub3();
 }

 private class test
 {
     protected abstract void blub4();
     public abstract void blub5();
 }

 ---

 module classes;

 import types;

 class A: itest
 {
     public void blub2(){}
     public void blub3(){}
 }

 class B: test
 {
     protected override void blub4(){}
     public override void blub5(){}
 }

 class C: test
 {
     public override void blub4(){}
     public override void blub5(){}
 }

 should the attributes do anything or is it a bug to allow the usage?
It's a bug. There is a pending pull request to fix the remaining protection issues.
Feb 03 2012