This is how interpret the error message:
“In the type annotation, you’ve said that this function can produce any type of message.
But in the function body, I see that this function only ever will produce messages of a type called Msg!
This means either:
- That you have a misleading type annotation. It says any message, but only produces
Msgmessages. If so, change the type annotation toMsginstead ofmsg! - That you’ve accidentally used a specific message in this function, but you intended it to be generic. If so, replace
SearchForwith something of a generic type!
”