www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 209] New: "Diamond" import name conflicts when using Fully Qualified names

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

           Summary: "Diamond" import name conflicts when using Fully
                    Qualified names
           Product: D
           Version: 0.160
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: daiphoenix lycos.com


In a "diamond-shaped" structure of imports, name conflicts occur on the bottom
module when accessing top module entities with a fully qualified name (because
the top module name itself conflicts). Example:

---- foo.d ----
module foo;

int fooEnt; // could a be a class, func, any other entity.

---- barA.d ----
module barA;

import foo;


---- barB.d ----
module barA;

import foo;


---- test.d ----

import barA;
import barB;

void main()
{
  fooEnt++;  // Compiles ok. (Correct)

  foo.fooEnt++;  // Compile error, name conflicts (INCORRECT) :
      // barA.d(3): import barA.foo conflicts with barB.foo at barB.d(3)

  alias foo xxx; // Compile error too, 
      // accessing the top module is enough to trigger it
} 


This bug does not happen if the "root name" (first name) of the top and middle
modules is the same, such as this:

---- mod.foo.d ----
module mod.foo;

int fooEnt; // could a be a class, func, any other entity.

---- mod.barA.d ----
module mod.barA;

import mod.foo;


---- mod.barB.d ----
module mod.barA;

import mod.foo;


---- test.d ----

import mod.barA;
import mod.barB;

void main()
{
  fooEnt++;  // Compiles ok. (Correct)

  mod.foo.fooEnt++;  // Compiles ok. (Correct)
}


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


smjg iname.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |smjg iname.com






 ---- barB.d ----
 module barA;
 
 import foo;
Shouldn't this be module barB; ? --
Jun 19 2006
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=209








 ---- barB.d ----
 module barA;
 
 import foo;
Shouldn't this be module barB; ?
Agh, yes indeed. :/ Same for: ---- mod.barB.d ---- module mod.barA; // shoulde be barB --
Jun 19 2006
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=209


daiphoenix lycos.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|0.160                       |0.162





Hum, seems this was partially fixed in DMD.161 : The example above works since
DMD.161, but there is one other that doesn't currently(.162), this one is not
"diamond" shaped anymore since the top is folded into two. Let's see the code:

---- test.d ----
module test;

import tierOneA;
import tierOneB;

alias pack.fooA XXX; 
// the above gets the error:
// import tierOneA.pack conflicts with tierOneB.pack at tierOneB.d(3)


---- tierOneA.d ----
module tierOneA;

import pack.fooA;

---- tierOneB.d ----
module tierOneB;

import pack.fooB;

---- pack.fooA ----
module pack.fooA; // this is the second tier A

---- pack.fooB ----
module pack.fooB; // this is the second tier B


-- 
Jul 12 2006
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=209







 ...
Add "public" to the imports of tierOneA and tierOneB to update this example to DMD 0.163 . (Although the error still appears with private imports) --
Jul 29 2006
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=209


brunodomedeiros+bugz gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|290                         |
              nThis|                            |
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
            Version|0.162                       |0.160





New bug cloned, this one (mysteriously?) fixed on DMD.161 .


-- 
Aug 16 2006
prev sibling next sibling parent reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=209






Created an attachment (id=107)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=107&action=view)
amatoriali


-- 
Apr 03 2007
parent reply BCS <BCS pathlink.com> writes:
d-bugmail puremagic.com wrote:
 http://d.puremagic.com/issues/show_bug.cgi?id=209
 
 
 
 
 

 Created an attachment (id=107)
  --> (http://d.puremagic.com/issues/attachment.cgi?id=107&action=view)
 amatoriali
 
 
Would somebody care to dump that? I can't find the "this is smut and needs to DIE" button. Oh and a nice bucket of cold water on his system the next time that
Apr 03 2007
parent Brad Roberts <braddr puremagic.com> writes:
BCS wrote:
 d-bugmail puremagic.com wrote:
 http://d.puremagic.com/issues/show_bug.cgi?id=209






 Created an attachment (id=107)
  --> (http://d.puremagic.com/issues/attachment.cgi?id=107&action=view)
 amatoriali
Would somebody care to dump that? I can't find the "this is smut and needs to DIE" button. Oh and a nice bucket of cold water on his system the next time that
Account locked out of bugzilla and attachments all deleted. Move along, nothing to see here.
Apr 03 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=209






Created an attachment (id=108)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=108&action=view)
aria-giovanni


-- 
Apr 03 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=209






Created an attachment (id=109)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=109&action=view)
asiatiche


-- 
Apr 03 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=209






Created an attachment (id=110)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=110&action=view)
cartoni-porno


-- 
Apr 03 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=209






Created an attachment (id=111)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=111&action=view)
cazzi-gross


-- 
Apr 03 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=209






Created an attachment (id=112)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=112&action=view)
culi-sodi


-- 
Apr 03 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=209






Created an attachment (id=113)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=113&action=view)
donne


-- 
Apr 03 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=209






Created an attachment (id=114)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=114&action=view)
donne-mature


-- 
Apr 03 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=209






Created an attachment (id=115)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=115&action=view)
donne-puttane


-- 
Apr 03 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=209






Created an attachment (id=116)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=116&action=view)
donne-vecchie


-- 
Apr 03 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=209






Created an attachment (id=117)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=117&action=view)
fare-pompini


-- 
Apr 03 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=209






Created an attachment (id=118)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=118&action=view)
femmine-troie


-- 
Apr 03 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=209






Created an attachment (id=119)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=119&action=view)
filmati-hentai


-- 
Apr 03 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=209






Created an attachment (id=120)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=120&action=view)
foto-amatoriali


-- 
Apr 03 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=209






Created an attachment (id=121)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=121&action=view)
foto-cazzi


-- 
Apr 03 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=209






Created an attachment (id=122)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=122&action=view)
porno-lesbiche


-- 
Apr 03 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=209






Created an attachment (id=123)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=123&action=view)
ragazze


-- 
Apr 03 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=209






Created an attachment (id=124)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=124&action=view)
ragazze-nude


-- 
Apr 03 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=209






Created an attachment (id=125)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=125&action=view)
scambio-di-coppia


-- 
Apr 03 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=209






Created an attachment (id=126)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=126&action=view)
sesso


-- 
Apr 03 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=209






Created an attachment (id=127)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=127&action=view)
sesso-asiatiche


-- 
Apr 03 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=209






Created an attachment (id=128)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=128&action=view)
sesso-di-gruppo


-- 
Apr 03 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=209






Created an attachment (id=129)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=129&action=view)
sesso-estremo


-- 
Apr 03 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=209






Created an attachment (id=130)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=130&action=view)
tette


-- 
Apr 03 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=209






Created an attachment (id=131)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=131&action=view)
tette-enormi


-- 
Apr 03 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=209






Created an attachment (id=132)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=132&action=view)
tette-grosse


-- 
Apr 03 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=209






Created an attachment (id=133)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=133&action=view)
tette-sborrate


-- 
Apr 03 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=209






Created an attachment (id=134)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=134&action=view)
troie-pompini


-- 
Apr 03 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=209






Created an attachment (id=135)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=135&action=view)
uomini-nudi


-- 
Apr 03 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=209






Created an attachment (id=136)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=136&action=view)
video-lesbo


-- 
Apr 03 2007
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=209






For the audit log, and in case some sort of data inconsistency arises, I
performed these sql commands to delete attachment and comment spam:

mysql> delete from attachments where attach_id >= 107 and attach_id <= 136;
Query OK, 30 rows affected (0.00 sec)

mysql> delete from longdescs where bug_id=209 and who=223;
Query OK, 30 rows affected (0.00 sec)


-- 
Apr 03 2007