Fix supervisor:terminate/2 spec and add some local specs#10772
Fix supervisor:terminate/2 spec and add some local specs#10772erszcz wants to merge 1 commit intoerlang:masterfrom
Conversation
CT Test Results 2 files 100 suites 1h 9m 23s ⏱️ Results for commit cb2e967. ♻️ This comment has been updated with latest results. To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass. See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally. Artifacts
// Erlang/OTP Github Action Bot |
ca9c330 to
ece55bb
Compare
36afea4 to
8cb8445
Compare
lib/stdlib/src/supervisor.erl
Outdated
| -spec terminate_children(children(), SupName) -> children() when | ||
| SupName :: {local, atom()} | {global, term()} | {pid(), module()}. |
There was a problem hiding this comment.
| -spec terminate_children(children(), SupName) -> children() when | |
| SupName :: {local, atom()} | {global, term()} | {pid(), module()}. | |
| -spec terminate_children(children(), SupName) -> children() when | |
| SupName :: {'local', atom()} | {'global', term()} | {'via', module(), term()} | {pid(), module()}. |
There was a problem hiding this comment.
Yes that would adhere to the style around
There was a problem hiding this comment.
Good point that SupName can't really be a {pid(), module()} anymore! Apparently, there's already a type defined for it. Pushed a change to just use it.
There was a problem hiding this comment.
Wait, I didn't say that! It will be {pid(), module()} if the supervisor is started by start_link/2, ie unregistered.
There was a problem hiding this comment.
Ahh, indeed, my bad! I hope I got it right this time 🤞
8cb8445 to
670d6fc
Compare
7f820a7 to
da18f47
Compare
`terminate_dynamic_children/1` returns `ok` from `maps:foreach(...)`, which matches the spec, but `terminate_children/2`, itself lacking a spec, returns `NChildren` returned by `children_map/2`.
2739b2e to
cb2e967
Compare
terminate_dynamic_children/1returnsokfrommaps:foreach(...), which matches the spec, butterminate_children/2, itself lacking a spec, returnsNChildrenreturned bychildren_map/2.