Bug 21146 – No introspection information on whether a class is COM or not

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-08-10T01:56:17Z
Last change time
2024-12-13T19:10:53Z
Assigned to
No Owner
Creator
Andrei Alexandrescu
Moved to GitHub: dmd#19768 →

Comments

Comment #0 by andrei — 2020-08-10T01:56:17Z
This info is only available magically through typeid(). Should be a __trait. This blocks https://github.com/dlang/druntime/pull/3174.
Comment #1 by destructionator — 2020-08-10T01:57:42Z
Might also work to check `is(T : IUnknown)` assuming you have the correct IUnknown available since all COM classes must use it as the base..... might work.
Comment #2 by andrei — 2020-08-10T02:38:25Z
IUnknown is declared in some Windows-specific modules, which I wouldn't want to import in object.d.
Comment #3 by bugzilla — 2020-08-10T20:57:25Z
IUnknown is declared as: extern(Windows) interface IUnknown { int QueryInterface(const(GUID)* riid, void** pvObject); uint AddRef(); uint Release(); } GUID is: align(1) struct GUID { // size is 16 align(1): uint Data1; ushort Data2; ushort Data3; ubyte[8] Data4; } We could move these from core.sys.windows.basetyps and unknown to object.d. Then Adam's prescription will work, without making the compiler more complex.
Comment #4 by robert.schadek — 2024-12-13T19:10:53Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19768 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB