Running the following code in Swift playgrounds (in Xcode):
func open<A: Equatable>(_ a: A) {}
func existentialFun(_ value: Any) {
guard let value = value as? any Equatable
else { return }
open(value)
}
Produces the following error:
error: type 'any Equatable' cannot conform to 'Equatable’
But does compile in a regular Swift project.