www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 206] New: attributes private, package, etc appear to be ignored

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=206

           Summary: attributes private, package, etc appear to be ignored
           Product: D
           Version: 0.160
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: critical
          Priority: P1
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: someidiot earthlink.net


Attributes marked as 'private' to one module are perfectly visible to all
others. It appears 'package' has a similar problem. Perhaps 'protected' too ?


-- 
Jun 18 2006
next sibling parent reply Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

d-bugmail puremagic.com schrieb am 2006-06-18:
 http://d.puremagic.com/issues/show_bug.cgi?id=206

 Attributes marked as 'private' to one module are perfectly visible to all
 others. It appears 'package' has a similar problem. Perhaps 'protected' too ?

Could you please back-up you bug report with a quote from the documentation? - As far as I'm aware, D doesn't care about visibility but accessibility... Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFEle0c3w+/yD4P9tIRAtbQAJ9K9ZFrxEJ6+5O/peL1ypTsBXygWQCgqMqu AhkrKj3mcGyNAnKQHI0u4G4= =BvL5 -----END PGP SIGNATURE-----
Jun 18 2006
parent kris <foo bar.com> writes:
Thomas Kuehne wrote:
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
 d-bugmail puremagic.com schrieb am 2006-06-18:
 
http://d.puremagic.com/issues/show_bug.cgi?id=206

Attributes marked as 'private' to one module are perfectly visible to all
others. It appears 'package' has a similar problem. Perhaps 'protected' too ?

Could you please back-up you bug report with a quote from the documentation? - As far as I'm aware, D doesn't care about visibility but accessibility... Thomas

I think we call all sleep safely tonight, knowing that the word "visibility" - when discussed in terms of private, package, public, and protected attributes - is both oft-used and perfectly valid terminology. Don't know what documentation you might be referring to, Thomas -- but hopefully this particular report refers to something sufficiently rudimentary that it will be correctly understood? I do hope so.
Jun 18 2006
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=206





------- Comment #1 from ddparnell bigpond.com  2006-06-18 19:45 -------
The original bug report uses the word 'visibility' when in fact 'accessibility'
was meant.

Here is a code example that compiles okay but it should not...

//----- file qwerty.d ----------
module qwerty;
private void  foo() {}
// ---EOF---

//----- file mod.d -------------
module mod;
private import qwerty;
private void bar(){}
// ---EOF---

//----- file test.d -------------
import mod;
void main()
{
   mod.bar();      // 'bar' is supposed to be private to mod.
   qwerty.foo();   // 'qwerty' is supposed to be private to mod.
                   // 'foo' is supposed to be private to qwerty.
}
// ---EOF---

Compile this with ...

  dmd test.d mod.d qwerty.d 

If you change the test.d file to remove the module qualifiers, it fails to
compile, which is correct.

//----- file test2.d -------------
import mod;
void main()
{
   bar();
   foo();
}
// ---EOF---

Now when compiled we get ....

  test2.d: module test2 mod.bar is private
  test2.d(5): undefined identifier foo
  test2.d(5): function expected before (), not foo of type int


-- 
Jun 18 2006
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=206


daiphoenix lycos.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE




------- Comment #2 from daiphoenix lycos.com  2006-06-19 06:43 -------
Duplicate...

*** This bug has been marked as a duplicate of 48 ***


-- 
Jun 19 2006
prev sibling next sibling parent reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=206


someidiot earthlink.net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|DUPLICATE                   |




------- Comment #3 from someidiot earthlink.net  2006-06-19 13:33 -------
This is *not* a duplicate of #48 -- read the descriptions carefully. #48
actually has the basic visibility operable and enabled (in march 2006), but
allows one to step around visibility by fully qualifiying. Since then, the
basic visibility mechanism has broken down completely.


-- 
Jun 19 2006
next sibling parent reply kris <foo bar.com> writes:
d-bugmail puremagic.com wrote:
 http://d.puremagic.com/issues/show_bug.cgi?id=206
 
 
 someidiot earthlink.net changed:
 
            What    |Removed                     |Added
 ----------------------------------------------------------------------------
              Status|RESOLVED                    |REOPENED
          Resolution|DUPLICATE                   |
 
 
 
 
 ------- Comment #3 from someidiot earthlink.net  2006-06-19 13:33 -------
 This is *not* a duplicate of #48 -- read the descriptions carefully. #48
 actually has the basic visibility operable and enabled (in march 2006), but
 allows one to step around visibility by fully qualifiying. Since then, the
 basic visibility mechanism has broken down completely.
 
 

It's somewhat annoying when someone goes in and starts removing active bug reports; especially when they apparently don't even understand the problem described. This kind of behaviour tends to dissuade the submission of reports in the first place. What can be done about this sort of thing?
Jun 19 2006
next sibling parent reply Sean Kelly <sean f4.ca> writes:
kris wrote:
 d-bugmail puremagic.com wrote:
 http://d.puremagic.com/issues/show_bug.cgi?id=206

 someidiot earthlink.net changed:

            What    |Removed                     |Added
 ---------------------------------------------------------------------------- 

              Status|RESOLVED                    |REOPENED
          Resolution|DUPLICATE                   |

 ------- Comment #3 from someidiot earthlink.net  2006-06-19 13:33 -------
 This is *not* a duplicate of #48 -- read the descriptions carefully. #48
 actually has the basic visibility operable and enabled (in march 
 2006), but
 allows one to step around visibility by fully qualifiying. Since then, 
 the
 basic visibility mechanism has broken down completely.

It's somewhat annoying when someone goes in and starts removing active bug reports; especially when they apparently don't even understand the problem described. This kind of behaviour tends to dissuade the submission of reports in the first place. What can be done about this sort of thing?

IMO only the responsible party (Walter, for DMD) or the submitter should alter a ticket's status. I appreciate the effort of others try and keep things all neat and tidy, but I'm not sure things have gotten to the point where this sort of help is truly necessary. If you suspect a ticket is a duplicate, perhaps it would be more appropriate to post something to the effect here and let the submitter decide? Sean
Jun 19 2006
next sibling parent reply Frank Benoit <keinfarbton nospam.xyz> writes:
 What can be done about this sort of thing?

IMO only the responsible party (Walter, for DMD) or the submitter should alter a ticket's status. I appreciate the effort of others try and keep things all neat and tidy, but I'm not sure things have gotten to the point where this sort of help is truly necessary. If you suspect a ticket is a duplicate, perhaps it would be more appropriate to post something to the effect here and let the submitter decide? Sean

I don't see a problem here. If someone marks a bug as duplicate, the bug do not silently disappear. Everybody can reopen the bug status at any time. And if there is really a argue about it, there is also the possibility of an poll in bugzilla. This is like a wiki. It lives from the community contributing to it. Any restriction is worse than it help. Animate the people to contribute, don't put restrictions on the system. Failures happens, only if no one is contributing any more, then no errors will happen. :)
Jun 19 2006
parent Walter Bright <newshound digitalmars.com> writes:
Frank Benoit wrote:
 I don't see a problem here.
 
 If someone marks a bug as duplicate, the bug do not silently disappear.
 Everybody can reopen the bug status at any time. And if there is really
 a argue about it, there is also the possibility of an poll in bugzilla.
 
 This is like a wiki. It lives from the community contributing to it. Any
 restriction is worse than it help. Animate the people to contribute,
 don't put restrictions on the system. Failures happens, only if no one
 is contributing any more, then no errors will happen. :)

There is a problem, but as you say, the solution is much worse than the problem. I think we're better off with an open community bugzilla. I think we can all live with honest mistakes here and there. I certainly make my share of them. So far, bugzilla hasn't been attacked with vandalism or spam. So far, so good <g>.
Jun 19 2006
prev sibling parent reply Bruno Medeiros <brunodomedeirosATgmail SPAM.com> writes:
Sean Kelly wrote:
 kris wrote:
 d-bugmail puremagic.com wrote:
 http://d.puremagic.com/issues/show_bug.cgi?id=206

 someidiot earthlink.net changed:

            What    |Removed                     |Added
 ---------------------------------------------------------------------------- 

              Status|RESOLVED                    |REOPENED
          Resolution|DUPLICATE                   |

 ------- Comment #3 from someidiot earthlink.net  2006-06-19 13:33 
 -------
 This is *not* a duplicate of #48 -- read the descriptions carefully. #48
 actually has the basic visibility operable and enabled (in march 
 2006), but
 allows one to step around visibility by fully qualifiying. Since 
 then, the
 basic visibility mechanism has broken down completely.

It's somewhat annoying when someone goes in and starts removing active bug reports; especially when they apparently don't even understand the problem described. This kind of behaviour tends to dissuade the submission of reports in the first place. What can be done about this sort of thing?

IMO only the responsible party (Walter, for DMD) or the submitter should alter a ticket's status. I appreciate the effort of others try and keep things all neat and tidy, but I'm not sure things have gotten to the point where this sort of help is truly necessary. If you suspect a ticket is a duplicate, perhaps it would be more appropriate to post something to the effect here and let the submitter decide? Sean

For now, I was thinking things could manage with a bit of reasoning and good sense, but if Walter wants to lay some rules, I'm sure we can all abide by that. But to note the following: I marked as duplicate because I'm pretty sure it's the same as Derek's example. Also, I won't revert any unduplication. Unduplication would mean there is contention, and contention must be settled outside of bugzilla, or by the leaders (Walter). -- Bruno Medeiros - CS/E student http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
Jun 19 2006
next sibling parent Sean Kelly <sean f4.ca> writes:
Bruno Medeiros wrote:
 Also, I won't revert any unduplication. Unduplication would mean there 
 is contention, and contention must be settled outside of bugzilla, or by 
 the leaders (Walter).

That works for me. I mostly just don't want to see this sort of thing turn into a battle. Sean
Jun 19 2006
prev sibling parent kris <foo bar.com> writes:
Bruno Medeiros wrote:
 Also, I won't revert any unduplication. Unduplication would mean there 
 is contention, and contention must be settled outside of bugzilla, or by 
 the leaders (Walter).

That sounds like a reasonable strategy, although I agree with Derek that it should perhaps be the report-initiator who actually closes any report -- that would tend to indicate an interim state for bugs that are technically "fixed", yet still awaiting confirmation. Bugzilla might be quite good at this, since it already sends out appropriate email notifications.
Jun 19 2006
prev sibling parent "Derek Parnell" <derek psych.ward> writes:
On Tue, 20 Jun 2006 04:37:59 +1000, kris <foo bar.com> wrote:

 d-bugmail puremagic.com wrote:
 http://d.puremagic.com/issues/show_bug.cgi?id=206
   someidiot earthlink.net changed:
             What    |Removed                     |Added
 ----------------------------------------------------------------------------
              Status|RESOLVED                    |REOPENED
          Resolution|DUPLICATE                   |
     ------- Comment #3 from someidiot earthlink.net  2006-06-19 13:33  
 -------
 This is *not* a duplicate of #48 -- read the descriptions carefully. #48
 actually has the basic visibility operable and enabled (in march 2006),  
 but
 allows one to step around visibility by fully qualifiying. Since then,  
 the
 basic visibility mechanism has broken down completely.

It's somewhat annoying when someone goes in and starts removing active bug reports; especially when they apparently don't even understand the problem described. This kind of behaviour tends to dissuade the submission of reports in the first place. What can be done about this sort of thing?

closed by the person who raised them. This is because they are the ones that need to be satisfied. Education about Product Support must be increased and this is slowly happening here. -- Derek Parnell Melbourne, Australia
Jun 19 2006
prev sibling next sibling parent Bruno Medeiros <brunodomedeirosATgmail SPAM.com> writes:
d-bugmail puremagic.com wrote:
 http://d.puremagic.com/issues/show_bug.cgi?id=206
 
 
 someidiot earthlink.net changed:
 
            What    |Removed                     |Added
 ----------------------------------------------------------------------------
              Status|RESOLVED                    |REOPENED
          Resolution|DUPLICATE                   |
 
 
 
 
 ------- Comment #3 from someidiot earthlink.net  2006-06-19 13:33 -------
 This is *not* a duplicate of #48 -- read the descriptions carefully. #48
 actually has the basic visibility operable and enabled (in march 2006), but
 allows one to step around visibility by fully qualifiying. Since then, the
 basic visibility mechanism has broken down completely.
 
 

I based my status change on Derek's code example, and I am *sure* (and I think that it should be obvious to anyone) that Derek's example *is* a duplicate of bug #48. If Derek's example wasn't what you meant for issue #206, then you should clarify. In fact you should have done that in the first place. And no, "visibility" is not the same as "accessibility". In Bug #48 one works around "accessibility" (and thus also "visibility") using FQ-names. Derek's example does the same, (and he himself explicits that it is about accessibility). Kuehne originally understood your bug in a different way, he thought that you were complaining that protection attributes do not affect visibility but just accessibility, so he commented that the spec indeed states that protection attributes only affect visibility. -- Bruno Medeiros - CS/E student http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
Jun 19 2006
prev sibling parent Brad Roberts <braddr puremagic.com> writes:
On Mon, 19 Jun 2006, Sean Kelly wrote:

 Bruno Medeiros wrote:
 Also, I won't revert any unduplication. Unduplication would mean there is
 contention, and contention must be settled outside of bugzilla, or by the
 leaders (Walter).

That works for me. I mostly just don't want to see this sort of thing turn into a battle. Sean

I'll worry about it only if things do go that far, and at that point by talking to the involved parties. The value of having the community help out with deduping bugs and helping each other out by improving the quality of the bug reports so greatly outweighs the occasional misstep that I'm not willing to throw in any roadblocks right now.
Jun 19 2006
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=206





------- Comment #4 from deewiant gmail.com  2006-06-19 13:39 -------
Bruno's comment in Bug 48 addresses this issue as well, however. And it's
likely they're both the same issue, caused by the same code in the compiler.
I'd argue that we stick with 48.


-- 
Jun 19 2006
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=206


someidiot earthlink.net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |NEW




------- Comment #5 from someidiot earthlink.net  2006-06-19 13:56 -------
It's a possibility, but a bit vague for my tastes. I'd argue that (a) Derek's
examples are notably superior, (b) the report is certainly related at some
level, but clearly identifies a different aspect (in the example) than the
earlier report, and (c) the more reports on this, the better :)


-- 
Jun 19 2006
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=206


deewiant gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Comment #6 from deewiant gmail.com  2006-07-22 08:20 -------
Fixed DMD 0.163.


-- 
Jul 22 2006