Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Properly collect variables in map expressions in v3_core #291

Closed
wants to merge 1 commit into from

4 participants

@josevalim josevalim commented on the diff
lib/compiler/test/map_SUITE.erl
@@ -285,6 +287,12 @@ t_expand_map_update(Config) when is_list(Config) ->
#{<<"hello">> := <<"les gens">>} = M,
ok.
+t_export(Config) when is_list(Config) ->
+ Raclette = id(#{}),
+ case brie of brie -> Fromage = Raclette end,
+ Raclette = Fromage#{},

Hahaha, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@OTP-Maintainer

Patch has passed first testings and has been assigned to be reviewed

@psyeugenic psyeugenic self-assigned this
@psyeugenic
Owner

I rebased this branch upon master (with #c_map.arg changes) and amended your commit to account for that change.

@nox

Ok, cool.

@psyeugenic
Owner

Merged: 41fe9a3

Edit: Added sha

@psyeugenic psyeugenic closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 10, 2014
  1. @nox

    Properly collect variables in map expressions in v3_core

    nox authored
    Reported-by: José Valim
This page is out of date. Refresh to see the latest.
Showing with 12 additions and 2 deletions.
  1. +2 −0  lib/compiler/src/v3_core.erl
  2. +10 −2 lib/compiler/test/map_SUITE.erl
View
2  lib/compiler/src/v3_core.erl
@@ -2166,6 +2166,8 @@ lit_vars(Lit) -> lit_vars(Lit, []).
lit_vars(#c_cons{hd=H,tl=T}, Vs) -> lit_vars(H, lit_vars(T, Vs));
lit_vars(#c_tuple{es=Es}, Vs) -> lit_list_vars(Es, Vs);
+lit_vars(#c_map{var=V,es=Es}, Vs) -> lit_vars(V, lit_list_vars(Es, Vs));
+lit_vars(#c_map_pair{key=K,val=V}, Vs) -> lit_vars(K, lit_vars(V, Vs));
lit_vars(#c_var{name=V}, Vs) -> add_element(V, Vs);
lit_vars(_, Vs) -> Vs. %These are atomic
View
12 lib/compiler/test/map_SUITE.erl
@@ -43,7 +43,8 @@
%% errors in 17.0-rc1
t_update_values/1,
- t_expand_map_update/1
+ t_expand_map_update/1,
+ t_export/1
]).
suite() -> [].
@@ -70,7 +71,8 @@ all() -> [
%% errors in 17.0-rc1
t_update_values,
- t_expand_map_update
+ t_expand_map_update,
+ t_export
].
groups() -> [].
@@ -285,6 +287,12 @@ t_expand_map_update(Config) when is_list(Config) ->
#{<<"hello">> := <<"les gens">>} = M,
ok.
+t_export(Config) when is_list(Config) ->
+ Raclette = id(#{}),
+ case brie of brie -> Fromage = Raclette end,
+ Raclette = Fromage#{},

Hahaha, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ ok.
+
check_val(#{val1:=V1, val2:=V2},V1,V2) -> ok.
get_val(#{ "wazzup" := _, val := V}) -> V;
Something went wrong with that request. Please try again.