mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
When we open an existential argument in a call to a generic function, type-erase contravariant uses of that opened existential in subsequent parameters. This primarily impacts closure parameters, where we want the closure to be provided with an existential parameter type rather than permit the parameter to have opened existential type. This prevents the opened existential type from being directly exposed in the type system. Note that we do not need to perform this erasure when the argument is a reference to a generic function, because there it is suitable to infer that the generic arguments are the opened archetypes. This subsumes the use case for `_openExistential`.
517 KiB
517 KiB