Bug 5161 – Selective import results in conflicting definition.

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2010-11-03T18:33:00Z
Last change time
2012-01-24T12:14:56Z
Assigned to
nobody
Creator
strtr

Comments

Comment #0 by strtr — 2010-11-03T18:33:47Z
The code below results in: i.d(6): Error: b.B at b.d(3) conflicts with c.B at c.d(4) -- module main; import c; void main(){} -- module c; import i; import b : B; //public import b; // using this line instead fixes it -- module i; import b; import c; B i; -- module b; struct B{ int b; } --
Comment #1 by witold.baryluk+d — 2010-11-21T22:04:43Z
I had the same problem in D2.049. I think it is regression, as it was working previously without problem.
Comment #2 by pszturmaj — 2011-07-25T14:40:09Z
I can confirm this bug in 2.054. Other test case (phobos+dmd 2.054): -- module main; import std.socket; import core.time; void test(Duration d) {} void main() {} -- main.d(6): Error: std.socket.Duration at D:\dmd2\windows\bin\..\..\src\phobos\std\socket.d(44) conflicts with core.time.Duration at D:\dmd2\windows\bin\..\..\src\druntime\import\core\time.di(35)
Comment #3 by kamm-removethis — 2011-07-25T15:37:29Z
The fix to bug 314 would fix this as well.
Comment #4 by clugdbug — 2012-01-24T12:14:56Z
This is not a regression (it failed in DMD 2.000, 0.165). But it was fixed when bug 314 was fixed. I think it's a duplicate: the conflict happened because the selective import was public. Anyway, it works now. *** This issue has been marked as a duplicate of issue 314 ***