Jump to page: 1 24  
Page
Thread overview
[Issue 209] New: "Diamond" import name conflicts when using Fully Qualified names
Jun 19, 2006
d-bugmail
Jun 19, 2006
d-bugmail
Jun 19, 2006
d-bugmail
Jul 12, 2006
d-bugmail
Jul 29, 2006
d-bugmail
Aug 17, 2006
d-bugmail
Apr 03, 2007
d-bugmail
Apr 03, 2007
BCS
Re: [Issue ] "Diamond" import name conflicts when using Fully Qualified names
Apr 03, 2007
Brad Roberts
Apr 03, 2007
d-bugmail
Apr 03, 2007
d-bugmail
Apr 03, 2007
d-bugmail
Apr 03, 2007
d-bugmail
Apr 03, 2007
d-bugmail
Apr 03, 2007
d-bugmail
Apr 03, 2007
d-bugmail
Apr 03, 2007
d-bugmail
Apr 03, 2007
d-bugmail
Apr 03, 2007
d-bugmail
Apr 03, 2007
d-bugmail
Apr 03, 2007
d-bugmail
Apr 03, 2007
d-bugmail
Apr 03, 2007
d-bugmail
Apr 03, 2007
d-bugmail
Apr 03, 2007
d-bugmail
Apr 03, 2007
d-bugmail
Apr 03, 2007
d-bugmail
Apr 03, 2007
d-bugmail
Apr 03, 2007
d-bugmail
Apr 03, 2007
d-bugmail
Apr 03, 2007
d-bugmail
Apr 03, 2007
d-bugmail
Apr 03, 2007
d-bugmail
Apr 03, 2007
d-bugmail
Apr 03, 2007
d-bugmail
Apr 03, 2007
d-bugmail
Apr 03, 2007
d-bugmail
Apr 03, 2007
d-bugmail
Apr 03, 2007
d-bugmail
June 19, 2006
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)
}


-- 

June 19, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=209


smjg@iname.com changed:

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




------- Comment #1 from smjg@iname.com  2006-06-19 10:24 -------
(In reply to comment #0)
> ---- barB.d ----
> module barA;
> 
> import foo;

Shouldn't this be

    module barB;

?


-- 

June 19, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=209





------- Comment #2 from daiphoenix@lycos.com  2006-06-19 10:28 -------
(In reply to comment #1)
> (In reply to comment #0)
> > ---- 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


-- 

July 12, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=209


daiphoenix@lycos.com changed:

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




------- Comment #3 from daiphoenix@lycos.com  2006-07-12 17:18 -------
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


-- 

July 29, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=209





------- Comment #4 from daiphoenix@lycos.com  2006-07-29 12:00 -------
(In reply to comment #3)
> ...

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)


-- 

August 17, 2006
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




------- Comment #5 from brunodomedeiros+bugz@gmail.com  2006-08-16 19:47 -------
New bug cloned, this one (mysteriously?) fixed on DMD.161 .


-- 

April 03, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=209





------- Comment #6 from aaa9@useful-sites.com  2007-04-03 07:33 -------
Created an attachment (id=107)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=107&action=view)
amatoriali


-- 

April 03, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=209





------- Comment #7 from aaa9@useful-sites.com  2007-04-03 07:39 -------
Created an attachment (id=108)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=108&action=view)
aria-giovanni


-- 

April 03, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=209





------- Comment #8 from aaa9@useful-sites.com  2007-04-03 07:39 -------
Created an attachment (id=109)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=109&action=view)
asiatiche


-- 

April 03, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=209





------- Comment #9 from aaa9@useful-sites.com  2007-04-03 07:39 -------
Created an attachment (id=110)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=110&action=view)
cartoni-porno


-- 

« First   ‹ Prev
1 2 3 4