[frustration, sorry] Import conflict madness.

Dawid Ciężarkiewicz dawid.ciezarkiewicz at gmail.com
Sat Jun 17 11:35:57 PDT 2006


Dawid Ciężarkiewicz wrote:
> And then out of nowhere: BANG!!!
> 
> battle.d(31): import battle.map conflicts with cell.cell.map at
> cell/cell.d(29)

OK. After some time I've finally discovered where the problem was and I see
that my previous post is not very informative. Instead it gives good look
how such "details" can frustrate people.

The problem is (if I understand right):
When you use identifier which was imported privately by something you
imported in current module you get this missleading "import X conficts with
Y" instead of info where it happens.

battle.d(31) == "private import map";
cell/cell/d(29) == "private import map";

As you can see your IDE will take you to battle.d, line 31 and you'll be
confused. You don't know which line of code triggered error. If you are
lucky and smart enough, you'll try fixing later errors and find which part
of the code triggered this one. If you're not - you'll be siting and
screaming knowing not what to do.

The good error msg would look like:

$file($line): triggered import conflict with X ($X:$Xline) and Y ($Y:$Yline)

Where $file($line) is place where compiler found that this two modules are
conflicting. This would be quite informative IMO. 

Another thing is that I do "private import $i" for purpose - I don't want
names from module be _anyhow_ visible - not triggering any conflicts.



More information about the Digitalmars-d mailing list