3:54 AM
@jckarter is there any way to get a value of type Any to pass itself to an unconstrained generic function to recover its type (without using the runtime directly)?
3:54 AM
3:56 AM
// RUN: %target-typecheck-verify-swift protocol P { } func foo<T: P>(_: T) {} func bar<T: P>(_: T.Type) {} func open(existential: P, mutExistential: inout P) { _openExistential(existential, do: foo) _openExistential(type(of: existential), do: bar) _openExistential(mutExistential, do: foo) _openExistential(type(of: mutExistential), do: bar) }
3:56 AM
existential self openテクを使わなくてもopenできる