Fix bug with runtime.get and gesture recognizer typing.

Authored by featherless on Tue, Mar 14, 4:28 PM.



The type-agnostic object cache crashes when working with generic types such as ReactiveUIGestureRecognizer because we're attempting to do a safe cast to the desired type. This breaks when attempting to cast from a ReactiveUIGestureRecognize<UIGestureRecognizer> to a ReactiveUIGestureRecognize<UIPanGestureRecognizer>, for example.

We now use an unsafe bit cast to force the conversion.

This diff fixes the directly manipulable example, which was crashing before this diff.

Diff Detail

rREACTIVEMOTIONSWIFT reactive-motion-swift
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
featherless created this revision.Tue, Mar 14, 4:28 PM
Restricted Application completed building Restricted Buildable.Tue, Mar 14, 4:28 PM
chuga accepted this revision.Wed, Mar 15, 11:07 AM
chuga added a subscriber: chuga.
chuga added inline comments.

we should probably leave a note here explaining the need for unsafeBitCast

This revision is now accepted and ready to land.Wed, Mar 15, 11:07 AM
This revision was automatically updated to reflect the committed changes.
featherless marked an inline comment as done.Wed, Mar 15, 1:46 PM