digitalmars.D.learn - import `Class` is used as a type
- Injeckt (30/30) Sep 10 2022 I'm trying use classes in my project, but when i'm try inherit
- H. S. Teoh (7/11) Sep 10 2022 [...]
- Injeckt (2/13) Sep 10 2022 Thank you!
I'm trying use classes in my project, but when i'm try inherit class, I get error: Error: import `Server.Console` is used as a type Server.d: module Server; import std.string; import core.sys.windows.windows; import Console; class Server : Console { this(HANDLE hIn, HANDLE hOut) { super(hIn, hOut); } ~this() { // Delete object; } } Console.d: module Console; import std.string; import core.sys.windows.windows; class Console { public: HANDLE hIn; HANDLE hOut; this(HANDLE hIn, HANDLE hOut) { this.hIn = hIn; this.hOut = hOut; } } What does it mean?
Sep 10 2022
On Sat, Sep 10, 2022 at 04:59:50PM +0000, Injeckt via Digitalmars-d-learn wrote:I'm trying use classes in my project, but when i'm try inherit class, I get error: Error: import `Server.Console` is used as a type[...] Don't name the module the same thing as the class. Rename it to, say, `console`, so that it wouldn't clash with the class name `Console`. T -- IBM = I Blame Microsoft
Sep 10 2022
On Saturday, 10 September 2022 at 17:20:29 UTC, H. S. Teoh wrote:On Sat, Sep 10, 2022 at 04:59:50PM +0000, Injeckt via Digitalmars-d-learn wrote:Thank you!I'm trying use classes in my project, but when i'm try inherit class, I get error: Error: import `Server.Console` is used as a type[...] Don't name the module the same thing as the class. Rename it to, say, `console`, so that it wouldn't clash with the class name `Console`. T
Sep 10 2022