mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
SR-3871: Dynamic casting of existentials stored in Obj-C references Arbitrary Swift objects get packaged into __SwiftValue containers so that pointers to them can be passed into Obj-C. (Obviously, Obj-C code can't do anything particularly useful with such pointers other than refcount them and give them back to Swift code.) Those values come back into Swift as either `Any` (existential box) or `AnyObject` (anonymous object pointer) values. Dynamically casting those requires first inspecting the outer value to get access to the actual type and value in the __SwiftValue container. The tryDynamicCastBoxedSwiftValue() function that handles this was missing a check for the `Any` case, which is why directly casting from `Any` would routinely fail. Resolves SR-3871
118 KiB
118 KiB