www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14405] New: Private class std.typecons.Foo conflicts with

https://issues.dlang.org/show_bug.cgi?id=14405

          Issue ID: 14405
           Summary: Private class  std.typecons.Foo conflicts with local
                    class
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Phobos
          Assignee: nobody puremagic.com
          Reporter: ryan rcorre.net

There is a private class named Foo defined in std.typecons (currently line
3091) that can conflict with a user-defined class when unittest is enabled.

--- file foo.d
module foo;
class Foo { }
---

--- file fail.d
import std.typecons;
import foo;
unittest { auto f = new Foo; }
---

rdmd -unittest -main fail.d

fail.d(5): Error: std.typecons.Foo at
/usr/include/dlang/dmd/std/typecons.d(2892) conflicts with foo.Foo at foo.d(2)
fail.d(5): Error: module fail class std.typecons.Foo is private

--
Apr 04 2015