I went to try using opaque types in my code using the Xcode 11 beta, and immediately ran into not being able to use optionals.
For example, I have this line (where Blob is a protocol):
func fileBlob(ref: String, path: String) -> Blob?
If I insert "some" before "Blob?", I get the error: "An 'opaque' type must specify only 'Any', 'AnyObject', protocols, and/or a base class".
I followed the discussion while this feature was in review, and never even thought about how it would work with optionals. I guess I just assumed some Blob? would be equally valid. Has anyone else run into this? Is there a workaround?
Similarly, It would be good to be able to return Result<some Blob, MyError>. Since some Blob? is equivalent to Optional<some Blob>, I guess what we're looking for is being able to use an opaque type as a generic type parameter.