Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is there module conflict?

ma.d

module ma;

struct A{ }

mb.d

module mb;
import ma : A;

struct B{ }

main.d

import ma;
import mb;

void main(){

  A a;
}

When compiled:

main.d(6): Error: ma.A at ma.d(3) conflicts with mb.A at mb.d(2)

In mb.d A is not a public import, so why the error?

Oddly enough, the following code compiles:

main.d

import mb;

void main(){

  A a;
}

So, is this another DMD bug, or have I misunderstood how imports and public imports work?

like image 844
Arlen Avatar asked Dec 29 '11 22:12

Arlen


1 Answers

Issue 314 - [module] Static, renamed, and selective imports are always public

like image 127
dnadlinger Avatar answered Oct 23 '22 19:10

dnadlinger