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

specs for gen_server module #5364

Closed
mheiber opened this issue Nov 10, 2021 · 2 comments · Fixed by #5751
Closed

specs for gen_server module #5364

mheiber opened this issue Nov 10, 2021 · 2 comments · Fixed by #5751
Assignees
Labels
enhancement team:PS Assigned to OTP team PS types The issue is related to types

Comments

@mheiber
Copy link
Contributor

mheiber commented Nov 10, 2021

Is your feature request related to a problem? Please describe.

gen_server:call/2, call/3, cast, etc. don't have specs, afaict, which makes type-checking these calls more difficult.
There are spec-like things written in the XML used to generate documentation. These could be adapted as a starting point for psecs.

Describe the solution you'd like

specs, which unfortunately would have to have a lot of term()s, because the type language doesn't allow us to express the ways in which the return of (for example)
call(ServerRef, Request) -> Reply is dependent on callback implementations in the process that corresponds to ServerRef.

Describe alternatives you've considered

  • no specs–type checkers would have to have their own logic for connecting behavior functions to callbacks
  • AND/OR extending the type language to express the relationship between behavior types and callback types. Adding term()y specs now doesn't preclude a more precise solution in future.

Additional context

Happy to make a PR–I have some of these typed up already, based on adapting specs from the xml used to generate documentation.

@rickard-green rickard-green added the team:PS Assigned to OTP team PS label Nov 15, 2021
@KennethL KennethL added the types The issue is related to types label Nov 22, 2021
@garazdawi
Copy link
Contributor

Related pr #2375

@RaimoNiskanen RaimoNiskanen linked a pull request Mar 16, 2022 that will close this issue
@RaimoNiskanen
Copy link
Contributor

Should be fixed by PR #5751

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement team:PS Assigned to OTP team PS types The issue is related to types
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants