View mode: basic / threaded / horizontal-split · Log in · Help
February 03, 2012
is it a bug? protection attributes on interfaces/abstracts have no effect outside module?
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?
February 03, 2012
Re: is it a bug? protection attributes on interfaces/abstracts have no effect outside module?
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.
February 03, 2012
Re: is it a bug? protection attributes on interfaces/abstracts have no effect outside module?
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?
February 03, 2012
Re: is it a bug? protection attributes on interfaces/abstracts have no effect outside module?
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?
February 03, 2012
Re: is it a bug? protection attributes on interfaces/abstracts have no effect outside module?
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?
February 03, 2012
Re: is it a bug? protection attributes on interfaces/abstracts have no effect outside module?
"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.
February 03, 2012
Re: is it a bug? protection attributes on interfaces/abstracts have no effect outside module?
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
February 03, 2012
Re: is it a bug? protection attributes on interfaces/abstracts have no effect outside module?
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
February 03, 2012
Re: is it a bug? protection attributes on interfaces/abstracts have no effect outside module?
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?
February 03, 2012
Re: is it a bug? protection attributes on interfaces/abstracts have no effect outside module?
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.
« First   ‹ Prev
1 2
Top | Discussion index | About this forum | D home