Fix bug with runtime.get and gesture recognizer typing.

Authored by featherless on Mar 14 2017, 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.Mar 14 2017, 4:28 PM
Restricted Application completed building Restricted Buildable.Mar 14 2017, 4:28 PM
chuga accepted this revision.Mar 15 2017, 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.Mar 15 2017, 11:07 AM
This revision was automatically updated to reflect the committed changes.
featherless marked an inline comment as done.Mar 15 2017, 1:46 PM