Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Think tank: Typed sends and receives #2

Open
kvakvs opened this issue Nov 5, 2021 · 0 comments
Open

Think tank: Typed sends and receives #2

kvakvs opened this issue Nov 5, 2021 · 0 comments
Labels
question Further information is requested

Comments

@kvakvs
Copy link
Owner

kvakvs commented Nov 5, 2021

It looks like it should be possible to have typespec for pids, and have pid types carry all types that process can send or receive (or just receive).

Support for raw Erlang: Scan the code reachable from the process spawn entry function, and all receive and send operators would contribute to the pid send/receive type.

Support for gen_server: Scan the behaviour implementation, namely add the raw gen messages, and add messages processed by the handle_info callback.

Of course disclaimer: This will only be valid during the compile-time, if the user reloads code to a different version, all type safety is gone and we're back to normal ordinary Erlang.

@kvakvs kvakvs added the question Further information is requested label Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant