Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
getMessages types: Handle
Message
being PmMessage
| StreamMessage
.
In the same basic way as in the previous commit, but with a bit of added complexity: the function isn't `(Message) => Message`; it's `(ServerMessage) => Message`. So, start by expressing how `ServerMessage` relates to `Message`, in a way that applies uniformly to `PmMessage` and `StreamMessage`. Then, annotate the function's param by applying that expression to `M`, which is a subtype of `Message`, and leave the return value as `M`. See discussion at https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/.60PmMessage.60.2C.20.60StreamMessage.60.20types.3F/near/1126688.
- Loading branch information