Fix bug with runtime.get and gesture recognizer typing.
ClosedPublic

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

Details

Summary

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

Repository
rREACTIVEMOTIONSWIFT reactive-motion-swift
Lint
Automatic diff as part of commit; lint not applicable.
Unit
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.
src/MotionRuntime.swift
192–197

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