Skip to content

swift_getDynamicType(______)

0x41c edited this page Feb 28, 2022 · 1 revision

swift_getDynamicType(_:_:_:)

Get the dynamic type of an opaque value.

@_silgen_name("swift_getDynamicType")
public func swift_getDynamicType(
    _ value: Any,
    _ type: Any.Type,
    _ existentialMetatype: Bool // This tells the function which one it is
) -> Any.Type?

Parameters

  • value: An opaque value
  • type: The static type metadata for the opaque value and the result type value.
  • existentialMetatype: Whether the result type value is an existential metatype. If type is an existential type, then a false value indicates that the result is of concrete metatype type type.Protocol, and existential containers will not be projected through. A true value indicates that the result is of existential metatype type type.Type, so existential containers can be projected through as long as a subtype relationship holds from type to the contained dynamic type.

Returns

The dynamic type of provided value.

Types
Protocols
Global Typealiases
Global Functions
Clone this wiki locally