In essence, it seems like when swift needs to pass along an instance of a type back to c++, the C++ compiler (or the swift compiler?) doesn't emit the swift type info into a library target properly(?)
This seems to stem from using CppType? in my swift file.
the SIL for Color.swift in my example repo doesn't emit the type metadata info for my C++ type, but the generated Shlib-Swift.h clang-header includes information for swift::Optional that assumes there is always type metadata generated for any type held within an optional? And since I'm trying to call the swift method that returns an optional, the missing metadata for my C++ type becomes an issue.
Is this simply a defect in the generated clang header that doesn't understand the proper ABI for Optional<CxxType>?
I have a similar problem where the bridging header references the “type metadata” symbol but the compiled library (.lib / .dll on Windows) doesn’t contain it so I cannot use the library (I get a linking error).
To be clear, the type metadata is missing for a C++ type that I use in Swift (and C++), not a Swift type.