Closed kinke closed 5 years ago
Reinterpreting an interface reference as class reference doesn't offset as it should, because the cas()
implementation then treats that reference as regular SyncDriver class reference, and offsets that back to the interface pointer (in a CAS implementation fixed in LDC 1.18).
It should all be in the realm of interface, there are no classes here. _syncDriver
should already be adjusted as it's typed as immutable Driver
. Maybe LDC is doing something too clever here?
Crap, I misread what was being deleted and added. Yes, your new code should be right.
I'm going to put your code in with #28 instead of here, because the current CI doesn't test properly (yet), it uses the latest DMD which has a broken cas.
Actually, I just decided to pull it. It's obviously correct. And I'd like to keep #28 focused on adding the meson build (even though it does technically also fix the normal build).
Why is the cast invalid? It's changing from
immutable Driver *
toshared(Driver)*
? In fact, I'd say the new cast is not valid.