May 17, 2017 [Issue 17404] New: creating type named 'object' fails to compile, but only if you import something | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=17404 Issue ID: 17404 Summary: creating type named 'object' fails to compile, but only if you import something Product: D Version: D2 Hardware: x86 OS: Windows Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nobody@puremagic.com Reporter: johnnymarler@gmail.com The following compiles today: struct object{} OR class object{] But as soon as you import anything, even just an empty module, DMD will give you the following error: Error: struct mymodule.object conflicts with import mymodule.object at mymodule.d Again, if you don't have any imports it WILL compile, but if you import anything, even an empty module then you get this odd error message. I'm not sure if D allows you to name types 'object'. If it does then this is clearly a bug in the compiler. If it doesn't then the error message should be fixed. -- |
Copyright © 1999-2021 by the D Language Foundation