Jump to page: 1 2
Thread overview
[Issue 313] New: Fully qualified names bypass private imports
Aug 27, 2006
d-bugmail
Sep 13, 2006
Thomas Kuehne
Jan 23, 2007
d-bugmail
Jan 23, 2007
Derek Parnell
Jan 23, 2007
d-bugmail
Jan 24, 2007
d-bugmail
Dec 08, 2008
d-bugmail
[Issue 313] [module] Fully qualified names bypass private imports
Jan 20, 2012
Jesse Phillips
Jan 24, 2012
dawg@dawgfoto.de
Feb 17, 2012
dawg@dawgfoto.de
Feb 17, 2012
dawg@dawgfoto.de
Feb 17, 2012
dawg@dawgfoto.de
Feb 17, 2012
dawg@dawgfoto.de
Feb 17, 2012
dawg@dawgfoto.de
Jun 25, 2013
Kenji Hara
August 27, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=313

           Summary: Fully qualified names bypass private imports
           Product: D
           Version: 0.165
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: accepts-invalid
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: deewiant@gmail.com


In file a.d:
--
// explicit private no longer needed but added for clarity private import std.stdio;
--
In file b.d:
--
import a;

void main() {
        // compiler correctly reports "undefined identifier writefln"
        writefln("foo");
        // works fine!
        std.stdio.writefln("foo");
}


-- 

September 13, 2006
d-bugmail@puremagic.com schrieb am 2006-08-27:
> http://d.puremagic.com/issues/show_bug.cgi?id=313

> In file a.d:
> --
> // explicit private no longer needed but added for clarity private import std.stdio;
> --
> In file b.d:
> --
> import a;
>
> void main() {
>         // compiler correctly reports "undefined identifier writefln"
>         writefln("foo");
>         // works fine!
>         std.stdio.writefln("foo");
> }

Added to DStress as
( http://dstress.kuehne.cn/addon/import_16_A.d )
( http://dstress.kuehne.cn/addon/import_16_B.d )
http://dstress.kuehne.cn/nocompile/i/import_16_C.d
http://dstress.kuehne.cn/nocompile/i/import_16_D.d
http://dstress.kuehne.cn/nocompile/i/import_16_E.d
http://dstress.kuehne.cn/nocompile/i/import_16_F.d
http://dstress.kuehne.cn/nocompile/i/import_16_G.d
http://dstress.kuehne.cn/nocompile/i/import_16_H.d

Thomas


January 23, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=313


davidl@126.com changed:

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




------- Comment #2 from davidl@126.com  2007-01-23 04:25 -------
d 1.0 does correctly report the error message


-- 

January 23, 2007
On Tue, 23 Jan 2007 10:25:56 +0000 (UTC), d-bugmail@puremagic.com wrote:

> http://d.puremagic.com/issues/show_bug.cgi?id=313
> 
> 
> davidl@126.com changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>              Status|NEW                         |RESOLVED
>          Resolution|                            |FIXED
> 
> 
> 
> 
> ------- Comment #2 from davidl@126.com  2007-01-23 04:25 -------
> d 1.0 does correctly report the error message

But is it correct? If the 'std.stdio' is private to "a.d" and not explicitly imported in to "b.d", then a statement in "b.d" should not be able to use anything in std.stdio, fully qualified or not.

As far as I'm concerned, D is still broken in this regard as it allows one to get access to private identifiers just by fully qualifying them. I believe that private identifies are *private* and thus should not be be able to be accessed by another module.

-- 
Derek Parnell
January 23, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=313


thomas-dloop@kuehne.cn changed:

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




------- Comment #3 from thomas-dloop@kuehne.cn  2007-01-23 07:44 -------
David, did you test on Windows?

import_16_C, D, F - H still fail on Linux.


-- 

January 24, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=313


thomas-dloop@kuehne.cn changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tomas@famolsen.dk




------- Comment #4 from thomas-dloop@kuehne.cn  2007-01-24 02:09 -------
*** Bug 880 has been marked as a duplicate of this bug. ***


-- 

December 08, 2008
http://d.puremagic.com/issues/show_bug.cgi?id=313





------- Comment #5 from bugzilla@digitalmars.com  2008-12-08 00:52 -------
Although this particular bug is fixed as of dmd 1.037 and 2.021, there are other cases that fail.


-- 

January 20, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=313


Jesse Phillips <Jesse.K.Phillips+D@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Jesse.K.Phillips+D@gmail.co
                   |                            |m
   Target Milestone|---                         |2.059


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 24, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=313


dawg@dawgfoto.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dawg@dawgfoto.de


--- Comment #6 from dawg@dawgfoto.de 2012-01-24 04:16:25 PST ---
---- a.d ----
import b;

void main()
{
    std.stdio.writefln("Hello");
}
---- b.d ----
public import std.ascii;
private import std.stdio;
-------------
dmd -c a

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 17, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=313


dawg@dawgfoto.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |shro8822@vandals.uidaho.edu


--- Comment #7 from dawg@dawgfoto.de 2012-02-16 18:46:11 PST ---
*** Issue 1504 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
« First   ‹ Prev
1 2