Given a class/interface/struct, I'd like to duplicate it's design
exactly, as if I copied and pasted directly from the source and
just changed the name. I need to inspect the contents too. Is
this possible with D?
Main things I'm thinking will fail are (multiple) alias this
unless there is a way to get which variables are aliased to this.
The idea is to be able to make sure one can modify a class and
drop it in for the original and it work in all cases. With alias
this, it can fail unless we can alias it too.
struct X { int y; alias this y; }
struct XX { mixin DupStruct!X; }
If DupStruct cannot handle the alias this then XX can fail to
mimic X completely.