Confirming that this is the direction we should go. We can do this independent of any changes to COpaquePointer, since you'll (almost) never want to pass a class reference through an opaque struct pointer. Feel free to make this part a formal proposal!
Jordan
···
On Dec 8, 2015, at 10:42, Joe Groff via swift-evolution <swift-evolution@swift.org> wrote:
On Dec 8, 2015, at 10:32 AM, Jacob Bandes-Storch <jtbandes@gmail.com <mailto:jtbandes@gmail.com>> wrote:
On Tue, Dec 8, 2015 at 9:42 AM, Joe Groff <jgroff@apple.com <mailto:jgroff@apple.com>> wrote:
COpaquePointer is IMO a vestige that should be eliminated completely. We'd ultimately like to import opaque C structs as distinct, non-constructible types in Swift, so that they can still be well-typed UnsafePointer<OpaqueThing> types in Swift.-Joe
That would be nice. But there is still the "context pointer" use case, where conversions to/from UnsafePointer<Void> are needed. Would it make sense for the Unmanaged type to deal in UnsafePointer<Void>, rather than COpaquePointer?
I think so, yeah.