-
Notifications
You must be signed in to change notification settings - Fork 3k
syntax_tools: Annotate map comprehensions and generators #10123
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
base: maint-26
Are you sure you want to change the base?
syntax_tools: Annotate map comprehensions and generators #10123
Conversation
Fix erlang#10119. This fix works for 26 and 27.
CT Test Results 2 files 13 suites 4m 26s ⏱️ Results for commit 0963ee5. ♻️ 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 |
Map-generator handling in 28 is fixed by 0f0e375. |
vann_map_comp_body_join() -> | ||
fun (T, {Env, Bound, Free}) -> | ||
{T1, Bound1, Free1} = case erl_syntax:type(T) of | ||
binary_generator -> | ||
vann_binary_generator(T,Env); | ||
generator -> | ||
vann_generator(T, Env); | ||
map_generator -> | ||
vann_map_generator(T,Env); | ||
_ -> | ||
%% Bindings in filters are not | ||
%% exported to the rest of the | ||
%% body. | ||
{T2, _, Free2} = vann(T, Env), | ||
{T2, [], Free2} | ||
end, | ||
Env1 = ordsets:union(Env, Bound1), | ||
{T1, {Env1, ordsets:union(Bound, Bound1), | ||
ordsets:union(Free, | ||
ordsets:subtract(Free1, Bound))}} | ||
end. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stylish question, there are now three (3) copies of this function (vann_map_comp_body_join
, vann_list_comp_body_join
and vann_binary_comp_body_join
where the last one has a slightly different indentation!) they include nothing map/list/binary specific, could they be replaced by a single vann_comp_body_join
? That should make future updates less error prone? 🤔
Fix #10119. This fix works for 26 and 27.