Add safety for gen_server init?
Would it be possible to make sure the init function of a gen_server:start and gen_server:start_link check the init function? Considering we pass the module as the first argument, it seems possible.
It's a good idea but the current type system doesn't recognize a module as something other than an atom. It would be interesting but unless we think this is an extremely important case, I wouldn't want to add a special case for just that. If we don't add a special case, then we would need to extend the type system with a completely new concept that has no support in the type language.
We could add hard-coded typing rules for gen_server and the other standard OTP behaviours...
Then, later, we can invent a way to let the users define their own typing rules for their user-defined behaviours...