Its current type signature is really an illusion, since it has special case treatment by the type checker today, that is effectively equivalent to always opening an existential argument and type-erasing the result back to the existential metatype. In Swift 6 mode, I think we'd want to change it to the more appropriate <T> (T) -> T.Type
signature and remove the special case behavior. With regards to _openExistential
, it might still be needed to open Any
, AnyObject
, Error
, and other self-conforming protocols in Swift 5 mode, but we should be able to deprecate it with the proposed Swift 6 rule.