You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Initially I was challenged with the idea of creating AnyView from Any by https://github.com/glukianets at the end of 2k22.
2
2
3
-
It was fun, I successfully passed the challenge, and now I challenge u, my reader, to implement similar thing without use of `_openExistential` (it is possible tho even more tricky) 😎
3
+
It was fun, I successfully passed the challenge, and now I challenge u, my reader, to implement similar thing without use of `_openExistential` (it is possible using tho even more tricky) 😎
> _You don't need this package or explicit `_openExistential` now, because [SE-0352](https://github.com/swiftlang/swift-evolution/blob/main/proposals/0352-implicit-open-existentials.md) introduced implicit open existentials and any of examples can be acheived with plain generic functions that now can open existentials implicitly. Example with AnyView can be simplified even more with [SE-0335](https://github.com/swiftlang/swift-evolution/blob/main/proposals/0335-existential-any.md)_ 💁♂️
It's enough, but the call site will look like this `(anyValue as? (any View))?.eraseToAnyView()` which is not very ergonomic and you may still want an AnyView extension
0 commit comments