Brainstorming how to import base classes for C++ interop

I'm not sure this is really "inverted." It seems like this is very similar to what I'm suggesting, just with slightly different implementation details. Rather than having a method for getting the parent class, you're suggesting that it would be a stored property. I think this is a great idea. It not only is a better/more Swifty design but also fixes our padding issue. When we ultimately IRGen this, it will go back to using Clang's representation of the type (and the proper functions), but that's an implementation detail, and as you said, it should line up with stored properties.

I also really like withUnsafeCxxDowncast. That seems like a cleaver way to implement down casting.

1 Like