Summary: Adding typechecks to prevent potential FPs like the added test Reviewed By: ngorogiannis Differential Revision: D16149511 fbshipit-source-id: 6d3fe0ad4