This isn't quite right. Seems like `value instanceof type` is the right solution.