[Issue 23819] New: defining your own interface IUnknown messes up vtable without any warning
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Apr 3 14:34:10 UTC 2023
https://issues.dlang.org/show_bug.cgi?id=23819
Issue ID: 23819
Summary: defining your own interface IUnknown messes up vtable
without any warning
Product: D
Version: D2
Hardware: x86_64
OS: Windows
Status: NEW
Severity: critical
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: puremagic at zoadian.de
I've defined my own interface IUnknown, but IUnknown is somehow treated
specially and leads to hidden bugs (in my case a defect vtable) where the
compiler doesn't warn me that the calling convention is somehow changed to
extern(Windows).
https://run.dlang.io/is/YuouXd
class Test : IUnknown {
void test() {}
}
interface IUnknown {
void test();
}
void main() {
auto hm = new Test();
hm.test();
}
vs
https://run.dlang.io/is/nxRwN0
class Test : IUnknown_x {
void test() {}
}
interface IUnknown_x {
void test();
}
void main() {
auto hm = new Test();
hm.test();
}
--
More information about the Digitalmars-d-bugs
mailing list